GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Windows/System32/WindowsPowerShell/v1.0/en-US/ |
Upload File : |
<?xml version="1.0" encoding="utf-8"?> <helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Add-History</command:name> <command:verb>Add</command:verb> <command:noun>History</command:noun> <maml:description> <maml:para>Appends entries to the session history.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Add-History` cmdlet adds entries to the end of the session history, that is, the list of commands entered during the current session.</maml:para> <maml:para>The session history is a list of the commands entered during the session. The session history represents the order of execution, the status, and the start and end times of the command. As you enter each command, PowerShell adds it to the history so that you can reuse it. For more information about the session history, see about_History (About/about_History.md).</maml:para> <maml:para>The session history is managed separately from the history maintained by the PSReadLine module. Both histories are available in sessions where PSReadLine is loaded. This cmdlet only works with the session history. For more information see, about_PSReadLine (../PSReadLine/About/about_PSReadLine.md).</maml:para> <maml:para>You can use the `Get-History` cmdlet to get the commands and pass them to `Add-History`, or you can export the commands to a CSV or XML file, then import the commands, and pass the imported file to `Add-History`. You can use this cmdlet to add specific commands to the history or to create a single history file that includes commands from more than one session.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Add-History</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies an array of entries to add to the history as HistoryInfo object to the session history. You can use this parameter to submit a HistoryInfo object, such as the ones that are returned by the `Get-History`, `Import-Clixml`, or `Import-Csv` cmdlets, to `Add-History`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Passthru</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a HistoryInfo object for each history entry. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies an array of entries to add to the history as HistoryInfo object to the session history. You can use this parameter to submit a HistoryInfo object, such as the ones that are returned by the `Get-History`, `Import-Clixml`, or `Import-Csv` cmdlets, to `Add-History`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Passthru</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a HistoryInfo object for each history entry. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>Microsoft.PowerShell.Commands.HistoryInfo</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a HistoryInfo object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None or Microsoft.PowerShell.Commands.HistoryInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a HistoryInfo object if you specify the PassThru parameter. Otherwise, this cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The session history is a list of the commands entered during the session together with the ID. The session history represents the order of execution, the status, and the start and end times of the command. As you enter each command, PowerShell adds it to the history so that you can reuse it. For more information about the session history, see about_History (About/about_History.md).</maml:para> <maml:para>To specify the commands to add to the history, use the InputObject parameter. The `Add-History` command accepts only HistoryInfo objects, such as those returned for each command by the `Get-History` cmdlet. You cannot pass it a path and file name or a list of commands.</maml:para> <maml:para>You can use the InputObject parameter to pass a file of HistoryInfo objects to `Add-History`. To do so, export the results of a `Get-History` command to a file by using the `Export-Csv` or `Export-Clixml` cmdlet and then import the file by using the `Import-Csv` or `Import-Clixml` cmdlets. You can then pass the file of imported HistoryInfo objects to `Add-History` through a pipeline or in a variable. For more information, see the examples.</maml:para> <maml:para>The file of HistoryInfo objects that you pass to the `Add-History` cmdlet must include the type information, column headings, and all of the properties of the HistoryInfo objects. If you intend to pass the objects back to `Add-History`, do not use the NoTypeInformation parameter of the `Export-Csv` cmdlet and do not delete the type information, column headings, or any fields in the file.</maml:para> <maml:para>To modify the session history, export the session to a CSV or XML file, modify the file, import the file, and use `Add-History` to append it to the current session history.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title> Example 1: Add commands to the history of a different session </maml:title> <dev:code>Get-History | Export-Csv c:\testing\history.csv -IncludeTypeInformation Import-Csv c:\testing\history.csv | Add-History</dev:code> <dev:remarks> <maml:para>The first command gets objects representing the commands in the history and exports them to the `History.csv` file.</maml:para> <maml:para>The second command is typed at the command line of a different session. It uses the `Import-Csv` cmdlet to import the objects in the `History.csv` file. The pipeline operator (`|`) passes the objects to the `Add-History` cmdlet, which adds the objects representing the commands in the `History.csv` file to the current session history.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 2: Import and run commands --------------</maml:title> <dev:code>Import-Clixml c:\temp\history.xml | Add-History -PassThru | ForEach-Object -Process {Invoke-History}</dev:code> <dev:remarks> <maml:para>The first command uses the `Import-Clixml` cmdlet to import a command history that was exported to the `History.xml` file. The pipeline operator passes the commands to the `Add-History` cmdlet, which adds the commands to the current session history. The PassThru parameter passes the objects representing the added commands down the pipeline.</maml:para> <maml:para>The command then uses the `ForEach-Object` cmdlet to apply the `Invoke-History` command to each of the commands in the combined history. The `Invoke-History` command is formatted as a script block, enclosed in braces (`{}`), as required by the Process parameter of the `ForEach-Object` cmdlet.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 3: Add commands in the history to the end of the history</maml:title> <dev:code>Get-History -Id 5 -Count 5 | Add-History</dev:code> <dev:remarks> <maml:para>The `Get-History` cmdlet gets the five commands ending in command 5. The pipeline operator passes them to the `Add-History` cmdlet, which appends them to the current history. The `Add-History` command does not include any parameters, but PowerShell associates the objects passed through the pipeline with the InputObject parameter of `Add-History`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title> Example 4: Add commands in a .csv file to the current history </maml:title> <dev:code>$a = Import-Csv c:\testing\history.csv Add-History -InputObject $a -PassThru</dev:code> <dev:remarks> <maml:para>The `Import-Csv` cmdlet imports the commands in the `History.csv` file and store its contents in the variable `$a`.</maml:para> <maml:para>The second command uses the `Add-History` cmdlet to add the commands from `History.csv` to the current session history. It uses the InputObject parameter to specify the `$a` variable and the PassThru parameter to generate an object to display at the command line. Without the PassThru parameter, the `Add-History` cmdlet does not generate any output.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: Add commands in an .xml file to the current history</maml:title> <dev:code>Add-History -InputObject (Import-Clixml c:\temp\history.xml)</dev:code> <dev:remarks> <maml:para>The InputObject parameter passes the results of the command in parentheses to the `Add-History` cmdlet. The command in parentheses, which is executed first, imports the `history.xml` file into PowerShell. The `Add-History` cmdlet then adds the commands in the file to the session history.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/add-history?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSReadLine</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSReadLineOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSReadLineOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Add-PSSnapin</command:name> <command:verb>Add</command:verb> <command:noun>PSSnapin</command:noun> <maml:description> <maml:para>Adds one or more Windows PowerShell snap-ins to the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Add-PSSnapin` cmdlet adds registered Windows PowerShell snap-ins to the current session. After the snap-ins are added, you can use the cmdlets and providers that the snap-ins support in the current session.</maml:para> <maml:para>To add the snap-in to all future Windows PowerShell sessions, add an `Add-PSSnapin` command to your Windows PowerShell profile. For more information, see about_Profiles (about/about_Profiles.md).</maml:para> <maml:para>Beginning in Windows PowerShell 3.0, the core commands that are included in Windows PowerShell are packaged in modules. The exception is Microsoft.PowerShell.Core , which is a snap-in (PSSnapin). By default, only the Microsoft.PowerShell.Core snap-in is added to the session. Modules are imported automatically on first use and you can use the Import-Module cmdlet to import them.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Add-PSSnapin</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the name of the snap-in. This is the Name, not the AssemblyName or ModuleName. Wildcards are permitted.</maml:para> <maml:para>To find the names of the registered snap-ins on your system, type `Get-PSSnapin -Registered`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns an object that represents each added snap-in. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the name of the snap-in. This is the Name, not the AssemblyName or ModuleName. Wildcards are permitted.</maml:para> <maml:para>To find the names of the registered snap-ins on your system, type `Get-PSSnapin -Registered`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns an object that represents each added snap-in. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None or System.Management.Automation.PSSnapInInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a PSSnapInInfo object that represents the snap-in if you specify the PassThru parameter. Otherwise, this cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>* Beginning in Windows PowerShell 3.0, the core commands that are installed with Windows PowerShell are packaged in modules. In Windows PowerShell 2.0, and in host programs that create older-style sessions in later versions of Windows PowerShell, the core commands are packaged in snap-ins (PSSnapins). The exception is Microsoft.PowerShell.Core , which is always a snap-in. Also, remote sessions, such as those started by the New-PSSession cmdlet, are older-style sessions that include core snap-ins.</maml:para> <maml:para> For information about the CreateDefault2 method that creates newer-style sessions with core modules, see CreateDefault2 Method (https://msdn.microsoft.com/library/system.management.automation.runspaces.initialsessionstate.createdefault2)in the MSDN library.</maml:para> <maml:para>* For more information about snap-ins, see about_PSSnapins (About/about_PSSnapins.md)and How to Create a Windows PowerShell Snap-in (/powershell/scripting/developer/cmdlet/how-to-create-a-windows-powershell-snap-in). * `Add-PSSnapin` adds the snap-in only to the current session. To add the snap-in to all Windows PowerShell sessions, add it to your Windows PowerShell profile. For more information, see about_Profiles. * You can add any snap-in that has been registered using the Microsoft .NET Framework install utility. For more information, see How to Register Cmdlets, Providers, and Host Applications (/previous-versions//ms714644(v=vs.85)). * To get a list of snap-ins that are registered on your computer, type `Get-PSSnapin -Registered`.</maml:para> <maml:para>* Before adding a snap-in, `Add-PSSnapin` checks the version of the snap-in to verify that it is</maml:para> <maml:para> compatible with the current version of Windows PowerShell. If the snap-in fails the version check, Windows PowerShell reports an error.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------------- Example 1: Add snap-ins -------------------</maml:title> <dev:code>PS C:\> Add-PSSnapIn -Name Microsoft.Exchange, Microsoft.Windows.AD</dev:code> <dev:remarks> <maml:para>This command adds the Microsoft Exchange and Active Directory snap-ins to the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 2: Add all the registered snap-ins ----------</maml:title> <dev:code>PS C:\> Get-PSSnapin -Registered | Add-PSSnapin -Passthru</dev:code> <dev:remarks> <maml:para>This command adds all of the registered Windows PowerShell snap-ins to the session. It uses the Get-PSSnapin cmdlet with the Registered parameter to get objects representing each of the registered snap-ins. The pipeline operator (|) passes the result to `Add-PSSnapin`, which adds them to the session. The PassThru parameter returns objects that represent each of the added snap-ins.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 3: Register a snap-in and add it -----------</maml:title> <dev:code>PS C:\> Get-PSSnapin PS C:\> Get-PSSnapin -Registered PS C:\> Set-Alias installutil $env:windir\Microsoft.NET\Framework\v2.0.50727\installutil.exe PS C:\> installutil C:\Dev\Management\ManagementCmdlets.dll PS C:\> Get-PSSnapin -Registered PS C:\> add-pssnapin ManagementFeatures PS C:\> Get-Command -Module ManagementFeatures PS C:\> (Get-Command Set-Alias).pssnapin</dev:code> <dev:remarks> <maml:para>This example demonstrates the process of registering a snap-in on your system and then adding it to your session. It uses ManagementFeatures, a fictitious snap-in implemented in a file that is named ManagementCmdlets.dll.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/add-pssnapin?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Clear-History</command:name> <command:verb>Clear</command:verb> <command:noun>History</command:noun> <maml:description> <maml:para>Deletes entries from the PowerShell session command history.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>`Clear-History` deletes the command history from a PowerShell session. Each PowerShell session has its own command history. To display the command history, use the `Get-History` cmdlet.</maml:para> <maml:para>By default, `Clear-History` deletes the entire command history from a PowerShell session. You can use parameters with `Clear-History` to delete selected commands.</maml:para> <maml:para>`Clear-History` does not clear the `PSReadLine` command history file. The `PSReadLine` module stores a history file that contains every PowerShell command from every PowerShell session. From a PowerShell prompt, use the up and down arrows on your keyboard to scroll through the command history. To display the `PSReadLine` configuration for command history, use `Get-PSReadLineOption`. `PSReadLine` shipped with PowerShell 5.0 and above. For more information, see about_PSReadLine (../PSReadLine/About/about_PSReadLine.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Clear-History</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Count</maml:name> <maml:Description> <maml:para>Specifies the number of history entries that `Clear-History` deletes. Commands are deleted in order, beginning with the oldest entry in the history.</maml:para> <maml:para>The Count and Id parameters can be used together. The Count parameter specifies the number of commands to delete, inclusive of the specified Id . Beginning at the specified Id , commands are deleted in reverse sequential order. For example, if the Id is 30 and the Count is 10, `Clear-History` deletes items 21 through 30.</maml:para> <maml:para>The Count and CommandLine parameters can be used together. Count specifies the number of commands to delete that match CommandLine parameter value. The commands are deleted in sequential order.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>CommandLine</maml:name> <maml:Description> <maml:para>Deletes command history from a PowerShell session. The string must be an exact match or use wildcards to match commands in the PowerShell session history displayed by `Get-History`. If you enter more than one string, `Clear-History` deletes commands that match any of the strings. The CommandLine parameter can be used with Count .</maml:para> <maml:para>For strings with a space, use single quotations. For more information, see about_Quoting_Rules (About/about_Quoting_Rules.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>When the Newest parameter is used, `Clear-History` deletes the newest entries in the history. By default, `Clear-History` deletes the oldest entries in the history.</maml:para> <maml:para>The Newest parameter can be used with Id and Count . The Count parameter specifies the number of commands to delete, inclusive of the specified Id . Beginning at the specified Id , commands are deleted in sequential order. For example, if the Id is 30 and the Count is 10, `Clear-History` deletes items 30 through 39.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the `Clear-History` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the `Clear-History` cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Clear-History</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the command history Id that `Clear-History` deletes. To display Id numbers, use the `Get-History` cmdlet. The Id numbers are sequential and commands keep their Id number throughout a PowerShell session. The Id parameter can be used with Count and Newest .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Count</maml:name> <maml:Description> <maml:para>Specifies the number of history entries that `Clear-History` deletes. Commands are deleted in order, beginning with the oldest entry in the history.</maml:para> <maml:para>The Count and Id parameters can be used together. The Count parameter specifies the number of commands to delete, inclusive of the specified Id . Beginning at the specified Id , commands are deleted in reverse sequential order. For example, if the Id is 30 and the Count is 10, `Clear-History` deletes items 21 through 30.</maml:para> <maml:para>The Count and CommandLine parameters can be used together. Count specifies the number of commands to delete that match CommandLine parameter value. The commands are deleted in sequential order.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>When the Newest parameter is used, `Clear-History` deletes the newest entries in the history. By default, `Clear-History` deletes the oldest entries in the history.</maml:para> <maml:para>The Newest parameter can be used with Id and Count . The Count parameter specifies the number of commands to delete, inclusive of the specified Id . Beginning at the specified Id , commands are deleted in sequential order. For example, if the Id is 30 and the Count is 10, `Clear-History` deletes items 30 through 39.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the `Clear-History` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the `Clear-History` cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>CommandLine</maml:name> <maml:Description> <maml:para>Deletes command history from a PowerShell session. The string must be an exact match or use wildcards to match commands in the PowerShell session history displayed by `Get-History`. If you enter more than one string, `Clear-History` deletes commands that match any of the strings. The CommandLine parameter can be used with Count .</maml:para> <maml:para>For strings with a space, use single quotations. For more information, see about_Quoting_Rules (About/about_Quoting_Rules.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Count</maml:name> <maml:Description> <maml:para>Specifies the number of history entries that `Clear-History` deletes. Commands are deleted in order, beginning with the oldest entry in the history.</maml:para> <maml:para>The Count and Id parameters can be used together. The Count parameter specifies the number of commands to delete, inclusive of the specified Id . Beginning at the specified Id , commands are deleted in reverse sequential order. For example, if the Id is 30 and the Count is 10, `Clear-History` deletes items 21 through 30.</maml:para> <maml:para>The Count and CommandLine parameters can be used together. Count specifies the number of commands to delete that match CommandLine parameter value. The commands are deleted in sequential order.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the command history Id that `Clear-History` deletes. To display Id numbers, use the `Get-History` cmdlet. The Id numbers are sequential and commands keep their Id number throughout a PowerShell session. The Id parameter can be used with Count and Newest .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>When the Newest parameter is used, `Clear-History` deletes the newest entries in the history. By default, `Clear-History` deletes the oldest entries in the history.</maml:para> <maml:para>The Newest parameter can be used with Id and Count . The Count parameter specifies the number of commands to delete, inclusive of the specified Id . Beginning at the specified Id , commands are deleted in sequential order. For example, if the Id is 30 and the Count is 10, `Clear-History` deletes items 30 through 39.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the `Clear-History` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the `Clear-History` cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe objects to `Clear-History`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>`Clear-History` does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The PowerShell session history is a list of the commands entered during a PowerShell session. You can view the history, add and delete commands, and run commands from the history. For more information, see about_History (About/about_History.md).</maml:para> <maml:para>The session history is managed separately from the history maintained by the PSReadLine module. Both histories are available in sessions where PSReadLine is loaded. This cmdlet only works with the session history. For more information see, about_PSReadLine (../PSReadLine/About/about_PSReadLine.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Delete the command history from a PowerShell session</maml:title> <dev:code>Get-History Id CommandLine -- ----------- 1 Set-Location .\Test 2 Update-Help 3 Set-Location C:\Test\Logs 4 Get-Location Clear-History Get-History Id CommandLine -- ----------- 5 Clear-History</dev:code> <dev:remarks> <maml:para>The `Get-History` cmdlet displays the PowerShell session's history. `Clear-History` deletes the entire command history. `Get-History` displays the updated command history and confirms the prior history was deleted.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 2: Delete the newest commands ------------</maml:title> <dev:code>Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-Command Clear-History 3 Get-Command Clear-History -Syntax 4 Get-Command Clear-History -ShowCommandInfo 5 Get-Help Get-Alias 6 Get-Command Get-ChildItem -Syntax 7 Get-Help Clear-History 8 Set-Location C:\Test\Logs 9 Get-Help Get-Variable 10 Get-Help Get-ChildItem Clear-History -Count 5 -Newest Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-Command Clear-History 3 Get-Command Clear-History -Syntax 4 Get-Command Clear-History -ShowCommandInfo 5 Get-Help Get-Alias 11 Clear-History -Count 5 -Newest</dev:code> <dev:remarks> <maml:para>The `Get-History` cmdlet displays the PowerShell session's history. `Clear-History` is used to delete the command history. The Count parameter specifies the number of commands to delete, inclusive of the specified Id . The Newest parameter specifies that the newest commands are cleared from the history. `Get-History` displays the updated command history and confirms that the five newest commands were deleted, Id 6 - Id 10 .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 3: Delete commands that match specific criteria ---</maml:title> <dev:code>Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-Command Clear-History 3 Get-Command Clear-History -Syntax 4 Get-Command Clear-History -ShowCommandInfo 5 Get-Help Get-Alias 6 Get-Command Get-ChildItem -Syntax 7 Get-Help Clear-History Clear-History -CommandLine *Help*, *Syntax Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-Command Clear-History 4 Get-Command Clear-History -ShowCommandInfo 8 Clear-History -CommandLine *Help*, *Syntax</dev:code> <dev:remarks> <maml:para>The `Get-History` cmdlet displays the PowerShell session's history. `Clear-History` deletes the command history. The CommandLine parameter specifies commands that contain Help or end with Syntax . `Get-History` displays the updated command history and confirms that commands Id 3 , Id 5 , Id 6 , and Id 7 were deleted.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 4: Delete commands by Id number -----------</maml:title> <dev:code>Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-History 3 Get-Help Get-Alias 4 Get-Command Clear-History 5 Get-Command Clear-History -Syntax 6 Get-Command Clear-History -ShowCommandInfo Clear-History -Id 3, 5 Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-History 4 Get-Command Clear-History 6 Get-Command Clear-History -ShowCommandInfo 7 Get-History 8 Clear-History -Id 3, 5</dev:code> <dev:remarks> <maml:para>The `Get-History` cmdlet displays the PowerShell session's history. `Clear-History` deletes the command history. The Id parameter specifies which commands to delete. `Get-History` displays the updated command history and confirms that Id 3 and Id 5 were deleted.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 5: Delete commands by Id number and count ------</maml:title> <dev:code>Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-Command Clear-History 3 Get-Command Clear-History -Syntax 4 Get-Command Clear-History -ShowCommandInfo 5 Get-Help Get-Alias 6 Get-Command Get-ChildItem -Syntax 7 Get-Help Clear-History 8 Set-Location C:\Test\Logs 9 Get-Help Get-Variable 10 Get-Help Get-ChildItem Clear-History -Id 7 -Count 5 Get-History Id CommandLine -- ----------- 1 Set-Location C:\Test\ 2 Get-Command Clear-History 8 Set-Location C:\Test\Logs 9 Get-Help Get-Variable 10 Get-Help Get-ChildItem 11 Clear-History -Id 7 -Count 5</dev:code> <dev:remarks> <maml:para>The `Get-History` cmdlet displays the PowerShell session's history. `Clear-History` deletes the command history. The Id parameter specifies to begin with Id 7 . The Count parameter specifies to delete five commands, inclusive of the specified Id . `Get-History` displays the updated command history and confirms that five commands were deleted, Id 3 - Id 7 .</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/clear-history?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSReadLine</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Quoting_Rules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Add-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSReadLineOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSReadLineOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Clear-Host</command:name> <command:verb>Clear</command:verb> <command:noun>Host</command:noun> <maml:description> <maml:para>Clears the display in the host program.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Clear-Host` function removes all text from the current display, including commands and output that might have accumulated. When complete, it displays the command prompt. You can use the function name or its alias, `cls`.</maml:para> <maml:para>`Clear-Host` affects only the current display. It does not delete saved results or remove any items from the session. Session-specific items, such as variables and functions, are not affected by this function.</maml:para> <maml:para>Because the behavior of the `Clear-Host` function is determined by the host program, `Clear-Host` might work differently in different host programs.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Clear-Host</maml:name> </command:syntaxItem> </command:syntax> <command:parameters /> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to `Clear-Host`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>`Clear-Host` does not generate any output</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>`Clear-Host` is a simple function, not an advanced function. As such, you cannot use common parameters, such as Debug , in a `Clear-Host` command.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code># Before PS C:\> Get-Process Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 843 33 14428 22556 99 17.41 1688 CcmExec 44 6 2196 4964 52 0.23 692 conhost 646 12 2332 4896 49 1.12 388 csrss 189 11 2860 7084 114 0.66 2896 csrss 78 11 1876 4008 42 0.22 4000 csrss 76 7 1848 5064 54 0.08 1028 dwm 610 41 23952 44048 208 4.40 2080 explorer 0 0 0 24 0 0 Idle 182 32 7692 15980 91 0.23 3056 LogonUI 186 25 7832 16068 91 0.27 3996 LogonUI 1272 32 11512 20432 58 25.07 548 lsass 267 10 3536 6736 34 0.80 556 lsm 137 17 3520 7472 61 0.05 1220 msdtc 447 31 70316 84476 201 1,429.67 836 MsMpEng 265 18 7136 15628 134 2.20 3544 msseces 248 16 6476 4076 76 0.22 1592 NisSrv 368 25 61312 65508 614 1.78 848 powershell 101 8 2304 6624 70 0.64 3648 rdpclip 258 15 6804 12156 50 2.65 536 services ... PS C:\> cls #After PS C:></dev:code> <dev:remarks> <maml:para>This command uses the `cls` alias of `Clear-Host` to clear the current display.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/functions/clear-host?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Read-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Write-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Connect-PSSession</command:name> <command:verb>Connect</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Reconnects to disconnected sessions.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Connect-PSSession cmdlet reconnects to user-managed Windows PowerShell sessions ( PSSessions ) that were disconnected. It works on sessions that are disconnected intentionally, such as by using the Disconnect-PSSession cmdlet or the InDisconnectedSession parameter of the Invoke-Command cmdlet, and those that were disconnected unintentionally, such as by a temporary network outage. Connect-PSSession can connect to any disconnected session that was started by the same user. These include those that were started by or disconnected from other sessions on other computers.</maml:para> <maml:para>However, Connect-PSSession cannot connect to broken or closed sessions, or interactive sessions started by using the Enter-PSSession cmdlet. Also you cannot connect sessions to sessions started by other users, unless you can provide the credentials of the user who created the session.</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (About/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This cmdlet was introduced in Windows PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies the URIs of the connection endpoints for the disconnected sessions.</maml:para> <maml:para>The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a connection URI, you can use the UseSSL and Port parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for Windows PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, Windows PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate URI.</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the New-PSSessionOption cmdlet or set the MaximumConnectionRedirectionCount property of the $PSSessionOption preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials in the command to reconnect to the disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts. They do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly names of the disconnected sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see New-PSSessionOption. For information about the $PSSessionOption preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies the URIs of the connection endpoints for the disconnected sessions.</maml:para> <maml:para>The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a connection URI, you can use the UseSSL and Port parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for Windows PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, Windows PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate URI.</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the New-PSSessionOption cmdlet or set the MaximumConnectionRedirectionCount property of the $PSSessionOption preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials in the command to reconnect to the disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts. They do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of the disconnected sessions.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer.</maml:para> <maml:para>The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see New-PSSessionOption. For information about the $PSSessionOption preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computers on which the disconnected sessions are stored. Sessions are stored on the computer that is at the server-side or receiving end of a connection. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one computer. Wildcard characters are not permitted. To specify the local computer, type the computer name, localhost, or a dot (.)</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the name of an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, the application name is WSMan: `http://localhost:5985/WSMAN`. The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials in the command to reconnect to the disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts. They do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly names of the disconnected sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used to reconnect to the session. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the Windows PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port that is set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see New-PSSessionOption. For information about the $PSSessionOption preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to connect to the disconnected session. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all Windows PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computers on which the disconnected sessions are stored. Sessions are stored on the computer that is at the server-side or receiving end of a connection. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one computer. Wildcard characters are not permitted. To specify the local computer, type the computer name, localhost, or a dot (.)</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the name of an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, the application name is WSMan: `http://localhost:5985/WSMAN`. The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials in the command to reconnect to the disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts. They do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of the disconnected sessions.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer.</maml:para> <maml:para>The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used to reconnect to the session. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the Windows PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port that is set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see New-PSSessionOption. For information about the $PSSessionOption preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to connect to the disconnected session. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all Windows PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the IDs of the disconnected sessions. The Id parameter works only when the disconnected session was previously connected to the current session.</maml:para> <maml:para>This parameter is valid, but not effective, when the session is stored on the local computer, but was not connected to the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of the disconnected sessions.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer.</maml:para> <maml:para>The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly names of the disconnected sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Connect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies the disconnected sessions. Enter a variable that contains the PSSession objects or a command that creates or gets the PSSession objects, such as a Get-PSSession command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate URI.</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the New-PSSessionOption cmdlet or set the MaximumConnectionRedirectionCount property of the $PSSessionOption preference variable. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the name of an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, the application name is WSMan: `http://localhost:5985/WSMAN`. The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials in the command to reconnect to the disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts. They do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computers on which the disconnected sessions are stored. Sessions are stored on the computer that is at the server-side or receiving end of a connection. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one computer. Wildcard characters are not permitted. To specify the local computer, type the computer name, localhost, or a dot (.)</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies the URIs of the connection endpoints for the disconnected sessions.</maml:para> <maml:para>The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a connection URI, you can use the UseSSL and Port parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for Windows PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, Windows PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the IDs of the disconnected sessions. The Id parameter works only when the disconnected session was previously connected to the current session.</maml:para> <maml:para>This parameter is valid, but not effective, when the session is stored on the local computer, but was not connected to the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of the disconnected sessions.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer.</maml:para> <maml:para>The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly names of the disconnected sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used to reconnect to the session. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the Windows PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port that is set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies the disconnected sessions. Enter a variable that contains the PSSession objects or a command that creates or gets the PSSession objects, such as a Get-PSSession command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see New-PSSessionOption. For information about the $PSSessionOption preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to connect to the disconnected session. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all Windows PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session ( PSSession ) to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns an object that represents the session to which it reconnected.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para> Connect-PSSession * reconnects only to sessions that are disconnected, that is, sessions that have a value of Disconnected for the State property. Only sessions that are connected to, or end at, computers that run Windows PowerShell 3.0 or later versions can be disconnected and reconnected. If you use Connect-PSSession * on a session that is not disconnected, the command does not affect the session and it does not generate errors. * Disconnected loopback sessions with interactive tokens, which are created by using the EnableNetworkAccess parameter, can be reconnected only from the computer on which the session was created. This restriction protects the computer from malicious access. The value of the State property of a PSSession * is relative to the current session. Therefore, a value of Disconnected means that the PSSession is not connected to the current session. However, it does not mean that the PSSession is disconnected from all sessions. It might be connected to a different session. To determine whether you can connect or reconnect to the session, use the Availability property.</maml:para> <maml:para> An Availability value of None indicates that you can connect to the session. A value of Busy indicates that you cannot connect to the PSSession because it is connected to another session.</maml:para> <maml:para> For more information about the values of the State property of sessions, see RunspaceState Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.runspacestate)in the MSDN library.</maml:para> <maml:para> For more information about the values of the Availability property of sessions, see RunspaceAvailability Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.runspaceavailability)in the MSDN library. You cannot change the idle time-out value of a PSSession * when you connect to the PSSession . The SessionOption parameter of Connect-PSSession takes a SessionOption object that has an IdleTimeout value. However, the IdleTimeout value of the SessionOption object and the IdleTimeout value of the $PSSessionOption variable are ignored when connecting to a PSSession .</maml:para> <maml:para> You can set and change the idle time-out of a PSSession when you create the PSSession , by using the New-PSSession or Invoke-Command cmdlets, and when you disconnect from the PSSession .</maml:para> <maml:para> The IdleTimeout property of a PSSession is critical to disconnected sessions, because it determines how long a disconnected session is maintained on the remote computer. Disconnected sessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------- Example 1: Reconnect to a session --------------</maml:title> <dev:code>PS C:\> Connect-PSSession -ComputerName Server01 -Name ITTask Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 4 ITTask Server01 Opened ITTasks Available</dev:code> <dev:remarks> <maml:para>This command reconnects to the ITTask session on the Server01 computer.</maml:para> <maml:para>The output shows that the command was successful. The State of the session is Opened and the Availability is Available, which indicates that you can run commands in the session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 2: Effect of disconnecting and reconnecting -----</maml:title> <dev:code>PS C:\> Get-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Backups Localhost Opened Microsoft.PowerShell Available PS C:\> Get-PSSession | Disconnect-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Backups Localhost Disconnected Microsoft.PowerShell None PS C:\> Get-PSSession | Connect-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Backups Localhost Opened Microsoft.PowerShell Available</dev:code> <dev:remarks> <maml:para>This example shows the effect of disconnecting and then reconnecting to a session.</maml:para> <maml:para>The first command uses the Get-PSSession cmdlet. Without the ComputerName parameter, the command gets only sessions that were created in the current session.</maml:para> <maml:para>The output shows that the command gets the Backups session on the local computer. The State of the session is Opened and the Availability is Available.</maml:para> <maml:para>The second command uses the Get-PSSession cmdlet to get the PSSession objects that were created in the current session and the Disconnect-PSSession cmdlet to disconnect the sessions. The output shows that the Backups session was disconnected. The State of the session is Disconnected and the Availability is None.</maml:para> <maml:para>The third command uses the Get-PSSession cmdlet to get the PSSession objects that were created in the current session and the Connect-PSSession cmdlet to reconnect the sessions. The output shows that the Backups session was reconnected. The State of the session is Opened and the Availability is Available.</maml:para> <maml:para>If you use the Connect-PSSession cmdlet on a session that is not disconnected, the command does not affect the session and it does not generate any errors.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 3: Series of commands in an enterprise scenario ---</maml:title> <dev:code>The administrator starts by creating a sessions on a remote computer and running a script in the session.The first command uses the **New-PSSession** cmdlet to create the ITTask session on the Server01 remote computer. The command uses the *ConfigurationName* parameter to specify the ITTasks session configuration. The command saves the sessions in the $s variable. PS C:\> $s = New-PSSession -ComputerName Server01 -Name ITTask -ConfigurationName ITTasks The second command **Invoke-Command** cmdlet to start a background job in the session in the $s variable. It uses the *FilePath* parameter to run the script in the background job. PS C:\> Invoke-Command -Session $s {Start-Job -FilePath \\Server30\Scripts\Backup-SQLDatabase.ps1} Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 2 Job2 Running True Server01 \\Server30\Scripts\Backup... The third command uses the Disconnect-PSSession cmdlet to disconnect from the session in the $s variable. The command uses the *OutputBufferingMode* parameter with a value of Drop to prevent the script from being blocked by having to deliver output to the session. It uses the *IdleTimeoutSec* parameter to extend the session time-out to 15 hours.When the command is completed, the administrator locks her computer and goes home for the evening. PS C:\> Disconnect-PSSession -Session $s -OutputBufferingMode Drop -IdleTimeoutSec 60*60*15 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server01 Disconnected ITTasks None Later that evening, the administrator starts her home computer, logs on to the corporate network, and starts Windows PowerShell. The fourth command uses the Get-PSSession cmdlet to get the sessions on the Server01 computer. The command finds the ITTask session.The fifth command uses the **Connect-PSSession** cmdlet to connect to the ITTask session. The command saves the session in the $s variable. PS C:\> Get-PSSession -ComputerName Server01 -Name ITTask Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server01 Disconnected ITTasks None PS C:\> $s = Connect-PSSession -ComputerName Server01 -Name ITTask Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server01 Opened ITTasks Available The sixth command uses the **Invoke-Command** cmdlet to run a Get-Job command in the session in the $s variable. The output shows that the job finished successfully.The seventh command uses the **Invoke-Command** cmdlet to run a Receive-Job command in the session in the $s variable in the session. The command saves the results in the $BackupSpecs variable.The eighth command uses the **Invoke-Command** cmdlet to runs another script in the session. The command uses the value of the $BackupSpecs variable in the session as input to the script. PS C:\> Invoke-Command -Session $s {Get-Job} Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 2 Job2 Completed True Server01 \\Server30\Scripts\Backup... PS C:\> Invoke-Command -Session $s {$BackupSpecs = Receive-Job -JobName Job2} PS C:\> Invoke-Command -Session $s {\\Server30\Scripts\New-SQLDatabase.ps1 -InitData $BackupSpecs.Initialization} The ninth command disconnects from the session in the $s variable.The administrator closes Windows PowerShell and closes the computer. She can reconnect to the session on the next day and check the script status from her work computer. PS C:\> Disconnect-PSSession -Session $s -OutputBufferingMode Drop -IdleTimeoutSec 60*60*15 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server01 Disconnected ITTasks None</dev:code> <dev:remarks> <maml:para>This series of commands shows how the Connect-PSSession cmdlet might be used in an enterprise scenario. In this case, a system administrator starts a long-running job in a session on a remote computer. After starting the job, the administrator disconnects from the session and goes home. Later that evening, the administrator logs on to her home computer and verifies that the job ran until it is completed.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/connect-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSTransportOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Debug-Job</command:name> <command:verb>Debug</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Debugs a running background, remote, or Windows PowerShell Workflow job.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Debug-Job cmdlet lets you debug scripts that are running within jobs. The cmdlet is designed to debug Windows PowerShell Workflow jobs, background jobs, and jobs running in remote sessions. Debug-Job accepts a running job object, name, ID, or instance ID as input, and starts a debugging session on the script it is running. The debugger quit command stops the job and running script. Starting in Windows PowerShell 5.0, the exit command detaches the debugger, and allows the job to continue to run.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Debug-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the ID number of a running job. To get the ID number of a job, run the Get-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Debug-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID GUID of a running job. To get the InstanceId of a job, run the Get-Job cmdlet, piping the results into a Format- * cmdlet, as shown in the following example:</maml:para> <maml:para>`Get-Job | Format-List -Property Id,Name,InstanceId,State`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Debug-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies a running job object. The simplest way to use this parameter is to save the results of a Get-Job command that returns the running job that you want to debug in a variable, and then specify the variable as the value of this parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Debug-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a job by the friendly name of the job. When you start a job, you can specify a job name by adding the JobName parameter, in cmdlets such as Invoke-Command and Start-Job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the ID number of a running job. To get the ID number of a job, run the Get-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID GUID of a running job. To get the InstanceId of a job, run the Get-Job cmdlet, piping the results into a Format- * cmdlet, as shown in the following example:</maml:para> <maml:para>`Get-Job | Format-List -Property Id,Name,InstanceId,State`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies a running job object. The simplest way to use this parameter is to save the results of a Get-Job command that returns the running job that you want to debug in a variable, and then specify the variable as the value of this parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a job by the friendly name of the job. When you start a job, you can specify a job name by adding the JobName parameter, in cmdlets such as Invoke-Command and Start-Job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.RemotingJob</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------------- Example 1: Debug a job by job ID ---------------</maml:title> <dev:code>PS C:\> Debug-Job -ID 3 Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 3 Job3 RemoteJob Running True PowerShellIx TestWFDemo1.ps1 Entering debug mode. Use h or ? for help. Hit Line breakpoint on 'C:\TestWFDemo1.ps1:8' At C:\TestWFDemo1.ps1:8 char:5 + Write-Output -InputObject "Now writing output:" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [DBG:PowerShellIx]: PS C:\> > list 3: 4: workflow SampleWorkflowTest 5: { 6: param ($MyOutput) 7: 8:* Write-Output -InputObject "Now writing output:" 9: Write-Output -Input $MyOutput 10: 11: Write-Output -InputObject "Get PowerShell process:" 12: Get-Process -Name powershell 13: 14: Write-Output -InputObject "Workflow function complete." 15: } 16: 17: # Call workflow function 18: SampleWorkflowTest -MyOutput "Hello"</dev:code> <dev:remarks> <maml:para>This command breaks into a running job with an ID of 3.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/debug-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Disable-PSRemoting</command:name> <command:verb>Disable</command:verb> <command:noun>PSRemoting</command:noun> <maml:description> <maml:para>Prevents PowerShell endpoints from receiving remote connections.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Disable-PSRemoting` cmdlet blocks remote access to all Windows PowerShell session endpoint configurations on the local computer. This includes any endpoints created by PowerShell 6 or higher.</maml:para> <maml:para>To re-enable remote access to all session configurations, use the `Enable-PSRemoting` cmdlet. This includes any endpoints created by PowerShell 6 or higher. To enable remote access to selected session configurations, use the AccessMode parameter of the `Set-PSSessionConfiguration` cmdlet. You can also use the `Enable-PSSessionConfiguration` and `Disable-PSSessionConfiguration` cmdlets to enable and disable session configurations for all users. For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> <maml:para>> [!NOTE] > Even after running `Disable-PSRemoting` you can still make loopback connections on the local > machine. A loopback connection is a PowerShell remote session that originates from and connects to > the same local machine. Remote sessions from external sources remain blocked. For loopback > connections you must use implicit credentials along the EnableNetworkAccess parameter. For > more information about loopback connections, see New-PSSession (New-PSSession.md).</maml:para> <maml:para>To run this cmdlet, start Windows PowerShell with the Run as administrator option.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Disable-PSRemoting</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Forces the command to run without asking for user confirmation.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Forces the command to run without asking for user confirmation.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe any objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- Disabling the session configurations does not undo all the changes that were made by the `Enable-PSRemoting` or `Enable-PSSessionConfiguration` cmdlets. You might have to undo the following changes manually.</maml:para> <maml:para> 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer.</maml:para> <maml:para> A session configuration is a group of settings that define the environment for a session. Every session that connects to the computer must use one of the session configurations that are registered on the computer. By denying remote access to all session configurations, you effectively prevent remote users from establishing sessions that connect to the computer.</maml:para> <maml:para> In Windows PowerShell 2.0, `Disable-PSRemoting` adds a Deny_All entry to the security descriptors of all session configurations. This setting prevents all users from creating user-managed sessions to the local computer. In Windows PowerShell 3.0, `Disable-PSRemoting` adds a Network_Deny_All entry to the security descriptors of all session configurations. This setting prevents users on other computers from creating user-managed sessions on the local computer, but allows users of the local computer to create user-managed loopback sessions.</maml:para> <maml:para> In Windows PowerShell 2.0, `Disable-PSRemoting` is the equivalent of `Disable-PSSessionConfiguration -Name *`. In Windows PowerShell 3.0 and later releases, `Disable-PSRemoting` is the equivalent of `Set-PSSessionConfiguration -Name <Configuration name> -AccessMode Local`</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Prevent remote access to all session configurations</maml:title> <dev:code>Disable-PSRemoting WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer.</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Prevent remote access to all session configurations without confirmation prompt</maml:title> <dev:code>Disable-PSRemoting -Force WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer.</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 3: Effects of running this cmdlet ----------</maml:title> <dev:code>Disable-PSRemoting -Force New-PSSession -ComputerName localhost WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer. New-PSSession : [localhost] Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. At line:1 char:1 + New-PSSession -ComputerName localhost -ConfigurationName PowerShell.6 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.Management.A\u2026tion.RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Effects of running this cmdlet and Enable-PSRemoting</maml:title> <dev:code>Disable-PSRemoting -force Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Auto Enable-PSRemoting -Force Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Auto Name Permission ---- ---------- microsoft.powershell NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell.workflow NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell32 NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.ServerManager NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed WithProfile NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed Name Permission ---- ---------- microsoft.powershell BUILTIN\Administrators AccessAllowed microsoft.powershell.workflow BUILTIN\Administrators AccessAllowed microsoft.powershell32 BUILTIN\Administrators AccessAllowed microsoft.ServerManager BUILTIN\Administrators AccessAllowed WithProfile BUILTIN\Administrators AccessAllowed</dev:code> <dev:remarks> <maml:para>The `Enable-PSRemoting` cmdlet re-enables remote access to all PowerShell session endpoint configurations on the computer. The Force parameter suppresses all user prompts and restarts the WinRM service without prompting. The new output shows that the AccessDenied security descriptors have been removed from all session configurations.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: Loopback connections with disabled session endpoint configurations</maml:title> <dev:code>Disable-PSRemoting -Force New-PSSession -ComputerName localhost WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer. New-PSSession : [localhost] Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. At line:1 char:1 + New-PSSession -ComputerName localhost + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin gTransportException + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed New-PSSession -ComputerName localhost -EnableNetworkAccess Id Name Transport ComputerName ComputerType State ConfigurationName Availability -- ---- --------- ------------ ------------ ----- ----------------- ------------ 1 Runspace1 WSMan localhost RemoteMachine Opened powershell.6 Available</dev:code> <dev:remarks> <maml:para>The first use of `New-PSSession` attempts to create a remote session to the local machine. This type of connection goes through the network stack and is not a loopback. Consequently, the connection attempt to the disabled endpoint fails with an Access is denied error.</maml:para> <maml:para>The second use of `New-PSSession` also attempts to create a remote session to the local machine. In this case, it succeeds because it is a loopback connection that bypasses the network stack.</maml:para> <maml:para>A loopback connection is created when the following conditions are met:</maml:para> <maml:para>- The computer name to connect to is 'localhost'.</maml:para> <maml:para>- No credentials are passed in. Current logged in user (implicit credentials) is used for the</maml:para> <maml:para> connection. - The EnableNetworkAccess switch parameter is used.</maml:para> <maml:para>For more information on loopback connections, see New-PSSession (New-PSSession.md)document.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: Prevent remote access to session configurations that have custom security descriptors</maml:title> <dev:code>Register-PSSessionConfiguration -Name Test -FilePath .\TestEndpoint.pssc -ShowSecurityDescriptorUI -Force Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Wrap Disable-PSRemoting -Force Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Wrap New-PSSession -ComputerName localhost -ConfigurationName Test Name Permission ---- ---------- microsoft.powershell BUILTIN\Administrators AccessAllowed Test NT AUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, DOMAIN01\User01 AccessAllowed WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer. Name Permission ---- ---------- microsoft.powershell NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed Test NT AUTHORITY\NETWORK AccessDenied, NTAUTHORITY\INTERACTIVE AccessAllowed, BUILTIN\Administrators AccessAllowed, DOMAIN01\User01 AccessAllowed [Server01] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_Rem ote_Troubleshooting Help topic. + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionOpenFailed</dev:code> <dev:remarks> <maml:para>Now the `Get-PSSessionConfiguration` and `Format-Table` cmdlets shows that an AccessDenied security descriptor for all network users is added to all session configurations, including the Test session configuration. Although the other security descriptors are not changed, the "network_deny_all" security descriptor takes precedence. This is illustrated by the attempt to use `New-PSSession` to connect to the Test session configuration.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 7: Re-enable remote access to selected session configurations</maml:title> <dev:code>Disable-PSRemoting -Force Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Auto Set-PSSessionConfiguration -Name Microsoft.ServerManager -AccessMode Remote -Force Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Auto WARNING: Disabling the session configurations does not undo all the changes made by the Enable-PSRemoting or Enable-PSSessionConfiguration cmdlet. You might have to manually undo the changes by following these steps: 1. Stop and disable the WinRM service. 2. Delete the listener that accepts requests on any IP address. 3. Disable the firewall exceptions for WS-Management communications. 4. Restore the value of the LocalAccountTokenFilterPolicy to 0, which restricts remote access to members of the Administrators group on the computer. Name Permission ---- ---------- microsoft.powershell NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell.workflow NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell32 NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.ServerManager NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed WithProfile NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed Name Permission ---- ---------- microsoft.powershell NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell.workflow NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell32 NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.ServerManager BUILTIN\Administrators AccessAllowed WithProfile NT AUTHORITY\NETWORK AccessDenied, BUILTIN\Administrators AccessAllowed</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/disable-psremoting?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSRemoting</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Disable-PSSessionConfiguration</command:name> <command:verb>Disable</command:verb> <command:noun>PSSessionConfiguration</command:noun> <maml:description> <maml:para>Disables session configurations on the local computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Disable-PSSessionConfiguration` cmdlet disables session configurations on the local computer, which prevents all users from using the session configurations to create a user-managed sessions ( PSSessions ) on the local computer. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.</maml:para> <maml:para>Starting in PowerShell 3.0, the `Disable-PSSessionConfiguration` cmdlet sets the Enabled setting of the session configuration (`WSMan:\localhost\Plugins<SessionConfiguration>\Enabled`) to False.</maml:para> <maml:para>In PowerShell 2.0, the `Disable-PSSessionConfiguration` cmdlet adds a Deny_All entry to the security descriptor of one or more registered session configurations.</maml:para> <maml:para>Without parameters, `Disable-PSSessionConfiguration` disables the Microsoft.PowerShell configuration, the default configuration used for sessions. Unless the user specifies a different configuration, both local and remote users are effectively prevented from creating any sessions that connect to the computer.</maml:para> <maml:para>To disable all session configurations on the computer, use `Disable-PSRemoting`.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Disable-PSSessionConfiguration</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of names of session configurations to disable. Enter one or more configuration names. Wildcard characters are permitted. You can also pipe a string that contains a configuration name or a session configuration object to `Disable-PSSessionConfiguration`.</maml:para> <maml:para>If you omit this parameter, `Disable-PSSessionConfiguration` disables the Microsoft.PowerShell session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Forces the command to run without asking for user confirmation.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Used to prevent the restart of the WSMan service. It is not necessary to restart the service to disable the configuration.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Forces the command to run without asking for user confirmation.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of names of session configurations to disable. Enter one or more configuration names. Wildcard characters are permitted. You can also pipe a string that contains a configuration name or a session configuration object to `Disable-PSSessionConfiguration`.</maml:para> <maml:para>If you omit this parameter, `Disable-PSSessionConfiguration` disables the Microsoft.PowerShell session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Used to prevent the restart of the WSMan service. It is not necessary to restart the service to disable the configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session configuration object or a string that contains the name of a session configuration to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not return any objects.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To run this cmdlet you must start PowerShell by using the Run as administrator option.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Disable the default configuration ---------</maml:title> <dev:code>Disable-PSSessionConfiguration</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 2: Disable all registered session configurations ---</maml:title> <dev:code>Disable-PSSessionConfiguration -Name *</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 3: Disable session configurations by name ------</maml:title> <dev:code>Disable-PSSessionConfiguration -Name Microsoft* -Force</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Disable session configurations by using the pipeline</maml:title> <dev:code>Get-PSSessionConfiguration -Name MaintenanceShell, AdminShell | Disable-PSSessionConfiguration</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 5: Effects of disabling a session configuration ---</maml:title> <dev:code>PS> Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Auto Name Permission ---- ---------- MaintenanceShell BUILTIN\Administrators AccessAllowed microsoft.powershell BUILTIN\Administrators AccessAllowed microsoft.powershell32 BUILTIN\Administrators AccessAllowed PS> Disable-PSSessionConfiguration -Name MaintenanceShell -Force PS> Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Auto Name Permission ---- ---------- MaintenanceShell Everyone AccessDenied, BUILTIN\Administrators AccessAllowed microsoft.powershell BUILTIN\Administrators AccessAllowed microsoft.powershell32 BUILTIN\Administrators AccessAllowed PS> New-PSSession -ComputerName localhost -ConfigurationName MaintenanceShell [localhost] Connecting to remote server failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionOpenFailed</dev:code> <dev:remarks> <maml:para>> [!NOTE] > Disabling the configuration does not prevent you from changing the configuration using the > `Set-PSSessionConfiguration` cmdlet. It only prevents use of the configuration.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/disable-pssessionconfiguration?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Disconnect-PSSession</command:name> <command:verb>Disconnect</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Disconnects from a session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Disconnect-PSSession` cmdlet disconnects a PowerShell session ("PSSession"), such as one started by using the `New-PSSession` cmdlet, from the current session. As a result, the PSSession is in a disconnected state. You can connect to the disconnected PSSession from the current session or from another session on the local computer or a different computer.</maml:para> <maml:para>The `Disconnect-PSSession` cmdlet disconnects only open PSSessions that are connected to the current session. `Disconnect-PSSession` cannot disconnect broken or closed PSSessions, or interactive PSSessions started by using the `Enter-PSSession` cmdlet, and it cannot disconnect PSSessions that are connected to other sessions.</maml:para> <maml:para>To reconnect to a disconnected PSSession, use the `Connect-PSSession` or `Receive-PSSession` cmdlets.</maml:para> <maml:para>When a PSSession is disconnected, the commands in the PSSession continue to run until they complete, unless the PSSession times out or the commands in the PSSession are blocked by a full output buffer. To change the idle timeout, use the IdleTimeoutSec parameter. To change the output buffering mode, use the OutputBufferingMode parameter You can also use the InDisconnectedSession parameter of the `Invoke-Command` cmdlet to run a command in a disconnected session.</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (./About/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This cmdlet is introduced in Windows PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Disconnect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Disconnects from sessions with the specified session ID. Type one or more IDs (separated by commas), or use the range operator (..) to specify a range of IDs.</maml:para> <maml:para>To get the ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in the ID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Changes the idle timeout value of the disconnected PSSession. Enter a value in seconds. The minimum value is 60 (1 minute).</maml:para> <maml:para>The idle timeout determines how long the disconnected PSSession is maintained on the remote computer. When the timeout expires, the PSSession is deleted.</maml:para> <maml:para>Disconnected PSSessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> <maml:para>The default value for the idle timeout of a session is set by the value of the IdleTimeoutMs property of the session configuration. The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The value of this parameter takes precedence over the value of the IdleTimeout property of the $PSSessionOption preference variable and the default idle timeout value in the session configuration. However, this value cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. The default value of MaxIdleTimeoutMs is 12 hours (43200000 milliseconds).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Sets the throttle limit for the `Disconnect-PSSession` command.</maml:para> <maml:para>The throttle limit is the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in the disconnected session when the output buffer is full. The default value is Block .</maml:para> <maml:para>If the command in the disconnected session is returning output and the output buffer fills, the value of this parameter effectively determines whether the command continues to run while the session is disconnected. A value of Block suspends the command until the session is reconnected. A value of Drop allows the command to complete, although data might be lost. When using the Drop value, redirect the command output to a file on disk.</maml:para> <maml:para>Valid values are:</maml:para> <maml:para>- Block : When the output buffer is full, execution is suspended until the buffer is clear. - Drop : When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None : No output buffering mode is specified. The value of the OutputBufferingMode property of the session configuration is used for the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Block</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Disconnect-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Changes the idle timeout value of the disconnected PSSession. Enter a value in seconds. The minimum value is 60 (1 minute).</maml:para> <maml:para>The idle timeout determines how long the disconnected PSSession is maintained on the remote computer. When the timeout expires, the PSSession is deleted.</maml:para> <maml:para>Disconnected PSSessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> <maml:para>The default value for the idle timeout of a session is set by the value of the IdleTimeoutMs property of the session configuration. The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The value of this parameter takes precedence over the value of the IdleTimeout property of the $PSSessionOption preference variable and the default idle timeout value in the session configuration. However, this value cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. The default value of MaxIdleTimeoutMs is 12 hours (43200000 milliseconds).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Disconnects from sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The instance ID is unique, even across multiple sessions on multiple computers.</maml:para> <maml:para>To get the instance ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Sets the throttle limit for the `Disconnect-PSSession` command.</maml:para> <maml:para>The throttle limit is the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in the disconnected session when the output buffer is full. The default value is Block .</maml:para> <maml:para>If the command in the disconnected session is returning output and the output buffer fills, the value of this parameter effectively determines whether the command continues to run while the session is disconnected. A value of Block suspends the command until the session is reconnected. A value of Drop allows the command to complete, although data might be lost. When using the Drop value, redirect the command output to a file on disk.</maml:para> <maml:para>Valid values are:</maml:para> <maml:para>- Block : When the output buffer is full, execution is suspended until the buffer is clear. - Drop : When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None : No output buffering mode is specified. The value of the OutputBufferingMode property of the session configuration is used for the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Block</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Disconnect-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Changes the idle timeout value of the disconnected PSSession. Enter a value in seconds. The minimum value is 60 (1 minute).</maml:para> <maml:para>The idle timeout determines how long the disconnected PSSession is maintained on the remote computer. When the timeout expires, the PSSession is deleted.</maml:para> <maml:para>Disconnected PSSessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> <maml:para>The default value for the idle timeout of a session is set by the value of the IdleTimeoutMs property of the session configuration. The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The value of this parameter takes precedence over the value of the IdleTimeout property of the $PSSessionOption preference variable and the default idle timeout value in the session configuration. However, this value cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. The default value of MaxIdleTimeoutMs is 12 hours (43200000 milliseconds).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Disconnects from sessions with the specified friendly names. Wildcards are permitted.</maml:para> <maml:para>To get the friendly name of a session, use the `Get-PSSession` cmdlet. The friendly name is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Sets the throttle limit for the `Disconnect-PSSession` command.</maml:para> <maml:para>The throttle limit is the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in the disconnected session when the output buffer is full. The default value is Block .</maml:para> <maml:para>If the command in the disconnected session is returning output and the output buffer fills, the value of this parameter effectively determines whether the command continues to run while the session is disconnected. A value of Block suspends the command until the session is reconnected. A value of Drop allows the command to complete, although data might be lost. When using the Drop value, redirect the command output to a file on disk.</maml:para> <maml:para>Valid values are:</maml:para> <maml:para>- Block : When the output buffer is full, execution is suspended until the buffer is clear. - Drop : When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None : No output buffering mode is specified. The value of the OutputBufferingMode property of the session configuration is used for the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Block</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Disconnect-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Disconnects from the specified PSSessions. Enter PSSession objects, such as those that the `New-PSSession` cmdlet returns. You can also pipe a PSSession object to `Disconnect-PSSession`.</maml:para> <maml:para>The `Get-PSSession` cmdlet can get all PSSessions that terminate at a remote computer, including PSSessions that are disconnected and PSSessions that are connected to other sessions on other computers. `Disconnect-PSSession` disconnects only PSSession that are connected to the current session. If you pipe other PSSessions to `Disconnect-PSSession`, the `Disconnect-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Changes the idle timeout value of the disconnected PSSession. Enter a value in seconds. The minimum value is 60 (1 minute).</maml:para> <maml:para>The idle timeout determines how long the disconnected PSSession is maintained on the remote computer. When the timeout expires, the PSSession is deleted.</maml:para> <maml:para>Disconnected PSSessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> <maml:para>The default value for the idle timeout of a session is set by the value of the IdleTimeoutMs property of the session configuration. The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The value of this parameter takes precedence over the value of the IdleTimeout property of the $PSSessionOption preference variable and the default idle timeout value in the session configuration. However, this value cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. The default value of MaxIdleTimeoutMs is 12 hours (43200000 milliseconds).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Sets the throttle limit for the `Disconnect-PSSession` command.</maml:para> <maml:para>The throttle limit is the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in the disconnected session when the output buffer is full. The default value is Block .</maml:para> <maml:para>If the command in the disconnected session is returning output and the output buffer fills, the value of this parameter effectively determines whether the command continues to run while the session is disconnected. A value of Block suspends the command until the session is reconnected. A value of Drop allows the command to complete, although data might be lost. When using the Drop value, redirect the command output to a file on disk.</maml:para> <maml:para>Valid values are:</maml:para> <maml:para>- Block : When the output buffer is full, execution is suspended until the buffer is clear. - Drop : When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None : No output buffering mode is specified. The value of the OutputBufferingMode property of the session configuration is used for the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Block</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Disconnects from sessions with the specified session ID. Type one or more IDs (separated by commas), or use the range operator (..) to specify a range of IDs.</maml:para> <maml:para>To get the ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in the ID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Changes the idle timeout value of the disconnected PSSession. Enter a value in seconds. The minimum value is 60 (1 minute).</maml:para> <maml:para>The idle timeout determines how long the disconnected PSSession is maintained on the remote computer. When the timeout expires, the PSSession is deleted.</maml:para> <maml:para>Disconnected PSSessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> <maml:para>The default value for the idle timeout of a session is set by the value of the IdleTimeoutMs property of the session configuration. The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The value of this parameter takes precedence over the value of the IdleTimeout property of the $PSSessionOption preference variable and the default idle timeout value in the session configuration. However, this value cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. The default value of MaxIdleTimeoutMs is 12 hours (43200000 milliseconds).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Disconnects from sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The instance ID is unique, even across multiple sessions on multiple computers.</maml:para> <maml:para>To get the instance ID of a session, use the `Get-PSSession` cmdlet. The instance ID is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Disconnects from sessions with the specified friendly names. Wildcards are permitted.</maml:para> <maml:para>To get the friendly name of a session, use the `Get-PSSession` cmdlet. The friendly name is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Disconnects from the specified PSSessions. Enter PSSession objects, such as those that the `New-PSSession` cmdlet returns. You can also pipe a PSSession object to `Disconnect-PSSession`.</maml:para> <maml:para>The `Get-PSSession` cmdlet can get all PSSessions that terminate at a remote computer, including PSSessions that are disconnected and PSSessions that are connected to other sessions on other computers. `Disconnect-PSSession` disconnects only PSSession that are connected to the current session. If you pipe other PSSessions to `Disconnect-PSSession`, the `Disconnect-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Sets the throttle limit for the `Disconnect-PSSession` command.</maml:para> <maml:para>The throttle limit is the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in the disconnected session when the output buffer is full. The default value is Block .</maml:para> <maml:para>If the command in the disconnected session is returning output and the output buffer fills, the value of this parameter effectively determines whether the command continues to run while the session is disconnected. A value of Block suspends the command until the session is reconnected. A value of Drop allows the command to complete, although data might be lost. When using the Drop value, redirect the command output to a file on disk.</maml:para> <maml:para>Valid values are:</maml:para> <maml:para>- Block : When the output buffer is full, execution is suspended until the buffer is clear. - Drop : When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None : No output buffering mode is specified. The value of the OutputBufferingMode property of the session configuration is used for the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Block</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session to `Disconnect-PSSession`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>`Disconnect-PSSession` returns an object that represents the session that it disconnected.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- The `Disconnect-PSSession` cmdlet works only when the local and remote computers are running PowerShell 3.0 or later. - If you use the `Disconnect-PSSession` cmdlet on a disconnected session, the command has no effect on the session and it does not generate errors. - Disconnected loopback sessions with interactive security tokens (those created with the EnableNetworkAccess parameter) can be reconnected only from the computer on which the session was created. This restriction protects the computer from malicious access. - When you disconnect a PSSession, the session state is Disconnected and the availability is None .</maml:para> <maml:para> The value of the State property is relative to the current session. Therefore, a value of Disconnected means that the PSSession is not connected to the current session. However, it does not mean that the PSSession is disconnected from all sessions. It might be connected to a different session. To determine whether you can connect or reconnect to the session, use the Availability property.</maml:para> <maml:para> An Availability value of None indicates that you can connect to the session. A value of Busy indicates that you cannot connect to the PSSession because it is connected to another session.</maml:para> <maml:para> For more information about the values of the State property of sessions, see RunspaceState Enumeration (/dotnet/api/system.management.automation.runspaces.runspacestate).</maml:para> <maml:para> For more information about the values of the Availability property of sessions, see RunspaceAvailability Enumeration (/dotnet/api/system.management.automation.runspaces.runspaceavailability).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------- Example 1 - Disconnect a session by name -----------</maml:title> <dev:code>PS> Disconnect-PSSession -Name UpdateSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 UpdateSession Server01 Disconnected Microsoft.PowerShell None</dev:code> <dev:remarks> <maml:para>The output shows that the attempt to disconnect was successful. The session state is Disconnected and the Availability is None, which indicates that the session is not busy and can be reconnected.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 2 - Disconnect a session from a specific computer --</maml:title> <dev:code>PS> Get-PSSession -ComputerName Server12 -Name ITTask | Disconnect-PSSession -OutputBufferingMode Drop -IdleTimeoutSec 86400 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server12 Disconnected ITTasks None</dev:code> <dev:remarks> <maml:para>The `Disconnect-PSSession` command uses the OutputBufferingMode parameter to set the output mode to Drop . This setting ensures that the script that is running in the session can continue to run even if the session output buffer is full. Because the script writes its output to a report on a file share, other output can be lost without consequence.</maml:para> <maml:para>The command also uses the IdleTimeoutSec parameter to extend the idle timeout of the session to 24 hours. This setting allows time for this administrator or other administrators to reconnect to the session to verify that the script ran and troubleshoot if needed.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 3 - Using multiple PSSessions on multiple computers -</maml:title> <dev:code>PS> $s = New-PSSession -ComputerName Srv1, Srv2, Srv30 -Name ITTask PS> Invoke-Command $s -FilePath \\Server01\Scripts\Get-PatchStatus.ps1 PS> Get-PSSession -Name ITTask -ComputerName Srv1 | Disconnect-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Srv1 Disconnected Microsoft.PowerShell None PS> Get-PSSession -ComputerName Srv1, Srv2, Srv30 -Name ITTask Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Srv1 Disconnected Microsoft.PowerShell None 2 ITTask Srv2 Opened Microsoft.PowerShell Available 3 ITTask Srv30 Opened Microsoft.PowerShell Available PS> Get-PSSession -ComputerName Srv1 -Name ITTask -Credential Domain01\User01 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Srv1 Disconnected Microsoft.PowerShell None PS> $s = Connect-PSSession -ComputerName Srv1 -Name ITTask -Credential Domain01\User01 PS> Invoke-Command -Session $s {dir $home\Scripts\PatchStatusOutput.ps1} PS> Invoke-Command -Session $s {mkdir $home\Scripts\PatchStatusOutput} PS> Invoke-Command -Session $s -FilePath \\Server01\Scripts\Get-PatchStatus.ps1 PS> Disconnect-PSSession -Session $s</dev:code> <dev:remarks> <maml:para>The technician begins by creating sessions on several remote computers and running a script in each session. The first command uses the `New-PSSession` cmdlet to create the ITTask session on three remote computers. The command saves the sessions in the $s variable. The second command uses the FilePath parameter of the `Invoke-Command` cmdlet to run a script in the sessions in the $s variable.</maml:para> <maml:para>The script running on the Srv1 computer generates unexpected errors. The technician contacts his manager and asks for assistance. The manager directs the technician to disconnect from the session so he can investigate.The second command uses the `Get-PSSession` cmdlet to get the ITTask session on the Srv1 computer and the `Disconnect-PSSession` cmdlet to disconnect it. This command does not affect the ITTask sessions on the other computers.</maml:para> <maml:para>The third command uses the `Get-PSSession` cmdlet to get the ITTask sessions. The output shows that the ITTask sessions on the Srv2 and Srv30 computers were not affected by the command to disconnect.</maml:para> <maml:para>The manager logs on to his home computer, connects to his corporate network, starts Windows PowerShell, and uses the `Get-PSSession` cmdlet to get the ITTask session on the Srv1 computer. He uses the credentials of the technician to access the session.</maml:para> <maml:para>Next, the manager uses the `Connect-PSSession` cmdlet to connect to the ITTask session on the Srv1 computer. The command saves the session in the $s variable.</maml:para> <maml:para>The manager uses the `Invoke-Command` cmdlet to run some diagnostic commands in the session in the `$s` variable. He recognizes that the script failed because it did not find a required directory. The manager uses the `MkDir` function to create the directory, and then he restarts the `Get-PatchStatus.ps1` script and disconnects from the session.The manager reports his findings to the technician, suggests that he reconnect to the session to complete the tasks, and asks him to add a command to the `Get-PatchStatus.ps1` script that creates the required directory if it does not exist.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 4 - Change the timeout value for a PSSession -----</maml:title> <dev:code>PS> $Timeout = New-PSSessionOption -IdleTimeout 172800000 PS> $s = New-PSSession -Computer Server01 -Name ITTask -SessionOption $Timeout PS> Disconnect-PSSession -Session $s Disconnect-PSSession : The session ITTask cannot be disconnected because the specified idle timeout value 172800(seconds) is either greater than the server maximum allowed 43200 (seconds) or less that the minimum allowed60(seconds). Choose an idle time out value that is within the allowed range and try again. PS> Invoke-Command -ComputerName Server01 {Get-PSSessionConfiguration Microsoft.PowerShell} | Format-List -Property * Architecture : 64 Filename : %windir%\system32\pwrshplugin.dll ResourceUri : http://schemas.microsoft.com/powershell/microsoft.powershell MaxConcurrentCommandsPerShell : 1000 UseSharedProcess : false ProcessIdleTimeoutSec : 0 xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration MaxConcurrentUsers : 5 lang : en-US SupportsOptions : true ExactMatch : true RunAsUser : IdleTimeoutms : 7200000 PSVersion : 3.0 OutputBufferingMode : Block AutoRestart : false SecurityDescriptorSddl : O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD) MaxMemoryPerShellMB : 1024 MaxIdleTimeoutms : 2147483647 Uri : http://schemas.microsoft.com/powershell/microsoft.powershell SDKVersion : 2 Name : microsoft.powershell XmlRenderingType : text Capability : {Shell} RunAsPassword : MaxProcessesPerShell : 15 ParentResourceUri : http://schemas.microsoft.com/powershell/microsoft.powershell Enabled : true MaxShells : 25 MaxShellsPerUser : 25 Permission : BUILTIN\Administrators AccessAllowed PSComputerName : localhost RunspaceId : aea84310-6dbf-4c21-90ac-13980039925a PSShowComputerName : True PS> $s.Runspace.ConnectionInfo ConnectionUri : http://Server01/wsman ComputerName : Server01 Scheme : http Port : 80 AppName : /wsman Credential : ShellUri : http://schemas.microsoft.com/powershell/Microsoft.PowerShell AuthenticationMechanism : Default CertificateThumbprint : MaximumConnectionRedirectionCount : 5 MaximumReceivedDataSizePerCommand : MaximumReceivedObjectSize : 209715200 UseCompression : True NoMachineProfile : False ProxyAccessType : None ProxyAuthentication : Negotiate ProxyCredential : SkipCACheck : False SkipCNCheck : False SkipRevocationCheck : False NoEncryption : False UseUTF16 : False OutputBufferingMode : Drop IncludePortInSPN : False Culture : en-US UICulture : en-US OpenTimeout : 180000 CancelTimeout : 60000 OperationTimeout : 180000 IdleTimeout : 172800000 PS> Disconnect-PSSession $s -IdleTimeoutSec 43200 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 4 ITTask Server01 Disconnected Microsoft.PowerShell None PS> $s.Runspace.ConnectionInfo.IdleTimeout 43200000</dev:code> <dev:remarks> <maml:para>The first command uses the `New-PSSessionOption` cmdlet to create a session option object. It uses the IdleTimeout parameter to set an idle timeout of 48 hours (172800000 milliseconds). The command saves the session option object in the $Timeout variable.</maml:para> <maml:para>The second command uses the `New-PSSession` cmdlet to create the ITTask session on the Server01 computer. The command save the session in the $s variable. The value of the SessionOption parameter is the 48-hour idle timeout in the $Timeout variable.</maml:para> <maml:para>The third command disconnects the ITTask session in the $s variable. The command fails because the idle timeout value of the session exceeds the MaxIdleTimeoutMs quota in the session configuration. Because the idle timeout is not used until the session is disconnected, this violation can go undetected while the session is in use.</maml:para> <maml:para>The fourth command uses the `Invoke-Command` cmdlet to run a `Get-PSSessionConfiguration` command for the Microsoft.PowerShell session configuration on the Server01 computer. The command uses the `Format-List` cmdlet to display all properties of the session configuration in a list.The output shows that the MaxIdleTimeoutMS property, which establishes the maximum permitted IdleTimeout value for sessions that use the session configuration, is 43200000 milliseconds (12 hours).</maml:para> <maml:para>The fifth command gets the session option values of the session in the $s variable. The values of many session options are properties of the ConnectionInfo property of the Runspace property of the session.The output shows that the value of the IdleTimeout property of the session is 172800000 milliseconds (48 hours), which violates the MaxIdleTimeoutMs quota of 12 hours in the session configuration.To resolve this conflict, you can use the ConfigurationName parameter to select a different session configuration or use the IdleTimeout parameter to reduce the idle timeout of the session.</maml:para> <maml:para>The sixth command disconnects the session. It uses the IdleTimeoutSec parameter to set the idle timeout to the 12-hour maximum.</maml:para> <maml:para>The seventh command gets the value of the IdleTimeout property of the disconnected session, which is measured in milliseconds. The output confirms that the command was successful.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/disconnect-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSTransportOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSSessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Disconnected_Sessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Enable-PSRemoting</command:name> <command:verb>Enable</command:verb> <command:noun>PSRemoting</command:noun> <maml:description> <maml:para>Configures the computer to receive remote commands.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Enable-PSRemoting` cmdlet configures the computer to receive PowerShell remote commands that are sent by using the WS-Management technology.</maml:para> <maml:para>PowerShell remoting is enabled by default on Windows Server 2012. You can use `Enable-PSRemoting` to enable PowerShell remoting on other supported versions of Windows and to re-enable remoting on Windows Server 2012 if it becomes disabled.</maml:para> <maml:para>You have to run this command only one time on each computer that will receive commands. You do not have to run it on computers that only send commands. Because the configuration starts listeners, it is prudent to run it only where it is needed.</maml:para> <maml:para>Beginning in PowerShell 3.0, the `Enable-PSRemoting` cmdlet can enable PowerShell remoting on client versions of Windows when the computer is on a public network. For more information, see the description of the SkipNetworkProfileCheck parameter.</maml:para> <maml:para>The `Enable-PSRemoting` cmdlet performs the following operations:</maml:para> <maml:para>- Runs the Set-WSManQuickConfig (../Microsoft.WSMan.Management/Set-WSManQuickConfig.md)cmdlet, which performs the following tasks: - Starts the WinRM service. - Sets the startup type on the WinRM service to Automatic. - Creates a listener to accept requests on any IP address. - Enables a firewall exception for WS-Management communications. - Registers the Microsoft.PowerShell and Microsoft.PowerShell.Workflow session configurations, if it they are not already registered. - Registers the Microsoft.PowerShell32 session configuration on 64-bit computers, if it is not already registered. - Enables all session configurations. - Changes the security descriptor of all session configurations to allow remote access. - Restarts the WinRM service to make the preceding changes effective.</maml:para> <maml:para>To run this cmdlet on the Windows platform, start PowerShell by using the Run as administrator option. This does not apply to Linux or MacOS versions of PowerShell.</maml:para> <maml:para>> [!CAUTION] > On systems that have both PowerShell 3.0 and PowerShell 2.0, do not use > PowerShell 2.0 to run the `Enable-PSRemoting` and `Disable-PSRemoting` cmdlets. The commands > might appear to succeed, but the remoting is not configured correctly. Remote commands and later > attempts to enable and disable remoting, are likely to fail.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Enable-PSRemoting</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Forces the command to run without asking for user confirmation.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipNetworkProfileCheck</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet enables remoting on client versions of the Windows operating system when the computer is on a public network. This parameter enables a firewall rule for public networks that allows remote access only from computers in the same local subnet.</maml:para> <maml:para>This parameter does not affect server versions of the Windows operating system, which, by default, have a local subnet firewall rule for public networks. If the local subnet firewall rule is disabled on a server version, `Enable-PSRemoting` re-enables it, regardless of the value of this parameter.</maml:para> <maml:para>To remove the local subnet restriction and enable remote access from all locations on public networks, use the `Set-NetFirewallRule` cmdlet in the NetSecurity module.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Forces the command to run without asking for user confirmation.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipNetworkProfileCheck</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet enables remoting on client versions of the Windows operating system when the computer is on a public network. This parameter enables a firewall rule for public networks that allows remote access only from computers in the same local subnet.</maml:para> <maml:para>This parameter does not affect server versions of the Windows operating system, which, by default, have a local subnet firewall rule for public networks. If the local subnet firewall rule is disabled on a server version, `Enable-PSRemoting` re-enables it, regardless of the value of this parameter.</maml:para> <maml:para>To remove the local subnet restriction and enable remote access from all locations on public networks, use the `Set-NetFirewallRule` cmdlet in the NetSecurity module.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns strings that describe its results.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>In PowerShell 3.0, `Enable-PSRemoting` creates the following firewall exceptions for WS-Management communications.</maml:para> <maml:para>On server versions of the Windows operating system, `Enable-PSRemoting` creates firewall rules for private and domain networks that allow remote access, and creates a firewall rule for public networks that allows remote access only from computers in the same local subnet.</maml:para> <maml:para>On client versions of the Windows operating system, `Enable-PSRemoting` in PowerShell 3.0 creates firewall rules for private and domain networks that allow unrestricted remote access. To create a firewall rule for public networks that allows remote access from the same local subnet, use the SkipNetworkProfileCheck parameter.</maml:para> <maml:para>On client or server versions of the Windows operating system, to create a firewall rule for public networks that removes the local subnet restriction and allows remote access , use the `Set-NetFirewallRule` cmdlet in the NetSecurity module to run the following command: `Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any`</maml:para> <maml:para>In PowerShell 2.0, `Enable-PSRemoting` creates the following firewall exceptions for WS-Management communications.</maml:para> <maml:para>On server versions of the Windows operating system, it creates firewall rules for all networks that allow remote access.</maml:para> <maml:para>On client versions of the Windows operating system, `Enable-PSRemoting` in PowerShell 2.0 creates a firewall exception only for domain and private network locations. To minimize security risks, `Enable-PSRemoting` does not create a firewall rule for public networks on client versions of Windows. When the current network location is public, `Enable-PSRemoting` returns the following message: Unable to check the status of the firewall.</maml:para> <maml:para>Starting in PowerShell 3.0, `Enable-PSRemoting` enables all session configurations by setting the value of the Enabled property of all session configurations to `$True`.</maml:para> <maml:para>In PowerShell 2.0, `Enable-PSRemoting` removes the Deny_All setting from the security descriptor of session configurations. In PowerShell 3.0, `Enable-PSRemoting` removes the Deny_All and Network_Deny_All settings. This provides remote access to session configurations that were reserved for local use.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-- Example 1: Configure a computer to receive remote commands --</maml:title> <dev:code>Enable-PSRemoting</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Configure a computer to receive remote commands without a confirmation prompt</maml:title> <dev:code>Enable-PSRemoting -Force</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 3: Allow remote access on clients ----------</maml:title> <dev:code>Get-NetFirewallRule -Name 'WINRM*' | Select-Object Name Name ---- WINRM-HTTP-In-TCP-NoScope WINRM-HTTP-In-TCP WINRM-HTTP-Compat-In-TCP-NoScope WINRM-HTTP-Compat-In-TCP Enable-PSRemoting -SkipNetworkProfileCheck -Force Set-NetFirewallRule -Name 'WINRM-HTTP-In-TCP' -RemoteAddress Any</dev:code> <dev:remarks> <maml:para>By default, `Enable-PSRemoting` creates network rules that allow remote access from private and domain networks. The command uses the SkipNetworkProfileCheck parameter to allow remote access from public networks in the same local subnet. The command specifies the Force parameter to suppress confirmation messages.</maml:para> <maml:para>The SkipNetworkProfileCheck parameter does not affect server versions of the Windows operating system, which allow remote access from public networks in the same local subnet by default.</maml:para> <maml:para>The `Set-NetFirewallRule` cmdlet in the NetSecurity module adds a firewall rule that allows remote access from public networks from any remote location. This includes locations in different subnets.</maml:para> <maml:para>> [!NOTE] > The name of the firewall rule can be different depending on the version of Windows. Use the > `Get-NetFirewallRule` cmdlet to list the names of the rules on your system.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enable-psremoting?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSRemoting</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Enable-PSSessionConfiguration</command:name> <command:verb>Enable</command:verb> <command:noun>PSSessionConfiguration</command:noun> <maml:description> <maml:para>Enables the session configurations on the local computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Enable-PSSessionConfiguration` cmdlet enables registered session configurations that have been disabled, such as by using the `Disable-PSSessionConfiguration` or `Disable-PSRemoting` cmdlets, or the AccessMode parameter of `Register-PSSessionConfiguration`. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.</maml:para> <maml:para>Without parameters, `Enable-PSSessionConfiguration` enables the Microsoft.PowerShell configuration, which is the default configuration that is used for sessions.</maml:para> <maml:para>`Enable-PSSessionConfiguration` removes the Deny_All setting from the security descriptor of the affected session configurations, turns on the listener that accepts requests on any IP address, and restarts the WinRM service. Beginning in PowerShell 3.0, `Enable-PSSessionConfiguration` also sets the value of the Enabled property of the session configuration (`WSMan:<computer>\PlugIn<SessionConfigurationName>\Enabled`) to True. However, `Enable-PSSessionConfiguration` does not remove or change the Network_Deny_All (`AccessMode=Local`) security descriptor setting that allows only users of the local computer to use to the session configuration.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Enable-PSSessionConfiguration</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of session configurations to enable. Enter one or more configuration names. Wildcard characters are permitted.</maml:para> <maml:para>You can also pipe a string that contains a configuration name or a session configuration object to `Enable-PSSessionConfiguration`.</maml:para> <maml:para>If you omit this parameter, `Enable-PSSessionConfiguration` enables the Microsoft.PowerShell session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that the cmdlet does not prompt you for confirmation, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Indicates that the cmdlet does not restart the service.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a security descriptor with which this cmdlet replaces the security descriptor on the session configuration.</maml:para> <maml:para>If you omit this parameter, `Enable-PSSessionConfiguration` only deletes the deny all item from the security descriptor.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipNetworkProfileCheck</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet enables the session configuration when the computer is on a public network. This parameter enables a firewall rule for public networks that allows remote access only from computers in the same local subnet. By default, `Enable-PSSessionConfiguration` fails on a public network.</maml:para> <maml:para>This parameter is designed for client versions of the Windows operating system. Server versions of the Windows operating system have a local subnet firewall rule for public networks. However, if the local subnet firewall rule is disabled on a server version of the Windows operating system, this parameter re-enables it.</maml:para> <maml:para>To remove the local subnet restriction and enable remote access from all locations on public networks, use the `Set-NetFirewallRule` cmdlet in the NetSecurity module. For more information, see `Enable-PSRemoting`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that the cmdlet does not prompt you for confirmation, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of session configurations to enable. Enter one or more configuration names. Wildcard characters are permitted.</maml:para> <maml:para>You can also pipe a string that contains a configuration name or a session configuration object to `Enable-PSSessionConfiguration`.</maml:para> <maml:para>If you omit this parameter, `Enable-PSSessionConfiguration` enables the Microsoft.PowerShell session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Indicates that the cmdlet does not restart the service.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a security descriptor with which this cmdlet replaces the security descriptor on the session configuration.</maml:para> <maml:para>If you omit this parameter, `Enable-PSSessionConfiguration` only deletes the deny all item from the security descriptor.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipNetworkProfileCheck</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet enables the session configuration when the computer is on a public network. This parameter enables a firewall rule for public networks that allows remote access only from computers in the same local subnet. By default, `Enable-PSSessionConfiguration` fails on a public network.</maml:para> <maml:para>This parameter is designed for client versions of the Windows operating system. Server versions of the Windows operating system have a local subnet firewall rule for public networks. However, if the local subnet firewall rule is disabled on a server version of the Windows operating system, this parameter re-enables it.</maml:para> <maml:para>To remove the local subnet restriction and enable remote access from all locations on public networks, use the `Set-NetFirewallRule` cmdlet in the NetSecurity module. For more information, see `Enable-PSRemoting`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration, System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session configuration object or a string that contains the name of a session configuration to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not return any objects.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To use this cmdlet, you must start PowerShell by using the Run as administrator option.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------- Example 1: Re-enable the default session -----------</maml:title> <dev:code>Enable-PSSessionConfiguration</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 2: Re-enable specified sessions -----------</maml:title> <dev:code>Enable-PSSessionConfiguration -Name MaintenanceShell, AdminShell</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 3: Re-enable the all sessions ------------</maml:title> <dev:code>Enable-PSSessionConfiguration -Name * Get-PSSessionConfiguration | Enable-PSSessionConfiguration</dev:code> <dev:remarks> <maml:para>`Enable-PSSessionConfiguration` does not generate an error if you enable a session configuration that is already enabled.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Re-enable a session and specify a new security descriptor</maml:title> <dev:code>$sddl = "O:NSG:BAD:P(A;;GXGWGR;;;BA)(A;;GAGR;;;S-1-5-21-123456789-188441444-3100496)S:P" Enable-PSSessionConfiguration -Name MaintenanceShell -SecurityDescriptorSDDL $sddl</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enable-pssessionconfiguration?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Enter-PSHostProcess</command:name> <command:verb>Enter</command:verb> <command:noun>PSHostProcess</command:noun> <maml:description> <maml:para>Connects to and enters into an interactive session with a local process.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Enter-PSHostProcess` cmdlet connects to and enters into an interactive session with a local process.</maml:para> <maml:para>Instead of creating a new process to host PowerShell and run a remote session, the remote, interactive session is run in an existing process that is already running PowerShell. When you are interacting with a remote session on a specified process, you can enumerate running runspaces, and then select a runspace to debug by running either `Debug-Runspace` or `Enable-RunspaceDebug`.</maml:para> <maml:para>The process that you want to enter must be hosting PowerShell (System.Management.Automation.dll). You must be either a member of the Administrators group on the computer on which the process is found, or you must be the user who is running the script that started the process.</maml:para> <maml:para>After you have selected a runspace to debug, a remote debug session is opened for the runspace if it is either currently running a command or is stopped in the debugger. You can then debug the runspace script in the same way you would debug other remote session scripts.</maml:para> <maml:para>Detach from a debugging session, and then the interactive session with the process, by running exit twice, or stop script execution by running the existing debugger quit command.</maml:para> <maml:para>If you specify a process by using the Name parameter, and there is only one process found with the specified name, the process is entered. If more than one process with the specified name is found, PowerShell returns an error, and lists all processes found with the specified name.</maml:para> <maml:para>To support attaching to processes on remote computers, the `Enter-PSHostProcess` cmdlet is enabled in a specified remote computer, so that you can attach to a local process within a remote PowerShell session.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Enter-PSHostProcess</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>HostProcessInfo</maml:name> <maml:Description> <maml:para>Specifies a PSHostProcessInfo object that can be connected to with PowerShell. Use `Get-PSHostProcessInfo` to get the object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.PSHostProcessInfo</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSHostProcessInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AppDomainName</maml:name> <maml:Description> <maml:para>Specifies an application domain name to connect to if omitted, uses DefaultAppDomain . Use `Get-PSHostProcessInfo` to display the application domain names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>DefaultAppDomain</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSHostProcess</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AppDomainName</maml:name> <maml:Description> <maml:para>Specifies an application domain name to connect to if omitted, uses DefaultAppDomain . Use `Get-PSHostProcessInfo` to display the application domain names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>DefaultAppDomain</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSHostProcess</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet. You can also get process names from the Properties dialog box of a process in Task Manager.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AppDomainName</maml:name> <maml:Description> <maml:para>Specifies an application domain name to connect to if omitted, uses DefaultAppDomain . Use `Get-PSHostProcessInfo` to display the application domain names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>DefaultAppDomain</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSHostProcess</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Process</maml:name> <maml:Description> <maml:para>Specifies a process by the process object. The simplest way to use this parameter is to save the results of a `Get-Process` command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Diagnostics.Process</command:parameterValue> <dev:type> <maml:name>System.Diagnostics.Process</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AppDomainName</maml:name> <maml:Description> <maml:para>Specifies an application domain name to connect to if omitted, uses DefaultAppDomain . Use `Get-PSHostProcessInfo` to display the application domain names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>DefaultAppDomain</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AppDomainName</maml:name> <maml:Description> <maml:para>Specifies an application domain name to connect to if omitted, uses DefaultAppDomain . Use `Get-PSHostProcessInfo` to display the application domain names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>DefaultAppDomain</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>HostProcessInfo</maml:name> <maml:Description> <maml:para>Specifies a PSHostProcessInfo object that can be connected to with PowerShell. Use `Get-PSHostProcessInfo` to get the object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.PSHostProcessInfo</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSHostProcessInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet. You can also get process names from the Properties dialog box of a process in Task Manager.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Process</maml:name> <maml:Description> <maml:para>Specifies a process by the process object. The simplest way to use this parameter is to save the results of a `Get-Process` command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Diagnostics.Process</command:parameterValue> <dev:type> <maml:name>System.Diagnostics.Process</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Diagnostics.Process</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para>`Enter-PSHostProcess` cannot enter the process of the PowerShell session in which you are running the command. You can, however, enter the process of another PowerShell session, or a PowerShell ISE session that is running at the same time as the session in which you are running `Enter-PSHostProcess`.</maml:para> <maml:para>`Enter-PSHostProcess` can enter only those processes that are hosting PowerShell. That is, they have loaded the PowerShell engine.</maml:para> <maml:para>To exit a process from within the process, type exit , and then press <kbd>Enter</kbd>.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Start debugging a runspace within the PowerShell ISE process</maml:title> <dev:code>PS C:\> Enter-PSHostProcess -Name powershell_ise [Process:1520]: PS C:\Test\Documents> Next, get available runspaces within the process you have entered. PS C:\> [Process:1520]: PS C:\> Get-Runspace Id Name InstanceId State Availability -- ------- ----------- ------ ------------- 1 Runspace1 2d91211d-9cce-42f0-ab0e-71ac258b32b5 Opened Available 2 Runspace2 a3855043-cb16-424a-a616-685360c3763b Opened RemoteDebug 3 MyLocalRS 2236dbd8-2105-4dec-a15a-a27d0bfaacb5 Opened LocalDebug 4 MyRunspace 771356e9-8c44-4b70-9de5-dd17cb41e48e Opened Busy 5 Runspace8 3e517382-a97a-49ba-9c3c-fd21f6664288 Broken None The runspace objects returned by Get-Runspace also have a NoteProperty called ScriptStackTrace of the running command stack, if available.Next, debug runspace ID 4, that is running another user's long-running script. From the list returned from Get-Runspace, note that the runspace state is Opened, and Availability is Busy, meaning that the runspace is still running the long-running script. PS C:\> [Process:1520]: PS C:\> (Get-Runspace -Id 4).ScriptStackTrace Command Arguments Location ------- --------- -------- MyModuleWorkflowF1 {} TestNoFile3.psm1: line 6 WFTest1 {} TestNoFile2.ps1: line 14 TestNoFile2.ps1 {} TestNoFile2.ps1: line 22 <ScriptBlock> {} <No file> Start an interactive debugging session with this runspace by running the Debug-Runspace cmdlet. PS C:\> [Process: 1520]: PS C:\> Debug-Runspace -Id 4 Hit Line breakpoint on 'C:\TestWFVar1.ps1:83' At C:\TestWFVar1.ps1:83 char:1 + $scriptVar = "Script Variable" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [Process: 1520]: [RSDBG: 4]: PS C:\> > After you are finished debugging, allow the script to continue running without the debugger attached by running the exit debugger command. Alternatively, you can quit the debugger with the q or Stop commands. PS C:\> [Process:346]: [RSDBG: 3]: PS C:\> > exit [Process:1520]: PS C:\> When you are finished working in the process, exit the process by running the Exit-PSHostProcess cmdlet. This returns you to the PS C:\> prompt. PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess PS C:\></dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pshostprocess?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSHostProcess</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSHostProcessInfo</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Enter-PSSession</command:name> <command:verb>Enter</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Starts an interactive session with a remote computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Enter-PSSession` cmdlet starts an interactive session with a single remote computer. During the session, the commands that you type run on the remote computer, just as if you were typing directly on the remote computer. You can have only one interactive session at a time.</maml:para> <maml:para>Typically, you use the ComputerName parameter to specify the name of the remote computer. However, you can also use a session that you create by using the `New-PSSession` cmdlet for the interactive session. However, you cannot use the `Disconnect-PSSession`, `Connect-PSSession`, or `Receive-PSSession` cmdlets to disconnect from or re-connect to an interactive session.</maml:para> <maml:para>To end the interactive session and disconnect from the remote computer, use the `Exit-PSSession` cmdlet, or type `exit`.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the session. The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a ConnectionURI , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created by using standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for Windows PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, Windows PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Allows redirection of this connection to an alternate Uniform Resource Identifier (URI). By default, redirection is not allowed.</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate the user's credentials. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enum (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the interactive session.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to . (dot), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also allow remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Sets advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies a computer name. This cmdlet starts an interactive session with the specified remote computer. Enter only one computer name. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, the IP address, or the fully qualified domain name of the computer. You can also pipe a computer name to `Enter-PSSession`.</maml:para> <maml:para>To use an IP address in the value of the ComputerName parameter, the command must include the Credential parameter. Also, the computer must be configured for HTTPS transport or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a Computer to the Trusted Host List" in about_Remote_Troubleshooting (About/about_Remote_Troubleshooting.md).</maml:para> <maml:para>Note: In Windows Vista and later versions of the Windows operating system, to include the local computer in the value of the ComputerName parameter, you must start Windows PowerShell with the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you are not using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate the user's credentials. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enum (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the interactive session.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to . (dot), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also allow remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this command. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. Use the following commands to configure the listener:</maml:para> <maml:para>1. `winrm delete winrm/config/listener?Address=*+Transport=HTTP` 2. `winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="<port-number>"}`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port setting in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Sets advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish a connection to the remote computer. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all Windows PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies the ID of a virtual machine.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the interactive session.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies the name of a virtual machine.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the interactive session.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies the ID of a container.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the interactive session.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that the PSSession runs as administrator.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the ID of an existing session. `Enter-PSSession` uses the specified session for the interactive session.</maml:para> <maml:para>To find the ID of a session, use the `Get-PSSession` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID of an existing session. `Enter-PSSession` uses the specified session for the interactive session.</maml:para> <maml:para>The instance ID is a GUID. To find the instance ID of a session, use the `Get-PSSession` cmdlet. You can also use the Session , Name , or ID parameters to specify an existing session. Or, you can use the ComputerName parameter to start a temporary session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly name of an existing session. `Enter-PSSession` uses the specified session for the interactive session.</maml:para> <maml:para>If the name that you specify matches more than one session, the command fails. You can also use the Session , InstanceID , or ID parameters to specify an existing session. Or, you can use the ComputerName parameter to start a temporary session.</maml:para> <maml:para>To establish a friendly name for a session, use the Name parameter of the `New-PSSession` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Enter-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies a Windows PowerShell session ( PSSession ) to use for the interactive session. This parameter takes a session object. You can also use the Name , InstanceID , or ID parameters to specify a PSSession .</maml:para> <maml:para>Enter a variable that contains a session object or a command that creates or gets a session object, such as a `New-PSSession` or `Get-PSSession` command. You can also pipe a session object to `Enter-PSSession`. You can submit only one PSSession by using this parameter. If you enter a variable that contains more than one PSSession , the command fails.</maml:para> <maml:para>When you use `Exit-PSSession` or the EXIT keyword, the interactive session ends, but the PSSession that you created remains open and available for use.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Allows redirection of this connection to an alternate Uniform Resource Identifier (URI). By default, redirection is not allowed.</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, Windows PowerShell does not redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you are not using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate the user's credentials. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enum (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>Caution: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the Windows PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies a computer name. This cmdlet starts an interactive session with the specified remote computer. Enter only one computer name. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, the IP address, or the fully qualified domain name of the computer. You can also pipe a computer name to `Enter-PSSession`.</maml:para> <maml:para>To use an IP address in the value of the ComputerName parameter, the command must include the Credential parameter. Also, the computer must be configured for HTTPS transport or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a Computer to the Trusted Host List" in about_Remote_Troubleshooting (About/about_Remote_Troubleshooting.md).</maml:para> <maml:para>Note: In Windows Vista and later versions of the Windows operating system, to include the local computer in the value of the ComputerName parameter, you must start Windows PowerShell with the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the interactive session.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the session. The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a ConnectionURI , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created by using standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for Windows PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, Windows PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies the ID of a container.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to . (dot), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also allow remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the ID of an existing session. `Enter-PSSession` uses the specified session for the interactive session.</maml:para> <maml:para>To find the ID of a session, use the `Get-PSSession` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID of an existing session. `Enter-PSSession` uses the specified session for the interactive session.</maml:para> <maml:para>The instance ID is a GUID. To find the instance ID of a session, use the `Get-PSSession` cmdlet. You can also use the Session , Name , or ID parameters to specify an existing session. Or, you can use the ComputerName parameter to start a temporary session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly name of an existing session. `Enter-PSSession` uses the specified session for the interactive session.</maml:para> <maml:para>If the name that you specify matches more than one session, the command fails. You can also use the Session , InstanceID , or ID parameters to specify an existing session. Or, you can use the ComputerName parameter to start a temporary session.</maml:para> <maml:para>To establish a friendly name for a session, use the Name parameter of the `New-PSSession` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this command. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. Use the following commands to configure the listener:</maml:para> <maml:para>1. `winrm delete winrm/config/listener?Address=*+Transport=HTTP` 2. `winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="<port-number>"}`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port setting in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that the PSSession runs as administrator.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies a Windows PowerShell session ( PSSession ) to use for the interactive session. This parameter takes a session object. You can also use the Name , InstanceID , or ID parameters to specify a PSSession .</maml:para> <maml:para>Enter a variable that contains a session object or a command that creates or gets a session object, such as a `New-PSSession` or `Get-PSSession` command. You can also pipe a session object to `Enter-PSSession`. You can submit only one PSSession by using this parameter. If you enter a variable that contains more than one PSSession , the command fails.</maml:para> <maml:para>When you use `Exit-PSSession` or the EXIT keyword, the interactive session ends, but the PSSession that you created remains open and available for use.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Sets advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish a connection to the remote computer. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all Windows PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies the ID of a virtual machine.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies the name of a virtual machine.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String, System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a computer name, as a string, or a session object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>The cmdlet does not return any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To connect to a remote computer, you must be a member of the Administrators group on the remote computer. To start an interactive session on the local computer, you must start PowerShell with the Run as administrator option.</maml:para> <maml:para>When you use `Enter-PSSession`, your user profile on the remote computer is used for the interactive session. The commands in the remote user profile, including commands to add PowerShell modules and to change the command prompt, run before the remote prompt is displayed.</maml:para> <maml:para>`Enter-PSSession` uses the UI culture setting on the local computer for the interactive session. To find the local UI culture, use the `$UICulture` automatic variable.</maml:para> <maml:para>`Enter-PSSession` requires the `Get-Command`, `Out-Default`, and `Exit-PSSession` cmdlets. If these cmdlets are not included in the session configuration on the remote computer, the `Enter-PSSession` commands fails.</maml:para> <maml:para>Unlike `Invoke-Command`, which parses and interprets the commands before it sends them to the remote computer, `Enter-PSSession` sends the commands directly to the remote computer without interpretation.</maml:para> <maml:para>If the session you want to enter is busy processing a command, there might be a delay before PowerShell responds to the `Enter-PSSession` command. You are connected as soon as the session is available. To cancel the `Enter-PSSession` command, press <kbd>CTRL</kbd>+<kbd>C</kbd>.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------- Example 1: Start an interactive session -----------</maml:title> <dev:code>PS C:\> Enter-PSSession [localhost]: PS C:\></dev:code> <dev:remarks> <maml:para>This command starts an interactive session on the local computer. The command prompt changes to indicate that you are now running commands in a different session.</maml:para> <maml:para>The commands that you enter run in the new session, and the results are returned to the default session as text.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 2: Work with an interactive session ---------</maml:title> <dev:code>PS C:\> Enter-PSSession -ComputerName Server01 [Server01]: PS C:\> [Server01]: PS C:\> Get-Process PowerShell > C:\ps-test\Process.txt [Server01]: PS C:\> exit PS C:\> PS C:\> dir C:\ps-test\process.txt Get-ChildItem : Cannot find path 'C:\ps-test\process.txt' because it does not exist. At line:1 char:4 + dir <<<< c:\ps-test\process.txt</dev:code> <dev:remarks> <maml:para>This command shows how to work in an interactive session with a remote computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 3: Use the Session parameter -------------</maml:title> <dev:code>PS C:\> $s = New-PSSession -ComputerName Server01 PS C:\> Enter-PSSession -Session $s [Server01]: PS C:\></dev:code> <dev:remarks> <maml:para>These commands use the Session parameter of `Enter-PSSession` to run the interactive session in an existing Windows PowerShell session ( PSSession ).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Start an interactive session and specify the Port and Credential parameters</maml:title> <dev:code>PS C:\> Enter-PSSession -ComputerName Server01 -Port 90 -Credential Domain01\User01 [Server01]: PS C:\></dev:code> <dev:remarks> <maml:para>This command starts an interactive session with the Server01 computer. It uses the Port parameter to specify the port and the Credential parameter to specify the account of a user who has permission to connect to the remote computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 5: Stop an interactive session ------------</maml:title> <dev:code>PS C:\> Enter-PSSession -ComputerName Server01 [Server01]: PS C:\> Exit-PSSession PS C:\></dev:code> <dev:remarks> <maml:para>This example shows how to start and stop an interactive session. The first command uses the `Enter-PSSession` cmdlet to start an interactive session with the Server01 computer.</maml:para> <maml:para>The second command uses the `Exit-PSSession` cmdlet to end the session. You can also use the Exit keyword to end the interactive session. `Exit-PSSession` and Exit have the same effect.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/enter-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSSessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Exit-PSHostProcess</command:name> <command:verb>Exit</command:verb> <command:noun>PSHostProcess</command:noun> <maml:description> <maml:para>Closes an interactive session with a local process.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Exit-PSHostProcess cmdlet closes an interactive session with a local process that you have opened by running the Enter-PSHostProcess cmdlet. You run the Exit-PSHostProcess cmdlet from within the process, when you are finished debugging or troubleshooting a script that is running within a process.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Exit-PSHostProcess</maml:name> </command:syntaxItem> </command:syntax> <command:parameters /> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------------ Example 1: Exit a process ------------------</maml:title> <dev:code>PS C:\> [Process:1520]: PS C:\> Exit-PSHostProcess PS C:\></dev:code> <dev:remarks> <maml:para>In this example, you have been working in an active process to debug a script running in a runspace in the process, as described in Enter-PSHostProcess. After you type the exit command to exit the debugger, run the Exit-PSHostProcess cmdlet to close your interactive session with the process. The cmdlet closes your session in the process, and returns you to the PS C:\> prompt.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/exit-pshostprocess?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSHostProcess</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Exit-PSSession</command:name> <command:verb>Exit</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Ends an interactive session with a remote computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Exit-PSSession cmdlet ends interactive sessions that you started by using the Enter-PSSession cmdlet.</maml:para> <maml:para>You can also use the Exit keyword to end an interactive session. The effect is the same as using Exit-PSSession .</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Exit-PSSession</maml:name> </command:syntaxItem> </command:syntax> <command:parameters /> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not return any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>* This cmdlet takes only the common parameters.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------- Example 1: Start and stop an interactive session -------</maml:title> <dev:code>PS C:\> Enter-PSSession -computername Server01 Server01\PS> Exit-PSSession PS C:\></dev:code> <dev:remarks> <maml:para>These commands start and then stop an interactive session with the Server01 remote computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Start and stop an interactive session by using a PSSession object</maml:title> <dev:code>PS C:\> $s = New-PSSession -ComputerName Server01 PS C:\> Enter-PSSession -Session $s Server01\PS> Exit-PSSession PS C:\> $s Id Name ComputerName State ConfigurationName -- ---- ------------ ----- ----------------- 1 Session1 Server01 Opened Microsoft.PowerShell</dev:code> <dev:remarks> <maml:para>These commands start and stop an interactive session with the Server01 computer that uses a Windows PowerShell session ( PSSession ).</maml:para> <maml:para>Because the interactive session was started by using a Windows PowerShell session, the PSSession is still available when the interactive session ends. If you use the ComputerName parameter, Enter-PSSession creates a temporary session that it closes when the interactive session ends.</maml:para> <maml:para>The first command uses the New-PSSession cmdlet to create a PSSession on the Server01 computer. The command saves the PSSession in the $s variable.</maml:para> <maml:para>The second command uses Enter-PSSession to start an interactive session using the PSSession in $s.</maml:para> <maml:para>The third command uses Exit-PSSession to stop the interactive session.</maml:para> <maml:para>The final command displays the PSSession in the $s variable. The State property shows the PSSession is still open and available for use.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 3: Use the Exit keyword to stop a session ------</maml:title> <dev:code>PS C:\> Enter-PSSession -computername Server01 Server01\PS> exit PS C:\></dev:code> <dev:remarks> <maml:para>This example uses the Exit keyword to stop an interactive session started by using Enter-PSSession . The Exit keyword has the same effect as using Exit-PSSession .</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/exit-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Export-Console</command:name> <command:verb>Export</command:verb> <command:noun>Console</command:noun> <maml:description> <maml:para>Exports the names of snap-ins in the current session to a console file.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Export-Console cmdlet exports the names of the Windows PowerShell snap-ins in the current session to a Windows PowerShell console file (.psc1). You can use this cmdlet to save the snap-ins for use in future sessions.</maml:para> <maml:para>To add the snap-ins in the .psc1 console file to a session, start Windows PowerShell (Powershell.exe) at the command line by using Cmd.exe or another Windows PowerShell session, and then use the PSConsoleFile parameter of Powershell.exe to specify the console file.</maml:para> <maml:para>For more information about Windows PowerShell snap-ins, see about_PSSnapins.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Export-Console</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="PSPath"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies a path and file name for the console file (*.psc1). Enter an optional path and name. Wildcard characters are not permitted.</maml:para> <maml:para>If you specify only a file name, Export-Console creates a file that has that name and the .psc1 file name extension in the current directory.</maml:para> <maml:para>This parameter is required unless you have opened Windows PowerShell with the PSConsoleFile parameter or exported a console file during the current session. It is also required when you use the NoClobber parameter to prevent the current console file from being overwritten.</maml:para> <maml:para>If you omit this parameter, Export-Console overwrites the console file that was used most recently in this session. The path of the most recently used console file is stored in the value of the $ConsoleFileName automatic variable. For more information, see about_Automatic_Variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet overwrites the data in a console file without warning, even if the file has the read-only attribute. The read-only attribute is changed and is not reset when the command finishes.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not overwrite an existing console file. By default, if a file occurs in the specified path, Export-Console overwrites the file without warning.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet overwrites the data in a console file without warning, even if the file has the read-only attribute. The read-only attribute is changed and is not reset when the command finishes.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not overwrite an existing console file. By default, if a file occurs in the specified path, Export-Console overwrites the file without warning.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="PSPath"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies a path and file name for the console file (*.psc1). Enter an optional path and name. Wildcard characters are not permitted.</maml:para> <maml:para>If you specify only a file name, Export-Console creates a file that has that name and the .psc1 file name extension in the current directory.</maml:para> <maml:para>This parameter is required unless you have opened Windows PowerShell with the PSConsoleFile parameter or exported a console file during the current session. It is also required when you use the NoClobber parameter to prevent the current console file from being overwritten.</maml:para> <maml:para>If you omit this parameter, Export-Console overwrites the console file that was used most recently in this session. The path of the most recently used console file is stored in the value of the $ConsoleFileName automatic variable. For more information, see about_Automatic_Variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a path string to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.IO.FileInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet creates a file that contains the exported aliases.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>When a console file (.psc1) is used to start the session, the name of the console file is automatically stored in the $ConsoleFileName automatic variable. The value of $ConsoleFileName is updated when you use the Path parameter of Export-Console * to specify a new console file. When no console file is used, $ConsoleFileName has no value ($Null).</maml:para> <maml:para> To use a Windows PowerShell console file in a new session, use the following syntax to start Windows PowerShell:</maml:para> <maml:para> `powershell.exe -PsConsoleFile <ConsoleFile>.psc1`</maml:para> <maml:para> You can also save Windows PowerShell snap-ins for future sessions by adding an Add-PSSnapin command to your Windows PowerShell profile. For more information, see about_Profiles.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Export the names of snap-ins in the current session</maml:title> <dev:code>PS C:\> Export-Console -Path $pshome\Consoles\ConsoleS1.psc1</dev:code> <dev:remarks> <maml:para>This command exports the names of Windows PowerShell snap-ins in the current session to the ConsoleS1.psc1 file in the Consoles folder of the Windows PowerShell installation folder, $pshome.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Export the names of snap-ins to the most recent console file</maml:title> <dev:code>PS C:\> Export-Console</dev:code> <dev:remarks> <maml:para>This command exports the names of Windows PowerShell snap-ins from current session to the Windows PowerShell console file that was most recently used in the current session. It overwrites the previous file contents.</maml:para> <maml:para>If you have not exported a console file during the current session, you are prompted for permission to continue and then prompted for a file name.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 3: Add a snap-in and export the names of snap-ins --</maml:title> <dev:code>PS C:\> Add-PSSnapin NewPSSnapin PS C:\> Export-Console -path NewPSSnapinConsole.psc1 PS C:\> powershell.exe -PsConsoleFile NewPsSnapinConsole.psc1</dev:code> <dev:remarks> <maml:para>These commands add the NewPSSnapin Windows PowerShell snap-in to the current session, export the names of Windows PowerShell snap-ins in the current session to a console file, and then start a Windows PowerShell session with the console file.</maml:para> <maml:para>The first command uses the Add-PSSnapin cmdlet to add the NewPSSnapin snap-in to the current session. You can only add Windows PowerShell snap-ins that are registered on your system.</maml:para> <maml:para>The second command exports the Windows PowerShell snap-in names to the NewPSSnapinConsole.psc1 file.</maml:para> <maml:para>The third command starts Windows PowerShell with the NewPSSnapinConsole.psc1 file. Because the console file includes the Windows PowerShell snap-in name, the cmdlets and providers in the snap-in are available in the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 4: Export names of snap-ins to a specified location -</maml:title> <dev:code>PS C:\> export-console -path Console01 PS C:\> notepad console01.psc1 <?xml version="1.0" encoding="utf-8"?> <PSConsoleFile ConsoleSchemaVersion="1.0"> <PSVersion>2.0</PSVersion> <PSSnapIns> <PSSnapIn Name="NewPSSnapin" /> </PSSnapIns> </PSConsoleFile></dev:code> <dev:remarks> <maml:para>This command exports the names of the Windows PowerShell snap-ins in the current session to the Console01.psc1 file in the current directory.</maml:para> <maml:para>The second command displays the contents of the Console01.psc1 file in Notepad.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 5: Determine the console file to update -------</maml:title> <dev:code>PS C:\> powershell.exe -PSConsoleFile Console01.psc1 PS C:\> Add-PSSnapin MySnapin PS C:\> Export-Console NewConsole.psc1 PS C:\> $ConsoleFileName PS C:\> Add-PSSnapin SnapIn03 PS C:\> Export-Console</dev:code> <dev:remarks> <maml:para>This example shows how to use the $ConsoleFileName automatic variable to determine the console file that will be updated if you use Export-Console without a Path parameter value.</maml:para> <maml:para>The first command uses the PSConsoleFile parameter of PowerShell.exe to open Windows PowerShell with the Console01.psc1 file.</maml:para> <maml:para>The second command uses the Add-PSSnapin cmdlet to add the MySnapin Windows PowerShell snap-in to the current session.</maml:para> <maml:para>The third command uses the Export-Console cmdlet to export the names of all the Windows PowerShell snap-ins in the session to the NewConsole.psc1 file.</maml:para> <maml:para>The fourth command displays the $ConsoleFileName variable. It contains the most recently used console file. The sample output shows that NewConsole.ps1 is the most recently used file.</maml:para> <maml:para>The fifth command adds SnapIn03 to the current console.</maml:para> <maml:para>The sixth command uses the Export-Console cmdlet without a Path parameter. This command exports the names of all the Windows PowerShell snap-ins in the current session to the most recently used file, NewConsole.psc1.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-console?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Add-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Export-ModuleMember</command:name> <command:verb>Export</command:verb> <command:noun>ModuleMember</command:noun> <maml:description> <maml:para>Specifies the module members that are exported.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Export-ModuleMember cmdlet specifies the module members that are exported from a script module (.psm1) file, or from a dynamic module created by using the New-Module cmdlet. Module members include cmdlets, functions, variables, and aliases. This cmdlet can be used only in a script module file or a dynamic module.</maml:para> <maml:para>If a script module does not include an Export-ModuleMember command, the functions and aliases in the script module are exported, but the variables are not. When a script module includes Export-ModuleMember commands, only the members specified in the Export-ModuleMember commands are exported. You can also use Export-ModuleMember to suppress or export members that the script module imports from other modules.</maml:para> <maml:para>An Export-ModuleMember command is optional, but it is a best practice. Even if the command confirms the default values, it demonstrates the intention of the module author.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Export-ModuleMember</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies the functions that are exported from the script module file. Enter the function names. Wildcard characters are permitted. You can also pipe function name strings to Export-ModuleMember .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that are exported from the script module file. Enter the alias names. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies the cmdlets that are exported from the script module file. Enter the cmdlet names. Wildcard characters are permitted.</maml:para> <maml:para>You cannot create cmdlets in a script module file, but you can import cmdlets from a binary module into a script module and re-export them from the script module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies the variables that are exported from the script module file. Enter the variable names, without a dollar sign. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that are exported from the script module file. Enter the alias names. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies the cmdlets that are exported from the script module file. Enter the cmdlet names. Wildcard characters are permitted.</maml:para> <maml:para>You cannot create cmdlets in a script module file, but you can import cmdlets from a binary module into a script module and re-export them from the script module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies the functions that are exported from the script module file. Enter the function names. Wildcard characters are permitted. You can also pipe function name strings to Export-ModuleMember .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies the variables that are exported from the script module file. Enter the variable names, without a dollar sign. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe function name strings to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To exclude a member from the list of exported members, add an Export-ModuleMember * command that lists all other members but omits the member that you want to exclude.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-- Example 1: Export functions and aliases in a script module --</maml:title> <dev:code>Export-ModuleMember -Function * -Alias *</dev:code> <dev:remarks> <maml:para>This command exports all the functions and aliases defined in the script module.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 2: Export specific aliases and functions -------</maml:title> <dev:code>Export-ModuleMember -Function Get-Test, New-Test, Start-Test -Alias gtt, ntt, stt</dev:code> <dev:remarks> <maml:para>This command exports three aliases and three functions defined in the script module.</maml:para> <maml:para>You can use this command format to specify the names of module members.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------- Example 3: Export no members -----------------</maml:title> <dev:code>Export-ModuleMember</dev:code> <dev:remarks> <maml:para>This command specifies that no members defined in the script module are exported.</maml:para> <maml:para>This command prevents the module members from being exported, but it does not hide the members. Users can read and copy module members or use the call operator (&) to invoke module members that are not exported.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 4: Export a specific variable ------------</maml:title> <dev:code>Export-ModuleMember -Variable increment</dev:code> <dev:remarks> <maml:para>This command exports only the $increment variable from the script module. No other members are exported.</maml:para> <maml:para>If you want to export a variable, in addition to exporting the functions in a module, the Export-ModuleMember command must include the names of all of the functions and the name of the variable.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 5: Multiple export commands -------------</maml:title> <dev:code># From TestModule.psm1 Function New-Test { Write-Output 'I am New-Test function' } Export-ModuleMember -Function New-Test function Validate-Test { Write-Output 'I am Validate-Test function' } function Start-Test { Write-Output 'I am Start-Test function' } Set-Alias stt Start-Test Export-ModuleMember -Function Start-Test -Alias stt</dev:code> <dev:remarks> <maml:para>These commands show how multiple Export-ModuleMember commands are interpreted in a script module (.psm1) file.</maml:para> <maml:para>These commands create three functions and one alias, and then they export two of the functions and the alias.</maml:para> <maml:para>Without the Export-ModuleMember commands, all three of the functions and the alias would be exported. With the Export-ModuleMember commands, only the New-Test and Start-Test functions and the STT alias are exported.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 6: Export members in a dynamic module --------</maml:title> <dev:code>New-Module -Script {function SayHello {"Hello!"}; Set-Alias Hi SayHello; Export-ModuleMember -Alias Hi -Function SayHello}</dev:code> <dev:remarks> <maml:para>This command shows how to use Export-ModuleMember in a dynamic module that is created by using the New-Module cmdlet.</maml:para> <maml:para>In this example, Export-ModuleMember is used to export both the Hi alias and the SayHello function in the dynamic module.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 7: Declare and export a function in a single command -</maml:title> <dev:code># From TestModule.psm1 function Export { param ( [Parameter(Mandatory=$true)] [ValidateSet("function","variable")] $Type, [Parameter(Mandatory=$true)] $Name, [Parameter(Mandatory=$true)] $Value ) if ($Type -eq "function") { Set-item "function:script:$Name" $Value Export-ModuleMember $Name } else { Set-Variable -scope Script $Name $Value Export-ModuleMember -variable $Name } } Export function New-Test {Write-Output 'I am New-Test function'} function helper {Write-Output 'I am helper function'} Export variable Interval 0 $Interval = 2</dev:code> <dev:remarks> <maml:para>This example includes a function named Export that declares a function or creates a variable, and then writes an `Export-ModuleMember` command for the function or variable. This lets you declare and export a function or variable in a single command.</maml:para> <maml:para>To use the Export function, include it in your script module. To export a function, type `Export` before the Function keyword.</maml:para> <maml:para>To export a variable, use the following format to declare the variable and set its value:</maml:para> <maml:para>`Export variable <variable-name> <value>`</maml:para> <maml:para>The commands in the example show the correct format. In this example, only the New-Test function and the $Interval variable are exported.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Modules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>ForEach-Object</command:name> <command:verb>ForEach</command:verb> <command:noun>Object</command:noun> <maml:description> <maml:para>Performs an operation against each item in a collection of input objects.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `ForEach-Object` cmdlet performs an operation on each item in a collection of input objects. The input objects can be piped to the cmdlet or specified by using the InputObject parameter.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, there are two different ways to construct a `ForEach-Object` command.</maml:para> <maml:para>- Script block . You can use a script block to specify the operation. Within the script block, use the `$_` variable to represent the current object. The script block is the value of the Process parameter. The script block can contain any PowerShell script.</maml:para> <maml:para> For example, the following command gets the value of the ProcessName property of each process on the computer.</maml:para> <maml:para> `Get-Process | ForEach-Object {$_.ProcessName}`</maml:para> <maml:para> `ForEach-Object` supports the `begin`, `process`, and `end` blocks as described in about_functions (about/about_functions.md#piping-objects-to-functions).</maml:para> <maml:para> > [!NOTE] > The script blocks run in the caller's scope. Therefore the blocks have access to variables in > that scope and can create new variables that persist in that scope after the cmdlet completes.</maml:para> <maml:para>- Operation statement . You can also write an operation statement, which is much more like natural language. You can use the operation statement to specify a property value or call a method. Operation statements were introduced in Windows PowerShell 3.0.</maml:para> <maml:para> For example, the following command also gets the value of the ProcessName property of each process on the computer.</maml:para> <maml:para> `Get-Process | ForEach-Object ProcessName`</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>ForEach-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="none"> <maml:name>MemberName</maml:name> <maml:Description> <maml:para>Specifies the property to get or the method to call.</maml:para> <maml:para>Wildcard characters are permitted, but work only if the resulting string resolves to a unique value. If, for example, you run `Get-Process | ForEach -MemberName *Name`, and more than one member exists with a name that contains the string Name, such as the ProcessName and Name properties, the command fails.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments to a method call. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the input objects. `ForEach-Object` runs the script block or operation statement on each input object. Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> <maml:para>When you use the InputObject parameter with `ForEach-Object`, instead of piping command results to `ForEach-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that if you use `ForEach-Object` to perform operations on a collection of objects for those objects that have specific values in defined properties, you use `ForEach-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>ForEach-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Process</maml:name> <maml:Description> <maml:para>Specifies the operation that is performed on each input object. This script block is run for every object in the pipeline. For more information about the `process` block, see about_Functions (about/about_functions.md#piping-objects-to-functions).</maml:para> <maml:para>When you provide multiple script blocks to the Process parameter, the first script block is always mapped to the `begin` block. If there are only two script blocks, the second block is mapped to the `process` block. If there are three or more script blocks, first script block is always mapped to the `begin` block, the last block is mapped to the `end` block, and the blocks in between are all mapped to the `process` block.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Begin</maml:name> <maml:Description> <maml:para>Specifies a script block that runs before this cmdlet processes any input objects. This script block is only run once for the entire pipeline. For more information about the `begin` block, see about_Functions (about/about_functions.md#piping-objects-to-functions).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:Description> <maml:para>Specifies a script block that runs after this cmdlet processes all input objects. This script block is only run once for the entire pipeline. For more information about the `end` block, see about_Functions (about/about_functions.md#piping-objects-to-functions).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the input objects. `ForEach-Object` runs the script block or operation statement on each input object. Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> <maml:para>When you use the InputObject parameter with `ForEach-Object`, instead of piping command results to `ForEach-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that if you use `ForEach-Object` to perform operations on a collection of objects for those objects that have specific values in defined properties, you use `ForEach-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RemainingScripts</maml:name> <maml:Description> <maml:para>Specifies all script blocks that are not taken by the Process parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments to a method call. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Begin</maml:name> <maml:Description> <maml:para>Specifies a script block that runs before this cmdlet processes any input objects. This script block is only run once for the entire pipeline. For more information about the `begin` block, see about_Functions (about/about_functions.md#piping-objects-to-functions).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>End</maml:name> <maml:Description> <maml:para>Specifies a script block that runs after this cmdlet processes all input objects. This script block is only run once for the entire pipeline. For more information about the `end` block, see about_Functions (about/about_functions.md#piping-objects-to-functions).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the input objects. `ForEach-Object` runs the script block or operation statement on each input object. Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> <maml:para>When you use the InputObject parameter with `ForEach-Object`, instead of piping command results to `ForEach-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that if you use `ForEach-Object` to perform operations on a collection of objects for those objects that have specific values in defined properties, you use `ForEach-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="none"> <maml:name>MemberName</maml:name> <maml:Description> <maml:para>Specifies the property to get or the method to call.</maml:para> <maml:para>Wildcard characters are permitted, but work only if the resulting string resolves to a unique value. If, for example, you run `Get-Process | ForEach -MemberName *Name`, and more than one member exists with a name that contains the string Name, such as the ProcessName and Name properties, the command fails.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Process</maml:name> <maml:Description> <maml:para>Specifies the operation that is performed on each input object. This script block is run for every object in the pipeline. For more information about the `process` block, see about_Functions (about/about_functions.md#piping-objects-to-functions).</maml:para> <maml:para>When you provide multiple script blocks to the Process parameter, the first script block is always mapped to the `begin` block. If there are only two script blocks, the second block is mapped to the `process` block. If there are three or more script blocks, first script block is always mapped to the `begin` block, the last block is mapped to the `end` block, and the blocks in between are all mapped to the `process` block.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RemainingScripts</maml:name> <maml:Description> <maml:para>Specifies all script blocks that are not taken by the Process parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para>You can pipe any object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns objects that are determined by the input.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- The `ForEach-Object` cmdlet works much like the Foreach statement, except that you cannot pipe input to a Foreach statement. For more information about the Foreach statement, see about_Foreach (./About/about_Foreach.md).</maml:para> <maml:para>- Starting in PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections. You can read more about these new methods here about_arrays (./About/about_Arrays.md)</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------ Example 1: Divide integers in an array ------------</maml:title> <dev:code>30000, 56798, 12432 | ForEach-Object -Process {$_/1024} 29.296875 55.466796875 12.140625</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 2: Get the length of all the files in a directory --</maml:title> <dev:code>Get-ChildItem $PSHOME | ForEach-Object -Process {if (!$_.PSIsContainer) {$_.Name; $_.Length / 1024; " " }}</dev:code> <dev:remarks> <maml:para>If the object is not a directory, the script block gets the name of the file, divides the value of its Length property by 1024, and adds a space (" ") to separate it from the next entry. The cmdlet uses the PSISContainer property to determine whether an object is a directory.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 3: Operate on the most recent System events -----</maml:title> <dev:code>$Events = Get-EventLog -LogName System -Newest 1000 $events | ForEach-Object -Begin {Get-Date} -Process {Out-File -FilePath Events.txt -Append -InputObject $_.Message} -End {Get-Date}</dev:code> <dev:remarks> <maml:para>`Get-EventLog` gets the 1000 most recent events from the System event log and stores them in the `$Events` variable. `$Events` is then piped to the `ForEach-Object` cmdlet. The Begin parameter displays the current date and time. Next, the Process parameter uses the `Out-File` cmdlet to create a text file that is named events.txt and stores the message property of each of the events in that file. Last, the End parameter is used to display the date and time after all of the processing has completed.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 4: Change the value of a Registry key --------</maml:title> <dev:code>Get-ItemProperty -Path HKCU:\Network\* | ForEach-Object {Set-ItemProperty -Path $_.PSPath -Name RemotePath -Value $_.RemotePath.ToUpper();}</dev:code> <dev:remarks> <maml:para>You can use this format to change the form or content of a registry entry value.</maml:para> <maml:para>Each subkey in the Network key represents a mapped network drive that will reconnect at logon. The RemotePath entry contains the UNC path of the connected drive. For example, if you map the E: drive to `\Server\Share`, there will be an E subkey of `HKCU:\Network` and the value of the RemotePath registry entry in the E subkey is `\Server\Share`.</maml:para> <maml:para>The command uses the `Get-ItemProperty` cmdlet to get all of the subkeys of the Network key and the `Set-ItemProperty` cmdlet to change the value of the RemotePath registry entry in each key. In the `Set-ItemProperty` command, the path is the value of the PSPath property of the registry key. This is a property of the Microsoft .NET Framework object that represents the registry key, not a registry entry. The command uses the ToUpper() method of the RemotePath value, which is a string (REG_SZ).</maml:para> <maml:para>Because `Set-ItemProperty` is changing the property of each key, the `ForEach-Object` cmdlet is required to access the property.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 5: Use the $Null automatic variable ---------</maml:title> <dev:code>1, 2, $null, 4 | ForEach-Object {"Hello"} Hello Hello Hello Hello</dev:code> <dev:remarks> <maml:para>Because PowerShell treats null as an explicit placeholder, the `ForEach-Object` cmdlet generates a value for `$Null`, just as it does for other objects that you pipe to it.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------------- Example 6: Get property values ----------------</maml:title> <dev:code>Get-Module -ListAvailable | ForEach-Object -MemberName Path Get-Module -ListAvailable | Foreach Path</dev:code> <dev:remarks> <maml:para>The second command is equivalent to the first. It uses the `Foreach` alias of the `ForEach-Object` cmdlet and omits the name of the MemberName parameter, which is optional.</maml:para> <maml:para>The `ForEach-Object` cmdlet is very useful for getting property values, because it gets the value without changing the type, unlike the Format cmdlets or the `Select-Object` cmdlet, which change the property value type.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 7: Split module names into component names ------</maml:title> <dev:code>"Microsoft.PowerShell.Core", "Microsoft.PowerShell.Host" | ForEach-Object {$_.Split(".")} "Microsoft.PowerShell.Core", "Microsoft.PowerShell.Host" | ForEach-Object -MemberName Split -ArgumentList "." "Microsoft.PowerShell.Core", "Microsoft.PowerShell.Host" | Foreach Split "." Microsoft PowerShell Core Microsoft PowerShell Host</dev:code> <dev:remarks> <maml:para>The commands call the Split method of strings. The three commands use different syntax, but they are equivalent and interchangeable.</maml:para> <maml:para>The first command uses the traditional syntax, which includes a script block and the current object operator `$_`. It uses the dot syntax to specify the method and parentheses to enclose the delimiter argument.</maml:para> <maml:para>The second command uses the MemberName parameter to specify the Split method and the ArgumentName parameter to identify the dot (".") as the split delimiter.</maml:para> <maml:para>The third command uses the Foreach alias of the `ForEach-Object` cmdlet and omits the names of the MemberName and ArgumentList parameters, which are optional.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 8: Using ForeEach-Object with two script blocks ---</maml:title> <dev:code>1..2 | ForEach-Object { 'begin' } { 'process' } begin process process</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 9: Using ForeEach-Object with more than two script blocks</maml:title> <dev:code>1..2 | ForEach-Object { 'begin' } { 'process A' } { 'process B' } { 'end' } begin process A process B process A process B end</dev:code> <dev:remarks> <maml:para>> [!NOTE] > The first script block is always mapped to the `begin` block, the last block is mapped to the > `end` block, and the blocks in between are all mapped to the `process` block.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title> Example 10: Run multiple script blocks for each pipeline item </maml:title> <dev:code>1..2 | ForEach-Object -Begin $null -Process { 'one' }, { 'two' }, { 'three' } -End $null one two three one two three</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Compare-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Where-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Group-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Measure-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Select-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Sort-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Tee-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-Command</command:name> <command:verb>Get</command:verb> <command:noun>Command</command:noun> <maml:description> <maml:para>Gets all commands.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-Command` cmdlet gets all commands that are installed on the computer, including cmdlets, aliases, functions, filters, scripts, and applications. `Get-Command` gets the commands from PowerShell modules and commands that were imported from other sessions. To get only commands that have been imported into the current session, use the ListImported parameter.</maml:para> <maml:para>Without parameters, `Get-Command` gets all of the cmdlets, functions, and aliases installed on the computer. `Get-Command *` gets all types of commands, including all of the non-PowerShell files in the Path environment variable (`$env:Path`), which it lists in the Application command type.</maml:para> <maml:para>`Get-Command` that uses the exact name of the command, without wildcard characters, automatically imports the module that contains the command so that you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the `$PSModuleAutoLoadingPreference` preference variable. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>`Get-Command` gets its data directly from the command code, unlike `Get-Help`, which gets its information from help topics.</maml:para> <maml:para>Starting in Windows PowerShell 5.0, results of the `Get-Command` cmdlet display a Version column by default. A new Version property has been added to the CommandInfo class.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a name or name pattern. Wildcard characters are permitted.</maml:para> <maml:para>To get commands that have the same name, use the All parameter. When two commands have the same name, by default, `Get-Command` gets the command that runs when you type the command name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments. This cmdlet gets information about a cmdlet or function when it is used with the specified parameters ("arguments"). The alias for ArgumentList is Args .</maml:para> <maml:para>To detect dynamic parameters that are available only when certain other parameters are used, set the value of ArgumentList to the parameters that trigger the dynamic parameters.</maml:para> <maml:para>To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the ArgumentList parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of ArgumentList . For information about the provider cmdlets, see about_Providers (About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>All</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all commands, including commands of the same type that have the same name. By default, `Get-Command` gets only the commands that run when you type the command name.</maml:para> <maml:para>For more information about the method that PowerShell uses to select the command to run when multiple commands have the same name, see about_Command_Precedence (About/about_Command_Precedence.md). For information about module-qualified command names and running commands that do not run by default because of a name conflict, see about_Modules (About/about_Modules.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>In Windows PowerShell 2.0, `Get-Command` gets all commands by default.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="Type"> <maml:name>CommandType</maml:name> <maml:Description> <maml:para>Specifies the types of commands that this cmdlet gets. Enter one or more command types. Use CommandType or its alias, Type . By default, `Get-Command` gets all cmdlets, functions, and aliases.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Alias. Gets the aliases of all PowerShell commands. For more information, see about_Aliases (About/about_Aliases.md). - All. Gets all command types. This parameter value is the equivalent of `Get-Command *`.</maml:para> <maml:para>- Application. Gets non-PowerShell files in paths listed in the Path environment variable ($env:path), including .txt, .exe, and .dll files. For more information about the Path environment variable, see about_Environment_Variables. - Cmdlet. Gets all cmdlets.</maml:para> <maml:para>- ExternalScript. Gets all .ps1 files in the paths listed in the Path environment variable ($env:path). - Filter and Function. Gets all PowerShell advanced and simple functions and filters.</maml:para> <maml:para>- Script. Gets all script blocks. To get PowerShell scripts (.ps1 files), use the ExternalScript</maml:para> <maml:para> value. - Workflow. Gets all workflows. For more information about workflows, see Introducing Windows PowerShell Workflow.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Application</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Script</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.CommandTypes</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.CommandTypes</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects, described in the Remarks section of ModuleSpecification Constructor (Hashtable) (/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). For example, the FullyQualifiedModule parameter accepts a module name that is specified in one of the following formats:</maml:para> <maml:para>- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}`</maml:para> <maml:para>- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter. The two parameters are mutually exclusive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ListImported</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets only commands in the current session.</maml:para> <maml:para>Starting in PowerShell 3.0, by default, `Get-Command` gets all installed commands, including, but not limited to, the commands in the current session. In PowerShell 2.0, it gets only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="PSSnapin"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Specifies an array of modules. This cmdlet gets the commands that came from the specified modules or snap-ins. Enter the names of modules or snap-ins.</maml:para> <maml:para>This parameter takes string values, but the value of this parameter can also be a PSModuleInfo or PSSnapinInfo object, such as the objects that the `Get-Module`, `Get-PSSnapin`, and `Import-PSSession` cmdlets return.</maml:para> <maml:para>You can refer to this parameter by its name, Module , or by its alias, PSSnapin . The parameter name that you choose has no effect on the command output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:Description> <maml:para>Specifies an array of parameter names. This cmdlet gets commands in the session that have the specified parameters. Enter parameter names or parameter aliases. Wildcard characters are supported.</maml:para> <maml:para>The ParameterName and ParameterType parameters search only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterType</maml:name> <maml:Description> <maml:para>Specifies an array of parameter names. This cmdlet gets commands in the session that have parameters of the specified type. Enter the full name or partial name of a parameter type. Wildcard characters are supported.</maml:para> <maml:para>The ParameterName and ParameterType parameters search only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTypeName[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTypeName[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowCommandInfo</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays command information.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 5.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Syntax</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets only the following specified data about the command:</maml:para> <maml:para>- Aliases. Gets the standard name.</maml:para> <maml:para>- Cmdlets. Gets the syntax.</maml:para> <maml:para>- Functions and filters. Gets the function definition.</maml:para> <maml:para>- Scripts and applications or files. Gets the path and filename.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>TotalCount</maml:name> <maml:Description> <maml:para>Specifies the number of commands to get. You can use this parameter to limit the output of a command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments. This cmdlet gets information about a cmdlet or function when it is used with the specified parameters ("arguments"). The alias for ArgumentList is Args .</maml:para> <maml:para>To detect dynamic parameters that are available only when certain other parameters are used, set the value of ArgumentList to the parameters that trigger the dynamic parameters.</maml:para> <maml:para>To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the ArgumentList parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of ArgumentList . For information about the provider cmdlets, see about_Providers (About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>All</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all commands, including commands of the same type that have the same name. By default, `Get-Command` gets only the commands that run when you type the command name.</maml:para> <maml:para>For more information about the method that PowerShell uses to select the command to run when multiple commands have the same name, see about_Command_Precedence (About/about_Command_Precedence.md). For information about module-qualified command names and running commands that do not run by default because of a name conflict, see about_Modules (About/about_Modules.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>In Windows PowerShell 2.0, `Get-Command` gets all commands by default.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects, described in the Remarks section of ModuleSpecification Constructor (Hashtable) (/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). For example, the FullyQualifiedModule parameter accepts a module name that is specified in one of the following formats:</maml:para> <maml:para>- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}`</maml:para> <maml:para>- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter. The two parameters are mutually exclusive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ListImported</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets only commands in the current session.</maml:para> <maml:para>Starting in PowerShell 3.0, by default, `Get-Command` gets all installed commands, including, but not limited to, the commands in the current session. In PowerShell 2.0, it gets only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="PSSnapin"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Specifies an array of modules. This cmdlet gets the commands that came from the specified modules or snap-ins. Enter the names of modules or snap-ins.</maml:para> <maml:para>This parameter takes string values, but the value of this parameter can also be a PSModuleInfo or PSSnapinInfo object, such as the objects that the `Get-Module`, `Get-PSSnapin`, and `Import-PSSession` cmdlets return.</maml:para> <maml:para>You can refer to this parameter by its name, Module , or by its alias, PSSnapin . The parameter name that you choose has no effect on the command output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Noun</maml:name> <maml:Description> <maml:para>Specifies an array of command nouns. This cmdlet gets commands, which include cmdlets, functions, and aliases, that have names that include the specified noun. Enter one or more nouns or noun patterns. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:Description> <maml:para>Specifies an array of parameter names. This cmdlet gets commands in the session that have the specified parameters. Enter parameter names or parameter aliases. Wildcard characters are supported.</maml:para> <maml:para>The ParameterName and ParameterType parameters search only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterType</maml:name> <maml:Description> <maml:para>Specifies an array of parameter names. This cmdlet gets commands in the session that have parameters of the specified type. Enter the full name or partial name of a parameter type. Wildcard characters are supported.</maml:para> <maml:para>The ParameterName and ParameterType parameters search only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTypeName[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTypeName[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowCommandInfo</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays command information.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 5.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Syntax</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets only the following specified data about the command:</maml:para> <maml:para>- Aliases. Gets the standard name.</maml:para> <maml:para>- Cmdlets. Gets the syntax.</maml:para> <maml:para>- Functions and filters. Gets the function definition.</maml:para> <maml:para>- Scripts and applications or files. Gets the path and filename.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>TotalCount</maml:name> <maml:Description> <maml:para>Specifies the number of commands to get. You can use this parameter to limit the output of a command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Verb</maml:name> <maml:Description> <maml:para>Specifies an array of command verbs. This cmdlet gets commands, which include cmdlets, functions, and aliases, that have names that include the specified verb. Enter one or more verbs or verb patterns. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>All</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all commands, including commands of the same type that have the same name. By default, `Get-Command` gets only the commands that run when you type the command name.</maml:para> <maml:para>For more information about the method that PowerShell uses to select the command to run when multiple commands have the same name, see about_Command_Precedence (About/about_Command_Precedence.md). For information about module-qualified command names and running commands that do not run by default because of a name conflict, see about_Modules (About/about_Modules.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>In Windows PowerShell 2.0, `Get-Command` gets all commands by default.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments. This cmdlet gets information about a cmdlet or function when it is used with the specified parameters ("arguments"). The alias for ArgumentList is Args .</maml:para> <maml:para>To detect dynamic parameters that are available only when certain other parameters are used, set the value of ArgumentList to the parameters that trigger the dynamic parameters.</maml:para> <maml:para>To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the ArgumentList parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of ArgumentList . For information about the provider cmdlets, see about_Providers (About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="Type"> <maml:name>CommandType</maml:name> <maml:Description> <maml:para>Specifies the types of commands that this cmdlet gets. Enter one or more command types. Use CommandType or its alias, Type . By default, `Get-Command` gets all cmdlets, functions, and aliases.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Alias. Gets the aliases of all PowerShell commands. For more information, see about_Aliases (About/about_Aliases.md). - All. Gets all command types. This parameter value is the equivalent of `Get-Command *`.</maml:para> <maml:para>- Application. Gets non-PowerShell files in paths listed in the Path environment variable ($env:path), including .txt, .exe, and .dll files. For more information about the Path environment variable, see about_Environment_Variables. - Cmdlet. Gets all cmdlets.</maml:para> <maml:para>- ExternalScript. Gets all .ps1 files in the paths listed in the Path environment variable ($env:path). - Filter and Function. Gets all PowerShell advanced and simple functions and filters.</maml:para> <maml:para>- Script. Gets all script blocks. To get PowerShell scripts (.ps1 files), use the ExternalScript</maml:para> <maml:para> value. - Workflow. Gets all workflows. For more information about workflows, see Introducing Windows PowerShell Workflow.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.CommandTypes</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.CommandTypes</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects, described in the Remarks section of ModuleSpecification Constructor (Hashtable) (/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). For example, the FullyQualifiedModule parameter accepts a module name that is specified in one of the following formats:</maml:para> <maml:para>- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}`</maml:para> <maml:para>- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter. The two parameters are mutually exclusive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ListImported</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets only commands in the current session.</maml:para> <maml:para>Starting in PowerShell 3.0, by default, `Get-Command` gets all installed commands, including, but not limited to, the commands in the current session. In PowerShell 2.0, it gets only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="PSSnapin"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Specifies an array of modules. This cmdlet gets the commands that came from the specified modules or snap-ins. Enter the names of modules or snap-ins.</maml:para> <maml:para>This parameter takes string values, but the value of this parameter can also be a PSModuleInfo or PSSnapinInfo object, such as the objects that the `Get-Module`, `Get-PSSnapin`, and `Import-PSSession` cmdlets return.</maml:para> <maml:para>You can refer to this parameter by its name, Module , or by its alias, PSSnapin . The parameter name that you choose has no effect on the command output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of names. This cmdlet gets only commands that have the specified name. Enter a name or name pattern. Wildcard characters are permitted.</maml:para> <maml:para>To get commands that have the same name, use the All parameter. When two commands have the same name, by default, `Get-Command` gets the command that runs when you type the command name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Noun</maml:name> <maml:Description> <maml:para>Specifies an array of command nouns. This cmdlet gets commands, which include cmdlets, functions, and aliases, that have names that include the specified noun. Enter one or more nouns or noun patterns. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:Description> <maml:para>Specifies an array of parameter names. This cmdlet gets commands in the session that have the specified parameters. Enter parameter names or parameter aliases. Wildcard characters are supported.</maml:para> <maml:para>The ParameterName and ParameterType parameters search only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterType</maml:name> <maml:Description> <maml:para>Specifies an array of parameter names. This cmdlet gets commands in the session that have parameters of the specified type. Enter the full name or partial name of a parameter type. Wildcard characters are supported.</maml:para> <maml:para>The ParameterName and ParameterType parameters search only commands in the current session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTypeName[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTypeName[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowCommandInfo</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays command information.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 5.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Syntax</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets only the following specified data about the command:</maml:para> <maml:para>- Aliases. Gets the standard name.</maml:para> <maml:para>- Cmdlets. Gets the syntax.</maml:para> <maml:para>- Functions and filters. Gets the function definition.</maml:para> <maml:para>- Scripts and applications or files. Gets the path and filename.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>TotalCount</maml:name> <maml:Description> <maml:para>Specifies the number of commands to get. You can use this parameter to limit the output of a command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Verb</maml:name> <maml:Description> <maml:para>Specifies an array of command verbs. This cmdlet gets commands, which include cmdlets, functions, and aliases, that have names that include the specified verb. Enter one or more verbs or verb patterns. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe command names to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.CommandInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns objects derived from the CommandInfo class. The type of object that is returned depends on the type of command that `Get-Command` gets.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.AliasInfo</maml:name> </dev:type> <maml:description> <maml:para>Represents aliases.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.ApplicationInfo</maml:name> </dev:type> <maml:description> <maml:para>Represents applications and files.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.CmdletInfo</maml:name> </dev:type> <maml:description> <maml:para>Represents cmdlets.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.FunctionInfo</maml:name> </dev:type> <maml:description> <maml:para>Represents functions and filters.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.WorkflowInfo</maml:name> </dev:type> <maml:description> <maml:para>Represents workflows.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>* When more than one command that has the same name is available to the session, `Get-Command` returns the command that runs when you type the command name. To get commands that have the same name, listed in run order, use the All parameter. For more information, see about_Command_Precedence (../Microsoft.PowerShell.Core/About/about_Command_Precedence.md). * When a module is imported automatically, the effect is the same as using the `Import-Module` cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference` preference variable. For more information, see about_Preference_Variables (../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------- Example 1: Get cmdlets, functions, and aliases --------</maml:title> <dev:code>Get-Command</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 2: Get commands in the current session --------</maml:title> <dev:code>Get-Command -ListImported</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Get cmdlets and display them in order -------</maml:title> <dev:code>Get-Command -Type Cmdlet | Sort-Object -Property Noun | Format-Table -GroupBy Noun</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 4: Get commands in a module -------------</maml:title> <dev:code>Get-Command -Module Microsoft.PowerShell.Security, Microsoft.PowerShell.Utility</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 5: Get information about a cmdlet ----------</maml:title> <dev:code>Get-Command Get-AppLockerPolicy</dev:code> <dev:remarks> <maml:para>When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the `$PSModuleAutoLoadingPreference` preference variable. For more information, see about_Preference_Variables (../Microsoft.PowerShell.Core/About/about_Preference_Variables.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 6: Get the syntax of a cmdlet ------------</maml:title> <dev:code>Get-Command Get-Childitem -Args Cert: -Syntax</dev:code> <dev:remarks> <maml:para>When you compare the syntax displayed in the output with the syntax that is displayed when you omit the Args ( ArgumentList ) parameter, you'll see that the Certificate provider adds a dynamic parameter, CodeSigningCert , to the `Get-ChildItem` cmdlet.</maml:para> <maml:para>For more information about the Certificate provider, see about_Certificate_Provider (../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 7: Get dynamic parameters --------------</maml:title> <dev:code>function Get-DynamicParameters { param ($Cmdlet, $PSDrive) (Get-Command $Cmdlet -ArgumentList $PSDrive).ParameterSets | ForEach-Object {$_.Parameters} | Where-Object { $_.IsDynamic } | Select-Object -Property Name -Unique } Get-DynamicParameters -Cmdlet Get-ChildItem -PSDrive Cert: Name ---- CodeSigningCert</dev:code> <dev:remarks> <maml:para>The `Get-DynamicParameters` function in this example gets the dynamic parameters of a cmdlet. This is an alternative to the method used in the previous example. Dynamic parameter can be added to a cmdlet by another cmdlet or a provider.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 8: Get all commands of all types -----------</maml:title> <dev:code>Get-Command *</dev:code> <dev:remarks> <maml:para>It returns an ApplicationInfo object (System.Management.Automation.ApplicationInfo) for each file, not a FileInfo object (System.IO.FileInfo).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 9: Get cmdlets by using a parameter name and type --</maml:title> <dev:code>Get-Command -ParameterName *Auth* -ParameterType AuthenticationMechanism</dev:code> <dev:remarks> <maml:para>You can use a command like this one to find cmdlets that let you specify the method that is used to authenticate the user.</maml:para> <maml:para>The ParameterType parameter distinguishes parameters that take an AuthenticationMechanism value from those that take an AuthenticationLevel parameter, even when they have similar names.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------------- Example 10: Get an alias -------------------</maml:title> <dev:code>Get-Command dir CommandType Name ModuleName ----------- ---- ---------- Alias dir -> Get-ChildItem</dev:code> <dev:remarks> <maml:para>Although it is typically used on cmdlets and functions, `Get-Command` also gets scripts, functions, aliases, and executable files.</maml:para> <maml:para>The output of the command shows the special view of the Name property value for aliases. The view shows the alias and the full command name.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 11: Get all instances of the Notepad command -----</maml:title> <dev:code>Get-Command Notepad -All | Format-Table CommandType, Name, Definition CommandType Name Definition ----------- ---- ---------- Application notepad.exe C:\WINDOWS\system32\notepad.exe Application NOTEPAD.EXE C:\WINDOWS\NOTEPAD.EXE</dev:code> <dev:remarks> <maml:para>The All parameter is useful when there is more than one command with the same name in the session.</maml:para> <maml:para>Beginning in Windows PowerShell 3.0, by default, when the session includes multiple commands with the same name, `Get-Command` gets only the command that runs when you type the command name. With the All parameter, `Get-Command` gets all commands with the specified name and returns them in execution precedence order. To run a command other than the first one in the list, type the fully qualified path to the command.</maml:para> <maml:para>For more information about command precedence, see about_Command_Precedence (About/about_Command_Precedence.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 12: Get the name of a module that contains a cmdlet -</maml:title> <dev:code>(Get-Command Get-Date).ModuleName Microsoft.PowerShell.Utility</dev:code> <dev:remarks> <maml:para>This command format works on commands in PowerShell modules, even if they are not imported into the session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 13: Get cmdlets and functions that have an output type</maml:title> <dev:code>Get-Command -Type Cmdlet | Where-Object OutputType | Format-List -Property Name, OutputType</dev:code> <dev:remarks> <maml:para>This command gets the cmdlets and functions that have an output type and the type of objects that they return.</maml:para> <maml:para>The first part of the command gets all cmdlets. A pipeline operator (|) sends the cmdlets to the `Where-Object` cmdlet, which selects only the ones in which the OutputType property is populated. Another pipeline operator sends the selected cmdlet objects to the `Format-List` cmdlet, which displays the name and output type of each cmdlet in a list.</maml:para> <maml:para>The OutputType property of a CommandInfo object has a non-null value only when the cmdlet code defines the OutputType attribute for the cmdlet.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 14: Get cmdlets that take a specific object type as input</maml:title> <dev:code>Get-Command -ParameterType (((Get-NetAdapter)[0]).PSTypeNames) CommandType Name ModuleName ----------- ---- ---------- Function Disable-NetAdapter NetAdapter Function Enable-NetAdapter NetAdapter Function Rename-NetAdapter NetAdapter Function Restart-NetAdapter NetAdapter Function Set-NetAdapter NetAdapter</dev:code> <dev:remarks> <maml:para>This command finds cmdlets that take net adapter objects as input. You can use this command format to find the cmdlets that accept the type of objects that any command returns.</maml:para> <maml:para>The command uses the PSTypeNames intrinsic property of all objects, which gets the types that describe the object. To get the PSTypeNames property of a net adapter, and not the PSTypeNames property of a collection of net adapters, the command uses array notation to get the first net adapter that the cmdlet returns. To get the PSTypeNames property of a net adapter, and not the PSTypeNames property of a collection of net adapters, the command uses array notation to get the first net adapter that the cmdlet returns.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Export-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Member</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSDrive</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Command_Precedence</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-Help</command:name> <command:verb>Get</command:verb> <command:noun>Help</command:noun> <maml:description> <maml:para>Displays information about PowerShell commands and concepts.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-Help` cmdlet displays information about PowerShell concepts and commands, including cmdlets, functions, Common Information Model (CIM) commands, workflows, providers, aliases, and scripts.</maml:para> <maml:para>To get help for a PowerShell cmdlet, type `Get-Help` followed by the cmdlet name, such as: `Get-Help Get-Process`.</maml:para> <maml:para>Conceptual help articles in PowerShell begin with about_ , such as about_Comparison_Operators . To see all about_ articles, type `Get-Help about_*`. To see a particular article, type `Get-Help about_<article-name>`, such as `Get-Help about_Comparison_Operators`.</maml:para> <maml:para>To get help for a PowerShell provider, type `Get-Help` followed by the provider name. For example, to get help for the Certificate provider, type `Get-Help Certificate`.</maml:para> <maml:para>You can also type `help` or `man`, which displays one screen of text at a time. Or, `<cmdlet-name> -?`, that is identical to `Get-Help`, but only works for cmdlets.</maml:para> <maml:para>`Get-Help` gets the help content that it displays from help files on your computer. Without the help files, `Get-Help` displays only basic information about cmdlets. Some PowerShell modules include help files. Beginning in PowerShell 3.0, the modules that come with the Windows operating system don't include help files. To download or update the help files for a module in PowerShell 3.0, use the `Update-Help` cmdlet.</maml:para> <maml:para>You can also view the PowerShell help documents online in the Microsoft Docs. To get the online version of a help file, use the Online parameter, such as: `Get-Help Get-Process -Online`. To read all the PowerShell documentation, see the Microsoft Docs PowerShell Documentation (/powershell).</maml:para> <maml:para>If you type `Get-Help` followed by the exact name of a help article, or by a word unique to a help article, `Get-Help` displays the article's content. If you specify the exact name of a command alias, `Get-Help` displays the help for the original command. If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles. If you enter a word that doesn't appear in any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>`Get-Help` can get help articles for all supported languages and locales. `Get-Help` first looks for help files in the locale set for Windows, then in the parent locale, such as pt for pt-BR , and then in a fallback locale. Beginning in PowerShell 3.0, if `Get-Help` doesn't find help in the fallback locale, it looks for help articles in English, en-US , before it returns an error message or displaying autogenerated help.</maml:para> <maml:para>For information about the symbols that `Get-Help` displays in the command syntax diagram, see about_Command_Syntax (./About/about_Command_Syntax.md). For information about parameter attributes, such as Required and Position , see about_Parameters (./About/about_Parameters.md).</maml:para> <maml:para>>[!NOTE] > In PowerShell 3.0 and PowerShell 4.0, `Get-Help` can't find About articles in modules unless > the module is imported into the current session. This is a known issue. To get About articles > in a module, import the module, either by using the `Import-Module` cmdlet or by running a cmdlet > that's included in the module.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Provider</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">General</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">FAQ</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Glossary</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">HelpFile</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ScriptCommand</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DefaultHelp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DscResource</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Class</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Detailed</maml:name> <maml:Description> <maml:para>Adds parameter descriptions and examples to the basic help display. This parameter is effective only when the help files are installed on the computer. It has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Provider</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">General</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">FAQ</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Glossary</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">HelpFile</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ScriptCommand</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DefaultHelp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DscResource</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Class</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Examples</maml:name> <maml:Description> <maml:para>Displays only the name, synopsis, and examples. To display only the examples, type `(Get-Help <cmdlet-name>).Examples`.</maml:para> <maml:para>This parameter is effective only when the help files are installed on the computer. It has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Provider</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">General</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">FAQ</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Glossary</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">HelpFile</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ScriptCommand</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DefaultHelp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DscResource</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Class</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Full</maml:name> <maml:Description> <maml:para>Displays the entire help article for a cmdlet. Full includes parameter descriptions and attributes, examples, input and output object types, and additional notes.</maml:para> <maml:para>This parameter is effective only when the help files are installed on the computer. It has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Provider</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">General</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">FAQ</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Glossary</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">HelpFile</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ScriptCommand</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DefaultHelp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DscResource</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Class</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Online</maml:name> <maml:Description> <maml:para>Displays the online version of a help article in the default browser. This parameter is valid only for cmdlet, function, workflow, and script help articles. You can't use the Online parameter with `Get-Help` in a remote session.</maml:para> <maml:para>For information about supporting this feature in help articles that you write, see about_Comment_Based_Help (./About/about_Comment_Based_Help.md), and Supporting Online Help (/powershell/scripting/developer/module/supporting-online-help), and Writing Help for PowerShell Cmdlets (/powershell/scripting/developer/help/writing-help-for-windows-powershell-cmdlets).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Provider</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">General</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">FAQ</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Glossary</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">HelpFile</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ScriptCommand</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DefaultHelp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DscResource</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Class</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Parameter</maml:name> <maml:Description> <maml:para>Displays only the detailed descriptions of the specified parameters. Wildcards are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Alias</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Cmdlet</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Provider</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">General</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">FAQ</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Glossary</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">HelpFile</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ScriptCommand</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Function</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Filter</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ExternalScript</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DefaultHelp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">DscResource</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Class</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Configuration</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowWindow</maml:name> <maml:Description> <maml:para>Displays the help topic in a window for easier reading. The window includes a Find search feature and a Settings box that lets you set options for the display, including options to display only selected sections of a help topic.</maml:para> <maml:para>The ShowWindow parameter supports help topics for commands (cmdlets, functions, CIM commands, workflows, scripts) and conceptual About articles. It does not support provider help.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Category</maml:name> <maml:Description> <maml:para>Displays help only for items in the specified category and their aliases. Conceptual articles are in the HelpFile category.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Alias</maml:para> <maml:para>- Cmdlet</maml:para> <maml:para>- Provider</maml:para> <maml:para>- General</maml:para> <maml:para>- FAQ</maml:para> <maml:para>- Glossary</maml:para> <maml:para>- HelpFile</maml:para> <maml:para>- ScriptCommand</maml:para> <maml:para>- Function</maml:para> <maml:para>- Filter</maml:para> <maml:para>- ExternalScript</maml:para> <maml:para>- All</maml:para> <maml:para>- DefaultHelp</maml:para> <maml:para>- Workflow</maml:para> <maml:para>- DscResource</maml:para> <maml:para>- Class</maml:para> <maml:para>- Configuration</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Component</maml:name> <maml:Description> <maml:para>Displays commands with the specified component value, such as Exchange . Enter a component name. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Detailed</maml:name> <maml:Description> <maml:para>Adds parameter descriptions and examples to the basic help display. This parameter is effective only when the help files are installed on the computer. It has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Examples</maml:name> <maml:Description> <maml:para>Displays only the name, synopsis, and examples. To display only the examples, type `(Get-Help <cmdlet-name>).Examples`.</maml:para> <maml:para>This parameter is effective only when the help files are installed on the computer. It has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Full</maml:name> <maml:Description> <maml:para>Displays the entire help article for a cmdlet. Full includes parameter descriptions and attributes, examples, input and output object types, and additional notes.</maml:para> <maml:para>This parameter is effective only when the help files are installed on the computer. It has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Functionality</maml:name> <maml:Description> <maml:para>Displays help for items with the specified functionality. Enter the functionality. Wildcard characters are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets help about the specified command or concept. Enter the name of a cmdlet, function, provider, script, or workflow, such as `Get-Member`, a conceptual article name, such as `about_Objects`, or an alias, such as `ls`. Wildcard characters are permitted in cmdlet and provider names, but you can't use wildcard characters to find the names of function help and script help articles.</maml:para> <maml:para>To get help for a script that isn't located in a path that's listed in the `$env:Path` environment variable, type the script's path and file name.</maml:para> <maml:para>If you enter the exact name of a help article, `Get-Help` displays the article contents.</maml:para> <maml:para>If you enter a word or word pattern that appears in several help article titles, `Get-Help` displays a list of the matching titles.</maml:para> <maml:para>If you enter a word that doesn't match any help article titles, `Get-Help` displays a list of articles that include that word in their contents.</maml:para> <maml:para>The names of conceptual articles, such as `about_Objects`, must be entered in English, even in non-English versions of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Online</maml:name> <maml:Description> <maml:para>Displays the online version of a help article in the default browser. This parameter is valid only for cmdlet, function, workflow, and script help articles. You can't use the Online parameter with `Get-Help` in a remote session.</maml:para> <maml:para>For information about supporting this feature in help articles that you write, see about_Comment_Based_Help (./About/about_Comment_Based_Help.md), and Supporting Online Help (/powershell/scripting/developer/module/supporting-online-help), and Writing Help for PowerShell Cmdlets (/powershell/scripting/developer/help/writing-help-for-windows-powershell-cmdlets).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Parameter</maml:name> <maml:Description> <maml:para>Displays only the detailed descriptions of the specified parameters. Wildcards are permitted. This parameter has no effect on displays of conceptual ( About_ ) help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Gets help that explains how the cmdlet works in the specified provider path. Enter a PowerShell provider path.</maml:para> <maml:para>This parameter gets a customized version of a cmdlet help article that explains how the cmdlet works in the specified PowerShell provider path. This parameter is effective only for help about a provider cmdlet and only when the provider includes a custom version of the provider cmdlet help article in its help file. To use this parameter, install the help file for the module that includes the provider.</maml:para> <maml:para>To see the custom cmdlet help for a provider path, go to the provider path location and enter a `Get-Help` command or, from any path location, use the Path parameter of `Get-Help` to specify the provider path. You can also find custom cmdlet help online in the provider help section of the help articles.</maml:para> <maml:para>For more information about PowerShell providers, see about_Providers (./About/about_Providers.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Role</maml:name> <maml:Description> <maml:para>Displays help customized for the specified user role. Enter a role. Wildcard characters are permitted.</maml:para> <maml:para>Enter the role that the user plays in an organization. Some cmdlets display different text in their help files based on the value of this parameter. This parameter has no effect on help for the core cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowWindow</maml:name> <maml:Description> <maml:para>Displays the help topic in a window for easier reading. The window includes a Find search feature and a Settings box that lets you set options for the display, including options to display only selected sections of a help topic.</maml:para> <maml:para>The ShowWindow parameter supports help topics for commands (cmdlets, functions, CIM commands, workflows, scripts) and conceptual About articles. It does not support provider help.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You can't send objects down the pipeline to `Get-Help`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>ExtendedCmdletHelpInfo</maml:name> </dev:type> <maml:description> <maml:para>If you run `Get-Help` on a command that doesn't have a help file, `Get-Help` returns an ExtendedCmdletHelpInfo object that represents autogenerated help.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>If you get a conceptual help article, `Get-Help` returns it as a string.</maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>MamlCommandHelpInfo</maml:name> </dev:type> <maml:description> <maml:para>If you get a command that has a help file, `Get-Help` returns a MamlCommandHelpInfo object.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>PowerShell 3.0 doesn't include help files. To download and install the help files that `Get-Help` reads, use the `Update-Help` cmdlet. You can use the `Update-Help` cmdlet to download and install help files for the core commands that come with PowerShell and for any modules that you install. You can also use it to update the help files so that the help on your computer is never outdated.</maml:para> <maml:para>You can also read the help articles about the commands that come with PowerShell online starting at Getting Started with Windows PowerShell (/powershell/scripting/getting-started/getting-started-with-windows-powershell).</maml:para> <maml:para>`Get-Help` displays help in the locale set for the Windows operating system or in the fallback language for that locale. If you don't have help files for the primary or fallback locale, `Get-Help` behaves as if there are no help files on the computer. To get help for a different locale, use Region and Language in Control Panel to change the settings. On Windows 10, Settings , Time & Language .</maml:para> <maml:para>The full view of help includes a table of information about the parameters. The table includes the following fields:</maml:para> <maml:para>- Required . Indicates whether the parameter is required (true) or optional (false).</maml:para> <maml:para>- Position . Indicates whether the parameter is named or positional (numeric). Positional parameters must appear in a specified place in the command.</maml:para> <maml:para>- Named indicates that the parameter name is required, but that the parameter can appear anywhere in the command.</maml:para> <maml:para>- Numeric indicates that the parameter name is optional, but when the name is omitted, the parameter must be in the place specified by the number. For example, `2` indicates that when the parameter name is omitted, the parameter must be the second or only unnamed parameter in the command. When the parameter name is used, the parameter can appear anywhere in the command.</maml:para> <maml:para>- Default value . The parameter value or default behavior that PowerShell uses if you don't include the parameter in the command.</maml:para> <maml:para>- Accepts pipeline input. Indicates whether you can (true) or can't (false) send objects to the parameter through a pipeline. By Property Name means that the pipelined object must have a property that has the same name as the parameter name.</maml:para> <maml:para>- Accepts wildcard characters . Indicates whether the value of a parameter can include wildcard characters, such as an asterisk (`*`) or question mark (`?`).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--- Example 1: Display basic help information about a cmdlet ---</maml:title> <dev:code>Get-Help Format-Table Get-Help -Name Format-Table Format-Table -?</dev:code> <dev:remarks> <maml:para>`Get-Help <cmdlet-name>` is the simplest and default syntax of `Get-Help` cmdlet. You can omit the Name parameter.</maml:para> <maml:para>The syntax `<cmdlet-name> -?` works only for cmdlets.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 2: Display basic information one page at a time ---</maml:title> <dev:code>help Format-Table man Format-Table Get-Help Format-Table | Out-Host -Paging</dev:code> <dev:remarks> <maml:para>`help` is a function that runs `Get-Help` cmdlet internally and displays the result one page at a time.</maml:para> <maml:para>`man` is an alias for the `help` function.</maml:para> <maml:para>`Get-Help Format-Table` sends the object down the pipeline. `Out-Host -Paging` receives the output from the pipeline and displays it one page at a time. For more information, see Out-Host (Out-Host.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Display more information for a cmdlet -------</maml:title> <dev:code>Get-Help Format-Table -Detailed Get-Help Format-Table -Full</dev:code> <dev:remarks> <maml:para>The Detailed parameter displays the help article's detailed view that includes parameter descriptions and examples.</maml:para> <maml:para>The Full parameter displays the help article's full view that includes parameter descriptions, examples, input and output object types, and additional notes.</maml:para> <maml:para>The Detailed and Full parameters are effective only for the commands that have help files installed on the computer. The parameters aren't effective for the conceptual ( about_ ) help articles.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Display selected parts of a cmdlet by using parameters</maml:title> <dev:code>Get-Help Format-Table -Examples Get-Help Format-Table -Parameter * Get-Help Format-Table -Parameter GroupBy</dev:code> <dev:remarks> <maml:para>The Examples parameter displays the help file's NAME and SYNOPSIS sections, and all the Examples. You can't specify an Example number because the Examples parameter is a switch parameter.</maml:para> <maml:para>The Parameter parameter displays only the descriptions of the specified parameters. If you specify only the asterisk (`*`) wildcard character, it displays the descriptions of all parameters. When Parameter specifies a parameter name such as GroupBy , information about that parameter is shown.</maml:para> <maml:para>These parameters aren't effective for the conceptual ( about_ ) help articles.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 5: Display online version of help ----------</maml:title> <dev:code>Get-Help Format-Table -Online</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 6: Display help about the help system --------</maml:title> <dev:code>Get-Help</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 7: Display available help articles ----------</maml:title> <dev:code>Get-Help *</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 8: Display a list of conceptual articles -------</maml:title> <dev:code>Get-Help about_*</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 9: Search for a word in cmdlet help ---------</maml:title> <dev:code>Get-Help Add-Member -Full | Out-String -Stream | Select-String -Pattern Clixml the Export-Clixml cmdlet to save the instance of the object, including the additional members... can use the Import-Clixml cmdlet to re-create the instance of the object from the information... Export-Clixml Import-Clixml</dev:code> <dev:remarks> <maml:para>`Get-Help` uses the Full parameter to get help information for `Add-Member`. The MamlCommandHelpInfo object is sent down the pipeline. `Out-String` uses the Stream parameter to convert the object into a string. `Select-String` uses the Pattern parameter to search the string for Clixml .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 10: Display a list of articles that include a word --</maml:title> <dev:code>Get-Help -Name remoting Name Category Module Synopsis ---- -------- ------ -------- Install-PowerShellRemoting.ps1 External Install-PowerShellRemoting.ps1 Disable-PSRemoting Cmdlet Microsoft.PowerShell.Core Prevents remote users... Enable-PSRemoting Cmdlet Microsoft.PowerShell.Core Configures the computer...</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 11: Display provider-specific help ----------</maml:title> <dev:code>Get-Help Get-Item -Path SQLSERVER:\DataCollection NAME Get-Item SYNOPSIS Gets a collection of Server objects for the local computer and any computers to which you have made a SQL Server PowerShell connection. ... Set-Location SQLSERVER:\DataCollection SQLSERVER:\DataCollection> Get-Help Get-Item NAME Get-Item SYNOPSIS Gets a collection of Server objects for the local computer and any computers to which you have made a SQL Server PowerShell connection. ...</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 12: Display help for a script ------------</maml:title> <dev:code>Get-Help -Name C:\PS-Test\MyScript.ps1</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-help?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Command_Syntax</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Comment_Based_Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Supporting Updatable Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Update-Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Writing Comment-Based Help Topics</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Writing Help for PowerShell Cmdlets</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-History</command:name> <command:verb>Get</command:verb> <command:noun>History</command:noun> <maml:description> <maml:para>Gets a list of the commands entered during the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-History` cmdlet gets the session history, that is, the list of commands entered during the current session.</maml:para> <maml:para>PowerShell automatically maintains a history of each session. The number of entries in the session history is determined by the value of the `$MaximumHistoryCount` preference variable. Beginning in Windows PowerShell 3.0, the default value is `4096`. By default, history files are saved in the home directory, but you can save the file in any location. For more information about the history features in PowerShell, see about_History (About/about_History.md).</maml:para> <maml:para>The session history is managed separately from the history maintained by the PSReadLine module. Both histories are available in sessions where PSReadLine is loaded. This cmdlet only works with the session history. For more information see, about_PSReadLine (../PSReadLine/About/about_PSReadLine.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-History</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of the IDs of entries in the session history. `Get-History` gets only specified entries. If you use both the Id and Count parameters in a command, `Get-History` gets the most recent entries ending with the entry specified by the Id parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int64[]</command:parameterValue> <dev:type> <maml:name>System.Int64[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Count</maml:name> <maml:Description> <maml:para>Specifies the number of the most recent history entries that this cmdlet gets. By, default, `Get-History` gets all entries in the session history. If you use both the Count and Id parameters in a command, the display ends with the command that is specified by the Id parameter.</maml:para> <maml:para>In Windows PowerShell 2.0, by default, `Get-History` gets the 32 most recent entries.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Count</maml:name> <maml:Description> <maml:para>Specifies the number of the most recent history entries that this cmdlet gets. By, default, `Get-History` gets all entries in the session history. If you use both the Count and Id parameters in a command, the display ends with the command that is specified by the Id parameter.</maml:para> <maml:para>In Windows PowerShell 2.0, by default, `Get-History` gets the 32 most recent entries.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of the IDs of entries in the session history. `Get-History` gets only specified entries. If you use both the Id and Count parameters in a command, `Get-History` gets the most recent entries ending with the entry specified by the Id parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int64[]</command:parameterValue> <dev:type> <maml:name>System.Int64[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Int64</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a history ID to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.HistoryInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a history object for each history item that it gets.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The session history is a list of the commands entered during the session. The session history represents the run order, the status, and the start and end times of the command. As you enter each command, PowerShell adds it to the history so that you can reuse it. For more information about the command history, see about_History (About/about_History.md).</maml:para> <maml:para>Starting in Windows PowerShell 3.0, the default value of the `$MaximumHistoryCount` preference variable is `4096`. In Windows PowerShell 2.0, the default value is `64`. For more information about the `$MaximumHistoryCount` variable, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------- Example 1: Get the session history --------------</maml:title> <dev:code>Get-History</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 2: Get entries that include a string ---------</maml:title> <dev:code>Get-History | Where-Object {$_.CommandLine -like "*Service*"}</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 3: Export at most seven entries -----------</maml:title> <dev:code>Get-History -ID 7 -Count 5 | Export-Csv History.csv</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 4: Display the most recent command ----------</maml:title> <dev:code>Get-History -Count 1</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: Display all the properties of the entries in the history</maml:title> <dev:code>Get-History | Format-List -Property *</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-history?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Add-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-Job</command:name> <command:verb>Get</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Gets PowerShell background jobs that are running in the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Get-Job cmdlet gets objects that represent the background jobs that were started in the current session. You can use Get-Job to get jobs that were started by using the Start-Job cmdlet, or by using the AsJob parameter of any cmdlet.</maml:para> <maml:para>Without parameters, a Get-Job command gets all jobs in the current session. You can use the parameters of Get-Job to get particular jobs.</maml:para> <maml:para>The job object that Get-Job returns contains useful information about the job, but it does not contain the job results. To get the results, use the Receive-Job cmdlet.</maml:para> <maml:para>A Windows PowerShell background job is a command that runs in the background without interacting with the current session. Typically, you use a background job to run a complex command that takes a long time to finish. For more information about background jobs in Windows PowerShell, see about_Jobs.</maml:para> <maml:para>Beginning in Windows PowerShell 3.0, the Get-Job cmdlet also gets custom job types, such as workflow jobs and instances of scheduled jobs. To find the job type of a job, use the PSJobTypeName property of the job.</maml:para> <maml:para>To enable Get-Job to get a custom job type, import the module that supports the custom job type into the session before you run a Get-Job command, either by using the Import-Module cmdlet or by using or getting a cmdlet in the module. For information about a particular custom job type, see the documentation of the custom job type feature.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-Job</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of jobs that this cmdlet gets.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and to type than the instance ID, but it is unique only in the current session. You can type one or more IDs separated by commas. To find the ID of a job, type `Get-Job` without parameters.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>After</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended after the specified date and time. Enter a DateTime object, such as one returned by the Get-Date cmdlet or a string that can be converted to a DateTime object, such as `Dec 1, 2012 2:00 AM` or `11/06`.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Before</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended before the specified date and time. Enter a DateTime object.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ChildJobState</maml:name> <maml:Description> <maml:para>Gets only the child jobs that have the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job does not get child jobs. By using the IncludeChildJob parameter, Get-Job gets all child jobs. If you use the ChildJobState parameter, the IncludeChildJob parameter has no effect.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HasMoreData</maml:name> <maml:Description> <maml:para>Indicates whether this cmdlet gets only jobs that have the specified HasMoreData property value. The HasMoreData property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of $True. To get jobs that do not have more results, specify a value of $False.</maml:para> <maml:para>To get the results of a job, use the Receive-Job cmdlet.</maml:para> <maml:para>When you use the Receive-Job cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it sets the value of the HasMoreData property of the job to $False) to indicate that it has no more results for the job in the current session. Use the Keep parameter of Receive-Job to prevent Receive-Job from deleting results and changing the value of the HasMoreData property. For more information, type `Get-Help Receive-Job`.</maml:para> <maml:para>The HasMoreData property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the Receive-Job cmdlet in a different session to get the job results again, even if the value of HasMoreData is $False. For more information, see the help topics for the custom job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Boolean</command:parameterValue> <dev:type> <maml:name>System.Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludeChildJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns child jobs, in addition to parent jobs.</maml:para> <maml:para>This parameter is especially useful for investigating workflow jobs, for which Get-Job returns a container parent job, and job failures, because the reason for the failure is saved in a property of the child job.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>Specifies a number of jobs to get. This cmdlet gets the jobs that ended most recently.</maml:para> <maml:para>The Newest parameter does not sort or return the newest jobs in end-time order. To sort the output, use the Sort-Object cmdlet.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Job</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>After</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended after the specified date and time. Enter a DateTime object, such as one returned by the Get-Date cmdlet or a string that can be converted to a DateTime object, such as `Dec 1, 2012 2:00 AM` or `11/06`.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Before</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended before the specified date and time. Enter a DateTime object.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ChildJobState</maml:name> <maml:Description> <maml:para>Gets only the child jobs that have the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job does not get child jobs. By using the IncludeChildJob parameter, Get-Job gets all child jobs. If you use the ChildJobState parameter, the IncludeChildJob parameter has no effect.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Command</maml:name> <maml:Description> <maml:para>Specifies an array of commands as strings. This cmdlet gets the jobs that include the specified commands. The default is all jobs. You can use wildcard characters to specify a command pattern.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HasMoreData</maml:name> <maml:Description> <maml:para>Indicates whether this cmdlet gets only jobs that have the specified HasMoreData property value. The HasMoreData property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of $True. To get jobs that do not have more results, specify a value of $False.</maml:para> <maml:para>To get the results of a job, use the Receive-Job cmdlet.</maml:para> <maml:para>When you use the Receive-Job cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it sets the value of the HasMoreData property of the job to $False) to indicate that it has no more results for the job in the current session. Use the Keep parameter of Receive-Job to prevent Receive-Job from deleting results and changing the value of the HasMoreData property. For more information, type `Get-Help Receive-Job`.</maml:para> <maml:para>The HasMoreData property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the Receive-Job cmdlet in a different session to get the job results again, even if the value of HasMoreData is $False. For more information, see the help topics for the custom job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Boolean</command:parameterValue> <dev:type> <maml:name>System.Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludeChildJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns child jobs, in addition to parent jobs.</maml:para> <maml:para>This parameter is especially useful for investigating workflow jobs, for which Get-Job returns a container parent job, and job failures, because the reason for the failure is saved in a property of the child job.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>Specifies a number of jobs to get. This cmdlet gets the jobs that ended most recently.</maml:para> <maml:para>The Newest parameter does not sort or return the newest jobs in end-time order. To sort the output, use the Sort-Object cmdlet.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of jobs that this cmdlet gets. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>After</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended after the specified date and time. Enter a DateTime object, such as one returned by the Get-Date cmdlet or a string that can be converted to a DateTime object, such as `Dec 1, 2012 2:00 AM` or `11/06`.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Before</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended before the specified date and time. Enter a DateTime object.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ChildJobState</maml:name> <maml:Description> <maml:para>Gets only the child jobs that have the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job does not get child jobs. By using the IncludeChildJob parameter, Get-Job gets all child jobs. If you use the ChildJobState parameter, the IncludeChildJob parameter has no effect.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HasMoreData</maml:name> <maml:Description> <maml:para>Indicates whether this cmdlet gets only jobs that have the specified HasMoreData property value. The HasMoreData property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of $True. To get jobs that do not have more results, specify a value of $False.</maml:para> <maml:para>To get the results of a job, use the Receive-Job cmdlet.</maml:para> <maml:para>When you use the Receive-Job cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it sets the value of the HasMoreData property of the job to $False) to indicate that it has no more results for the job in the current session. Use the Keep parameter of Receive-Job to prevent Receive-Job from deleting results and changing the value of the HasMoreData property. For more information, type `Get-Help Receive-Job`.</maml:para> <maml:para>The HasMoreData property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the Receive-Job cmdlet in a different session to get the job results again, even if the value of HasMoreData is $False. For more information, see the help topics for the custom job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Boolean</command:parameterValue> <dev:type> <maml:name>System.Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludeChildJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns child jobs, in addition to parent jobs.</maml:para> <maml:para>This parameter is especially useful for investigating workflow jobs, for which Get-Job returns a container parent job, and job failures, because the reason for the failure is saved in a property of the child job.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>Specifies a number of jobs to get. This cmdlet gets the jobs that ended most recently.</maml:para> <maml:para>The Newest parameter does not sort or return the newest jobs in end-time order. To sort the output, use the Sort-Object cmdlet.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of instance friendly names of jobs that this cmdlet gets. Enter a job name, or use wildcard characters to enter a job name pattern. By default, Get-Job gets all jobs in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>After</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended after the specified date and time. Enter a DateTime object, such as one returned by the Get-Date cmdlet or a string that can be converted to a DateTime object, such as `Dec 1, 2012 2:00 AM` or `11/06`.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Before</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended before the specified date and time. Enter a DateTime object.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ChildJobState</maml:name> <maml:Description> <maml:para>Gets only the child jobs that have the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job does not get child jobs. By using the IncludeChildJob parameter, Get-Job gets all child jobs. If you use the ChildJobState parameter, the IncludeChildJob parameter has no effect.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HasMoreData</maml:name> <maml:Description> <maml:para>Indicates whether this cmdlet gets only jobs that have the specified HasMoreData property value. The HasMoreData property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of $True. To get jobs that do not have more results, specify a value of $False.</maml:para> <maml:para>To get the results of a job, use the Receive-Job cmdlet.</maml:para> <maml:para>When you use the Receive-Job cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it sets the value of the HasMoreData property of the job to $False) to indicate that it has no more results for the job in the current session. Use the Keep parameter of Receive-Job to prevent Receive-Job from deleting results and changing the value of the HasMoreData property. For more information, type `Get-Help Receive-Job`.</maml:para> <maml:para>The HasMoreData property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the Receive-Job cmdlet in a different session to get the job results again, even if the value of HasMoreData is $False. For more information, see the help topics for the custom job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Boolean</command:parameterValue> <dev:type> <maml:name>System.Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludeChildJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns child jobs, in addition to parent jobs.</maml:para> <maml:para>This parameter is especially useful for investigating workflow jobs, for which Get-Job returns a container parent job, and job failures, because the reason for the failure is saved in a property of the child job.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>Specifies a number of jobs to get. This cmdlet gets the jobs that ended most recently.</maml:para> <maml:para>The Newest parameter does not sort or return the newest jobs in end-time order. To sort the output, use the Sort-Object cmdlet.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet gets only jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job gets all the jobs in the current session.</maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>After</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended after the specified date and time. Enter a DateTime object, such as one returned by the Get-Date cmdlet or a string that can be converted to a DateTime object, such as `Dec 1, 2012 2:00 AM` or `11/06`.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Before</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended before the specified date and time. Enter a DateTime object.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ChildJobState</maml:name> <maml:Description> <maml:para>Gets only the child jobs that have the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job does not get child jobs. By using the IncludeChildJob parameter, Get-Job gets all child jobs. If you use the ChildJobState parameter, the IncludeChildJob parameter has no effect.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HasMoreData</maml:name> <maml:Description> <maml:para>Indicates whether this cmdlet gets only jobs that have the specified HasMoreData property value. The HasMoreData property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of $True. To get jobs that do not have more results, specify a value of $False.</maml:para> <maml:para>To get the results of a job, use the Receive-Job cmdlet.</maml:para> <maml:para>When you use the Receive-Job cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it sets the value of the HasMoreData property of the job to $False) to indicate that it has no more results for the job in the current session. Use the Keep parameter of Receive-Job to prevent Receive-Job from deleting results and changing the value of the HasMoreData property. For more information, type `Get-Help Receive-Job`.</maml:para> <maml:para>The HasMoreData property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the Receive-Job cmdlet in a different session to get the job results again, even if the value of HasMoreData is $False. For more information, see the help topics for the custom job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Boolean</command:parameterValue> <dev:type> <maml:name>System.Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludeChildJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns child jobs, in addition to parent jobs.</maml:para> <maml:para>This parameter is especially useful for investigating workflow jobs, for which Get-Job returns a container parent job, and job failures, because the reason for the failure is saved in a property of the child job.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>Specifies a number of jobs to get. This cmdlet gets the jobs that ended most recently.</maml:para> <maml:para>The Newest parameter does not sort or return the newest jobs in end-time order. To sort the output, use the Sort-Object cmdlet.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet gets jobs that satisfy all of the conditions. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>After</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended after the specified date and time. Enter a DateTime object, such as one returned by the Get-Date cmdlet or a string that can be converted to a DateTime object, such as `Dec 1, 2012 2:00 AM` or `11/06`.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Before</maml:name> <maml:Description> <maml:para>Gets completed jobs that ended before the specified date and time. Enter a DateTime object.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs, that have an EndTime property. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.DateTime</command:parameterValue> <dev:type> <maml:name>System.DateTime</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ChildJobState</maml:name> <maml:Description> <maml:para>Gets only the child jobs that have the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job does not get child jobs. By using the IncludeChildJob parameter, Get-Job gets all child jobs. If you use the ChildJobState parameter, the IncludeChildJob parameter has no effect.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Command</maml:name> <maml:Description> <maml:para>Specifies an array of commands as strings. This cmdlet gets the jobs that include the specified commands. The default is all jobs. You can use wildcard characters to specify a command pattern.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet gets jobs that satisfy all of the conditions. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HasMoreData</maml:name> <maml:Description> <maml:para>Indicates whether this cmdlet gets only jobs that have the specified HasMoreData property value. The HasMoreData property indicates whether all job results have been received in the current session. To get jobs that have more results, specify a value of $True. To get jobs that do not have more results, specify a value of $False.</maml:para> <maml:para>To get the results of a job, use the Receive-Job cmdlet.</maml:para> <maml:para>When you use the Receive-Job cmdlet, it deletes from its in-memory, session-specific storage the results that it returned. When it has returned all results of the job in the current session, it sets the value of the HasMoreData property of the job to $False) to indicate that it has no more results for the job in the current session. Use the Keep parameter of Receive-Job to prevent Receive-Job from deleting results and changing the value of the HasMoreData property. For more information, type `Get-Help Receive-Job`.</maml:para> <maml:para>The HasMoreData property is specific to the current session. If results for a custom job type are saved outside of the session, such as the scheduled job type, which saves job results on disk, you can use the Receive-Job cmdlet in a different session to get the job results again, even if the value of HasMoreData is $False. For more information, see the help topics for the custom job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Boolean</command:parameterValue> <dev:type> <maml:name>System.Boolean</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of jobs that this cmdlet gets.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and to type than the instance ID, but it is unique only in the current session. You can type one or more IDs separated by commas. To find the ID of a job, type `Get-Job` without parameters.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludeChildJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns child jobs, in addition to parent jobs.</maml:para> <maml:para>This parameter is especially useful for investigating workflow jobs, for which Get-Job returns a container parent job, and job failures, because the reason for the failure is saved in a property of the child job.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of jobs that this cmdlet gets. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of instance friendly names of jobs that this cmdlet gets. Enter a job name, or use wildcard characters to enter a job name pattern. By default, Get-Job gets all jobs in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Newest</maml:name> <maml:Description> <maml:para>Specifies a number of jobs to get. This cmdlet gets the jobs that ended most recently.</maml:para> <maml:para>The Newest parameter does not sort or return the newest jobs in end-time order. To sort the output, use the Sort-Object cmdlet.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet gets only jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>By default, Get-Job gets all the jobs in the current session.</maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.RemotingJob</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns objects that represent the jobs in the session.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The PSJobTypeName * property of jobs indicates the job type of the job. The property value is determined by the job type author. The following list shows common job types.</maml:para> <maml:para> - BackgroundJob . Local job started by using Start-Job .</maml:para> <maml:para> - RemoteJob . Job started in a PSSession by using the AsJob parameter of the Invoke-Command cmdlet.</maml:para> <maml:para> - PSWorkflowJob . Job started by using the AsJob common parameter of workflows.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Get all background jobs started in the current session</maml:title> <dev:code>PS C:\> Get-Job</dev:code> <dev:remarks> <maml:para>This command gets all background jobs started in the current session. It does not include jobs created in other sessions, even if the jobs run on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 2: Stop a job by using an instance ID --------</maml:title> <dev:code>The first command uses the **Get-Job** cmdlet to get a job. It uses the *Name* parameter to identify the job. The command stores the job object that **Get-Job** returns in the $j variable. In this example, there is only one job with the specified name. PS C:\> $j = Get-Job -Name Job1 The second command gets the **InstanceId** property of the object in the $j variable and stores it in the $ID variable. PS C:\> $ID = $j.InstanceID The third command displays the value of the $ID variable. PS C:\> $ID Guid ---- 03c3232e-1d23-453b-a6f4-ed73c9e29d55 The fourth command uses Stop-Job cmdlet to stop the job. It uses the *InstanceId* parameter to identify the job and $ID variable to represent the instance ID of the job. PS C:\> Stop-Job -InstanceId $ID</dev:code> <dev:remarks> <maml:para>These commands show how to get the instance ID of a job and then use it to stop a job. Unlike the name of a job, which is not unique, the instance ID is unique.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 3: Get jobs that include a specific command -----</maml:title> <dev:code>PS C:\> Get-Job -Command "*get-process*"</dev:code> <dev:remarks> <maml:para>This command gets the jobs on the system that include a Get-Process command. The command uses the Command parameter of Get-Job to limit the jobs retrieved. The command uses wildcard characters ( ) to get jobs that include a Get-Process * command anywhere in the command string.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Get jobs that include a specific command by using the pipeline</maml:title> <dev:code>PS C:\> "*get-process*" | Get-Job</dev:code> <dev:remarks> <maml:para>Like the command in the previous example, this command gets the jobs on the system that include a Get-Process command. The command uses a pipeline operator (|) to send a string, in quotation marks, to the Get-Job cmdlet. It is the equivalent of the previous command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 5: Get jobs that have not been started --------</maml:title> <dev:code>PS C:\> Get-Job -State NotStarted</dev:code> <dev:remarks> <maml:para>This command gets only those jobs that have been created but have not yet been started. This includes jobs that are scheduled to run in the future and those not yet scheduled.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 6: Get jobs that have not been assigned a name ----</maml:title> <dev:code>PS C:\> Get-Job -Name Job*</dev:code> <dev:remarks> <maml:para>This command gets all jobs that have job names that begin with job. Because job<number> is the default name for a job, this command gets all jobs that do not have an explicitly assigned name.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title> Example 7: Use a job object to represent the job in a command </maml:title> <dev:code>The first command uses the **Start-Job** cmdlet to start a background job that runs a **Get-Process** command on the local computer. The command uses the *Name* parameter of **Start-Job** to assign a friendly name to the job. PS C:\> Start-Job -ScriptBlock {Get-Process} -Name MyJob The second command uses Get-Job to get the job. It uses the *Name* parameter of **Get-Job** to identify the job. The command saves the resulting job object in the $j variable. PS C:\> $j = Get-Job -Name MyJob The third command displays the value of the job object in the $j variable. The value of the **State** property shows that the job is completed. The value of the **HasMoreData** property shows that there are results available from the job that have not yet been retrieved. PS C:\> $j Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 6 MyJob BackgroundJob Completed True localhost Get-Process The fourth command uses the **Receive-Job** cmdlet to get the results of the job. It uses the job object in the $j variable to represent the job. You can also use a pipeline operator to send a job object to **Receive-Job**. PS C:\> Receive-Job -Job $j Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 124 4 13572 12080 59 1140 audiodg 783 16 11428 13636 100 548 CcmExec 96 4 4252 3764 59 3856 ccmsetup ...</dev:code> <dev:remarks> <maml:para>This example shows how to use Get-Job to get a job object, and then it shows how to use the job object to represent the job in a command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 8: Get all jobs including jobs started by a different method</maml:title> <dev:code>The first command uses the **Start-Job** cmdlet to start a job on the local computer. PS C:\> Start-Job -ScriptBlock {Get-EventLog System} The second command uses the *AsJob* parameter of the **Invoke-Command** cmdlet to start a job on the S1 computer. Even though the commands in the job run on the remote computer, the job object is created on the local computer, so you use local commands to manage the job. PS C:\> Invoke-Command -ComputerName S1 -ScriptBlock {Get-EventLog System} -AsJob The third command uses the **Invoke-Command** cmdlet to run a **Start-Job** command on the S2 computer. By using this method, the job object is created on the remote computer, so you use remote commands to manage the job. PS C:\> Invoke-Command -ComputerName S2 -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog System}} The fourth command uses **Get-Job** to get the jobs stored on the local computer. The **PSJobTypeName** property of jobs, introduced in Windows PowerShell 3.0, shows that the local job started by using the **Start-Job** cmdlet is a background job and the job started in a remote session by using the **Invoke-Command** cmdlet is a remote job. PS C:\> Get-Job Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 1 Job1 BackgroundJob Running True localhost Get-EventLog System 2 Job2 RemoteJob Running True S1 Get-EventLog System The fifth command uses **Invoke-Command** to run a **Get-Job** command on the S2 computer.The sample output shows the results of the Get-Job command. On the S2 computer, the job appears to be a local job. The computer name is localhost and the job type is a background job.For more information about how to run background jobs on remote computers, see about_Remote_Jobs. PS C:\> Invoke-Command -ComputerName S2 -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog System}} Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- ------- ------- 4 Job4 BackgroundJob Running True localhost Get-Eventlog System</dev:code> <dev:remarks> <maml:para>This example demonstrates that the Get-Job cmdlet can get all of the jobs that were started in the current session, even if they were started by using different methods.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 9: Investigate a failed job -------------</maml:title> <dev:code>The first command uses the **Start-Job** cmdlet to start a job on the local computer. The job object that **Start-Job** returns shows that the job failed. The value of the **State** property is Failed. PS C:\> Start-Job -ScriptBlock {Get-Process} Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 1 Job1 BackgroundJob Failed False localhost Get-Process The second command uses the **Get-Job** cmdlet to get the job. The command uses the dot method to get the value of the **JobStateInfo** property of the object. It uses a pipeline operator to send the object in the **JobStateInfo** property to the Format-List cmdlet, which formats all of the properties of the object (*) in a list.The result of the **Format-List** command shows that the value of the **Reason** property of the job is blank. PS C:\> (Get-Job).JobStateInfo | Format-List -Property * State : Failed Reason : The third command investigates more. It uses a **Get-Job** command to get the job and then uses a pipeline operator to send the whole job object to the **Format-List** cmdlet, which displays all of the properties of the job in a list.The display of all properties in the job object shows that the job contains a child job named Job2. PS C:\> Get-Job | Format-List -Property * HasMoreData : False StatusMessage : Location : localhost Command : get-process JobStateInfo : Failed Finished : System.Threading.ManualReset EventInstanceId : fb792295-1318-4f5d-8ac8-8a89c5261507 Id : 1 Name : Job1 ChildJobs : {Job2} Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} StateChanged : The fourth command uses **Get-Job** to get the job object that represents the Job2 child job. This is the job in which the command actually ran. It uses the dot method to get the **Reason** property of the **JobStateInfo** property.The result shows that the job failed because of an Access Denied error. In this case, the user forgot to use the Run as administrator option when starting Windows PowerShell.Because background jobs use the remoting features of Windows PowerShell, the computer must be configured for remoting to run a job, even when the job runs on the local computer.For information about requirements for remoting in Windows PowerShell, see about_Remote_Requirements. For troubleshooting tips, see about_Remote_Troubleshooting. PS C:\> (Get-Job -Name job2).JobStateInfo.Reason Connecting to remote server using WSManCreateShellEx api failed. The async callback gave the following error message: Access is denied.</dev:code> <dev:remarks> <maml:para>This command shows how to use the job object that Get-Job returns to investigate why a job failed. It also shows how to get the child jobs of each job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------- Example 10: Get filtered results ---------------</maml:title> <dev:code>The first command uses the **Workflow** keyword to create the WFProcess workflow. PS C:\> Workflow WFProcess {Get-Process} The second command uses the *AsJob* parameter of the WFProcess workflow to run the workflow as a background job. It uses the *JobName* parameter of the workflow to specify a name for the job, and the *PSPrivateMetadata* parameter of the workflow to specify a custom ID. PS C:\> WFProcess -AsJob -JobName WFProcessJob -PSPrivateMetadata @{MyCustomId = 92107} The third command uses the *Filter* parameter of **Get-Job** to get the job by custom ID that was specified in the *PSPrivateMetadata* parameter. PS C:\> Get-Job -Filter @{MyCustomId = 92107} Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 1 WFProcessJob Completed True localhost WFProcess</dev:code> <dev:remarks> <maml:para>This example shows how to use the Filter parameter to get a workflow job. The Filter parameter, introduced in Windows PowerShell 3.0 is valid only on custom job types, such as workflow jobs and scheduled jobs.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 11: Get information about child jobs ---------</maml:title> <dev:code>The first command gets the jobs in the current session. The output includes a background job, a remote job and several instances of a scheduled job. The remote job, Job4, appears to have failed. PS C:\> Get-Job Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1 4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1 7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help The second command uses the *IncludeChildJob* parameter of **Get-Job**. The output adds the child jobs of all jobs that have child jobs.In this case, the revised output shows that only the Job5 child job of Job4 failed. PS C:\> Get-Job -IncludeChildJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1 3 Job3 Completed True localhost .\Get-Archive.ps1 4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1 5 Job5 Failed False Server01 .\Get-Archive.ps1 6 Job6 Completed True Server02 .\Get-Archive.ps1 7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help The third command uses the *ChildJobState* parameter with a value of Failed.The output includes all parent jobs and only the child jobs that failed. PS C:\> Get-Job -Name Job4 -ChildJobState Failed Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 2 Job2 BackgroundJob Completed True localhost .\Get-Archive.ps1 4 Job4 RemoteJob Failed True Server01, Server02 .\Get-Archive.ps1 5 Job5 Failed False Server01 .\Get-Archive.ps1 7 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 8 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 9 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help 10 UpdateHelpJob PSScheduledJob Completed True localhost Update-Help The fifth command uses the **JobStateInfo** property of jobs and its **Reason** property to discover why Job5 failed. PS C:\> (Get-Job -Name Job5).JobStateInfo.Reason Connecting to remote server Server01 failed with the following error message: Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.</dev:code> <dev:remarks> <maml:para>This example shows the effect of using the IncludeChildJob and ChildJobState parameters of the Get-Job cmdlet.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Job_Details</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Scheduled_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-Module</command:name> <command:verb>Get</command:verb> <command:noun>Module</command:noun> <maml:description> <maml:para>Gets the modules that have been imported or that can be imported into the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-Module` cmdlet gets the PowerShell modules that have been imported, or that can be imported, into a PowerShell session. The module object that `Get-Module` returns contains valuable information about the module. You can also pipe the module objects to other cmdlets, such as the `Import-Module` and `Remove-Module` cmdlets.</maml:para> <maml:para>Without parameters, `Get-Module` gets modules that have been imported into the current session. To get all installed modules, specify the ListAvailable parameter.</maml:para> <maml:para>`Get-Module` gets modules, but it does not import them. Starting in Windows PowerShell 3.0, modules are automatically imported when you use a command in the module, but a `Get-Module` command does not trigger an automatic import. You can also import the modules into your session by using the `Import-Module` cmdlet.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, you can get and then, import modules from remote sessions into the local session. This strategy uses the Implicit Remoting feature of PowerShell and is equivalent to using the `Import-PSSession` cmdlet. When you use commands in modules imported from another session, the commands run implicitly in the remote session. This feature lets you manage the remote computer from the local session.</maml:para> <maml:para>Also, starting in Windows PowerShell 3.0, you can use `Get-Module` and `Import-Module` to get and import Common Information Model (CIM) modules, in which the cmdlets are defined in Cmdlet Definition XML (CDXML) files. This feature lets you use cmdlets that are implemented in non-managed code assemblies, such as those written in C++.</maml:para> <maml:para>With these new features, the `Get-Module` and `Import-Module` cmdlets become primary tools for managing heterogeneous enterprises that include computers that run the Windows operating system and computers that run other operating systems.</maml:para> <maml:para>To manage remote computers that run the Windows operating system that have PowerShell and PowerShell remoting enabled, create a PSSession on the remote computer and then use the PSSession parameter of `Get-Module` to get the PowerShell modules in the PSSession . When you import the modules, and then use the imported commands in the current session, the commands run implicitly in the PSSession on the remote computer. You can use this strategy to manage the remote computer.</maml:para> <maml:para>You can use a similar strategy to manage computers that do not have PowerShell remoting enabled. These include computers that are not running the Windows operating system, and computers that have PowerShell but do not have PowerShell remoting enabled.</maml:para> <maml:para>Start by creating a CIM session on the remote computer. A CIM session is a connection to Windows Management Instrumentation (WMI) on the remote computer. Then use the CIMSession parameter of `Get-Module` to get CIM modules from the CIM session. When you import a CIM module by using the `Import-Module` cmdlet and then run the imported commands, the commands run implicitly on the remote computer. You can use this WMI and CIM strategy to manage the remote computer.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-Module</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies names or name patterns of modules that this cmdlet gets. Wildcard characters are permitted. You can also pipe the names to `Get-Module`. You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter. Name cannot accept a module GUID as a value. To return modules by specifying a GUID, use FullyQualifiedName instead.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>All</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all modules in each module folder, including nested modules, manifest (.psd1) files, script module (.psm1) files, and binary module (.dll) files. Without this parameter, `Get-Module` gets only the default module in each module folder.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies names of modules in the form of ModuleSpecification objects. These objects are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedName parameter accepts a module name that is specified in the following formats:</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"}</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"} ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Module</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies names or name patterns of modules that this cmdlet gets. Wildcard characters are permitted. You can also pipe the names to `Get-Module`. You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter. Name cannot accept a module GUID as a value. To return modules by specifying a GUID, use FullyQualifiedName instead.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>All</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all modules in each module folder, including nested modules, manifest (.psd1) files, script module (.psm1) files, and binary module (.dll) files. Without this parameter, `Get-Module` gets only the default module in each module folder.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies names of modules in the form of ModuleSpecification objects. These objects are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedName parameter accepts a module name that is specified in the following formats:</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"}</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"} ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ListAvailable</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all installed modules. `Get-Module` gets modules in paths listed in the PSModulePath environment variable. Without this parameter, `Get-Module` gets only the modules that are both listed in the PSModulePath environment variable, and that are loaded in the current session. ListAvailable does not return information about modules that are not found in the PSModulePath environment variable, even if those modules are loaded in the current session.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSEdition</maml:name> <maml:Description> <maml:para>Gets the modules that support specified edition of PowerShell.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Desktop</maml:para> <maml:para>- Core</maml:para> <maml:para></maml:para> <maml:para>The Get-Module cmdlet checks CompatiblePSEditions property of PSModuleInfo object for the specified value and returns only those modules that have it set.</maml:para> <maml:para>> [!NOTE] > > - Desktop Edition: Built on .NET Framework and provides compatibility with scripts and modules > targeting versions of PowerShell running on full footprint editions of Windows such as Server Core > and Windows Desktop. > - Core Edition: Built on .NET Core and provides compatibility with scripts and modules > targeting versions of PowerShell running on reduced footprint editions of Windows such as Nano > Server and Windows IoT.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Refresh</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet refreshes the cache of installed commands. The command cache is created when the session starts. It enables the `Get-Command` cmdlet to get commands from modules that are not imported into the session.</maml:para> <maml:para>This parameter is designed for development and testing scenarios in which the contents of modules have changed since the session started.</maml:para> <maml:para>When you specify the Refresh parameter in a command, you must specify ListAvailable .</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Module</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies names or name patterns of modules that this cmdlet gets. Wildcard characters are permitted. You can also pipe the names to `Get-Module`. You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter. Name cannot accept a module GUID as a value. To return modules by specifying a GUID, use FullyQualifiedName instead.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimNamespace</maml:name> <maml:Description> <maml:para>Specifies the namespace of an alternate CIM provider that exposes CIM modules. The default value is the namespace of the Module Discovery WMI provider.</maml:para> <maml:para>Use this parameter to get CIM modules from computers and devices that are not running the Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimResourceUri</maml:name> <maml:Description> <maml:para>Specifies an alternate location for CIM modules. The default value is the resource URI of the Module Discovery WMI provider on the remote computer.</maml:para> <maml:para>Use this parameter to get CIM modules from computers and devices that are not running the Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimSession</maml:name> <maml:Description> <maml:para>Specifies a CIM session on the remote computer. Enter a variable that contains the CIM session or a command that gets the CIM session, such as a Get-CimSession (/powershell/module/cimcmdlets/get-cimsession)command.</maml:para> <maml:para>`Get-Module` uses the CIM session connection to get modules from the remote computer. When you import the module by using the `Import-Module` cmdlet and use the commands from the imported module in the current session, the commands actually run on the remote computer.</maml:para> <maml:para>You can use this parameter to get modules from computers and devices that are not running the Windows operating system, and computers that have PowerShell, but do not have PowerShell remoting enabled.</maml:para> <maml:para>The CimSession parameter gets all modules in the CIMSession . However, you can import only CIM-based and Cmdlet Definition XML (CDXML)-based modules.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.Management.Infrastructure.CimSession</command:parameterValue> <dev:type> <maml:name>Microsoft.Management.Infrastructure.CimSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies names of modules in the form of ModuleSpecification objects. These objects are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedName parameter accepts a module name that is specified in the following formats:</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"}</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"} ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ListAvailable</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all installed modules. `Get-Module` gets modules in paths listed in the PSModulePath environment variable. Without this parameter, `Get-Module` gets only the modules that are both listed in the PSModulePath environment variable, and that are loaded in the current session. ListAvailable does not return information about modules that are not found in the PSModulePath environment variable, even if those modules are loaded in the current session.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Refresh</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet refreshes the cache of installed commands. The command cache is created when the session starts. It enables the `Get-Command` cmdlet to get commands from modules that are not imported into the session.</maml:para> <maml:para>This parameter is designed for development and testing scenarios in which the contents of modules have changed since the session started.</maml:para> <maml:para>When you specify the Refresh parameter in a command, you must specify ListAvailable .</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-Module</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies names or name patterns of modules that this cmdlet gets. Wildcard characters are permitted. You can also pipe the names to `Get-Module`. You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter. Name cannot accept a module GUID as a value. To return modules by specifying a GUID, use FullyQualifiedName instead.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies names of modules in the form of ModuleSpecification objects. These objects are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedName parameter accepts a module name that is specified in the following formats:</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"}</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"} ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ListAvailable</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all installed modules. `Get-Module` gets modules in paths listed in the PSModulePath environment variable. Without this parameter, `Get-Module` gets only the modules that are both listed in the PSModulePath environment variable, and that are loaded in the current session. ListAvailable does not return information about modules that are not found in the PSModulePath environment variable, even if those modules are loaded in the current session.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSEdition</maml:name> <maml:Description> <maml:para>Gets the modules that support specified edition of PowerShell.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Desktop</maml:para> <maml:para>- Core</maml:para> <maml:para></maml:para> <maml:para>The Get-Module cmdlet checks CompatiblePSEditions property of PSModuleInfo object for the specified value and returns only those modules that have it set.</maml:para> <maml:para>> [!NOTE] > > - Desktop Edition: Built on .NET Framework and provides compatibility with scripts and modules > targeting versions of PowerShell running on full footprint editions of Windows such as Server Core > and Windows Desktop. > - Core Edition: Built on .NET Core and provides compatibility with scripts and modules > targeting versions of PowerShell running on reduced footprint editions of Windows such as Nano > Server and Windows IoT.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSSession</maml:name> <maml:Description> <maml:para>Gets the modules in the specified user-managed PowerShell session ( PSSession ). Enter a variable that contains the session, a command that gets the session, such as a `Get-PSSession` command, or a command that creates the session, such as a `New-PSSession` command.</maml:para> <maml:para>When the session is connected to a remote computer, you must specify the ListAvailable parameter.</maml:para> <maml:para>A `Get-Module` command that uses the PSSession parameter is equivalent to using the `Invoke-Command` cmdlet to run a `Get-Module -ListAvailable` command in a PSSession .</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Refresh</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet refreshes the cache of installed commands. The command cache is created when the session starts. It enables the `Get-Command` cmdlet to get commands from modules that are not imported into the session.</maml:para> <maml:para>This parameter is designed for development and testing scenarios in which the contents of modules have changed since the session started.</maml:para> <maml:para>When you specify the Refresh parameter in a command, you must specify ListAvailable .</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>All</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all modules in each module folder, including nested modules, manifest (.psd1) files, script module (.psm1) files, and binary module (.dll) files. Without this parameter, `Get-Module` gets only the default module in each module folder.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimNamespace</maml:name> <maml:Description> <maml:para>Specifies the namespace of an alternate CIM provider that exposes CIM modules. The default value is the namespace of the Module Discovery WMI provider.</maml:para> <maml:para>Use this parameter to get CIM modules from computers and devices that are not running the Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimResourceUri</maml:name> <maml:Description> <maml:para>Specifies an alternate location for CIM modules. The default value is the resource URI of the Module Discovery WMI provider on the remote computer.</maml:para> <maml:para>Use this parameter to get CIM modules from computers and devices that are not running the Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimSession</maml:name> <maml:Description> <maml:para>Specifies a CIM session on the remote computer. Enter a variable that contains the CIM session or a command that gets the CIM session, such as a Get-CimSession (/powershell/module/cimcmdlets/get-cimsession)command.</maml:para> <maml:para>`Get-Module` uses the CIM session connection to get modules from the remote computer. When you import the module by using the `Import-Module` cmdlet and use the commands from the imported module in the current session, the commands actually run on the remote computer.</maml:para> <maml:para>You can use this parameter to get modules from computers and devices that are not running the Windows operating system, and computers that have PowerShell, but do not have PowerShell remoting enabled.</maml:para> <maml:para>The CimSession parameter gets all modules in the CIMSession . However, you can import only CIM-based and Cmdlet Definition XML (CDXML)-based modules.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.Management.Infrastructure.CimSession</command:parameterValue> <dev:type> <maml:name>Microsoft.Management.Infrastructure.CimSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies names of modules in the form of ModuleSpecification objects. These objects are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedName parameter accepts a module name that is specified in the following formats:</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"}</maml:para> <maml:para>- @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"} ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ListAvailable</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets all installed modules. `Get-Module` gets modules in paths listed in the PSModulePath environment variable. Without this parameter, `Get-Module` gets only the modules that are both listed in the PSModulePath environment variable, and that are loaded in the current session. ListAvailable does not return information about modules that are not found in the PSModulePath environment variable, even if those modules are loaded in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies names or name patterns of modules that this cmdlet gets. Wildcard characters are permitted. You can also pipe the names to `Get-Module`. You cannot specify the FullyQualifiedName parameter in the same command as a Name parameter. Name cannot accept a module GUID as a value. To return modules by specifying a GUID, use FullyQualifiedName instead.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSEdition</maml:name> <maml:Description> <maml:para>Gets the modules that support specified edition of PowerShell.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Desktop</maml:para> <maml:para>- Core</maml:para> <maml:para></maml:para> <maml:para>The Get-Module cmdlet checks CompatiblePSEditions property of PSModuleInfo object for the specified value and returns only those modules that have it set.</maml:para> <maml:para>> [!NOTE] > > - Desktop Edition: Built on .NET Framework and provides compatibility with scripts and modules > targeting versions of PowerShell running on full footprint editions of Windows such as Server Core > and Windows Desktop. > - Core Edition: Built on .NET Core and provides compatibility with scripts and modules > targeting versions of PowerShell running on reduced footprint editions of Windows such as Nano > Server and Windows IoT.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSSession</maml:name> <maml:Description> <maml:para>Gets the modules in the specified user-managed PowerShell session ( PSSession ). Enter a variable that contains the session, a command that gets the session, such as a `Get-PSSession` command, or a command that creates the session, such as a `New-PSSession` command.</maml:para> <maml:para>When the session is connected to a remote computer, you must specify the ListAvailable parameter.</maml:para> <maml:para>A `Get-Module` command that uses the PSSession parameter is equivalent to using the `Invoke-Command` cmdlet to run a `Get-Module -ListAvailable` command in a PSSession .</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Refresh</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet refreshes the cache of installed commands. The command cache is created when the session starts. It enables the `Get-Command` cmdlet to get commands from modules that are not imported into the session.</maml:para> <maml:para>This parameter is designed for development and testing scenarios in which the contents of modules have changed since the session started.</maml:para> <maml:para>When you specify the Refresh parameter in a command, you must specify ListAvailable .</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe module names to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns objects that represent modules. When you specify the ListAvailable parameter, `Get-Module` returns a ModuleInfoGrouping object, which is a type of PSModuleInfo object that has the same properties and methods.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- Beginning in Windows PowerShell 3.0, the core commands that are included in PowerShell are packaged in modules. The exception is Microsoft.PowerShell.Core , which is a snap-in ( PSSnapin ). By default, only the Microsoft.PowerShell.Core snap-in is added to the session. Modules are imported automatically on first use and you can use the `Import-Module` cmdlet to import them. - Starting in Windows PowerShell 3.0, the core commands that are installed with PowerShell are packaged in modules. In Windows PowerShell 2.0, and in host programs that create older-style sessions in later versions of PowerShell, the core commands are packaged in snap-ins ( PSSnapins ). The exception is Microsoft.PowerShell.Core , which is always a snap-in. Also, remote sessions, such as those started by the `New-PSSession` cmdlet, are older-style sessions that include core snap-ins.</maml:para> <maml:para> For information about the CreateDefault2 method that creates newer-style sessions with core modules, see CreateDefault2 Method (/dotnet/api/system.management.automation.runspaces.initialsessionstate.createdefault2)in the MSDN library.</maml:para> <maml:para>- `Get-Module` only gets modules in locations that are stored in the value of the PSModulePath environment variable ($env:PSModulePath). You can use the Path parameter of the `Import-Module` cmdlet to import modules in other locations, but you cannot use the `Get-Module` cmdlet to get them. - Also, starting in PowerShell 3.0, new properties have been added to the object that `Get-Module` returns that make it easier to learn about modules even before they are imported. All properties are populated before importing. These include the ExportedCommands , ExportedCmdlets and ExportedFunctions properties that list the commands that the module exports. - The ListAvailable parameter gets only well-formed modules, that is, folders that contain at least one file whose base name is the same as the name of the module folder. The base name is the name without the file name extension. Folders that contain files that have different names are considered to be containers, but not modules.</maml:para> <maml:para> To get modules that are implemented as .dll files, but are not enclosed in a module folder, specify both the ListAvailable and All parameters.</maml:para> <maml:para>- To use the CIM session feature, the remote computer must have WS-Management remoting and Windows Management Instrumentation (WMI), which is the Microsoft implementation of the Common Information Model (CIM) standard. The computer must also have the Module Discovery WMI provider or an alternate WMI provider that has the same basic features.</maml:para> <maml:para> You can use the CIM session feature on computers that are not running the Windows operating system and on Windows computers that have PowerShell, but do not have PowerShell remoting enabled.</maml:para> <maml:para> You can also use the CIM parameters to get CIM modules from computers that have PowerShell remoting enabled. This includes the local computer. When you create a CIM session on the local computer, PowerShell uses DCOM, instead of WMI, to create the session.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--- Example 1: Get modules imported into the current session ---</maml:title> <dev:code>Get-Module</dev:code> <dev:remarks> <maml:para>This command gets modules that have been imported into the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 2: Get installed modules and available modules ----</maml:title> <dev:code>Get-Module -ListAvailable</dev:code> <dev:remarks> <maml:para>This command gets the modules that are installed on the computer and can be imported into the current session.</maml:para> <maml:para>`Get-Module` looks for available modules in the path specified by the $env:PSModulePath environment variable. For more information about PSModulePath , see about_Modules (About/about_Modules.md)and about_Environment_Variables (About/about_Environment_Variables.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 3: Get all exported files --------------</maml:title> <dev:code>Get-Module -ListAvailable -All</dev:code> <dev:remarks> <maml:para>This command gets all of the exported files for all available modules.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 4: Get a module by its fully qualified name -----</maml:title> <dev:code>$FullyQualifedName = @{ModuleName="Microsoft.PowerShell.Management";ModuleVersion="3.1.0.0"} Get-Module -FullyQualifiedName $FullyQualifedName | Format-Table -Property Name,Version Name Version ---- ------- Microsoft.PowerShell.Management 3.1.0.0</dev:code> <dev:remarks> <maml:para>This command gets the Microsoft.PowerShell.Management module by specifying the fully qualified name of the module by using the FullyQualifiedName parameter. The command then pipes the results into the `Format-Table` cmdlet to format the results as a table with Name and Version as the column headings.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 5: Get properties of a module ------------</maml:title> <dev:code>Get-Module | Get-Member -MemberType Property | Format-Table Name Name ---- AccessMode Author ClrVersion CompanyName Copyright Definition Description DotNetFrameworkVersion ExportedAliases ExportedCmdlets ExportedCommands ExportedFormatFiles ExportedFunctions ExportedTypeFiles ExportedVariables ExportedWorkflows FileList Guid HelpInfoUri LogPipelineExecutionDetails ModuleBase ModuleList ModuleType Name NestedModules OnRemove Path PowerShellHostName PowerShellHostVersion PowerShellVersion PrivateData ProcessorArchitecture RequiredAssemblies RequiredModules RootModule Scripts SessionState Version</dev:code> <dev:remarks> <maml:para>This command gets the properties of the PSModuleInfo object that `Get-Module` returns. There is one object for each module file.</maml:para> <maml:para>You can use the properties to format and filter the module objects. For more information about the properties, see PSModuleInfo Properties (/dotnet/api/system.management.automation.psmoduleinfo).</maml:para> <maml:para>The output includes the new properties, such as Author and CompanyName , that were introduced in Windows PowerShell 3.0.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 6: Group all modules by name -------------</maml:title> <dev:code>Get-Module -ListAvailable -All | Format-Table -Property Name, Moduletype, Path -Groupby Name Name: AppLocker Name ModuleType Path ---- ---------- ---- AppLocker Manifest C:\Windows\system32\WindowsPowerShell\v1.0\Modules\AppLocker\AppLocker.psd1 Name: Appx Name ModuleType Path ---- ---------- ---- Appx Manifest C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Appx\en-US\Appx.psd1 Appx Manifest C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Appx\Appx.psd1 Appx Script C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Appx\Appx.psm1 Name: BestPractices Name ModuleType Path ---- ---------- ---- BestPractices Manifest C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BestPractices\BestPractices.psd1 Name: BitsTransfer Name ModuleType Path ---- ---------- ---- BitsTransfer Manifest C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\BitsTransfer.psd1</dev:code> <dev:remarks> <maml:para>This command gets all module files, both imported and available, and then groups them by module name. This lets you see the module files that each script is exporting.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 7: Display the contents of a module manifest -----</maml:title> <dev:code># First command $m = Get-Module -list -Name BitsTransfer # Second command Get-Content $m.Path @ { GUID = "{8FA5064B-8479-4c5c-86EA-0D311FE48875}" Author = "Microsoft Corporation" CompanyName = "Microsoft Corporation" Copyright = "Microsoft Corporation. All rights reserved." ModuleVersion = "1.0.0.0" Description = "Windows PowerShell File Transfer Module" PowerShellVersion = "2.0" CLRVersion = "2.0" NestedModules = "Microsoft.BackgroundIntelligentTransfer.Management" FormatsToProcess = "FileTransfer.Format.ps1xml" RequiredAssemblies = Join-Path $psScriptRoot "Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll" }</dev:code> <dev:remarks> <maml:para>The first command gets the PSModuleInfo object that represents BitsTransfer module. It saves the object in the `$m` variable.</maml:para> <maml:para>The second command uses the `Get-Content` cmdlet to get the content of the manifest file in the specified path. It uses dot notation to get the path to the manifest file, which is stored in the Path property of the object. The output shows the contents of the module manifest.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 8: List files in module directory ----------</maml:title> <dev:code>dir (Get-Module -ListAvailable FileTransfer).ModuleBase Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules\FileTransfer Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 12/16/2008 12:36 PM en-US -a--- 11/19/2008 11:30 PM 16184 FileTransfer.Format.ps1xml -a--- 11/20/2008 11:30 PM 1044 FileTransfer.psd1 -a--- 12/16/2008 12:20 AM 108544 Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll</dev:code> <dev:remarks> <maml:para>This command lists the files in the directory of the module. This is another way to determine what is in a module before you import it. Some modules might have help files or ReadMe files that describe the module.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 9: Get modules installed on a computer --------</maml:title> <dev:code>$s = New-PSSession -ComputerName Server01 Get-Module -PSSession $s -ListAvailable</dev:code> <dev:remarks> <maml:para>These commands get the modules that are installed on the Server01 computer.</maml:para> <maml:para>The first command uses the `New-PSSession` cmdlet to create a PSSession on the Server01 computer. The command saves the PSSession in the $s variable.</maml:para> <maml:para>The second command uses the PSSession and ListAvailable parameters of `Get-Module` to get the modules in the PSSession in the $s variable.</maml:para> <maml:para>If you pipe modules from other sessions to the `Import-Module` cmdlet, `Import-Module` imports the module into the current session by using the implicit remoting feature. This is equivalent to using the `Import-PSSession` cmdlet. You can use the cmdlets from the module in the current session, but commands that use these cmdlets actually run the remote session. For more information, see `Import-Module` (Import-Module.md) and [`Import-PSSession`](../Microsoft.PowerShell.Utility/Import-PSSession.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 10: Manage a computer that does not run the Windows operating system</maml:title> <dev:code>$cs = New-CimSession -ComputerName RSDGF03 Get-Module -CimSession $cs -Name Storage | Import-Module Get-Command Get-Disk CommandType Name ModuleName ----------- ---- ---------- Function Get-Disk Storage Get-Disk Number Friendly Name OperationalStatus Total Size Partition Style ------ ------------- ----------------- ---------- --------------- 0 Virtual HD ATA Device Online 40 GB MBR</dev:code> <dev:remarks> <maml:para>The first command uses the `New-CimSession` cmdlet to create a session on the RSDGF03 remote computer. The session connects to WMI on the remote computer. The command saves the CIM session in the `$cs` variable.</maml:para> <maml:para>The second command uses the CIM session in the `$cs` variable to run a `Get-Module` command on the RSDGF03 computer. The command uses the Name parameter to specify the Storage module. The command uses a pipeline operator (|) to send the Storage module to the `Import-Module` cmdlet, which imports it into the local session.</maml:para> <maml:para>The third command runs the `Get-Command` cmdlet on the `Get-Disk` command in the Storage module. When you import a CIM module into the local session, PowerShell converts the CDXML files that represent the CIM module into PowerShell scripts, which appear as functions in the local session.</maml:para> <maml:para>The fourth command runs the `Get-Disk` command. Although the command is typed in the local session, it runs implicitly on the remote computer from which it was imported. The command gets objects from the remote computer and returns them to the local session.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-module?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-CimSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-CimSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Modules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-PSHostProcessInfo</command:name> <command:verb>Get</command:verb> <command:noun>PSHostProcessInfo</command:noun> <maml:description> <maml:para>Gets process information about the PowerShell host.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-PSHostProcessInfo` cmdlet gets information about PowerShell host processes running on the local computer.</maml:para> <maml:para>Beginning in PowerShell 6.2, this cmdlet is supported on non-Windows platforms.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSHostProcessInfo</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSHostProcessInfo</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSHostProcessInfo</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Process</maml:name> <maml:Description> <maml:para>Specifies a process by the process object. The simplest way to use this parameter is to save the results of a `Get-Process` command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Diagnostics.Process[]</command:parameterValue> <dev:type> <maml:name>System.Diagnostics.Process[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies a process by the process ID. To get a process ID, run the `Get-Process` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a process by the process name. To get a process name, run the `Get-Process` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Process</maml:name> <maml:Description> <maml:para>Specifies a process by the process object. The simplest way to use this parameter is to save the results of a `Get-Process` command that returns process that you want to enter in a variable, and then specify the variable as the value of this parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Diagnostics.Process[]</command:parameterValue> <dev:type> <maml:name>System.Diagnostics.Process[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Diagnostics.Process</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a Process object from `Get-Process` to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSHostProcessInfo</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--- 1: Get a list of PowerShell hosts running on the system ---</maml:title> <dev:code>Get-PSHostProcessInfo ProcessName ProcessId AppDomainName MainWindowTitle ----------- --------- ------------- --------------- powershell 14676 DefaultAppDomain Windows PowerShell powershell 5184 DefaultAppDomain Windows PowerShell</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- 2: Get PowerShell host information for a specific process --</maml:title> <dev:code>Get-PSHostProcessInfo -Id 14676 ProcessName ProcessId AppDomainName MainWindowTitle ----------- --------- ------------- --------------- powershell 14676 DefaultAppDomain Windows PowerShell</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-pshostprocessinfo?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Process</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-PSSession</command:name> <command:verb>Get</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Gets the PowerShell sessions on local and remote computers.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-PSSession` cmdlet gets the user-managed PowerShell sessions ( PSSessions ) on local and remote computers.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, sessions are stored on the computers at the remote end of each connection. You can use the ComputerName or ConnectionUri parameters of `Get-PSSession` to get the sessions that connect to the local computer or remote computers, even if they were not created in the current session.</maml:para> <maml:para>Without parameters, `Get-PSSession` gets all sessions that were created in the current session.</maml:para> <maml:para>Use the filtering parameters, including Name , ID , InstanceID , State , ApplicationName , and ConfigurationName to select from among the sessions that `Get-PSSession` returns.</maml:para> <maml:para>Use the remaining parameters to configure the temporary connection in which the `Get-PSSession` command runs when you use the ComputerName or ConnectionUri parameters.</maml:para> <maml:para>NOTE: In Windows PowerShell 2.0, without parameters, `Get-PSSession` gets all sessions that were created in the current session. The ComputerName parameter gets sessions that were created in the current session and connect to the specified computer.</maml:para> <maml:para>For more information about PowerShell sessions, see about_PSSessions (about/about_PSSessions.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the temporary session in which the `Get-PSSession` command runs. The URI must be fully qualified.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ConnectionUri parameter.</maml:para> <maml:para>The format of this string is:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is: `http://localhost:5985/WSMAN`.</maml:para> <maml:para>If you do not specify a ConnectionUri , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values. Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>This parameter gets sessions only from computers that run Windows PowerShell 3.0 or later versions of Windows PowerShell. Earlier versions do not store sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI). By default, PowerShell does not redirect connections.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate credentials for the session in which the `Get-PSSession` command runs.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential.</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>CAUTION: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to create the session in which the `Get-PSSession` command runs. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the PowerShell Cert: drive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command with the permissions of the specified user. Specify a user account that has permission to connect to the remote computer and run a `Get-PSSession` command. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run the `Get-PSSession` command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used. The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the temporary session in which the `Get-PSSession` command runs. The URI must be fully qualified.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ConnectionUri parameter.</maml:para> <maml:para>The format of this string is:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is: `http://localhost:5985/WSMAN`.</maml:para> <maml:para>If you do not specify a ConnectionUri , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values. Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>This parameter gets sessions only from computers that run Windows PowerShell 3.0 or later versions of Windows PowerShell. Earlier versions do not store sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI). By default, PowerShell does not redirect connections.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate credentials for the session in which the `Get-PSSession` command runs.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential.</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>CAUTION: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to create the session in which the `Get-PSSession` command runs. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the PowerShell Cert: drive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command with the permissions of the specified user. Specify a user account that has permission to connect to the remote computer and run a `Get-PSSession` command. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run the `Get-PSSession` command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used. The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. Gets the sessions that connect to the specified computers. Wildcard characters are not permitted. There is no default value.</maml:para> <maml:para>Beginning in Windows PowerShell 3.0, PSSession objects are stored on the computers at the remote end of each connection. To get the sessions on the specified computers, PowerShell creates a temporary connection to each computer and runs a `Get-PSSession` command.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully-qualified domain name of one or more computers. To specify the local computer, type the computer name, localhost, or a dot (.).</maml:para> <maml:para>Note: This parameter gets sessions only from computers that run Windows PowerShell 3.0 or later versions of PowerShell. Earlier versions do not store sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the name of an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, the application name is WSMan: `http://localhost:5985/WSMAN`. The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate credentials for the session in which the `Get-PSSession` command runs.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential.</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>CAUTION: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to create the session in which the `Get-PSSession` command runs. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the PowerShell Cert: drive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command with the permissions of the specified user. Specify a user account that has permission to connect to the remote computer and run a `Get-PSSession` command. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the specified network port that is used for the temporary connection in which the `Get-PSSession` command runs. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Do not use the Port parameter unless you must. The Port set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>5985, 5986</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run the `Get-PSSession` command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used. The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish the connection in which the `Get-PSSession` command runs. By default, SSL is not used. If you use this parameter, but SSL is not available on the port used for the command, the command fails.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. Gets the sessions that connect to the specified computers. Wildcard characters are not permitted. There is no default value.</maml:para> <maml:para>Beginning in Windows PowerShell 3.0, PSSession objects are stored on the computers at the remote end of each connection. To get the sessions on the specified computers, PowerShell creates a temporary connection to each computer and runs a `Get-PSSession` command.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully-qualified domain name of one or more computers. To specify the local computer, type the computer name, localhost, or a dot (.).</maml:para> <maml:para>Note: This parameter gets sessions only from computers that run Windows PowerShell 3.0 or later versions of PowerShell. Earlier versions do not store sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the name of an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, the application name is WSMan: `http://localhost:5985/WSMAN`. The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate credentials for the session in which the `Get-PSSession` command runs.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential.</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>CAUTION: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to create the session in which the `Get-PSSession` command runs. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the PowerShell Cert: drive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command with the permissions of the specified user. Specify a user account that has permission to connect to the remote computer and run a `Get-PSSession` command. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the specified network port that is used for the temporary connection in which the `Get-PSSession` command runs. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Do not use the Port parameter unless you must. The Port set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>5985, 5986</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run the `Get-PSSession` command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used. The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish the connection in which the `Get-PSSession` command runs. By default, SSL is not used. If you use this parameter, but SSL is not available on the port used for the command, the command fails.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet starts an interactive session with each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet starts an interactive session with each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the `Get-VM` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">All</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Opened</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Closed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Broken</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the `Get-VM` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of session IDs. This cmdlet gets only the sessions with the specified IDs. Type one or more IDs, separated by commas, or use the range operator (..) to specify a range of IDs. You cannot use the ID parameter together with the ComputerName parameter.</maml:para> <maml:para>An ID is an integer that uniquely identifies the user-managed sessions in the current session. It is easier to remember and type than the InstanceId , but it is unique only within the current session. The ID of a session is stored in the ID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Get-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI). By default, PowerShell does not redirect connections.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the name of an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, the application name is WSMan: `http://localhost:5985/WSMAN`. The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate credentials for the session in which the `Get-PSSession` command runs.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential.</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.authenticationmechanism)in the MSDN library.</maml:para> <maml:para>CAUTION: Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are passed to a remote computer to be authenticated, is designed for commands that require authentication on more than one resource, such as accessing a remote network share. This mechanism increases the security risk of the remote operation. If the remote computer is compromised, the credentials that are passed to it can be used to control the network session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to create the session in which the `Get-PSSession` command runs. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a Get-Item or Get-ChildItem command in the PowerShell Cert: drive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. Gets the sessions that connect to the specified computers. Wildcard characters are not permitted. There is no default value.</maml:para> <maml:para>Beginning in Windows PowerShell 3.0, PSSession objects are stored on the computers at the remote end of each connection. To get the sessions on the specified computers, PowerShell creates a temporary connection to each computer and runs a `Get-PSSession` command.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully-qualified domain name of one or more computers. To specify the local computer, type the computer name, localhost, or a dot (.).</maml:para> <maml:para>Note: This parameter gets sessions only from computers that run Windows PowerShell 3.0 or later versions of PowerShell. Earlier versions do not store sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a configuration. This cmdlet gets only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/powershell`. The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The value of this parameter is used to select and filter sessions. It does not change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the temporary session in which the `Get-PSSession` command runs. The URI must be fully qualified.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ConnectionUri parameter.</maml:para> <maml:para>The format of this string is:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is: `http://localhost:5985/WSMAN`.</maml:para> <maml:para>If you do not specify a ConnectionUri , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values. Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>This parameter gets sessions only from computers that run Windows PowerShell 3.0 or later versions of Windows PowerShell. Earlier versions do not store sessions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet starts an interactive session with each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command with the permissions of the specified user. Specify a user account that has permission to connect to the remote computer and run a `Get-PSSession` command. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of session IDs. This cmdlet gets only the sessions with the specified IDs. Type one or more IDs, separated by commas, or use the range operator (..) to specify a range of IDs. You cannot use the ID parameter together with the ComputerName parameter.</maml:para> <maml:para>An ID is an integer that uniquely identifies the user-managed sessions in the current session. It is easier to remember and type than the InstanceId , but it is unique only within the current session. The ID of a session is stored in the ID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of sessions. This cmdlet gets only the sessions with the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a session on a local or remote computer. The InstanceID is unique, even when you have multiple sessions running in PowerShell.</maml:para> <maml:para>The instance ID of a session is stored in the InstanceID property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of session names. This cmdlet gets only the sessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>The friendly name of a session is stored in the Name property of the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the specified network port that is used for the temporary connection in which the `Get-PSSession` command runs. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>This parameter configures to the temporary connection that is created to run a `Get-PSSession` command with the ComputerName or ConnectionUri parameter.</maml:para> <maml:para>Do not use the Port parameter unless you must. The Port set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>5985, 5986</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the New-PSSessionOption cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the $PSSessionOption preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options, including the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a session state. This cmdlet gets only sessions in the specified state. The acceptable values for this parameter are: All, Opened, Disconnected, Closed, and Broken. The default value is All.</maml:para> <maml:para>The session state value is relative to the current sessions. Sessions that were not created in the current sessions and are not connected to the current session have a state of Disconnected even when they are connected to a different session.</maml:para> <maml:para>The state of a session is stored in the State property of the session.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.SessionFilterState</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.SessionFilterState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run the `Get-PSSession` command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used. The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish the connection in which the `Get-PSSession` command runs. By default, SSL is not used. If you use this parameter, but SSL is not available on the port used for the command, the command fails.</maml:para> <maml:para>This parameter configures the temporary connection that is created to run a `Get-PSSession` command with the ComputerName parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the `Get-VM` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- This cmdlet gets user-managed sessions PSSession objects" such as those that are created by using the New-PSSession, `Enter-PSSession`, and Invoke-Command cmdlets. It does not get the system-managed session that is created when you start PowerShell. - Starting in Windows PowerShell 3.0, PSSession objects are stored on the computer that is at the server-side or receiving end of a connection. To get the sessions that are stored on the local computer or a remote computer, PowerShell establishes a temporary session to the specified computer and runs query commands in the session. - To get sessions that connect to a remote computer, use the ComputerName or ConnectionUri parameters to specify the remote computer. To filter the sessions that `Get-PSSession` gets, use the Name , ID , InstanceID , and State parameters. Use the remaining parameters to configure the temporary session that `Get-PSSession` uses. - When you use the ComputerName or ConnectionUri parameters, `Get-PSSession` gets only sessions from computers running Windows PowerShell 3.0 and later versions of PowerShell. - The value of the State property of a PSSession is relative to the current session. Therefore, a value of Disconnected means that the PSSession is not connected to the current session. However, it does not mean that the PSSession is disconnected from all sessions. It might be connected to a different session. To determine whether you can connect or reconnect to the PSSession from the current session, use the Availability property.</maml:para> <maml:para>An Availability value of None indicates that you can connect to the session. A value of Busy indicates that you cannot connect to the PSSession because it is connected to another session.</maml:para> <maml:para>For more information about the values of the State property of sessions, see RunspaceState Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.runspacestate).</maml:para> <maml:para>For more information about the values of the Availability property of sessions, see RunspaceAvailability Enumeration (https://msdn.microsoft.com/library/system.management.automation.runspaces.runspaceavailability).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---- Example 1: Get sessions created in the current session ----</maml:title> <dev:code>Get-PSSession</dev:code> <dev:remarks> <maml:para>This command gets all of the PSSessions that were created in the current session. It does not get PSSessions that were created in other sessions or on other computers, even if they connect to this computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 2: Get sessions connected to the local computer ---</maml:title> <dev:code>Get-PSSession -ComputerName "localhost"</dev:code> <dev:remarks> <maml:para>This command gets the PSSessions that are connected to the local computer. To indicate the local computer, type the computer name, localhost, or a dot (.)</maml:para> <maml:para>The command returns all of the sessions on the local computer, even if they were created in different sessions or on different computers.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Get sessions connected to a computer -------</maml:title> <dev:code>Get-PSSession -ComputerName "Server02" Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 2 Session3 Server02 Disconnected ITTasks Busy 1 ScheduledJobs Server02 Opened Microsoft.PowerShell Available 3 Test Server02 Disconnected Microsoft.PowerShell Busy</dev:code> <dev:remarks> <maml:para>This command gets the PSSessions that are connected to the Server02 computer.</maml:para> <maml:para>The command returns all of the sessions on Server02, even if they were created in different sessions or on different computers.</maml:para> <maml:para>The output shows that two of the sessions have a Disconnected state and a Busy availability. They were created in different sessions and are currently in use. The ScheduledJobs session, which is Opened and Available, was created in the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 4: Save results of this command -----------</maml:title> <dev:code>New-PSSession -ComputerName Server01, Server02, Server03 $s1, $s2, $s3 = Get-PSSession</dev:code> <dev:remarks> <maml:para>This example shows how to save the results of a `Get-PSSession` command in multiple variables.</maml:para> <maml:para>The first command uses the `New-PSSession` cmdlet to create PSSessions on three remote computers.</maml:para> <maml:para>The second command uses a `Get-PSSession` cmdlet to get the three PSSessions . It then saves each of the PSSessions in a separate variable.</maml:para> <maml:para>When PowerShell assigns an array of objects to an array of variables, it assigns the first object to the first variable, the second object to the second variable, and so on. If there are more objects than variables, it assigns all remaining objects to the last variable in the array. If there are more variables than objects, the extra variables are not used.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 5: Delete a session by using an instance ID -----</maml:title> <dev:code>Get-PSSession | Format-Table -Property ComputerName, InstanceID $s = Get-PSSession -InstanceID a786be29-a6bb-40da-80fb-782c67f7db0f Remove-PSSession -Session $s</dev:code> <dev:remarks> <maml:para>This example shows how to get a PSSession by using its instance ID, and then to delete the PSSession .</maml:para> <maml:para>The first command gets all of the PSSessions that were created in the current session. It sends the PSSessions to the Format-Table cmdlet, which displays the ComputerName and InstanceID properties of each PSSession .</maml:para> <maml:para>The second command uses the `Get-PSSession` cmdlet to get a particular PSSession and to save it in the `$s` variable. The command uses the InstanceID parameter to identify the PSSession .</maml:para> <maml:para>The third command uses the Remove-PSSession cmdlet to delete the PSSession in the `$s` variable.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 6: Get a session that has a particular name -----</maml:title> <dev:code>Get-PSSession -ComputerName Server02, Server12 -Name BackupJob* -ConfigurationName ITTasks -SessionOption @{OperationTimeout=240000} Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 3 BackupJob04 Server02 Disconnected ITTasks None $s = Get-PSSession -ComputerName Server02 -Name BackupJob04 -ConfigurationName ITTasks | Connect-PSSession $s Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 5 BackupJob04 Server02 Opened ITTasks Available</dev:code> <dev:remarks> <maml:para>The first command gets sessions on the Server02 and Server12 remote computers that have names that begin with BackupJob and use the ITTasks session configuration.The command uses the Name parameter to specify the name pattern and the ConfigurationName parameter to specify the session configuration. The value of the SessionOption parameter is a hash table that sets the value of the OperationTimeout to 240000 milliseconds (4 minutes). This setting gives the command more time to complete.The ConfigurationName and SessionOption parameters are used to configure the temporary sessions in which the `Get-PSSession` cmdlet runs on each computer.The output shows that the command returns the BackupJob04 session. The session is disconnected and the Availability is None, which indicates that it is not in use.</maml:para> <maml:para>The second command uses the `Get-PSSession` cmdlet to get to the BackupJob04 session and the Connect-PSSession cmdlet to connect to the session. The command saves the session in the $s variable.</maml:para> <maml:para>The third command gets the session in the $s variable. The output shows that the `Connect-PSSession` command was successful. The session is in the Opened state and is available for use.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 7: Get a session by using its ID -----------</maml:title> <dev:code>Get-PSSession -Id 2</dev:code> <dev:remarks> <maml:para>This command gets the PSSession with ID 2. Because the value of the ID property is unique only in the current session, the Id parameter is valid only for local commands.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSSessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-PSSessionCapability</command:name> <command:verb>Get</command:verb> <command:noun>PSSessionCapability</command:noun> <maml:description> <maml:para>Gets the capabilities of a specific user on a constrained session configuration.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Get-PSSessionCapability cmdlet gets the capabilities of a specific user on a constrained session configuration. Use this cmdlet to audit customized session configurations for users.</maml:para> <maml:para>Starting in Windows PowerShell 5.0, you can use the RoleDefinitions property in a session configuration (.pssc) file. Using this property lets you grant users different capabilities on a single constrained endpoint based on group membership. The Get-PSSessionCapability cmdlet reduces complexity when auditing these endpoints by letting you determine the exact capabilities granted to a user.</maml:para> <maml:para>By default, the Get-PSSessionCapability cmdlet returns a list of commands the specified user can run in the specified endpoint. This is equivalent to the user running Get-Command in the specified endpoint. When run with the Full parameter, this cmdlet returns an InitialSessionState object. This object contains details about the Windows PowerShell runspace the specified user would interact with for the specified endpoint. It includes information such as Language Mode, Execution Policy, and Environmental Variables.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSSessionCapability</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the constrained session configuration (endpoint) that you are inspecting.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Username</maml:name> <maml:Description> <maml:para>Specifies the user whose capabilities you are inspecting.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Full</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the entire initial session state for the specified user at the specified constrained endpoint.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the constrained session configuration (endpoint) that you are inspecting.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Full</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the entire initial session state for the specified user at the specified constrained endpoint.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Username</maml:name> <maml:Description> <maml:para>Specifies the user whose capabilities you are inspecting.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.AliasInfo</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.FunctionInfo</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.InitialSessionState</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Get commands available for a user ---------</maml:title> <dev:code>PS C:\> Get-PSSessionCapability -ConfigurationName Endpoint1 -Username 'CONTOSO\User'</dev:code> <dev:remarks> <maml:para>This example returns the commands available to the user CONTOSO\User when connecting to the Endpoint1 constrained endpoint on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 2: Get details about a runspace for a user ------</maml:title> <dev:code>PS C:\> Get-PSSessionCapability -ConfigurationName Endpoint1 -Username 'CONTOSO\User' -Full</dev:code> <dev:remarks> <maml:para>This example returns details about the runspace the user CONTOSO\User would interact with when connecting to the Endpoint1 constrained endpoint.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-pssessioncapability?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSRoleCapabilityFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-PSSessionConfiguration</command:name> <command:verb>Get</command:verb> <command:noun>PSSessionConfiguration</command:noun> <maml:description> <maml:para>Gets the registered session configurations on the computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-PSSessionConfiguration` cmdlet gets the session configurations that have been registered on the local computer. This is an advanced cmdlet that is designed to be used by system administrators to manage customized session configurations for their users.</maml:para> <maml:para>Beginning in PowerShell 3.0, you can define the properties of a session configuration by using a session configuration (.pssc) file. This feature lets you create customized and restricted sessions without writing a computer program. For more information about session configuration files, see about_Session_Configuration_Files (About/about_Session_Configuration_Files.md).</maml:para> <maml:para>Also, beginning in PowerShell 3.0, new note properties have been added to the session configuration object that `Get-PSSessionConfiguration` returns. These properties make it easier for users and session configuration authors to examine and compare session configurations.</maml:para> <maml:para>To create and register a session configuration, use the `Register-PSSessionConfiguration` cmdlet. For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSSessionConfiguration</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets only the session configurations with the specified name or name pattern. Enter one or more session configuration names. Wildcards are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All session configurations on the local computer</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses the prompt to restart the WinRM service, if the service is not already running.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses the prompt to restart the WinRM service, if the service is not already running.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Gets only the session configurations with the specified name or name pattern. Enter one or more session configuration names. Wildcards are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All session configurations on the local computer</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- To run this cmdlet, start PowerShell with the Run as administrator option.</maml:para> <maml:para>- To view the session configurations on the computer, you must be a member of the Administrators group on the computer.</maml:para> <maml:para>- To run a `Get-PSSessionConfiguration` command on a remote computer, Credential Security Service Provider (CredSSP) authentication must be enabled in the client settings on the local computer (by using the `Enable-WSManCredSSP` cmdlet) and in the service settings on the remote computer. Also, you must use the CredSSP value of the Authentication parameter when establishing the remote session. Otherwise, access is denied.</maml:para> <maml:para>- The note properties of the object that `Get-PSSessionConfiguration` returns appear on the object only when they have a value. Only session configurations that were created by using a session configuration file have all the defined properties.</maml:para> <maml:para>- The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties.</maml:para> <maml:para>- You can use commands in the WSMan: drive to change the properties of session configurations. However, you cannot use the WSMan: drive in PowerShell 2.0 to change session configuration properties that are introduced in PowerShell 3.0, such as OutputBufferingMode . PowerShell 2.0 commands do not generate an error, but they are ineffective. To change properties introduced in PowerShell 3.0, use the WSMan: drive in PowerShell 3.0.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>- Example 1 - Get session configurations on the local computer -</maml:title> <dev:code>Get-PSSessionConfiguration</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 2 - Get the two default session configurations ----</maml:title> <dev:code>Get-PSSessionConfiguration -Name Microsoft* Name PSVersion StartupScript Permission ---- --------- ------------- ---------- microsoft.powershell 5.1 BUILTIN\Administrators AccessAll... microsoft.powershell32 5.1 BUILTIN\Administrators AccessAll...</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 3 - Get the properties and values of a session configuration</maml:title> <dev:code>Get-PSSessionConfiguration -Name Full | Format-List -Property * Copyright : (c) 2011 User01. All rights reserved. AliasDefinitions : {System.Collections.Hashtable} SessionType : Default CompanyName : Unknown GUID : 1e9cb265-dae0-4bd3-89a9-8338a47698a1 Author : User01 ExecutionPolicy : Restricted SchemaVersion : 1.0.0.0 LanguageMode : FullLanguage Architecture : 64 Filename : %windir%\system32\pwrshplugin.dll ResourceUri : http://schemas.microsoft.com/powershell/Full MaxConcurrentCommandsPerShell : 1500 UseSharedProcess : false ProcessIdleTimeoutSec : 0 xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration MaxConcurrentUsers : 10 lang : en-US SupportsOptions : true ExactMatch : true configfilepath : C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Full_1e9cb265-dae0-4bd3-89a9-8338a47698a1.pssc RunAsUser : IdleTimeoutms : 7200000 PSVersion : 3.0 OutputBufferingMode : Block AutoRestart : false MaxShells : 300 MaxMemoryPerShellMB : 1024 MaxIdleTimeoutms : 43200000 SDKVersion : 1 Name : Full XmlRenderingType : text Capability : {Shell} RunAsPassword : MaxProcessesPerShell : 25 Enabled : True MaxShellsPerUser : 30 Permission :</dev:code> <dev:remarks> <maml:para>The example uses the `Get-PSSessionConfiguration` cmdlet to get the full session configuration. A pipeline operator sends the Full session configuration to the `Format-List` cmdlet. The Property parameter with a value of `*` (all) directs `Format-List` to display all the properties and values of the object in a list.</maml:para> <maml:para>The output includes useful information, including the author of the session configuration, the session type, language mode, and execution policy of sessions that are created with this session configuration, session quotas, and the full path to the session configuration file.</maml:para> <maml:para>This view of a session configuration is used for sessions that include a session configuration file. For more information about session configuration files, see about_Session_Configuration_Files (About/about_Session_Configuration_Files.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title> Example 4 - Another way to look at the session configurations </maml:title> <dev:code>dir wsman:\localhost\plugin Type Keys Name ---- ---- ---- Container {Name=Event Forwarding Plugin} Event Forwarding Plugin Container {Name=Full} Full Container {Name=microsoft.powershell} microsoft.powershell Container {Name=microsoft.powershell.workf... microsoft.powershell.workflow Container {Name=microsoft.powershell32} microsoft.powershell32 Container {Name=microsoft.ServerManager} microsoft.ServerManager Container {Name=WMI Provider} WMI Provider</dev:code> <dev:remarks> <maml:para>The PlugIn node contains ContainerElement objects (Microsoft.WSMan.Management.WSManConfigContainerElement) that represent the registered PowerShell session configurations, along with other plug-ins for WS-Management.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 6 - View session configurations on a remote computer -</maml:title> <dev:code>Connect-WSMan -ComputerName Server01 dir WSMan:\Server01\Plugin WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin Type Keys Name ---- ---- ---- Container {Name=Empty} Empty Container {Name=Event Forwarding Plugin} Event Forwarding Plugin Container {Name=Full} Full Container {Name=microsoft.powershell} microsoft.powershell Container {Name=microsoft.powershell.workf... microsoft.powershell.workflow Container {Name=microsoft.powershell32} microsoft.powershell32 Container {Name=microsoft.ServerManager} microsoft.ServerManager Container {Name=NoLanguage} NoLanguage Container {Name=RestrictedLang} RestrictedLang Container {Name=RRS} RRS Container {Name=SEL Plugin} SEL Plugin Container {Name=WithProfile} WithProfile Container {Name=WMI Provider} WMI Provider</dev:code> <dev:remarks> <maml:para>The `Connect-WSMan` cmdlet connects to the WinRM service on the Server01 remote computer. The `Get-ChildItem` cmdlet (alias `dir`) of the WSMan: drive gets the items in the Server01\Plugin path. The output shows the items in the Plugin directory on the Server01 computer. The items include the session configurations, which are a type of WSMan plug-in, along with other types of plug-ins on the computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 7 - Get detailed session configurations from a remote computer</maml:title> <dev:code>Enable-WSManCredSSP -Delegate Server02 Connect-WSMan Server02 Set-Item WSMan:\Server02*\Service\Auth\CredSSP -Value $true Invoke-Command -ScriptBlock {Get-PSSessionConfiguration} -ComputerName Server02 -Authentication CredSSP -Credential Domain01\Admin01 Name PSVersion StartupScript Permission PSComputerName ---- --------- ------------- ---------- -------------- microsoft.powershell 5.1 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com microsoft.powershell32 5.1 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com MyX86Shell 5.1 c:\test\x86Shell.ps1 BUILTIN\Administrators AccessAll... server02.corp.fabrikam.com</dev:code> <dev:remarks> <maml:para>The `Enable-WSManCredSSP` cmdlet enables CredSSP delegation on Server01, the local computer. The `Connect-WSMan` cmdlet connects to Server02 computer. This action adds a node for Server02 to the WSMan: drive on the local computer, allowing you to view and change the WS-Management settings on the Server02 computer. The `Set-Item` cmdlet changes the value of the CredSSP item in the Service node of the Server02 computer to True . This configures the service settings on the remote computer. The `Invoke-Command` cmdlet runs the`Get-PSSessionConfiguration` command on the Server02 computer. The command uses the Credential parameter, and it uses the Authentication parameter with a value of CredSSP . The output shows the session configurations on the Server02 remote computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 8 - Get the resource URI of a session configuration -</maml:title> <dev:code>(Get-PSSessionConfiguration -Name CustomShell).resourceURI http://schemas.microsoft.com/powershell/microsoft.CustomShell</dev:code> <dev:remarks> <maml:para>The `$PSSessionConfigurationName` variable specifies the default configuration that is used when you create a session. This variable is set on the local computer, but it specifies a configuration on the remote computer. For more information about the `$PSSessionConfiguration` variable, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-pssessionconfiguration?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-PSSnapin</command:name> <command:verb>Get</command:verb> <command:noun>PSSnapin</command:noun> <maml:description> <maml:para>Gets the Windows PowerShell snap-ins on the computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Get-PSSnapin cmdlet gets the Windows PowerShell snap-ins that have been added to the current session or that have been registered on the system. This cmdlet lists the snap-ins in the order in which they are detected. Get-PSSnapin gets only registered snap-ins. To register a Windows PowerShell snap-in, use the InstallUtil tool included with the Microsoft .NET Framework 2.0. For more information, see How to Register Cmdlets, Providers, and Host Applications (https://go.microsoft.com/fwlink/?LinkID=143619)in the MSDN library.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, the core commands that are included in Windows PowerShell are packaged in modules. The exception is Microsoft.PowerShell.Core , which is a snap-in (PSSnapin). By default, only the Microsoft.PowerShell.Core snap-in is added to the session. Modules are imported automatically on first use and you can use the Import-Module cmdlet to import them.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-PSSnapin</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of snap-in names. This cmdlet gets only the specified Windows PowerShell snap-ins. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Registered</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets the Windows PowerShell snap-ins that have been registered on the system even if they have not yet been added to the session.</maml:para> <maml:para>The snap-ins that are installed with Windows PowerShell do not appear in this list.</maml:para> <maml:para>Without this parameter, Get-PSSnapin gets the Windows PowerShell snap-ins that have been added to the session.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of snap-in names. This cmdlet gets only the specified Windows PowerShell snap-ins. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Registered</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets the Windows PowerShell snap-ins that have been registered on the system even if they have not yet been added to the session.</maml:para> <maml:para>The snap-ins that are installed with Windows PowerShell do not appear in this list.</maml:para> <maml:para>Without this parameter, Get-PSSnapin gets the Windows PowerShell snap-ins that have been added to the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSSnapInInfo</maml:name> </dev:type> <maml:description> <maml:para>Get-PSSnapin returns an object for each snap-in that it gets.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Starting in Windows PowerShell 3.0, the core commands that are installed with Windows PowerShell are packaged in modules. In Windows PowerShell 2.0, and in host programs that create older-style sessions in later versions of Windows PowerShell, the core commands are packaged in snap-ins ( PSSnapin ). The exception is Microsoft.PowerShell.Core *, which is always a snap-in. Also, remote sessions, such as those started by the New-PSSession cmdlet, are older-style sessions that include core snap-ins.</maml:para> <maml:para> For information about the CreateDefault2 method that creates newer-style sessions with core modules, see CreateDefault2 Method (https://msdn.microsoft.com/library/system.management.automation.runspaces.initialsessionstate.createdefault2)in the MSDN library.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------ Example 1: Get snap-ins that are currently loaded ------</maml:title> <dev:code>PS C:\> Get-PSSnapIn</dev:code> <dev:remarks> <maml:para>This command gets the Windows PowerShell snap-ins that are currently loaded in the session. This includes the snap-ins that are installed with Windows PowerShell and those that have been added to the session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 2: Get snap-ins that have been registered ------</maml:title> <dev:code>PS C:\> get-PSSnapIn -Registered</dev:code> <dev:remarks> <maml:para>This command gets the Windows PowerShell snap-ins that have been registered on the computer, including those that have already been added to the session. The output does not include snap-ins that are installed with Windows PowerShell or Windows PowerShell snap-in dynamic-link libraries (DLLs) that have not yet been registered on the system.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 3: Get current snap-ins that match a string -----</maml:title> <dev:code>PS C:\> Get-PSSnapIn -Name smp*</dev:code> <dev:remarks> <maml:para>This command gets the Windows PowerShell snap-ins in the current session that have names that begin with smp.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-pssnapin?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Add-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-Verb</command:name> <command:verb>Get</command:verb> <command:noun>Verb</command:noun> <maml:description> <maml:para>Gets approved PowerShell verbs.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Get-Verb` function gets verbs that are approved for use in PowerShell commands.</maml:para> <maml:para>PowerShell recommends cmdlet and function names have the Verb-Noun format and include an approved verb. This practice makes command names more consistent, predictable, and easier to use.</maml:para> <maml:para>Commands that use unapproved verbs run in PowerShell. However, when you import a module that includes a command with an unapproved verb in its name, the `Import-Module` command displays a warning message.</maml:para> <maml:para>> [!NOTE] > The verb list that `Get-Verb` returns might not be complete. For an updated list of approved > PowerShell verbs with descriptions, see > Approved Verbs (/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands)in > the Microsoft Docs.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-Verb</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="1" aliases="none"> <maml:name>verb</maml:name> <maml:Description> <maml:para>Gets only the specified verbs. Enter the name of a verb or a name pattern. Wildcards are allowed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All verbs</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="1" aliases="none"> <maml:name>verb</maml:name> <maml:Description> <maml:para>Gets only the specified verbs. Enter the name of a verb or a name pattern. Wildcards are allowed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All verbs</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Selected.Microsoft.PowerShell.Commands.MemberDefinition</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>`Get-Verb` returns a modified version of a Microsoft.PowerShell.Commands.MemberDefinition object. The object does not have the standard properties of a MemberDefinition object. Instead it has Verb and Group properties. The Verb property contains a string with the verb name. The Group property contains a string with the verb group.</maml:para> <maml:para>PowerShell verbs are assigned to a group based on their most common use. The groups are designed to make the verbs easy to find and compare, not to restrict their use. You can use any approved verb for any type of command.</maml:para> <maml:para>Each PowerShell verb is assigned to one of the following groups.</maml:para> <maml:para>- Common: Define generic actions that can apply to almost any cmdlet, such as Add.</maml:para> <maml:para>- Communications: Define actions that apply to communications, such as Connect.</maml:para> <maml:para>- Data: Define actions that apply to data handling, such as Backup.</maml:para> <maml:para>- Diagnostic: Define actions that apply to diagnostics, such as Debug.</maml:para> <maml:para>- Lifecycle: Define actions that apply to the lifecycle of a cmdlet, such as Complete.</maml:para> <maml:para>- Security: Define actions that apply to security, such as Revoke.</maml:para> <maml:para>- Other: Define other types of actions.</maml:para> <maml:para></maml:para> <maml:para>Some of the cmdlets that are installed with PowerShell, such as `Tee-Object` and `Where-Object`, use unapproved verbs. These cmdlets are historic exceptions and their verbs are classified as reserved .</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------- Example 1 - Get a list of all verbs -------------</maml:title> <dev:code>Get-Verb</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title> Example 2 - Get a list of approved verbs that begin with "un" </maml:title> <dev:code>Get-Verb un* Verb Group ---- ----- Undo Common Unlock Common Unpublish Data Uninstall Lifecycle Unregister Lifecycle Unblock Security Unprotect Security</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 3 - Get all approved verbs in the Security group ---</maml:title> <dev:code>Get-Verb | Where-Object Group -EQ Security Verb Group ---- ----- Block Security Grant Security Protect Security Revoke Security Unblock Security Unprotect Security</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4 - Finds all commands in a module that have unapproved verbs</maml:title> <dev:code>Get-Command -Module Microsoft.PowerShell.Utility | Where-Object Verb -NotIn (Get-Verb).Verb CommandType Name Version Source ----------- ---- ------- ------ Cmdlet Sort-Object 3.1.0.0 Microsoft.PowerShell.Utility Cmdlet Tee-Object 3.1.0.0 Microsoft.PowerShell.Utility</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/functions/get-verb?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Import-Module</command:name> <command:verb>Import</command:verb> <command:noun>Module</command:noun> <maml:description> <maml:para>Adds modules to the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Import-Module` cmdlet adds one or more modules to the current session. Starting in PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the `Import-Module` command to import a module. You can disable automatic module importing using the `$PSModuleAutoloadingPreference` preference variable. For more information about the `$PSModuleAutoloadingPreference` variable, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>A module is a package that contains members that can be used in PowerShell. Members include cmdlets, providers, scripts, functions, variables, and other tools and files. After a module is imported, you can use the module members in your session. For more information about modules, see about_Modules (About/about_Modules.md).</maml:para> <maml:para>By default, `Import-Module` imports all members that the module exports, but you can use the Alias , Function , Cmdlet , and Variable parameters to restrict which members are imported. The NoClobber parameter prevents `Import-Module` from importing members that have the same names as members in the current session.</maml:para> <maml:para>`Import-Module` imports a module only into the current session. To import the module into every new session, add an `Import-Module` command to your PowerShell profile. For more information about profiles, see about_Profiles (About/about_Profiles.md).</maml:para> <maml:para>You can manage remote Windows computers that have PowerShell remoting enabled by creating a PSSession on the remote computer. Then use the PSSession parameter of `Import-Module` to import the modules that are installed on the remote computer. You can now use the imported commands in the current session. The commands implicitly run on the remote computer.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, you can use `Import-Module` to import Common Information Model (CIM) modules, in which the cmdlets are defined in Cmdlet Definition XML (CDXML) files. This feature allows you to use cmdlets that are implemented in non-managed code assemblies, such as those written in C++.</maml:para> <maml:para>For remote computers that don't have PowerShell remoting enabled, including computers that aren't running the Windows operating system, you can use the CIMSession parameter of `Import-Module` to import CIM modules from the remote computer. The imported commands run implicitly on the remote computer. A CIMSession is a connection to Windows Management Instrumentation (WMI) on the remote computer.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Assembly</maml:name> <maml:Description> <maml:para>Specifies an array of assembly objects. This cmdlet imports the cmdlets and providers implemented in the specified assembly objects. Enter a variable that contains assembly objects or a command that creates assembly objects. You can also pipe an assembly object to `Import-Module`.</maml:para> <maml:para>When you use this parameter, only the cmdlets and providers implemented by the specified assemblies are imported. If the module contains other files, they aren't imported, and you might be missing important members of the module. Use this parameter for debugging and testing the module, or when you're instructed to use it by the module author.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Reflection.Assembly[]</command:parameterValue> <dev:type> <maml:name>System.Reflection.Assembly[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of the modules to import. Enter the name of the module or the name of a file in the module, such as a `.psd1`, `.psm1`, `.dll`, or `.ps1` file. File paths are optional. Wildcard characters aren't permitted. You can also pipe module names and filenames to `Import-Module`.</maml:para> <maml:para>If you omit a path, `Import-Module` looks for the module in the paths saved in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>Specify only the module name whenever possible. When you specify a file name, only the members that are implemented in that file are imported. If the module contains other files, they aren't imported, and you might be missing important members of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimNamespace</maml:name> <maml:Description> <maml:para>Specifies the namespace of an alternate CIM provider that exposes CIM modules. The default value is the namespace of the Module Discovery WMI provider.</maml:para> <maml:para>Use this parameter to import CIM modules from computers and devices that aren't running a Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimResourceUri</maml:name> <maml:Description> <maml:para>Specifies an alternate location for CIM modules. The default value is the resource URI of the Module Discovery WMI provider on the remote computer.</maml:para> <maml:para>Use this parameter to import CIM modules from computers and devices that aren't running a Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimSession</maml:name> <maml:Description> <maml:para>Specifies a CIM session on the remote computer. Enter a variable that contains the CIM session or a command that gets the CIM session, such as a Get-CimSession (../CimCmdlets/Get-CimSession.md)command.</maml:para> <maml:para>`Import-Module` uses the CIM session connection to import modules from the remote computer into the current session. When you use the commands from the imported module in the current session, the commands run on the remote computer.</maml:para> <maml:para>You can use this parameter to import modules from computers and devices that aren't running the Windows operating system, and Windows computers that have PowerShell, but don't have PowerShell remoting enabled.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.Management.Infrastructure.CimSession</command:parameterValue> <dev:type> <maml:name>Microsoft.Management.Infrastructure.CimSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumVersion</maml:name> <maml:Description> <maml:para>Specifies a maximum version. This cmdlet imports only a version of the module that is less than or equal to the specified value. If no version qualifies, `Import-Module` returns an error.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Version"> <maml:name>MinimumVersion</maml:name> <maml:Description> <maml:para>Specifies a minimum version. This cmdlet imports only a version of the module that is greater than or equal to the specified value. Use the MinimumVersion parameter name or its alias, Version . If no version qualifies, `Import-Module` generates an error.</maml:para> <maml:para>To specify an exact version, use the RequiredVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredVersion</maml:name> <maml:Description> <maml:para>Specifies a version of the module that this cmdlet imports. If the version is not installed, `Import-Module` generates an error.</maml:para> <maml:para>By default, `Import-Module` imports the module without checking the version number.</maml:para> <maml:para>To specify a minimum version, use the MinimumVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>Scripts that use RequiredVersion to import modules that are included with existing releases of the Windows operating system don't automatically run in future releases of the Windows operating system. This is because PowerShell module version numbers in future releases of the Windows operating system are higher than module version numbers in existing releases of the Windows operating system.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified name of the module as a hash table. The value can be a combination of strings and hash tables. The hash table has the following keys.</maml:para> <maml:para>- `ModuleName` - Required Specifies the module name. - `GUID` - Optional Specifies the GUID of the module. - It's also Required to specify one of the three below keys. These keys can't be used together. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified name of the module as a hash table. The value can be a combination of strings and hash tables. The hash table has the following keys.</maml:para> <maml:para>- `ModuleName` - Required Specifies the module name. - `GUID` - Optional Specifies the GUID of the module. - It's also Required to specify one of the three below keys. These keys can't be used together. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSSession</maml:name> <maml:Description> <maml:para>Specifies a PowerShell user-managed session ( PSSession ) from which this cmdlet imports modules into the current session. Enter a variable that contains a PSSession or a command that gets a PSSession , such as a `Get-PSSession` command.</maml:para> <maml:para>When you import a module from a different session into the current session, you can use the cmdlets from the module in the current session, just as you would use cmdlets from a local module. Commands that use the remote cmdlets run in the remote session, but the remoting details are managed in the background by PowerShell.</maml:para> <maml:para>This parameter uses the Implicit Remoting feature of PowerShell. It is equivalent to using the `Import-PSSession` cmdlet to import particular modules from a session.</maml:para> <maml:para>`Import-Module` cannot import PowerShell Core modules from another session. The PowerShell Core modules have names that begin with Microsoft.PowerShell.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of the modules to import. Enter the name of the module or the name of a file in the module, such as a `.psd1`, `.psm1`, `.dll`, or `.ps1` file. File paths are optional. Wildcard characters aren't permitted. You can also pipe module names and filenames to `Import-Module`.</maml:para> <maml:para>If you omit a path, `Import-Module` looks for the module in the paths saved in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>Specify only the module name whenever possible. When you specify a file name, only the members that are implemented in that file are imported. If the module contains other files, they aren't imported, and you might be missing important members of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumVersion</maml:name> <maml:Description> <maml:para>Specifies a maximum version. This cmdlet imports only a version of the module that is less than or equal to the specified value. If no version qualifies, `Import-Module` returns an error.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Version"> <maml:name>MinimumVersion</maml:name> <maml:Description> <maml:para>Specifies a minimum version. This cmdlet imports only a version of the module that is greater than or equal to the specified value. Use the MinimumVersion parameter name or its alias, Version . If no version qualifies, `Import-Module` generates an error.</maml:para> <maml:para>To specify an exact version, use the RequiredVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredVersion</maml:name> <maml:Description> <maml:para>Specifies a version of the module that this cmdlet imports. If the version is not installed, `Import-Module` generates an error.</maml:para> <maml:para>By default, `Import-Module` imports the module without checking the version number.</maml:para> <maml:para>To specify a minimum version, use the MinimumVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>Scripts that use RequiredVersion to import modules that are included with existing releases of the Windows operating system don't automatically run in future releases of the Windows operating system. This is because PowerShell module version numbers in future releases of the Windows operating system are higher than module version numbers in existing releases of the Windows operating system.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of the modules to import. Enter the name of the module or the name of a file in the module, such as a `.psd1`, `.psm1`, `.dll`, or `.ps1` file. File paths are optional. Wildcard characters aren't permitted. You can also pipe module names and filenames to `Import-Module`.</maml:para> <maml:para>If you omit a path, `Import-Module` looks for the module in the paths saved in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>Specify only the module name whenever possible. When you specify a file name, only the members that are implemented in that file are imported. If the module contains other files, they aren't imported, and you might be missing important members of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumVersion</maml:name> <maml:Description> <maml:para>Specifies a maximum version. This cmdlet imports only a version of the module that is less than or equal to the specified value. If no version qualifies, `Import-Module` returns an error.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Version"> <maml:name>MinimumVersion</maml:name> <maml:Description> <maml:para>Specifies a minimum version. This cmdlet imports only a version of the module that is greater than or equal to the specified value. Use the MinimumVersion parameter name or its alias, Version . If no version qualifies, `Import-Module` generates an error.</maml:para> <maml:para>To specify an exact version, use the RequiredVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSSession</maml:name> <maml:Description> <maml:para>Specifies a PowerShell user-managed session ( PSSession ) from which this cmdlet imports modules into the current session. Enter a variable that contains a PSSession or a command that gets a PSSession , such as a `Get-PSSession` command.</maml:para> <maml:para>When you import a module from a different session into the current session, you can use the cmdlets from the module in the current session, just as you would use cmdlets from a local module. Commands that use the remote cmdlets run in the remote session, but the remoting details are managed in the background by PowerShell.</maml:para> <maml:para>This parameter uses the Implicit Remoting feature of PowerShell. It is equivalent to using the `Import-PSSession` cmdlet to import particular modules from a session.</maml:para> <maml:para>`Import-Module` cannot import PowerShell Core modules from another session. The PowerShell Core modules have names that begin with Microsoft.PowerShell.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredVersion</maml:name> <maml:Description> <maml:para>Specifies a version of the module that this cmdlet imports. If the version is not installed, `Import-Module` generates an error.</maml:para> <maml:para>By default, `Import-Module` imports the module without checking the version number.</maml:para> <maml:para>To specify a minimum version, use the MinimumVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>Scripts that use RequiredVersion to import modules that are included with existing releases of the Windows operating system don't automatically run in future releases of the Windows operating system. This is because PowerShell module version numbers in future releases of the Windows operating system are higher than module version numbers in existing releases of the Windows operating system.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Import-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>ModuleInfo</maml:name> <maml:Description> <maml:para>Specifies an array of module objects to import. Enter a variable that contains the module objects, or a command that gets the module objects, such as the following command: `Get-Module -ListAvailable`. You can also pipe module objects to `Import-Module`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Global</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Alias</maml:name> <maml:Description> <maml:para>Specifies the aliases that this cmdlet imports from the module into the current session. Enter a comma-separated list of aliases. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected aliases into your session when you import the module. This parameter lets you select from among the exported aliases.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, that are passed to a script module during the `Import-Module` command. This parameter is valid only when you're importing a script module.</maml:para> <maml:para>You can also refer to the ArgumentList parameter by its alias, args . For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object with members that represent the imported module members. This parameter is valid only for script modules.</maml:para> <maml:para>When you use the AsCustomObject parameter, `Import-Module` imports the module members into the session and then returns a PSCustomObject object instead of a PSModuleInfo object. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Assembly</maml:name> <maml:Description> <maml:para>Specifies an array of assembly objects. This cmdlet imports the cmdlets and providers implemented in the specified assembly objects. Enter a variable that contains assembly objects or a command that creates assembly objects. You can also pipe an assembly object to `Import-Module`.</maml:para> <maml:para>When you use this parameter, only the cmdlets and providers implemented by the specified assemblies are imported. If the module contains other files, they aren't imported, and you might be missing important members of the module. Use this parameter for debugging and testing the module, or when you're instructed to use it by the module author.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Reflection.Assembly[]</command:parameterValue> <dev:type> <maml:name>System.Reflection.Assembly[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimNamespace</maml:name> <maml:Description> <maml:para>Specifies the namespace of an alternate CIM provider that exposes CIM modules. The default value is the namespace of the Module Discovery WMI provider.</maml:para> <maml:para>Use this parameter to import CIM modules from computers and devices that aren't running a Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimResourceUri</maml:name> <maml:Description> <maml:para>Specifies an alternate location for CIM modules. The default value is the resource URI of the Module Discovery WMI provider on the remote computer.</maml:para> <maml:para>Use this parameter to import CIM modules from computers and devices that aren't running a Windows operating system.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CimSession</maml:name> <maml:Description> <maml:para>Specifies a CIM session on the remote computer. Enter a variable that contains the CIM session or a command that gets the CIM session, such as a Get-CimSession (../CimCmdlets/Get-CimSession.md)command.</maml:para> <maml:para>`Import-Module` uses the CIM session connection to import modules from the remote computer into the current session. When you use the commands from the imported module in the current session, the commands run on the remote computer.</maml:para> <maml:para>You can use this parameter to import modules from computers and devices that aren't running the Windows operating system, and Windows computers that have PowerShell, but don't have PowerShell remoting enabled.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.Management.Infrastructure.CimSession</command:parameterValue> <dev:type> <maml:name>Microsoft.Management.Infrastructure.CimSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet imports from the module into the current session. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected cmdlets into your session when you import the module. This parameter lets you select from among the exported cmdlets.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DisableNameChecking</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the message that warns you when you import a cmdlet or function whose name includes an unapproved verb or a prohibited character.</maml:para> <maml:para>By default, when a module that you import exports cmdlets or functions that have unapproved verbs in their names, PowerShell displays the following warning message:</maml:para> <maml:para>> WARNING: Some imported command names include unapproved verbs which might make them less > discoverable. Use the Verbose parameter for more detail or type Get-Verb to see the list of > approved verbs.</maml:para> <maml:para>This message is only a warning. The complete module is still imported, including the non-conforming commands. Although the message is displayed to module users, the naming problem should be fixed by the module author.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>This parameter causes a module to be loaded, or reloaded, over top of the current one.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified name of the module as a hash table. The value can be a combination of strings and hash tables. The hash table has the following keys.</maml:para> <maml:para>- `ModuleName` - Required Specifies the module name. - `GUID` - Optional Specifies the GUID of the module. - It's also Required to specify one of the three below keys. These keys can't be used together. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet imports from the module into the current session. Wildcard characters are permitted. Some modules automatically export selected functions into your session when you import the module. This parameter lets you select from among the exported functions.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Global</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the calling module's session state.</maml:para> <maml:para>> [!TIP] > You should avoid calling `Import-Module` from within a module. Instead, declare the target module > as a nested module in the parent module's manifest. Declaring nested modules improves the > discoverability of dependencies.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global .</maml:para> <maml:para>To restrict the commands that a module exports, use an `Export-ModuleMember` command in the script module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumVersion</maml:name> <maml:Description> <maml:para>Specifies a maximum version. This cmdlet imports only a version of the module that is less than or equal to the specified value. If no version qualifies, `Import-Module` returns an error.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Version"> <maml:name>MinimumVersion</maml:name> <maml:Description> <maml:para>Specifies a minimum version. This cmdlet imports only a version of the module that is greater than or equal to the specified value. Use the MinimumVersion parameter name or its alias, Version . If no version qualifies, `Import-Module` generates an error.</maml:para> <maml:para>To specify an exact version, use the RequiredVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>ModuleInfo</maml:name> <maml:Description> <maml:para>Specifies an array of module objects to import. Enter a variable that contains the module objects, or a command that gets the module objects, such as the following command: `Get-Module -ListAvailable`. You can also pipe module objects to `Import-Module`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of the modules to import. Enter the name of the module or the name of a file in the module, such as a `.psd1`, `.psm1`, `.dll`, or `.ps1` file. File paths are optional. Wildcard characters aren't permitted. You can also pipe module names and filenames to `Import-Module`.</maml:para> <maml:para>If you omit a path, `Import-Module` looks for the module in the paths saved in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>Specify only the module name whenever possible. When you specify a file name, only the members that are implemented in that file are imported. If the module contains other files, they aren't imported, and you might be missing important members of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="NoOverwrite"> <maml:name>NoClobber</maml:name> <maml:Description> <maml:para>Prevents importing commands that have the same names as existing commands in the current session. By default, `Import-Module` imports all exported module commands.</maml:para> <maml:para>Commands that have the same names can hide or replace commands in the session. To avoid command name conflicts in a session, use the Prefix or NoClobber parameters. For more information about name conflicts and command precedence, see "Modules and Name Conflicts" in about_Modules (about/about_Modules.md)and about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you're working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Prefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that this cmdlet adds to the nouns in the names of imported module members.</maml:para> <maml:para>Use this parameter to avoid name conflicts that might occur when different members in the session have the same name. This parameter does not change the module, and it does not affect files that the module imports for its own use. These are known as nested modules. This cmdlet affects only the names of members in the current session.</maml:para> <maml:para>For example, if you specify the prefix UTC and then import a `Get-Date` cmdlet, the cmdlet is known in the session as `Get-UTCDate`, and it is not confused with the original `Get-Date` cmdlet.</maml:para> <maml:para>The value of this parameter takes precedence over the DefaultCommandPrefix property of the module, which specifies the default prefix.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSSession</maml:name> <maml:Description> <maml:para>Specifies a PowerShell user-managed session ( PSSession ) from which this cmdlet imports modules into the current session. Enter a variable that contains a PSSession or a command that gets a PSSession , such as a `Get-PSSession` command.</maml:para> <maml:para>When you import a module from a different session into the current session, you can use the cmdlets from the module in the current session, just as you would use cmdlets from a local module. Commands that use the remote cmdlets run in the remote session, but the remoting details are managed in the background by PowerShell.</maml:para> <maml:para>This parameter uses the Implicit Remoting feature of PowerShell. It is equivalent to using the `Import-PSSession` cmdlet to import particular modules from a session.</maml:para> <maml:para>`Import-Module` cannot import PowerShell Core modules from another session. The PowerShell Core modules have names that begin with Microsoft.PowerShell.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredVersion</maml:name> <maml:Description> <maml:para>Specifies a version of the module that this cmdlet imports. If the version is not installed, `Import-Module` generates an error.</maml:para> <maml:para>By default, `Import-Module` imports the module without checking the version number.</maml:para> <maml:para>To specify a minimum version, use the MinimumVersion parameter. You can also use the Module and Version parameters of the #Requires keyword to require a specific version of a module in a script.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>Scripts that use RequiredVersion to import modules that are included with existing releases of the Windows operating system don't automatically run in future releases of the Windows operating system. This is because PowerShell module version numbers in future releases of the Windows operating system are higher than module version numbers in existing releases of the Windows operating system.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Scope</maml:name> <maml:Description> <maml:para>Specifies a scope into which this cmdlet imports the module.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- Global . Available to all commands in the session. Equivalent to the Global parameter. - Local . Available only in the current scope.</maml:para> <maml:para>By default, when `Import-Module` cmdlet is called from the command prompt, script file, or scriptblock, all the commands are imported into the global session state. You can use the -Scope parameter with the value of Local to import module content into the script or scriptblock scope.</maml:para> <maml:para>When invoked from another module, `Import-Module` cmdlet imports the commands in a module, including commands from nested modules, into the caller's session state. Specifying `-Scope Global` or `-Global` indicates that this cmdlet imports modules into the global session state so they are available to all commands in the session.</maml:para> <maml:para>The Global parameter is equivalent to the Scope parameter with a value of Global.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Variable</maml:name> <maml:Description> <maml:para>Specifies an array of variables that this cmdlet imports from the module into the current session. Enter a list of variables. Wildcard characters are permitted.</maml:para> <maml:para>Some modules automatically export selected variables into your session when you import the module. This parameter lets you select from among the exported variables.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String, System.Management.Automation.PSModuleInfo, System.Reflection.Assembly</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a module name, module object, or assembly object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None, System.Management.Automation.PSModuleInfo, or System.Management.Automation.PSCustomObject</maml:name> </dev:type> <maml:description> <maml:para>By default, `Import-Module` does not generate any output. If you specify the PassThru parameter, the cmdlet generates a System.Management.Automation.PSModuleInfo object that represents the module. If you specify the AsCustomObject parameter, it generates a PSCustomObject object.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- Before you can import a module, the module must be installed on the local computer. That is, the module directory must be copied to a directory that is accessible to your local computer. For more information, see about_Modules (About/about_Modules.md).</maml:para> <maml:para> You can also use the PSSession and CIMSession parameters to import modules that are installed on remote computers. However, commands that use the cmdlets in these modules run in the remote session on the remote computer.</maml:para> <maml:para>- If you import members with the same name and the same type into your session, PowerShell uses the member imported last by default. Variables and aliases are replaced, and the originals aren't accessible. Functions, cmdlets, and providers are merely shadowed by the new members. They can be accessed by qualifying the command name with the name of its snap-in, module, or function path.</maml:para> <maml:para>- To update the formatting data for commands that have been imported from a module, use the `Update-FormatData` cmdlet. `Update-FormatData` also updates the formatting data for commands in the session that were imported from modules. If the formatting file for a module changes, you can run an `Update-FormatData` command to update the formatting data for imported commands. You don't need to import the module again.</maml:para> <maml:para>- Starting in Windows PowerShell 3.0, the core commands that are installed with PowerShell are packaged in modules. In Windows PowerShell 2.0, and in host programs that create older-style sessions in later versions of PowerShell, the core commands are packaged in snap-ins ( PSSnapins ). The exception is Microsoft.PowerShell.Core , which is always a snap-in. Also, remote sessions, such as those started by the `New-PSSession` cmdlet, are older-style sessions that include core snap-ins.</maml:para> <maml:para> For information about the CreateDefault2 method that creates newer-style sessions with core modules, see the CreateDefault2 Method (/dotnet/api/system.management.automation.runspaces.initialsessionstate.createdefault2).</maml:para> <maml:para>- `Import-Module` cannot import PowerShell Core modules from another session. The PowerShell Core modules have names that begin with `Microsoft.PowerShell`.</maml:para> <maml:para>- In Windows PowerShell 2.0, some of the property values of the module object, such as the ExportedCmdlets and NestedModules property values, were not populated until the module was imported and were not available on the module object that the PassThru parameter returns. In Windows PowerShell 3.0, all module property values are populated.</maml:para> <maml:para>- If you attempt to import a module that contains mixed-mode assemblies that aren't compatible with Windows PowerShell 3.0, `Import-Module` returns an error message like the following one.</maml:para> <maml:para> > Import-Module : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and > cannot be loaded in the 4.0 runtime without additional configuration information.</maml:para> <maml:para> This error occurs when a module that is designed for Windows PowerShell 2.0 contains at least one mixed-module assembly, that is, an assembly that includes both managed and non-managed code, such as C++ and C#.</maml:para> <maml:para> To import a module that contains mixed-mode assemblies, start Windows PowerShell 2.0 by using the following command, and then try the `Import-Module` command again.</maml:para> <maml:para> `PowerShell.exe -Version 2.0`</maml:para> <maml:para>- To use the CIM session feature, the remote computer must have WS-Management remoting and Windows Management Instrumentation (WMI), which is the Microsoft implementation of the Common Information Model (CIM) standard. The computer must also have the Module Discovery WMI provider or an alternate CIM provider that has the same basic features.</maml:para> <maml:para> You can use the CIM session feature on computers that aren't running a Windows operating system and on Windows computers that have PowerShell, but don't have PowerShell remoting enabled.</maml:para> <maml:para> You can also use the CIM parameters to get CIM modules from computers that have PowerShell remoting enabled, including the local computer. When you create a CIM session on the local computer, PowerShell uses DCOM, instead of WMI, to create the session.</maml:para> <maml:para>- By default, `Import-Module` imports modules in the global scope even when called from a descendant scope. The top-level scope and all descendant scopes have access to the module's exported elements.</maml:para> <maml:para> In a descendant scope, `-Scope Local` limits the import to that scope and all its descendant scopes. Parent scopes then do not see the imported members.</maml:para> <maml:para> > [!NOTE] > `Get-Module` shows all modules loaded in the current session. This includes modules loaded > locally in a descendant scope. Use `Get-Command -Module modulename` to see which members are > loaded in the current scope.</maml:para> <maml:para> If the module includes class and enum definitions, use `using module` at the beginning of your script. This import the scripts, including the class and enum definitions. For more information, see about_Using (About/about_Using.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Import the members of a module into the current session</maml:title> <dev:code>Import-Module -Name PSDiagnostics</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 2: Import all modules specified by the module path --</maml:title> <dev:code>Get-Module -ListAvailable | Import-Module</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 3: Import the members of several modules into the current session</maml:title> <dev:code>$m = Get-Module -ListAvailable PSDiagnostics, Dism Import-Module -ModuleInfo $m</dev:code> <dev:remarks> <maml:para>The `Get-Module` cmdlet gets the PSDiagnostics and Dism modules and saves the objects in the `$m` variable. The ListAvailable parameter is required when you're getting modules that aren't yet imported into the session.</maml:para> <maml:para>The ModuleInfo parameter of `Import-Module` is used to import the modules into the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 4: Import all modules specified by a path ------</maml:title> <dev:code>Import-Module -Name c:\ps-test\modules\test -Verbose VERBOSE: Loading module from path 'C:\ps-test\modules\Test\Test.psm1'. VERBOSE: Exporting function 'my-parm'. VERBOSE: Exporting function 'Get-Parameter'. VERBOSE: Exporting function 'Get-Specification'. VERBOSE: Exporting function 'Get-SpecDetails'.</dev:code> <dev:remarks> <maml:para>Using the Verbose parameter causes `Import-Module` to report progress as it loads the module. Without the Verbose , PassThru , or AsCustomObject parameter, `Import-Module` does not generate any output when it imports a module.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 5: Restrict module members imported into a session --</maml:title> <dev:code>Import-Module PSDiagnostics -Function Disable-PSTrace, Enable-PSTrace (Get-Module PSDiagnostics).ExportedCommands Key Value --- ----- Disable-PSTrace Disable-PSTrace Disable-PSWSManCombinedTrace Disable-PSWSManCombinedTrace Disable-WSManTrace Disable-WSManTrace Enable-PSTrace Enable-PSTrace Enable-PSWSManCombinedTrace Enable-PSWSManCombinedTrace Enable-WSManTrace Enable-WSManTrace Get-LogProperties Get-LogProperties Set-LogProperties Set-LogProperties Start-Trace Start-Trace Stop-Trace Stop-Trace Get-Command -Module PSDiagnostics CommandType Name Version Source ----------- ---- ------- ------ Function Disable-PSTrace 6.1.0.0 PSDiagnostics Function Enable-PSTrace 6.1.0.0 PSDiagnostics</dev:code> <dev:remarks> <maml:para>Using the Module parameter of the `Get-Command` cmdlet shows the commands that were imported from the PSDiagnostics module. The results confirm that only the `Disable-PSTrace` and `Enable-PSTrace` cmdlets were imported.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 6: Import the members of a module and add a prefix --</maml:title> <dev:code>Import-Module PSDiagnostics -Prefix x -PassThru ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 6.1.0.0 PSDiagnostics {Disable-xPSTrace, Disable-xPSWSManCombinedTrace, Disable-xW... Get-Command -Module PSDiagnostics CommandType Name Version Source ----------- ---- ------- ------ Function Disable-xPSTrace 6.1.0.0 PSDiagnostics Function Disable-xPSWSManCombinedTrace 6.1.0.0 PSDiagnostics Function Disable-xWSManTrace 6.1.0.0 PSDiagnostics Function Enable-xPSTrace 6.1.0.0 PSDiagnostics Function Enable-xPSWSManCombinedTrace 6.1.0.0 PSDiagnostics Function Enable-xWSManTrace 6.1.0.0 PSDiagnostics Function Get-xLogProperties 6.1.0.0 PSDiagnostics Function Set-xLogProperties 6.1.0.0 PSDiagnostics Function Start-xTrace 6.1.0.0 PSDiagnostics Function Stop-xTrace 6.1.0.0 PSDiagnostics</dev:code> <dev:remarks> <maml:para>`Get-Command` gets the members that have been imported from the module. The output shows that the module members were correctly prefixed.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 7: Get and use a custom object ------------</maml:title> <dev:code>Get-Module -List | Format-Table -Property Name, ModuleType -AutoSize Name ModuleType ---- ---------- Show-Calendar Script BitsTransfer Manifest PSDiagnostics Manifest TestCmdlets Script ... $a = Import-Module -Name Show-Calendar -AsCustomObject -Passthru $a | Get-Member TypeName: System.Management.Automation.PSCustomObject Name MemberType Definition ---- ---------- ---------- Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetType Method type GetType() ToString Method string ToString() Show-Calendar ScriptMethod System.Object Show-Calendar(); $a."Show-Calendar"()</dev:code> <dev:remarks> <maml:para>The Show-Calendar script module is imported using the AsCustomObject parameter to request a custom object and the PassThru parameter to return the object. The resulting custom object is saved in the `$a` variable.</maml:para> <maml:para>The `$a` variable is piped to the `Get-Member` cmdlet to show the properties and methods of the saved object. The output shows a Show-Calendar script method.</maml:para> <maml:para>To call the Show-Calendar script method, the method name must be enclosed in quotation marks because the name includes a hyphen.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 8: Reimport a module into the same session ------</maml:title> <dev:code>Import-Module PSDiagnostics Import-Module PSDiagnostics -Force -Prefix PS</dev:code> <dev:remarks> <maml:para>The first command imports the PSDiagnostics module. The second command imports the module again, this time using the Prefix parameter.</maml:para> <maml:para>Without the Force parameter, the session would include two copies of each PSDiagnostics cmdlet, one with the standard name and one with the prefixed name.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 9: Run commands that have been hidden by imported commands</maml:title> <dev:code>Get-Date Thursday, August 15, 2019 2:26:12 PM Import-Module TestModule Get-Date 19227 Get-Command Get-Date -All | Format-Table -Property CommandType, Name, ModuleName -AutoSize CommandType Name ModuleName ----------- ---- ---------- Function Get-Date TestModule Cmdlet Get-Date Microsoft.PowerShell.Utility Microsoft.PowerShell.Utility\Get-Date Thursday, August 15, 2019 2:28:31 PM</dev:code> <dev:remarks> <maml:para>The first `Get-Date` cmdlet returns a DateTime object with the current date. After importing the TestModule module, `Get-Date` returns the year and day of the year.</maml:para> <maml:para>Using the All parameter of `Get-Command` show all the `Get-Date` commands in the session. The results show that there are two `Get-Date` commands in the session, a function from the TestModule module and a cmdlet from the Microsoft.PowerShell.Utility module.</maml:para> <maml:para>Because functions take precedence over cmdlets, the `Get-Date` function from the TestModule module runs, instead of the `Get-Date` cmdlet. To run the original version of `Get-Date`, you must qualify the command name with the module name.</maml:para> <maml:para>For more information about command precedence in PowerShell, see about_Command_Precedence (about/about_Command_Precedence.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 10: Import a minimum version of a module -------</maml:title> <dev:code>Import-Module -Name PowerShellGet -MinimumVersion 2.0.0</dev:code> <dev:remarks> <maml:para>You can also use the RequiredVersion parameter to import a particular version of a module, or use the Module and Version parameters of the `#Requires` keyword to require a particular version of a module in a script.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 11: Import using a fully qualified name -------</maml:title> <dev:code>PS> Get-Module -ListAvailable PowerShellGet | Select-Object Name, Version Name Version ---- ------- PowerShellGet 2.2.1 PowerShellGet 2.1.3 PowerShellGet 2.1.2 PowerShellGet 1.0.0.1 PS> Import-Module -FullyQualifiedName @{ModuleName = 'PowerShellGet'; ModuleVersion = '2.1.3' }</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 12: Import using a fully qualified path -------</maml:title> <dev:code>PS> Get-Module -ListAvailable PowerShellGet | Select-Object Path Path ---- C:\Program Files\PowerShell\Modules\PowerShellGet\2.2.1\PowerShellGet.psd1 C:\program files\powershell\6\Modules\PowerShellGet\PowerShellGet.psd1 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.1.2\PowerShellGet.psd1 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PowerShellGet.psd1 PS> Import-Module -Name 'C:\Program Files\PowerShell\Modules\PowerShellGet\2.2.1\PowerShellGet.psd1'</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 13: Import a module from a remote computer ------</maml:title> <dev:code>$s = New-PSSession -ComputerName Server01 Get-Module -PSSession $s -ListAvailable -Name NetSecurity ModuleType Name ExportedCommands ---------- ---- ---------------- Manifest NetSecurity {New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoProposal, New-Ne... Import-Module -PSSession $s -Name NetSecurity Get-Command -Module NetSecurity -Name Get-*Firewall* CommandType Name ModuleName ----------- ---- ---------- Function Get-NetFirewallAddressFilter NetSecurity Function Get-NetFirewallApplicationFilter NetSecurity Function Get-NetFirewallInterfaceFilter NetSecurity Function Get-NetFirewallInterfaceTypeFilter NetSecurity Function Get-NetFirewallPortFilter NetSecurity Function Get-NetFirewallProfile NetSecurity Function Get-NetFirewallRule NetSecurity Function Get-NetFirewallSecurityFilter NetSecurity Function Get-NetFirewallServiceFilter NetSecurity Function Get-NetFirewallSetting NetSecurity Get-NetFirewallRule -DisplayName "Windows Remote Management*" | Format-Table -Property DisplayName, Name -AutoSize DisplayName Name ----------- ---- Windows Remote Management (HTTP-In) WINRM-HTTP-In-TCP Windows Remote Management (HTTP-In) WINRM-HTTP-In-TCP-PUBLIC Windows Remote Management - Compatibility Mode (HTTP-In) WINRM-HTTP-Compat-In-TCP</dev:code> <dev:remarks> <maml:para>`New-PSSession` creates a remote session ( PSSession ) to the Server01 computer. The PSSession is saved in the `$s` variable.</maml:para> <maml:para>Running `Get-Module` with the PSSession parameter shows that the NetSecurity module is installed and available on the remote computer. This command is equivalent to using the `Invoke-Command` cmdlet to run `Get-Module` command in the remote session. For example: (`Invoke-Command $s {Get-Module -ListAvailable -Name NetSecurity`</maml:para> <maml:para>Running `Import-Module` with the PSSession parameter imports the NetSecurity module from the remote computer into the current session. The `Get-Command` cmdlet is used to get commands that begin with Get and include Firewall from the NetSecurity module. The output confirms that the module and its cmdlets were imported into the current session.</maml:para> <maml:para>Next, the `Get-NetFirewallRule` cmdlet gets Windows Remote Management firewall rules on the Server01 computer. This is equivalent to using the `Invoke-Command` cmdlet to run `Get-NetFirewallRule` on the remote session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 14: Manage storage on a remote computer without the Windows operating system</maml:title> <dev:code>$cs = New-CimSession -ComputerName RSDGF03 Import-Module -CimSession $cs -Name Storage # Importing a CIM module, converts the CDXML files for each command into PowerShell scripts. # These appear as functions in the local session. Get-Command Get-Disk CommandType Name ModuleName ----------- ---- ---------- Function Get-Disk Storage # Use implicit remoting to query disks on the remote computer from which the module was imported. Get-Disk Number Friendly Name OperationalStatus Total Size Partition Style ------ ------------- ----------------- ---------- --------------- 0 Virtual HD ATA Device Online 40 GB MBR</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/import-module?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Export-ModuleMember</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Invoke-Command</command:name> <command:verb>Invoke</command:verb> <command:noun>Command</command:noun> <maml:description> <maml:para>Runs commands on local and remote computers.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Invoke-Command` cmdlet runs commands on a local or remote computer and returns all output from the commands, including errors. Using a single `Invoke-Command` command, you can run commands on multiple computers.</maml:para> <maml:para>To run a single command on a remote computer, use the ComputerName parameter. To run a series of related commands that share data, use the `New-PSSession` cmdlet to create a PSSession (a persistent connection) on the remote computer, and then use the Session parameter of `Invoke-Command` to run the command in the PSSession . To run a command in a disconnected session, use the InDisconnectedSession parameter. To run a command in a background job, use the AsJob parameter.</maml:para> <maml:para>You can also use `Invoke-Command` on a local computer to a script block as a command. PowerShell runs the script block immediately in a child scope of the current scope.</maml:para> <maml:para>Before using `Invoke-Command` to run commands on a remote computer, read about_Remote (./About/about_Remote.md).</maml:para> <maml:para>Some code samples use splatting to reduce the line length. For more information, see about_Splatting (./About/about_Splatting.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a Uniform Resource Identifier (URI) that defines the connection endpoint of the session. The URI must be fully qualified.</maml:para> <maml:para>The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you don't specify a connection URI, you can use the UseSSL and Port parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but don't specify a port, the session is created with the standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell doesn't redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user's credentials. CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session. For more > information, see > Credential Security Support Provider (/windows/win32/secauthn/credential-security-support-provider).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts and they don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (`.`), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can allow remote access in a loopback session using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created using EnableNetworkAccess , can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Disconnected"> <maml:name>InDisconnectedSession</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs a command or script in a disconnected session.</maml:para> <maml:para>When you use the InDisconnectedSession parameter, `Invoke-Command` creates a persistent session on each remote computer, starts the command specified by the ScriptBlock or FilePath parameter, and then disconnects from the session. The commands continue to run in the disconnected sessions. InDisconnectedSession enables you to run commands without maintaining a connection to the remote sessions. And, because the session is disconnected before any results are returned, InDisconnectedSession makes sure that all command results are returned to the reconnected session, instead of being split between sessions.</maml:para> <maml:para>You can't use InDisconnectedSession with the Session parameter or the AsJob parameter.</maml:para> <maml:para>Commands that use InDisconnectedSession return a PSSession object that represents the disconnected session. They don't return the command output. To connect to the disconnected session, use the `Connect-PSSession` or `Receive-PSSession` cmdlets. To get the results of commands that ran in the session, use the `Receive-PSSession` cmdlet. To run commands that generate output in a disconnected session, set the value of the OutputBufferingMode session option to Drop . If you intend to connect to the disconnected session, set the idle time-out in the session so that it provides sufficient time for you to connect before deleting the session.</maml:para> <maml:para>You can set the output buffering mode and idle time-out in the SessionOption parameter or in the `$PSSessionOption` preference variable. For more information about session options, see `New-PSSessionOption` and about_Preference_Variables (./about/about_preference_variables.md).</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (about/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a Uniform Resource Identifier (URI) that defines the connection endpoint of the session. The URI must be fully qualified.</maml:para> <maml:para>The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you don't specify a connection URI, you can use the UseSSL and Port parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but don't specify a port, the session is created with the standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell doesn't redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user's credentials. CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session. For more > information, see > Credential Security Support Provider (/windows/win32/secauthn/credential-security-support-provider).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (`.`), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can allow remote access in a loopback session using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created using EnableNetworkAccess , can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Disconnected"> <maml:name>InDisconnectedSession</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs a command or script in a disconnected session.</maml:para> <maml:para>When you use the InDisconnectedSession parameter, `Invoke-Command` creates a persistent session on each remote computer, starts the command specified by the ScriptBlock or FilePath parameter, and then disconnects from the session. The commands continue to run in the disconnected sessions. InDisconnectedSession enables you to run commands without maintaining a connection to the remote sessions. And, because the session is disconnected before any results are returned, InDisconnectedSession makes sure that all command results are returned to the reconnected session, instead of being split between sessions.</maml:para> <maml:para>You can't use InDisconnectedSession with the Session parameter or the AsJob parameter.</maml:para> <maml:para>Commands that use InDisconnectedSession return a PSSession object that represents the disconnected session. They don't return the command output. To connect to the disconnected session, use the `Connect-PSSession` or `Receive-PSSession` cmdlets. To get the results of commands that ran in the session, use the `Receive-PSSession` cmdlet. To run commands that generate output in a disconnected session, set the value of the OutputBufferingMode session option to Drop . If you intend to connect to the disconnected session, set the idle time-out in the session so that it provides sufficient time for you to connect before deleting the session.</maml:para> <maml:para>You can set the output buffering mode and idle time-out in the SessionOption parameter or in the `$PSSessionOption` preference variable. For more information about session options, see `New-PSSessionOption` and about_Preference_Variables (./about/about_preference_variables.md).</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (about/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computers on which the command runs. The default is the local computer.</maml:para> <maml:para>When you use the ComputerName parameter, PowerShell creates a temporary connection that's used only to run the specified command and is then closed. If you need a persistent connection, use the Session parameter.</maml:para> <maml:para>Type the NETBIOS name, IP address, or fully qualified domain name of one or more computers in a comma-separated list. To specify the local computer, type the computer name, localhost, or a dot (`.`).</maml:para> <maml:para>To use an IP address in the value of ComputerName , the command must include the Credential parameter. The computer must be configured for the HTTPS transport or the IP address of the remote computer must be included in the local computer's WinRM TrustedHosts list. For instructions to add a computer name to the TrustedHosts list, see [How to Add a Computer to the Trusted Host List](./about/about_remote_troubleshooting.md#how-to-add-a-computer-to-the-trusted-hosts-list).</maml:para> <maml:para>On Windows Vista and later versions of the Windows operating system, to include the local computer in the value of ComputerName , you must run PowerShell using the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Local computer</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you aren't using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable isn't defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (./About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionApplicationName if set on the local computer, otherwise WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user's credentials. CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session. For more > information, see > Credential Security Support Provider (/windows/win32/secauthn/credential-security-support-provider).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (`.`), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can allow remote access in a loopback session using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created using EnableNetworkAccess , can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Disconnected"> <maml:name>InDisconnectedSession</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs a command or script in a disconnected session.</maml:para> <maml:para>When you use the InDisconnectedSession parameter, `Invoke-Command` creates a persistent session on each remote computer, starts the command specified by the ScriptBlock or FilePath parameter, and then disconnects from the session. The commands continue to run in the disconnected sessions. InDisconnectedSession enables you to run commands without maintaining a connection to the remote sessions. And, because the session is disconnected before any results are returned, InDisconnectedSession makes sure that all command results are returned to the reconnected session, instead of being split between sessions.</maml:para> <maml:para>You can't use InDisconnectedSession with the Session parameter or the AsJob parameter.</maml:para> <maml:para>Commands that use InDisconnectedSession return a PSSession object that represents the disconnected session. They don't return the command output. To connect to the disconnected session, use the `Connect-PSSession` or `Receive-PSSession` cmdlets. To get the results of commands that ran in the session, use the `Receive-PSSession` cmdlet. To run commands that generate output in a disconnected session, set the value of the OutputBufferingMode session option to Drop . If you intend to connect to the disconnected session, set the idle time-out in the session so that it provides sufficient time for you to connect before deleting the session.</maml:para> <maml:para>You can set the output buffering mode and idle time-out in the SessionOption parameter or in the `$PSSessionOption` preference variable. For more information about session options, see `New-PSSessionOption` and about_Preference_Variables (./about/about_preference_variables.md).</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (about/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this command. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985 (WinRM port for HTTP) and 5986 (WinRM port for HTTPS).</maml:para> <maml:para>Before using an alternate port, configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Don't use the Port parameter unless you must. The port that is set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for a disconnected session. You can use the name to refer to the session in subsequent commands, such as a `Get-PSSession` command. This parameter is valid only with the InDisconnectedSession parameter.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish a connection to the remote computer. By default, SSL isn't used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS, instead of HTTP.</maml:para> <maml:para>If you use this parameter, but SSL isn't available on the port that's used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computers on which the command runs. The default is the local computer.</maml:para> <maml:para>When you use the ComputerName parameter, PowerShell creates a temporary connection that's used only to run the specified command and is then closed. If you need a persistent connection, use the Session parameter.</maml:para> <maml:para>Type the NETBIOS name, IP address, or fully qualified domain name of one or more computers in a comma-separated list. To specify the local computer, type the computer name, localhost, or a dot (`.`).</maml:para> <maml:para>To use an IP address in the value of ComputerName , the command must include the Credential parameter. The computer must be configured for the HTTPS transport or the IP address of the remote computer must be included in the local computer's WinRM TrustedHosts list. For instructions to add a computer name to the TrustedHosts list, see [How to Add a Computer to the Trusted Host List](./about/about_remote_troubleshooting.md#how-to-add-a-computer-to-the-trusted-hosts-list).</maml:para> <maml:para>On Windows Vista and later versions of the Windows operating system, to include the local computer in the value of ComputerName , you must run PowerShell using the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Local computer</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you aren't using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable isn't defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (./About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionApplicationName if set on the local computer, otherwise WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user's credentials. CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session. For more > information, see > Credential Security Support Provider (/windows/win32/secauthn/credential-security-support-provider).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts and they don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (`.`), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can allow remote access in a loopback session using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created using EnableNetworkAccess , can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Disconnected"> <maml:name>InDisconnectedSession</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs a command or script in a disconnected session.</maml:para> <maml:para>When you use the InDisconnectedSession parameter, `Invoke-Command` creates a persistent session on each remote computer, starts the command specified by the ScriptBlock or FilePath parameter, and then disconnects from the session. The commands continue to run in the disconnected sessions. InDisconnectedSession enables you to run commands without maintaining a connection to the remote sessions. And, because the session is disconnected before any results are returned, InDisconnectedSession makes sure that all command results are returned to the reconnected session, instead of being split between sessions.</maml:para> <maml:para>You can't use InDisconnectedSession with the Session parameter or the AsJob parameter.</maml:para> <maml:para>Commands that use InDisconnectedSession return a PSSession object that represents the disconnected session. They don't return the command output. To connect to the disconnected session, use the `Connect-PSSession` or `Receive-PSSession` cmdlets. To get the results of commands that ran in the session, use the `Receive-PSSession` cmdlet. To run commands that generate output in a disconnected session, set the value of the OutputBufferingMode session option to Drop . If you intend to connect to the disconnected session, set the idle time-out in the session so that it provides sufficient time for you to connect before deleting the session.</maml:para> <maml:para>You can set the output buffering mode and idle time-out in the SessionOption parameter or in the `$PSSessionOption` preference variable. For more information about session options, see `New-PSSessionOption` and about_Preference_Variables (./about/about_preference_variables.md).</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (about/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this command. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985 (WinRM port for HTTP) and 5986 (WinRM port for HTTPS).</maml:para> <maml:para>Before using an alternate port, configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Don't use the Port parameter unless you must. The port that is set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for a disconnected session. You can use the name to refer to the session in subsequent commands, such as a `Get-PSSession` command. This parameter is valid only with the InDisconnectedSession parameter.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish a connection to the remote computer. By default, SSL isn't used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS, instead of HTTP.</maml:para> <maml:para>If you use this parameter, but SSL isn't available on the port that's used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of sessions in which this cmdlet runs the command. Enter a variable that contains PSSession objects or a command that creates or gets the PSSession objects, such as a `New-PSSession` or `Get-PSSession` command.</maml:para> <maml:para>When you create a PSSession , PowerShell establishes a persistent connection to the remote computer. Use a PSSession to run a series of related commands that share data. To run a single command or a series of unrelated commands, use the ComputerName parameter. For more information, see about_PSSessions (./About/about_PSSessions.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of sessions in which this cmdlet runs the command. Enter a variable that contains PSSession objects or a command that creates or gets the PSSession objects, such as a `New-PSSession` or `Get-PSSession` command.</maml:para> <maml:para>When you create a PSSession , PowerShell establishes a persistent connection to the remote computer. Use a PSSession to run a series of related commands that share data. To run a single command or a series of unrelated commands, use the ComputerName parameter. For more information, see about_PSSessions (./About/about_PSSessions.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of virtual machines.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of virtual machines.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of container IDs.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet invokes a command as an Administrator.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of container IDs.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet invokes a command as an Administrator.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Invoke-Command</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoNewScope</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the specified command in the current scope. By default, `Invoke-Command` runs commands in their own scope.</maml:para> <maml:para>This parameter is valid only in commands that are run in the current session, that is, commands that omit both the ComputerName and Session parameters.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell doesn't redirect connections, but you can use this parameter to allow it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you aren't using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable isn't defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (./About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionApplicationName if set on the local computer, otherwise WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Supplies the values of local variables in the command. The variables in the command are replaced by these values before the command is run on the remote computer. Enter the values in a comma-separated list. Values are associated with variables in the order that they're listed. The alias for ArgumentList is Args.</maml:para> <maml:para>The values in the ArgumentList parameter can be actual values, such as 1024, or they can be references to local variables, such as `$max`.</maml:para> <maml:para>To use local variables in a command, use the following command format:</maml:para> <maml:para>`{param($<name1>[, $<name2>]...) <command-with-local-variables>} -ArgumentList <value>` -or- `<local-variable>`</maml:para> <maml:para>The param keyword lists the local variables that are used in the command. ArgumentList supplies the values of the variables, in the order that they're listed. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command as a background job on a remote computer. Use this parameter to run commands that take an extensive time to finish.</maml:para> <maml:para>When you use the AsJob parameter, the command returns an object that represents the job, and then displays the command prompt. You can continue to work in the session while the job finishes. To manage the job, use the `*-Job` cmdlets. To get the job results, use the `Receive-Job` cmdlet.</maml:para> <maml:para>The AsJob parameter resembles using the `Invoke-Command` cmdlet to run a `Start-Job` cmdlet remotely. However, with AsJob , the job is created on the local computer, even though the job runs on a remote computer. The results of the remote job are automatically returned to the local computer.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user's credentials. CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session. For more > information, see > Credential Security Support Provider (/windows/win32/secauthn/credential-security-support-provider).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts and they don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computers on which the command runs. The default is the local computer.</maml:para> <maml:para>When you use the ComputerName parameter, PowerShell creates a temporary connection that's used only to run the specified command and is then closed. If you need a persistent connection, use the Session parameter.</maml:para> <maml:para>Type the NETBIOS name, IP address, or fully qualified domain name of one or more computers in a comma-separated list. To specify the local computer, type the computer name, localhost, or a dot (`.`).</maml:para> <maml:para>To use an IP address in the value of ComputerName , the command must include the Credential parameter. The computer must be configured for the HTTPS transport or the IP address of the remote computer must be included in the local computer's WinRM TrustedHosts list. For instructions to add a computer name to the TrustedHosts list, see [How to Add a Computer to the Trusted Host List](./about/about_remote_troubleshooting.md#how-to-add-a-computer-to-the-trusted-hosts-list).</maml:para> <maml:para>On Windows Vista and later versions of the Windows operating system, to include the local computer in the value of ComputerName , you must run PowerShell using the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Local computer</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration doesn't exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable isn't set, the default is Microsoft.PowerShell . For more information, see about_Preference_Variables (about/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>$PSSessionConfigurationName if set on the local computer, otherwise Microsoft.PowerShell</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a Uniform Resource Identifier (URI) that defines the connection endpoint of the session. The URI must be fully qualified.</maml:para> <maml:para>The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you don't specify a connection URI, you can use the UseSSL and Port parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but don't specify a port, the session is created with the standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of container IDs.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (`.`), localhost, or the name of the local computer.</maml:para> <maml:para>By default, loopback sessions are created using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can allow remote access in a loopback session using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created using EnableNetworkAccess , can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="PSPath"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs on one or more remote computers. Enter the path and filename of the script, or pipe a script path to `Invoke-Command`. The script must exist on the local computer or in a directory that the local computer can access. Use ArgumentList to specify the values of parameters in the script.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block, transmits the script block to the remote computer, and runs it on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="HCN"> <maml:name>HideComputerName</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet omits the computer name of each object from the output display. By default, the name of the computer that generated the object appears in the display.</maml:para> <maml:para>This parameter affects only the output display. It doesn't change the object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Disconnected"> <maml:name>InDisconnectedSession</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs a command or script in a disconnected session.</maml:para> <maml:para>When you use the InDisconnectedSession parameter, `Invoke-Command` creates a persistent session on each remote computer, starts the command specified by the ScriptBlock or FilePath parameter, and then disconnects from the session. The commands continue to run in the disconnected sessions. InDisconnectedSession enables you to run commands without maintaining a connection to the remote sessions. And, because the session is disconnected before any results are returned, InDisconnectedSession makes sure that all command results are returned to the reconnected session, instead of being split between sessions.</maml:para> <maml:para>You can't use InDisconnectedSession with the Session parameter or the AsJob parameter.</maml:para> <maml:para>Commands that use InDisconnectedSession return a PSSession object that represents the disconnected session. They don't return the command output. To connect to the disconnected session, use the `Connect-PSSession` or `Receive-PSSession` cmdlets. To get the results of commands that ran in the session, use the `Receive-PSSession` cmdlet. To run commands that generate output in a disconnected session, set the value of the OutputBufferingMode session option to Drop . If you intend to connect to the disconnected session, set the idle time-out in the session so that it provides sufficient time for you to connect before deleting the session.</maml:para> <maml:para>You can set the output buffering mode and idle time-out in the SessionOption parameter or in the `$PSSessionOption` preference variable. For more information about session options, see `New-PSSessionOption` and about_Preference_Variables (./about/about_preference_variables.md).</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (about/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects or type a command or expression that gets the objects.</maml:para> <maml:para>When using the InputObject parameter, use the `$Input` automatic variable in the value of the ScriptBlock parameter to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the background job. By default, jobs are named `Job<n>`, where `<n>` is an ordinal number.</maml:para> <maml:para>If you use the JobName parameter in a command, the command is run as a job, and `Invoke-Command` returns a job object, even if you don't include AsJob in the command.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Job<n></dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoNewScope</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the specified command in the current scope. By default, `Invoke-Command` runs commands in their own scope.</maml:para> <maml:para>This parameter is valid only in commands that are run in the current session, that is, commands that omit both the ComputerName and Session parameters.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this command. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985 (WinRM port for HTTP) and 5986 (WinRM port for HTTPS).</maml:para> <maml:para>Before using an alternate port, configure the WinRM listener on the remote computer to listen at that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Don't use the Port parameter unless you must. The port that is set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet invokes a command as an Administrator.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run. Enclose the commands in curly braces `{ }` to create a script block. This parameter is required.</maml:para> <maml:para>By default, any variables in the command are evaluated on the remote computer. To include local variables in the command, use ArgumentList .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of sessions in which this cmdlet runs the command. Enter a variable that contains PSSession objects or a command that creates or gets the PSSession objects, such as a `New-PSSession` or `Get-PSSession` command.</maml:para> <maml:para>When you create a PSSession , PowerShell establishes a persistent connection to the remote computer. Use a PSSession to run a series of related commands that share data. To run a single command or a series of unrelated commands, use the ComputerName parameter. For more information, see about_PSSessions (./About/about_PSSessions.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for a disconnected session. You can use the name to refer to the session in subsequent commands, such as a `Get-PSSession` command. This parameter is valid only with the InDisconnectedSession parameter.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>32</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to establish a connection to the remote computer. By default, SSL isn't used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. The UseSSL parameter is an additional protection that sends the data across an HTTPS, instead of HTTP.</maml:para> <maml:para>If you use this parameter, but SSL isn't available on the port that's used for the command, the command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of virtual machines.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a command in a script block to `Invoke-Command`. Use the `$Input` automatic variable to represent the input objects in the command.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSRemotingJob, System.Management.Automation.Runspaces.PSSession, or the output of the invoked command</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a job object, if you use the AsJob parameter. If you specify the InDisconnectedSession parameter, `Invoke-Command` returns a PSSession object. Otherwise, it returns the output of the invoked command, which is the value of the ScriptBlock parameter.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>On Windows Vista, and later versions of the Windows operating system, to use the ComputerName parameter of `Invoke-Command` to run a command on the local computer, you must run PowerShell using the Run as administrator option.</maml:para> <maml:para>When you run commands on multiple computers, PowerShell connects to the computers in the order in which they appear in the list. However, the command output is displayed in the order that it's received from the remote computers, which might be different.</maml:para> <maml:para>Errors that result from the command that `Invoke-Command` runs are included in the command results. Errors that would be terminating errors in a local command are treated as non-terminating errors in a remote command. This strategy makes sure that terminating errors on one computer don't close the command on all computers on which it's run. This practice is used even when a remote command is run on a single computer.</maml:para> <maml:para>If the remote computer isn't in a domain that the local computer trusts, the computer might not be able to authenticate the user's credentials. To add the remote computer to the list of trusted hosts in WS-Management, use the following command in the `WSMAN` provider, where `<Remote-Computer-Name>` is the name of the remote computer:</maml:para> <maml:para>`Set-Item -Path WSMan:\Localhost\Client\TrustedHosts -Value <Remote-Computer-Name>`</maml:para> <maml:para>When you disconnect a PSSession using the InDisconnectedSession parameter, the session state is Disconnected and the availability is None . The value of the State property is relative to the current session. A value of Disconnected means that the PSSession isn't connected to the current session. However, it doesn't mean that the PSSession is disconnected from all sessions. It might be connected to a different session. To determine whether you can connect or reconnect to the session, use the Availability property.</maml:para> <maml:para>An Availability value of None indicates that you can connect to the session. A value of Busy indicates that you can't connect to the PSSession because it's connected to another session. For more information about the values of the State property of sessions, see RunspaceState (/dotnet/api/system.management.automation.runspaces.runspacestate). For more information about the values of the Availability property of sessions, see RunspaceAvailability (/dotnet/api/system.management.automation.runspaces.runspaceavailability).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------- Example 1: Run a script on a server -------------</maml:title> <dev:code>Invoke-Command -FilePath c:\scripts\test.ps1 -ComputerName Server01</dev:code> <dev:remarks> <maml:para>The FilePath parameter specifies a script that is located on the local computer. The script runs on the remote computer and the results are returned to the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 2: Run a command on a remote server ---------</maml:title> <dev:code>Invoke-Command -ComputerName Server01 -Credential Domain01\User01 -ScriptBlock { Get-Culture }</dev:code> <dev:remarks> <maml:para>The ComputerName parameter specifies the name of the remote computer. The Credential parameter is used to run the command in the security context of Domain01\User01, a user who has permission to run commands. The ScriptBlock parameter specifies the command to be run on the remote computer.</maml:para> <maml:para>In response, PowerShell requests the password and an authentication method for the User01 account. It then runs the command on the Server01 computer and returns the result.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 3: Run a command in a persistent connection -----</maml:title> <dev:code>$s = New-PSSession -ComputerName Server02 -Credential Domain01\User01 Invoke-Command -Session $s -ScriptBlock {Get-Culture}</dev:code> <dev:remarks> <maml:para>The `New-PSSession` cmdlet creates a session on the Server02 remote computer and saves it in the `$s` variable. Typically, you create a session only when you run a series of commands on the remote computer.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs the `Get-Culture` command on Server02. The Session parameter specifies the session saved in the `$s` variable.</maml:para> <maml:para>In response, PowerShell runs the command in the session on the Server02 computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Use a session to run a series of commands that share data</maml:title> <dev:code>Invoke-Command -ComputerName Server02 -ScriptBlock {$p = Get-Process PowerShell} Invoke-Command -ComputerName Server02 -ScriptBlock {$p.VirtualMemorySize} $s = New-PSSession -ComputerName Server02 Invoke-Command -Session $s -ScriptBlock {$p = Get-Process PowerShell} Invoke-Command -Session $s -ScriptBlock {$p.VirtualMemorySize} 17930240</dev:code> <dev:remarks> <maml:para>The first two commands use the ComputerName parameter of `Invoke-Command` to run commands on the Server02 remote computer. The first command uses the `Get-Process` cmdlet to get the PowerShell process on the remote computer and to save it in the `$p` variable. The second command gets the value of the VirtualMemorySize property of the PowerShell process.</maml:para> <maml:para>When you use the ComputerName parameter, PowerShell creates a new session to run the command. The session is closed when the command completes. The `$p` variable was created in one connection, but it doesn't exist in the connection created for the second command.</maml:para> <maml:para>The problem is solved by creating a persistent session on the remote computer, then running both of the commands in the same session.</maml:para> <maml:para>The `New-PSSession` cmdlet creates a persistent session on the computer Server02 and saves the session in the `$s` variable. The `Invoke-Command` lines that follow use the Session parameter to run both of the commands in the same session. Since both commands run in the same session, the `$p` value remains active.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 5: Enter a command stored in a local variable ----</maml:title> <dev:code>$command = { Get-EventLog -LogName "Windows PowerShell" | Where-Object {$_.Message -like "*certificate*"} } Invoke-Command -ComputerName S1, S2 -ScriptBlock $command</dev:code> <dev:remarks> <maml:para>The `$command` variable stores the `Get-EventLog` command that's formatted as a script block. The `Invoke-Command` runs the command stored in `$command` on the S1 and S2 remote computers.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 6: Run a single command on several computers -----</maml:title> <dev:code>$parameters = @{ ComputerName = "Server01", "Server02", "TST-0143", "localhost" ConfigurationName = 'MySession.PowerShell' ScriptBlock = { Get-EventLog "Windows PowerShell" } } Invoke-Command @parameters</dev:code> <dev:remarks> <maml:para>The ComputerName parameter specifies a comma-separated list of computer names. The list of computers includes the localhost value, which represents the local computer. The ConfigurationName parameter specifies an alternate session configuration. The ScriptBlock parameter runs `Get-EventLog` to get the Windows PowerShell event logs from each computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 7: Get the version of the host program on multiple computers</maml:title> <dev:code>$version = Invoke-Command -ComputerName (Get-Content Machines.txt) -ScriptBlock {(Get-Host).Version}</dev:code> <dev:remarks> <maml:para>Because only one command is run, you don't have to create persistent connections to each of the computers. Instead, the command uses the ComputerName parameter to indicate the computers. To specify the computers, it uses the `Get-Content` cmdlet to get the contents of the Machine.txt file, a file of computer names.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs a `Get-Host` command on the remote computers. It uses dot notation to get the Version property of the PowerShell host.</maml:para> <maml:para>These commands run one at a time. When the commands complete, the output of the commands from all of the computers is saved in the `$version` variable. The output includes the name of the computer from which the data originated.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 8: Run a background job on several remote computers -</maml:title> <dev:code>$s = New-PSSession -ComputerName Server01, Server02 Invoke-Command -Session $s -ScriptBlock {Get-EventLog system} -AsJob Id Name State HasMoreData Location Command --- ---- ----- ----- ----------- --------------- 1 Job1 Running True Server01,Server02 Get-EventLog system $j = Get-Job $j | Format-List -Property * HasMoreData : True StatusMessage : Location : Server01,Server02 Command : Get-EventLog system JobStateInfo : Running Finished : System.Threading.ManualResetEvent InstanceId : e124bb59-8cb2-498b-a0d2-2e07d4e030ca Id : 1 Name : Job1 ChildJobs : {Job2, Job3} Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} StateChanged : $results = $j | Receive-Job</dev:code> <dev:remarks> <maml:para>The `New-PSSession` cmdlet creates sessions on the Server01 and Server02 remote computers. The `Invoke-Command` cmdlet runs a background job in each of the sessions. The command uses the AsJob parameter to run the command as a background job. This command returns a job object that contains two child job objects, one for each of the jobs run on the two remote computers.</maml:para> <maml:para>The `Get-Job` command saves the job object in the `$j` variable. The `$j` variable is then piped to the `Format-List` cmdlet to display all properties of the job object in a list. The last command gets the results of the jobs. It pipes the job object in `$j` to the `Receive-Job` cmdlet and stores the results in the `$results` variable.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 9: Include local variables in a command run on a remote computer</maml:title> <dev:code>$Log = "Windows PowerShell" Invoke-Command -ComputerName Server01 -ScriptBlock { Get-EventLog -LogName $Using:Log -Newest 10 }</dev:code> <dev:remarks> <maml:para>The `$Log` variable stores the name of the event log, Windows PowerShell. The `Invoke-Command` cmdlet runs `Get-EventLog` on Server01 to get the ten newest events from the event log. The value of the LogName parameter is the `$Log` variable, which is prefixed by the `Using` scope modifier to indicate that it was created in the local session, not in the remote session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 10: Hide the computer name --------------</maml:title> <dev:code>Invoke-Command -ComputerName S1, S2 -ScriptBlock {Get-Process PowerShell} PSComputerName Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName -------------- ------- ------ ----- ----- ----- ------ -- ----------- S1 575 15 45100 40988 200 4.68 1392 PowerShell S2 777 14 35100 30988 150 3.68 67 PowerShell Invoke-Command -ComputerName S1, S2 -ScriptBlock {Get-Process PowerShell} -HideComputerName Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 575 15 45100 40988 200 4.68 1392 PowerShell 777 14 35100 30988 150 3.68 67 PowerShell</dev:code> <dev:remarks> <maml:para>The first two commands use `Invoke-Command` to run a `Get-Process` command for the PowerShell process. The output of the first command includes the PsComputerName property, which contains the name of the computer on which the command ran. The output of the second command, which uses HideComputerName , doesn't include the PsComputerName column.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 11: Use the Param keyword in a script block -----</maml:title> <dev:code>$parameters = @{ ComputerName = "Server01" ScriptBlock = { Param ($param1,$param2) Get-ChildItem -Name $param1 -Include $param2 } ArgumentList = "a*", "*.pdf" } Invoke-Command @parameters aa.pdf ab.pdf ac.pdf az.pdf</dev:code> <dev:remarks> <maml:para>`Invoke-Command` uses the ScriptBlock parameter that defines two variables, `$param1` and `$param2`. `Get-ChildItem` uses the named parameters, Name and Include with the variable names. The ArgumentList passes the values to the variables.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 12: Use the $args automatic variable in a script block</maml:title> <dev:code>$parameters = @{ ComputerName = "Server01" ScriptBlock = { Get-ChildItem $args[0] $args[1] } ArgumentList = "C:\Test", "*.txt*" } Invoke-Command @parameters Directory: C:\Test Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 6/12/2019 15:15 128 alog.txt -a--- 7/27/2019 15:16 256 blog.txt -a--- 9/28/2019 17:10 64 zlog.txt</dev:code> <dev:remarks> <maml:para>`Invoke-Command` uses a ScriptBlock parameter and `Get-ChildItem` specifies the `$args[0]` and `$args[1]` array values. The ArgumentList passes the `$args` array values to the `Get-ChildItem` parameter positions for Path and Filter .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 13: Run a script on all the computers listed in a text file</maml:title> <dev:code>Invoke-Command -ComputerName (Get-Content Servers.txt) -FilePath C:\Scripts\Sample.ps1 -ArgumentList Process, Service</dev:code> <dev:remarks> <maml:para>When you submit the command, the content of the `Sample.ps1` file is copied into a script block and the script block is run on each of the remote computers. This procedure is equivalent to using the ScriptBlock parameter to submit the contents of the script.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 14: Run a command on a remote computer using a URI --</maml:title> <dev:code>$LiveCred = Get-Credential $parameters = @{ ConfigurationName = 'Microsoft.Exchange' ConnectionUri = 'https://ps.exchangelabs.com/PowerShell' Credential = $LiveCred Authentication = 'Basic' ScriptBlock = {Set-Mailbox Dan -DisplayName "Dan Park"} } Invoke-Command @parameters</dev:code> <dev:remarks> <maml:para>The first line uses the `Get-Credential` cmdlet to store Windows Live ID credentials in the `$LiveCred` variable. PowerShell prompts the user to enter Windows Live ID credentials.</maml:para> <maml:para>The `$parameters` variable is a hash table containing the parameters to be passed to the `Invoke-Command` cmdlet. The `Invoke-Command` cmdlet runs a `Set-Mailbox` command using the Microsoft.Exchange session configuration. The ConnectionURI parameter specifies the URL of the Exchange server endpoint. The Credential parameter specifies the credentials stored in the `$LiveCred` variable. The AuthenticationMechanism parameter specifies the use of basic authentication. The ScriptBlock parameter specifies a script block that contains the command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------- Example 15: Use a session option ---------------</maml:title> <dev:code>$so = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck Invoke-Command -ComputerName server01 -UseSSL -ScriptBlock { Get-HotFix } -SessionOption $so -Credential server01\user01</dev:code> <dev:remarks> <maml:para>The `New-PSSessionOption` cmdlet creates a session option object that causes the remote end not to verify the Certificate Authority, Canonical Name, and Revocation Lists while evaluating the incoming HTTPS connection. The SessionOption object is saved in the `$so` variable.</maml:para> <maml:para>> [!NOTE] > Disabling these checks is convenient for troubleshooting, but obviously not secure.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs a `Get-HotFix` command remotely. The SessionOption parameter is given the `$so` variable.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 16: Manage URI redirection in a remote command ----</maml:title> <dev:code>$max = New-PSSessionOption -MaximumRedirection 1 $parameters = @{ ConnectionUri = "https://ps.exchangelabs.com/PowerShell" ScriptBlock = { Get-Mailbox dan } AllowRedirection = $true SessionOption = $max } Invoke-Command @parameters</dev:code> <dev:remarks> <maml:para>The `New-PSSessionOption` cmdlet creates a PSSessionOption object that is saved in the `$max` variable. The command uses the MaximumRedirection parameter to set the MaximumConnectionRedirectionCount property of the PSSessionOption object to 1.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs a `Get-Mailbox` command on a remote Microsoft Exchange Server. The AllowRedirection parameter provides explicit permission to redirect the connection to an alternate endpoint. The SessionOption parameter uses the session object stored in the `$max` variable.</maml:para> <maml:para>As a result, if the remote computer specified by ConnectionURI returns a redirection message, PowerShell redirects the connection, but if the new destination returns another redirection message, the redirection count value of 1 is exceeded, and `Invoke-Command` returns a non-terminating error.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 17: Access a network share in a remote session ----</maml:title> <dev:code>Enable-WSManCredSSP -Role Client -DelegateComputer Server02 $s = New-PSSession Server02 Invoke-Command -Session $s -ScriptBlock {Enable-WSManCredSSP -Role Server -Force} $parameters = @{ Session = $s ScriptBlock = { Get-Item \\Net03\Scripts\LogFiles.ps1 } Authentication = "CredSSP" Credential = "Domain01\Admin01" } Invoke-Command @parameters</dev:code> <dev:remarks> <maml:para>The `Enable-WSManCredSSP` cmdlet enables CredSSP delegation from the Server01 local computer to the Server02 remote computer. The Role parameter specifies Client to configure the CredSSP client setting on the local computer.</maml:para> <maml:para>`New-PSSession` creates a PSSession object for Server02 and stores the object in the `$s` variable.</maml:para> <maml:para>The `Invoke-Command` cmdlet uses the `$s` variable to connect to the remote computer, Server02. The ScriptBlock parameter runs `Enable-WSManCredSSP` on the remote computer. The Role parameter specifies Server to configure the CredSSP server setting on the remote computer.</maml:para> <maml:para>The `$parameters` variable contains the parameter values to connect to the network share. The `Invoke-Command` cmdlet runs a `Get-Item` command in the session in `$s`. This command gets a script from the `\Net03\Scripts` network share. The command uses the Authentication parameter with a value of CredSSP and the Credential parameter with a value of Domain01\Admin01 .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 18: Start scripts on many remote computers ------</maml:title> <dev:code>$parameters = @{ ComputerName = (Get-Content -Path C:\Test\Servers.txt) InDisconnectedSession = $true FilePath = "\\Scripts\Public\ConfigInventory.ps1" SessionOption = @{OutputBufferingMode="Drop";IdleTimeout=43200000} } Invoke-Command @parameters</dev:code> <dev:remarks> <maml:para>The command uses `Invoke-Command` to run the script. The value of the ComputerName parameter is a `Get-Content` command that gets the names of the remote computers from a text file. The InDisconnectedSession parameter disconnects the sessions as soon as it starts the command. The value of the FilePath parameter is the script that `Invoke-Command` runs on each computer.</maml:para> <maml:para>The value of SessionOption is a hash table. The OutputBufferingMode value is set to Drop and the IdleTimeout value is set to 43200000 milliseconds (12 hours).</maml:para> <maml:para>To get the results of commands and scripts that run in disconnected sessions, use the `Receive-PSSession` cmdlet.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSSessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Disconnected_Sessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Troubleshooting</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Variables</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Scopes</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Item</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Invoke-History</command:name> <command:verb>Invoke</command:verb> <command:noun>History</command:noun> <maml:description> <maml:para>Runs commands from the session history.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Invoke-History` cmdlet runs commands from the session history. You can pass objects representing the commands from Get-History to `Invoke-History`, or you can identify commands in the current history by using their Id number. To find the identification number of a command, use the `Get-History` cmdlet.</maml:para> <maml:para>The session history is managed separately from the history maintained by the PSReadLine module. Both histories are available in sessions where PSReadLine is loaded. This cmdlet only works with the session history. For more information see, about_PSReadLine (../PSReadLine/About/about_PSReadLine.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Invoke-History</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the Id of a command in the history. You can type the Id number of the command or the first few characters of the command.</maml:para> <maml:para>If you type characters, `Invoke-History` matches the most recent commands first. If you omit this parameter, `Invoke-History` runs the last, or most recent, command. To find the Id number of a command, use the `Get-History` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the Id of a command in the history. You can type the Id number of the command or the first few characters of the command.</maml:para> <maml:para>If you type characters, `Invoke-History` matches the most recent commands first. If you omit this parameter, `Invoke-History` runs the last, or most recent, command. To find the Id number of a command, use the `Get-History` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a history Id to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output, but output might be generated by the commands that `Invoke-History` runs.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The session history is a list of the commands entered during the session. The session history represents the order of execution, the status, and the start and end times of the command. As you enter each command, PowerShell adds it to the history so that you can reuse it. For more information about the session history, see about_History (About/about_History.md).</maml:para> <maml:para>You can also refer to `Invoke-History` by its built-in aliases, `r` and `ihy`. For more information, see about_Aliases (About/about_Aliases.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---- Example 1: Run the most recent command in the history ----</maml:title> <dev:code>Invoke-History</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 2: Run the command that has a specified ID ------</maml:title> <dev:code>Invoke-History -Id 132</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 3: Run the most recent command by using the command text</maml:title> <dev:code>Invoke-History -Id get-pr</dev:code> <dev:remarks> <maml:para>> [!NOTE] > Pattern matching is case-insensitive, but the pattern matches the beginning of the line.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 4: Run a sequence of commands from the history ----</maml:title> <dev:code>16..24 | ForEach {Invoke-History -Id $_ }</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 5 --------------------------</maml:title> <dev:code>Get-History -Id 255 -Count 7 | ForEach {Invoke-History -Id $_.Id}</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/invoke-history?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Add-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-History</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-Module</command:name> <command:verb>New</command:verb> <command:noun>Module</command:noun> <maml:description> <maml:para>Creates a new dynamic module that exists only in memory.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `New-Module` cmdlet creates a dynamic module from a script block. The members of the dynamic module, such as functions and variables, are immediately available in the session and remain available until you close the session.</maml:para> <maml:para>Like static modules, by default, the cmdlets and functions in a dynamic module are exported and the variables and aliases are not. However, you can use the Export-ModuleMember cmdlet and the parameters of `New-Module` to override the defaults.</maml:para> <maml:para>You can also use the AsCustomObject parameter of `New-Module` to return the dynamic module as a custom object. The members of the modules, such as functions, are implemented as script methods of the custom object instead of being imported into the session.</maml:para> <maml:para>Dynamic modules exist only in memory, not on disk. Like all modules, the members of dynamic modules run in a private module scope that is a child of the global scope. Get-Module cannot get a dynamic module, but Get-Command can get the exported members.</maml:para> <maml:para>To make a dynamic module available to `Get-Module`, pipe a `New-Module` command to Import-Module, or pipe the module object that `New-Module` returns to `Import-Module`. This action adds the dynamic module to the `Get-Module` list, but it does not save the module to disk or make it persistent.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a name for the new module. You can also pipe a module name to New-Module.</maml:para> <maml:para>The default value is an autogenerated name that starts with ` _DynamicModule ` and is followed by a GUID that specifies the path of the dynamic module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the contents of the dynamic module. Enclose the contents in braces (`{}`) to create a script block. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments which are parameter values that are passed to the script block. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object that represents the dynamic module. The module members are implemented as script methods of the custom object, but they are not imported into the session. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> <maml:para>If the module has multiple members with the same name, such as a function and a variable that are both named A, only one member with each name can be accessed from the custom object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet exports from the module into the current session. Enter a comma-separated list of cmdlets. Wildcard characters are permitted. By default, all cmdlets in the module are exported.</maml:para> <maml:para>You cannot define cmdlets in a script block, but a dynamic module can include cmdlets if it imports the cmdlets from a binary module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet exports from the module into the current session. Enter a comma-separated list of functions. Wildcard characters are permitted. By default, all functions defined in a module are exported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ReturnResult</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the script block and returns the script block results instead of returning a module object.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments which are parameter values that are passed to the script block. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AsCustomObject</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns a custom object that represents the dynamic module. The module members are implemented as script methods of the custom object, but they are not imported into the session. You can save the custom object in a variable and use dot notation to invoke the members.</maml:para> <maml:para>If the module has multiple members with the same name, such as a function and a variable that are both named A, only one member with each name can be accessed from the custom object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Cmdlet</maml:name> <maml:Description> <maml:para>Specifies an array of cmdlets that this cmdlet exports from the module into the current session. Enter a comma-separated list of cmdlets. Wildcard characters are permitted. By default, all cmdlets in the module are exported.</maml:para> <maml:para>You cannot define cmdlets in a script block, but a dynamic module can include cmdlets if it imports the cmdlets from a binary module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>Function</maml:name> <maml:Description> <maml:para>Specifies an array of functions that this cmdlet exports from the module into the current session. Enter a comma-separated list of functions. Wildcard characters are permitted. By default, all functions defined in a module are exported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a name for the new module. You can also pipe a module name to New-Module.</maml:para> <maml:para>The default value is an autogenerated name that starts with ` _DynamicModule ` and is followed by a GUID that specifies the path of the dynamic module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ReturnResult</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the script block and returns the script block results instead of returning a module object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the contents of the dynamic module. Enclose the contents in braces (`{}`) to create a script block. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a module name to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo, System.Management.Automation.PSCustomObject, or None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet generates a PSModuleInfo object, by default. If you use the AsCustomObject parameter, it generates a PSCustomObject object. If you use the ReturnResult parameter, it returns the result of evaluating the script block in the dynamic module.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>You can also refer to `New-Module` by its alias, `nmo`. For more information, see about_Aliases (About/about_Aliases.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------- Example 1: Create a dynamic module --------------</maml:title> <dev:code>New-Module -ScriptBlock {function Hello {"Hello!"}} Name : __DynamicModule_2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5 Path : 2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5 Description : Guid : 00000000-0000-0000-0000-000000000000 Version : 0.0 ModuleBase : ModuleType : Script PrivateData : AccessMode : ReadWrite ExportedAliases : {} ExportedCmdlets : {} ExportedFunctions : {[Hello, Hello]} ExportedVariables : {} NestedModules : {}</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Working with dynamic modules and Get-Module and Get-Command</maml:title> <dev:code>new-module -scriptblock {function Hello {"Hello!"}} Name : __DynamicModule_2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5 Path : 2ceb1d0a-990f-45e4-9fe4-89f0f6ead0e5 Description : Guid : 00000000-0000-0000-0000-000000000000 Version : 0.0 ModuleBase : ModuleType : Script PrivateData : AccessMode : ReadWrite ExportedAliases : {} ExportedCmdlets : {} ExportedFunctions : {[Hello, Hello]} ExportedVariables : {} NestedModules : {} Get-Module Get-Command Hello CommandType Name Definition ----------- ---- ---------- Function Hello "Hello!"</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 3: Export a variable into the current session ----</maml:title> <dev:code>New-Module -ScriptBlock {$SayHelloHelp="Type 'SayHello', a space, and a name."; function SayHello ($name) { "Hello, $name" }; Export-ModuleMember -function SayHello -Variable SayHelloHelp} $SayHelloHelp Type 'SayHello', a space, and a name. SayHello Jeffrey Hello, Jeffrey</dev:code> <dev:remarks> <maml:para>The output shows that both the variable and the function were exported into the session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 4: Make a dynamic module available to Get-Module ---</maml:title> <dev:code>New-Module -ScriptBlock {function Hello {"Hello!"}} -name GreetingModule | Import-Module Get-Module Name : GreetingModule Path : d54dfdac-4531-4db2-9dec-0b4b9c57a1e5 Description : Guid : 00000000-0000-0000-0000-000000000000 Version : 0.0 ModuleBase : ModuleType : Script PrivateData : AccessMode : ReadWrite ExportedAliases : {} ExportedCmdlets : {} ExportedFunctions : {[Hello, Hello]} ExportedVariables : {} NestedModules : {} Get-Command hello CommandType Name Definition ----------- ---- ---------- Function Hello "Hello!"</dev:code> <dev:remarks> <maml:para>The `Get-Command` cmdlet shows the `Hello` function that the dynamic module exports.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: Generate a custom object that has exported functions</maml:title> <dev:code>$m = New-Module -ScriptBlock { function Hello ($name) {"Hello, $name"} function Goodbye ($name) {"Goodbye, $name"} } -AsCustomObject $m $m | Get-Member TypeName: System.Management.Automation.PSCustomObject Name MemberType Definition ---- ---------- ---------- Equals Method bool Equals(System.Object obj) GetHashCode Method int GetHashCode() GetType Method type GetType() ToString Method string ToString() Goodbye ScriptMethod System.Object Goodbye(); Hello ScriptMethod System.Object Hello(); $m.goodbye("Jane") Goodbye, Jane $m.hello("Manoj") Hello, Manoj</dev:code> <dev:remarks> <maml:para>Piping `$m` to the `Get-Member` cmdlet displays the properties and methods of the custom object. The output shows that the object has script methods that represent the `Hello` and `Goodbye` functions. Finally, we call these script methods and display the results.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 6: Get the results of the script block --------</maml:title> <dev:code>New-Module -ScriptBlock {function SayHello {"Hello, World!"}; SayHello} -ReturnResult Hello, World!</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-module?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Export-ModuleMember</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Modules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-ModuleManifest</command:name> <command:verb>New</command:verb> <command:noun>ModuleManifest</command:noun> <maml:description> <maml:para>Creates a new module manifest.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `New-ModuleManifest` cmdlet creates a new module manifest (`.psd1`) file, populates its values, and saves the manifest file in the specified path.</maml:para> <maml:para>Module authors can use this cmdlet to create a manifest for their module. A module manifest is a `.psd1` file that contains a hash table. The keys and values in the hash table describe the contents and attributes of the module, define the prerequisites, and determine how the components are processed. Manifests aren't required for a module.</maml:para> <maml:para>`New-ModuleManifest` creates a manifest that includes all the commonly used manifest keys, so you can use the default output as a manifest template. To add or change values, or to add module keys that this cmdlet doesn't add, open the resulting file in a text editor.</maml:para> <maml:para>Each parameter, except for Path and PassThru , creates a module manifest key and its value. In a module manifest, only the ModuleVersion key is required. Unless specified in the parameter description, if you omit a parameter from the command, `New-ModuleManifest` creates a comment string for the associated value that has no effect.</maml:para> <maml:para>In PowerShell 2.0, `New-ModuleManifest` prompts you for the values of commonly used parameters that aren't specified in the command, in addition to required parameter values. Beginning in PowerShell 3.0, `New-ModuleManifest` prompts only when required parameter values aren't specified.</maml:para> <maml:para>If you are planning to publish your module in the PowerShell Gallery, the manifest must contain values for certain properties. For more information, see Required metadata for items published to the PowerShell Gallery (/powershell/scripting/gallery/how-to/publishing-packages/publishing-a-package#required-metadata-for-items-published-to-the-powershell-gallery)in the Gallery documentation.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-ModuleManifest</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and file name of the new module manifest. Enter a path and file name with a `.psd1` file name extension, such as `$pshome\Modules\MyModule\MyModule.psd1`. The Path parameter is required.</maml:para> <maml:para>If you specify the path to an existing file, `New-ModuleManifest` replaces the file without warning unless the file has the read-only attribute.</maml:para> <maml:para>The manifest should be located in the module's directory, and the manifest file name should be the same as the module directory name, but with a `.psd1` file name extension.</maml:para> <maml:para>> [!NOTE] > You cannot use variables, such as `$PSHOME` or `$HOME`, in response to a prompt for a Path > parameter value. To use a variable, include the Path parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>AliasesToExport</maml:name> <maml:Description> <maml:para>Specifies the aliases that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the aliases that are exported by the module. It can remove aliases from the list of exported aliases, but it can't add aliases to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates an AliasesToExport key with a value of `*` (all), meaning that all aliases defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Author</maml:name> <maml:Description> <maml:para>Specifies the module author.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates an Author key with the name of the current user.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Name of the current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClrVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of the Common Language Runtime (CLR) of the Microsoft .NET Framework that the module requires.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>CmdletsToExport</maml:name> <maml:Description> <maml:para>Specifies the cmdlets that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the cmdlets that are exported by the module. It can remove cmdlets from the list of exported cmdlets, but it can't add cmdlets to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a CmdletsToExport key with a value of `*` (all), meaning that all cmdlets defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompanyName</maml:name> <maml:Description> <maml:para>Identifies the company or vendor who created the module.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a CompanyName key with a value of "Unknown".</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>"Unknown"</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompatiblePSEditions</maml:name> <maml:Description> <maml:para>Specifies the module's compatible PSEditions. For information about PSEdition, see Modules with compatible PowerShell Editions (/powershell/scripting/gallery/concepts/module-psedition-support).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Desktop</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Core</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copyright</maml:name> <maml:Description> <maml:para>Specifies a copyright statement for the module.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a Copyright key with a value of `(c) <year> <username>. All rights reserved.` where `<year>` is the current year and `<username>` is the value of the Author key.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>(c) <year> <username>. All rights reserved.</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Describes the contents of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DotNetFrameworkVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of the Microsoft .NET Framework that the module requires.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>DscResourcesToExport</maml:name> <maml:Description> <maml:para>Specifies the Desired State Configuration (DSC) resources that the module exports. Wildcards are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FileList</maml:name> <maml:Description> <maml:para>Specifies all items that are included in the module.</maml:para> <maml:para>This key is designed to act as a module inventory. The files listed in the key are included when the module is published, but any functions aren't automatically exported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FormatsToProcess</maml:name> <maml:Description> <maml:para>Specifies the formatting files (`.ps1xml`) that run when the module is imported.</maml:para> <maml:para>When you import a module, PowerShell runs the `Update-FormatData` cmdlet with the specified files. Because formatting files aren't scoped, they affect all session states in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>FunctionsToExport</maml:name> <maml:Description> <maml:para>Specifies the functions that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the functions that are exported by the module. It can remove functions from the list of exported aliases, but it can't add functions to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates an FunctionsToExport key with a value of `*` (all), meaning that all functions defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Guid</maml:name> <maml:Description> <maml:para>Specifies a unique identifier for the module. The GUID can be used to distinguish among modules with the same name.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a GUID key in the manifest and generates a GUID for the value.</maml:para> <maml:para>To create a new GUID in PowerShell, type `[guid]::NewGuid()`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>A GUID generated for the module</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HelpInfoUri</maml:name> <maml:Description> <maml:para>Specifies the internet address of the HelpInfo XML file for the module. Enter a Uniform Resource Identifier (URI) that begins with http or https .</maml:para> <maml:para>The HelpInfo XML file supports the Updatable Help feature that was introduced in PowerShell 3.0. It contains information about the location of downloadable help files for the module and the version numbers of the newest help files for each supported locale.</maml:para> <maml:para>For information about Updatable Help, see about_Updatable_Help (./About/about_Updatable_Help.md). For information about the HelpInfo XML file, see Supporting Updatable Help (/powershell/scripting/developer/module/supporting-updatable-help).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IconUri</maml:name> <maml:Description> <maml:para>Specifies the URL of an icon for the module. The specified icon is displayed on the gallery web page for the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>LicenseUri</maml:name> <maml:Description> <maml:para>Specifies the URL of licensing terms for the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModuleList</maml:name> <maml:Description> <maml:para>Lists all modules that are included in this module.</maml:para> <maml:para>Enter each module name as a string or as a hash table with ModuleName and ModuleVersion keys. The hash table can also have an optional GUID key. You can combine strings and hash tables in the parameter value.</maml:para> <maml:para>This key is designed to act as a module inventory. The modules that are listed in the value of this key aren't automatically processed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModuleVersion</maml:name> <maml:Description> <maml:para>Specifies the module's version.</maml:para> <maml:para>This parameter isn't required, but a ModuleVersion key is required in the manifest. If you omit this parameter, `New-ModuleManifest` creates a ModuleVersion key with a value of 1.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>1.0</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NestedModules</maml:name> <maml:Description> <maml:para>Specifies script modules (`.psm1`) and binary modules (`.dll`) that are imported into the module's session state. The files in the NestedModules key run in the order in which they're listed in the value.</maml:para> <maml:para>Enter each module name as a string or as a hash table with ModuleName and ModuleVersion keys. The hash table can also have an optional GUID key. You can combine strings and hash tables in the parameter value.</maml:para> <maml:para>Typically, nested modules contain commands that the root module needs for its internal processing. By default, the commands in nested modules are exported from the module's session state into the caller's session state, but the root module can restrict the commands that it exports. For example, by using an `Export-ModuleMember` command.</maml:para> <maml:para>Nested modules in the module session state are available to the root module, but they aren't returned by a `Get-Module` command in the caller's session state.</maml:para> <maml:para>Scripts (`.ps1`) that are listed in the NestedModules key are run in the module's session state, not in the caller's session state. To run a script in the caller's session state, list the script file name in the value of the ScriptsToProcess key in the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Writes the resulting module manifest to the console and creates a `.psd1` file. By default, this cmdlet doesn't generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellHostName</maml:name> <maml:Description> <maml:para>Specifies the name of the PowerShell host program that the module requires. Enter the name of the host program, such as Windows PowerShell ISE Host or ConsoleHost . Wildcards aren't permitted.</maml:para> <maml:para>To find the name of a host program, in the program, type `$Host.Name`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellHostVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of the PowerShell host program that works with the module. Enter a version number, such as 1.1.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of PowerShell that works with this module. For example, you can enter 1.0, 2.0, or 3.0 as the parameter's value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PrivateData</maml:name> <maml:Description> <maml:para>Specifies data that is passed to the module when it's imported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProcessorArchitecture</maml:name> <maml:Description> <maml:para>Specifies the processor architecture that the module requires. Valid values are x86, AMD64, IA64, MSIL, and None (unknown or unspecified).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MSIL</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">X86</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">IA64</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Amd64</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Arm</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Reflection.ProcessorArchitecture</command:parameterValue> <dev:type> <maml:name>System.Reflection.ProcessorArchitecture</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProjectUri</maml:name> <maml:Description> <maml:para>Specifies the URL of a web page about this project.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ReleaseNotes</maml:name> <maml:Description> <maml:para>Specifies release notes.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredAssemblies</maml:name> <maml:Description> <maml:para>Specifies the assembly (`.dll`) files that the module requires. Enter the assembly file names. PowerShell loads the specified assemblies before updating types or formats, importing nested modules, or importing the module file that is specified in the value of the RootModule key.</maml:para> <maml:para>Use this parameter to list all the assemblies that the module requires, including assemblies that must be loaded to update any formatting or type files that are listed in the FormatsToProcess or TypesToProcess keys, even if those assemblies are also listed as binary modules in the NestedModules key.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredModules</maml:name> <maml:Description> <maml:para>Specifies modules that must be in the global session state. If the required modules aren't in the global session state, PowerShell imports them. If the required modules aren't available, the `Import-Module` command fails.</maml:para> <maml:para>Enter each module name as a string or as a hash table with ModuleName and ModuleVersion keys. The hash table can also have an optional GUID key. You can combine strings and hash tables in the parameter value.</maml:para> <maml:para>In PowerShell 2.0, `Import-Module` doesn't import required modules automatically. It just verifies that the required modules are in the global session state.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptsToProcess</maml:name> <maml:Description> <maml:para>Specifies script (`.ps1`) files that run in the caller's session state when the module is imported. You can use these scripts to prepare an environment, just as you might use a login script.</maml:para> <maml:para>To specify scripts that run in the module's session state, use the NestedModules key.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tags</maml:name> <maml:Description> <maml:para>Specifies an array of tags.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TypesToProcess</maml:name> <maml:Description> <maml:para>Specifies the type files (`.ps1xml`) that run when the module is imported.</maml:para> <maml:para>When you import the module, PowerShell runs the `Update-TypeData` cmdlet with the specified files. Because type files aren't scoped, they affect all session states in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VariablesToExport</maml:name> <maml:Description> <maml:para>Specifies the variables that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the variables that are exported by the module. It can remove variables from the list of exported variables, but it can't add variables to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a VariablesToExport key with a value of `*` (all), meaning that all variables defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DefaultCommandPrefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that is prepended to the nouns of all commands in the module when they're imported into a session. Enter a prefix string. Prefixes prevent command name conflicts in a user's session.</maml:para> <maml:para>Module users can override this prefix by specifying the Prefix parameter of the `Import-Module` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ModuleToProcess"> <maml:name>RootModule</maml:name> <maml:Description> <maml:para>Specifies the primary or root file of the module. Enter the file name of a script (`.ps1`), a script module (`.psm1`), a module manifest(`.psd1`), an assembly (`.dll`), a cmdlet definition XML file (`.cdxml`), or a workflow (`.xaml`). When the module is imported, the members that are exported from the root module file are imported into the caller's session state.</maml:para> <maml:para>If a module has a manifest file and no root file was designated in the RootModule key, the manifest becomes the primary file for the module, and the module becomes a manifest module (ModuleType = Manifest).</maml:para> <maml:para>To export members from `.psm1` or `.dll` files in a module that has a manifest, the names of those files must be specified in the values of the RootModule or NestedModules keys in the manifest. Otherwise, their members aren't exported.</maml:para> <maml:para>> [!NOTE] > In PowerShell 2.0, this key was called ModuleToProcess . You can use the RootModule > parameter name or its ModuleToProcess alias.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `New-ModuleManifest` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>AliasesToExport</maml:name> <maml:Description> <maml:para>Specifies the aliases that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the aliases that are exported by the module. It can remove aliases from the list of exported aliases, but it can't add aliases to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates an AliasesToExport key with a value of `*` (all), meaning that all aliases defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Author</maml:name> <maml:Description> <maml:para>Specifies the module author.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates an Author key with the name of the current user.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Name of the current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ClrVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of the Common Language Runtime (CLR) of the Microsoft .NET Framework that the module requires.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>CmdletsToExport</maml:name> <maml:Description> <maml:para>Specifies the cmdlets that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the cmdlets that are exported by the module. It can remove cmdlets from the list of exported cmdlets, but it can't add cmdlets to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a CmdletsToExport key with a value of `*` (all), meaning that all cmdlets defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompanyName</maml:name> <maml:Description> <maml:para>Identifies the company or vendor who created the module.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a CompanyName key with a value of "Unknown".</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>"Unknown"</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompatiblePSEditions</maml:name> <maml:Description> <maml:para>Specifies the module's compatible PSEditions. For information about PSEdition, see Modules with compatible PowerShell Editions (/powershell/scripting/gallery/concepts/module-psedition-support).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copyright</maml:name> <maml:Description> <maml:para>Specifies a copyright statement for the module.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a Copyright key with a value of `(c) <year> <username>. All rights reserved.` where `<year>` is the current year and `<username>` is the value of the Author key.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>(c) <year> <username>. All rights reserved.</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Describes the contents of the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DotNetFrameworkVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of the Microsoft .NET Framework that the module requires.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>DscResourcesToExport</maml:name> <maml:Description> <maml:para>Specifies the Desired State Configuration (DSC) resources that the module exports. Wildcards are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FileList</maml:name> <maml:Description> <maml:para>Specifies all items that are included in the module.</maml:para> <maml:para>This key is designed to act as a module inventory. The files listed in the key are included when the module is published, but any functions aren't automatically exported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FormatsToProcess</maml:name> <maml:Description> <maml:para>Specifies the formatting files (`.ps1xml`) that run when the module is imported.</maml:para> <maml:para>When you import a module, PowerShell runs the `Update-FormatData` cmdlet with the specified files. Because formatting files aren't scoped, they affect all session states in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>FunctionsToExport</maml:name> <maml:Description> <maml:para>Specifies the functions that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the functions that are exported by the module. It can remove functions from the list of exported aliases, but it can't add functions to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates an FunctionsToExport key with a value of `*` (all), meaning that all functions defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Guid</maml:name> <maml:Description> <maml:para>Specifies a unique identifier for the module. The GUID can be used to distinguish among modules with the same name.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a GUID key in the manifest and generates a GUID for the value.</maml:para> <maml:para>To create a new GUID in PowerShell, type `[guid]::NewGuid()`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>A GUID generated for the module</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>HelpInfoUri</maml:name> <maml:Description> <maml:para>Specifies the internet address of the HelpInfo XML file for the module. Enter a Uniform Resource Identifier (URI) that begins with http or https .</maml:para> <maml:para>The HelpInfo XML file supports the Updatable Help feature that was introduced in PowerShell 3.0. It contains information about the location of downloadable help files for the module and the version numbers of the newest help files for each supported locale.</maml:para> <maml:para>For information about Updatable Help, see about_Updatable_Help (./About/about_Updatable_Help.md). For information about the HelpInfo XML file, see Supporting Updatable Help (/powershell/scripting/developer/module/supporting-updatable-help).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IconUri</maml:name> <maml:Description> <maml:para>Specifies the URL of an icon for the module. The specified icon is displayed on the gallery web page for the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>LicenseUri</maml:name> <maml:Description> <maml:para>Specifies the URL of licensing terms for the module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModuleList</maml:name> <maml:Description> <maml:para>Lists all modules that are included in this module.</maml:para> <maml:para>Enter each module name as a string or as a hash table with ModuleName and ModuleVersion keys. The hash table can also have an optional GUID key. You can combine strings and hash tables in the parameter value.</maml:para> <maml:para>This key is designed to act as a module inventory. The modules that are listed in the value of this key aren't automatically processed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModuleVersion</maml:name> <maml:Description> <maml:para>Specifies the module's version.</maml:para> <maml:para>This parameter isn't required, but a ModuleVersion key is required in the manifest. If you omit this parameter, `New-ModuleManifest` creates a ModuleVersion key with a value of 1.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>1.0</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NestedModules</maml:name> <maml:Description> <maml:para>Specifies script modules (`.psm1`) and binary modules (`.dll`) that are imported into the module's session state. The files in the NestedModules key run in the order in which they're listed in the value.</maml:para> <maml:para>Enter each module name as a string or as a hash table with ModuleName and ModuleVersion keys. The hash table can also have an optional GUID key. You can combine strings and hash tables in the parameter value.</maml:para> <maml:para>Typically, nested modules contain commands that the root module needs for its internal processing. By default, the commands in nested modules are exported from the module's session state into the caller's session state, but the root module can restrict the commands that it exports. For example, by using an `Export-ModuleMember` command.</maml:para> <maml:para>Nested modules in the module session state are available to the root module, but they aren't returned by a `Get-Module` command in the caller's session state.</maml:para> <maml:para>Scripts (`.ps1`) that are listed in the NestedModules key are run in the module's session state, not in the caller's session state. To run a script in the caller's session state, list the script file name in the value of the ScriptsToProcess key in the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Writes the resulting module manifest to the console and creates a `.psd1` file. By default, this cmdlet doesn't generate any output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and file name of the new module manifest. Enter a path and file name with a `.psd1` file name extension, such as `$pshome\Modules\MyModule\MyModule.psd1`. The Path parameter is required.</maml:para> <maml:para>If you specify the path to an existing file, `New-ModuleManifest` replaces the file without warning unless the file has the read-only attribute.</maml:para> <maml:para>The manifest should be located in the module's directory, and the manifest file name should be the same as the module directory name, but with a `.psd1` file name extension.</maml:para> <maml:para>> [!NOTE] > You cannot use variables, such as `$PSHOME` or `$HOME`, in response to a prompt for a Path > parameter value. To use a variable, include the Path parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellHostName</maml:name> <maml:Description> <maml:para>Specifies the name of the PowerShell host program that the module requires. Enter the name of the host program, such as Windows PowerShell ISE Host or ConsoleHost . Wildcards aren't permitted.</maml:para> <maml:para>To find the name of a host program, in the program, type `$Host.Name`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellHostVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of the PowerShell host program that works with the module. Enter a version number, such as 1.1.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellVersion</maml:name> <maml:Description> <maml:para>Specifies the minimum version of PowerShell that works with this module. For example, you can enter 1.0, 2.0, or 3.0 as the parameter's value.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PrivateData</maml:name> <maml:Description> <maml:para>Specifies data that is passed to the module when it's imported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProcessorArchitecture</maml:name> <maml:Description> <maml:para>Specifies the processor architecture that the module requires. Valid values are x86, AMD64, IA64, MSIL, and None (unknown or unspecified).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Reflection.ProcessorArchitecture</command:parameterValue> <dev:type> <maml:name>System.Reflection.ProcessorArchitecture</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProjectUri</maml:name> <maml:Description> <maml:para>Specifies the URL of a web page about this project.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ReleaseNotes</maml:name> <maml:Description> <maml:para>Specifies release notes.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredAssemblies</maml:name> <maml:Description> <maml:para>Specifies the assembly (`.dll`) files that the module requires. Enter the assembly file names. PowerShell loads the specified assemblies before updating types or formats, importing nested modules, or importing the module file that is specified in the value of the RootModule key.</maml:para> <maml:para>Use this parameter to list all the assemblies that the module requires, including assemblies that must be loaded to update any formatting or type files that are listed in the FormatsToProcess or TypesToProcess keys, even if those assemblies are also listed as binary modules in the NestedModules key.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredModules</maml:name> <maml:Description> <maml:para>Specifies modules that must be in the global session state. If the required modules aren't in the global session state, PowerShell imports them. If the required modules aren't available, the `Import-Module` command fails.</maml:para> <maml:para>Enter each module name as a string or as a hash table with ModuleName and ModuleVersion keys. The hash table can also have an optional GUID key. You can combine strings and hash tables in the parameter value.</maml:para> <maml:para>In PowerShell 2.0, `Import-Module` doesn't import required modules automatically. It just verifies that the required modules are in the global session state.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptsToProcess</maml:name> <maml:Description> <maml:para>Specifies script (`.ps1`) files that run in the caller's session state when the module is imported. You can use these scripts to prepare an environment, just as you might use a login script.</maml:para> <maml:para>To specify scripts that run in the module's session state, use the NestedModules key.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Tags</maml:name> <maml:Description> <maml:para>Specifies an array of tags.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TypesToProcess</maml:name> <maml:Description> <maml:para>Specifies the type files (`.ps1xml`) that run when the module is imported.</maml:para> <maml:para>When you import the module, PowerShell runs the `Update-TypeData` cmdlet with the specified files. Because type files aren't scoped, they affect all session states in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VariablesToExport</maml:name> <maml:Description> <maml:para>Specifies the variables that the module exports. Wildcards are permitted.</maml:para> <maml:para>You can use this parameter to restrict the variables that are exported by the module. It can remove variables from the list of exported variables, but it can't add variables to the list.</maml:para> <maml:para>If you omit this parameter, `New-ModuleManifest` creates a VariablesToExport key with a value of `*` (all), meaning that all variables defined in the module are exported by the manifest.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>* (all)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>DefaultCommandPrefix</maml:name> <maml:Description> <maml:para>Specifies a prefix that is prepended to the nouns of all commands in the module when they're imported into a session. Enter a prefix string. Prefixes prevent command name conflicts in a user's session.</maml:para> <maml:para>Module users can override this prefix by specifying the Prefix parameter of the `Import-Module` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ModuleToProcess"> <maml:name>RootModule</maml:name> <maml:Description> <maml:para>Specifies the primary or root file of the module. Enter the file name of a script (`.ps1`), a script module (`.psm1`), a module manifest(`.psd1`), an assembly (`.dll`), a cmdlet definition XML file (`.cdxml`), or a workflow (`.xaml`). When the module is imported, the members that are exported from the root module file are imported into the caller's session state.</maml:para> <maml:para>If a module has a manifest file and no root file was designated in the RootModule key, the manifest becomes the primary file for the module, and the module becomes a manifest module (ModuleType = Manifest).</maml:para> <maml:para>To export members from `.psm1` or `.dll` files in a module that has a manifest, the names of those files must be specified in the values of the RootModule or NestedModules keys in the manifest. Otherwise, their members aren't exported.</maml:para> <maml:para>> [!NOTE] > In PowerShell 2.0, this key was called ModuleToProcess . You can use the RootModule > parameter name or its ModuleToProcess alias.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `New-ModuleManifest` runs. The cmdlet isn't run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You can't pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None or System.String</maml:name> </dev:type> <maml:description> <maml:para>By default, `New-ModuleManifest` doesn't generate any output. However, if you use the PassThru parameter, it generates a System.String object representing the module manifest.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>`New-ModuleManifest` creates module manifest (`.psd1`) files encoded as UTF16 .</maml:para> <maml:para>Module manifests are usually optional. However, a module manifest is required to export an assembly that is installed in the global assembly cache.</maml:para> <maml:para>To add or change files in the `$pshome\Modules` directory, start PowerShell with the **Run as administrator** option.</maml:para> <maml:para>In PowerShell 2.0, many parameters of `New-ModuleManifest` were mandatory, even though they weren't required in a module manifest. Beginning in PowerShell 3.0, only the Path parameter is mandatory.</maml:para> <maml:para>A session is an instance of the PowerShell execution environment. A session can have one or more session states. By default, a session has only a global session state, but each imported module has its own session state. Session states allow the commands in a module to run without affecting the global session state.</maml:para> <maml:para>The caller's session state is the session state into which a module is imported. Typically, it refers to the global session state, but when a module imports nested modules, the caller is the module and the caller's session state is the module's session state.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------- Example 1 - Create a new module manifest -----------</maml:title> <dev:code>New-ModuleManifest -Path C:\ps-test\Test-Module\Test-Module.psd1 -PassThru # # Module manifest for module 'Test-Module' # # Generated by: ContosoAdmin # # Generated on: 1/22/2019 # @{ # Script module or binary module file associated with this manifest. # RootModule = '' # Version number of this module. ModuleVersion = '1.0' # Supported PSEditions # CompatiblePSEditions = @() # ID used to uniquely identify this module GUID = '47179120-0bcb-4f14-8d80-f4560107f85c' # Author of this module Author = 'ContosoAdmin' # Company or vendor of this module CompanyName = 'Unknown' # Copyright statement for this module Copyright = '(c) 2019 ContosoAdmin. All rights reserved.' # Description of the functionality provided by this module # Description = '' # Minimum version of the Windows PowerShell engine required by this module # PowerShellVersion = '' # Name of the Windows PowerShell host required by this module # PowerShellHostName = '' # Minimum version of the Windows PowerShell host required by this module # PowerShellHostVersion = '' # Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # DotNetFrameworkVersion = '' # Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. # CLRVersion = '' # Processor architecture (None, X86, Amd64) required by this module # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module # RequiredModules = @() # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @() # Type files (.ps1xml) to be loaded when importing this module # TypesToProcess = @() # Format files (.ps1xml) to be loaded when importing this module # FormatsToProcess = @() # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @() # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() # Variables to export from this module VariablesToExport = '*' # Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. AliasesToExport = @() # DSC resources to export from this module # DscResourcesToExport = @() # List of all modules packaged with this module # ModuleList = @() # List of all files packaged with this module # FileList = @() # Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. # Tags = @() # A URL to the license for this module. # LicenseUri = '' # A URL to the main website for this project. # ProjectUri = '' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module # ReleaseNotes = '' } # End of PSData hashtable } # End of PrivateData hashtable # HelpInfo URI of this module # HelpInfoURI = '' # Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. # DefaultCommandPrefix = '' }</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2 - Create a new manifest with some prepopulated settings</maml:title> <dev:code>New-ModuleManifest -PowerShellVersion 1.0 -AliasesToExport JKBC, DRC, TAC -Path C:\ps-test\ManifestTest.psd1</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 3 - Create a manifest that requires other modules --</maml:title> <dev:code>$moduleSettings = @{ RequiredModules = ("BitsTransfer", @{ ModuleName="PSScheduledJob" ModuleVersion="1.0.0.0"; GUID="50cdb55f-5ab7-489f-9e94-4ec21ff51e59" }) Path = 'C:\ps-test\ManifestTest.psd1' } New-ModuleManifest @moduleSettings</dev:code> <dev:remarks> <maml:para>This example shows how to use the string and hash table formats of the ModuleList , RequiredModules , and NestedModules parameter. You can combine strings and hash tables in the same parameter value.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 4 - Create a manifest that supports updateable help -</maml:title> <dev:code>$moduleSettings = @{ HelpInfoUri = 'http://https://go.microsoft.com/fwlink/?LinkID=603' Path = 'C:\ps-test\ManifestTest.psd1' } New-ModuleManifest @moduleSettings</dev:code> <dev:remarks> <maml:para>For information about Updatable Help, see about_Updatable_Help (./About/about_Updatable_Help.md). For information about the HelpInfo XML file, see Supporting Updatable Help (/powershell/scripting/developer/module/supporting-updatable-help).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 5 - Getting module information ------------</maml:title> <dev:code>Get-Module Microsoft.PowerShell.Diagnostics -List | Format-List -Property * LogPipelineExecutionDetails : False Name : Microsoft.PowerShell.Diagnostics Path : C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Diagnostics\Micro soft.PowerShell.Diagnostics.psd1 Definition : Description : Guid : ca046f10-ca64-4740-8ff9-2565dba61a4f HelpInfoUri : https://go.microsoft.com/fwlink/?LinkID=210596 ModuleBase : C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Microsoft.PowerShell.Diagnostics PrivateData : Version : 3.0.0.0 ModuleType : Manifest Author : Microsoft Corporation AccessMode : ReadWrite ClrVersion : 4.0 CompanyName : Microsoft Corporation Copyright : Microsoft Corporation. All rights reserved. DotNetFrameworkVersion : ExportedFunctions : {} ExportedCmdlets : {[Get-WinEvent, Get-WinEvent], [Get-Counter, Get-Counter], [Import-Counter, Import-Counter], [Export-Counter, Export-Counter]...} ExportedCommands : {[Get-WinEvent, Get-WinEvent], [Get-Counter, Get-Counter], [Import-Counter, Import-Counter], [Export-Counter, Export-Counter]...} FileList : {} ModuleList : {} NestedModules : {} PowerShellHostName : PowerShellHostVersion : PowerShellVersion : 3.0 ProcessorArchitecture : None Scripts : {} RequiredAssemblies : {} RequiredModules : {} RootModule : ExportedVariables : {} ExportedAliases : {} ExportedWorkflows : {} SessionState : OnRemove : ExportedFormatFiles : {C:\Windows\system32\WindowsPowerShell\v1.0\Event.format.ps1xml, C:\Windows\system32\WindowsPowerShell\v1.0\Diagnostics.format.ps1xml} ExportedTypeFiles : {C:\Windows\system32\WindowsPowerShell\v1.0\GetEvent.types.ps1xml}</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-modulemanifest?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Export-ModuleMember</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-ModuleManifest</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Modules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-PSRoleCapabilityFile</command:name> <command:verb>New</command:verb> <command:noun>PSRoleCapabilityFile</command:noun> <maml:description> <maml:para>Creates a file that defines a set of capabilities to be exposed through a session configuration.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `New-PSRoleCapabilityFile` cmdlet creates a file that defines a set of user capabilities that can be exposed through session configuration files. This includes determining which cmdlets, functions, and scripts are available to users. The capability file is a human-readable text file that contains a hash table of session configuration properties and values. The file has a .psrc file name extension, and can be used by more than one session configuration.</maml:para> <maml:para>All the parameters of `New-PSRoleCapabilityFile` are optional except for the Path parameter, which specifies the file path for the file. If you do not include a parameter when you run the cmdlet, the corresponding key in the session configuration file is commented-out, except where noted in the parameter description. For example, if you do not include the AssembliesToLoad parameter then that section of the session configuration file is commented out.</maml:para> <maml:para>To use the role capability file in a session configuration, first place the file in a RoleCapabilities subfolder of a valid PowerShell module folder. Then reference the file by name in the RoleDefinitions field in a PowerShell Session Configuration (.pssc) file.</maml:para> <maml:para>This cmdlet was introduced in Windows PowerShell 5.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-PSRoleCapabilityFile</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of the role capability file. The file must have a `.psrc` filename extension.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AliasDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified aliases to sessions that use the role capability file. Enter a hash table with the following keys:</maml:para> <maml:para>- Name. Name of the alias. This key is required.</maml:para> <maml:para>- Value. The command that the alias represents. This key is required.</maml:para> <maml:para>- Description. A text string that describes the alias. This key is optional.</maml:para> <maml:para>- Options. Alias options. This key is optional. The default value is None. The acceptable values for</maml:para> <maml:para> this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name="hlp";Value="Get-Help";Description="Gets help";Options="ReadOnly"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AssembliesToLoad</maml:name> <maml:Description> <maml:para>Specifies the assemblies to load into the sessions that use the role capability file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Author</maml:name> <maml:Description> <maml:para>Specifies the user that created the role capability file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompanyName</maml:name> <maml:Description> <maml:para>Identifies the company that created the role capability file. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copyright</maml:name> <maml:Description> <maml:para>Specifies a copyright for the role capability file. If you omit this parameter, `New-PSRoleCapabilityFile` generates a copyright statement by using the value of the Author parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Specifies a description for the role capability file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnvironmentVariables</maml:name> <maml:Description> <maml:para>Specifies the environment variables for sessions that expose this role capability file. Enter a hash table in which the keys are the environment variable names and the values are the environment variable values.</maml:para> <maml:para>For example: `EnvironmentVariables=@{TestShare="\\Server01\TestShare"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FormatsToProcess</maml:name> <maml:Description> <maml:para>Specifies the formatting files (.ps1xml) that run in sessions that use the role capability file. The value of this parameter must be a full or absolute path of the formatting files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FunctionDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified functions to sessions that expose the role capability. Enter a hash table with the following keys:</maml:para> <maml:para>- Name. Name of the function. This key is required.</maml:para> <maml:para>- ScriptBlock. Function body. Enter a script block. This key is required.</maml:para> <maml:para>- Options. Function options. This key is optional. The default value is None. The acceptable values</maml:para> <maml:para> for this parameter are: are None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example:</maml:para> <maml:para>`@{Name="Get-PowerShellProcess";ScriptBlock={Get-Process PowerShell};Options="AllScope"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Guid</maml:name> <maml:Description> <maml:para>Specifies a unique identifier for the role capability file. If you omit this parameter, `New-PSRoleCapabilityFile` generates a GUID for the file. To create a new GUID in PowerShell, type `[guid]::NewGuid()`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules that are automatically imported into sessions that use the role capability file. By default, all the commands in listed modules are visible. When used with VisibleCmdlets or VisibleFunctions , the commands visible from the specified modules can be restricted.</maml:para> <maml:para>Each module used in the value of this parameter can be represented by a string or by a hash table. A module string consists only of the name of the module. A module hash table can include ModuleName , ModuleVersion , and GUID keys. Only the ModuleName key is required.</maml:para> <maml:para>For example, the following value consists of a string and a hash table. Any combination of strings and hash tables, in any order, is valid.</maml:para> <maml:para>`"TroubleshootingPack", @{ModuleName="PSDiagnostics"; ModuleVersion="1.0.0.0";GUID="c61d6278-02a3-4618-ae37-a524d40a7f44"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptsToProcess</maml:name> <maml:Description> <maml:para>Specifies scripts to add to sessions that use the role capability file. Enter the path and file names of the scripts. The value of this parameter must be a full or absolute path of the script file names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TypesToProcess</maml:name> <maml:Description> <maml:para>Specifies type files (.ps1xml) to add to sessions that use the role capability file. Enter the type filenames. The value of this parameter must be a full or absolute path of the type filenames.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VariableDefinitions</maml:name> <maml:Description> <maml:para>Specifies variables to add to sessions that use the role capability file. Enter a hash table with the following keys:</maml:para> <maml:para>- Name. Name of the variable. This key is required.</maml:para> <maml:para>- Value. Variable value. This key is required.</maml:para> <maml:para>- Options. Variable options. This key is optional. The default value is None. The acceptable values</maml:para> <maml:para> for this parameter are: are None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name="WarningPreference";Value="SilentlyContinue";Options="AllScope"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleAliases</maml:name> <maml:Description> <maml:para>Limits the aliases in the session to those aliases specified in the value of this parameter, plus any aliases that you define in the AliasDefinition parameter. Wildcard characters are supported. By default, all aliases that are defined by the PowerShell engine and all aliases that modules export are visible in the session.</maml:para> <maml:para>For example, to limit the available aliases to gm and gcm use this syntax: `VisibleAliases="gcm", "gp"`</maml:para> <maml:para>When any Visible parameter is included in the role capability file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleCmdlets</maml:name> <maml:Description> <maml:para>Limits the cmdlets in the session to those specified in the value of this parameter. Wildcard characters and Module Qualified Names are supported.</maml:para> <maml:para>By default, all cmdlets that the modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session. If no modules in ModulesToImport expose the cmdlet, `New-PSRoleCapabilityFile` tries to load the appropriate module.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleExternalCommands</maml:name> <maml:Description> <maml:para>Limits the external binaries, scripts and commands that can be executed in the session to those specified in the value of this parameter.</maml:para> <maml:para>By default, no external commands are visible in this session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleFunctions</maml:name> <maml:Description> <maml:para>Limits the functions in the session to those specified in the value of this parameter, plus any functions that you define in the FunctionDefinitions parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all functions exported by modules in the session are visible in that session. Use the SessionType and ModulesToImport parameters to determine which modules are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleProviders</maml:name> <maml:Description> <maml:para>Limits the PowerShell providers in the session to those specified in the value of this parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all providers exported by a module in the session are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AliasDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified aliases to sessions that use the role capability file. Enter a hash table with the following keys:</maml:para> <maml:para>- Name. Name of the alias. This key is required.</maml:para> <maml:para>- Value. The command that the alias represents. This key is required.</maml:para> <maml:para>- Description. A text string that describes the alias. This key is optional.</maml:para> <maml:para>- Options. Alias options. This key is optional. The default value is None. The acceptable values for</maml:para> <maml:para> this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name="hlp";Value="Get-Help";Description="Gets help";Options="ReadOnly"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AssembliesToLoad</maml:name> <maml:Description> <maml:para>Specifies the assemblies to load into the sessions that use the role capability file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Author</maml:name> <maml:Description> <maml:para>Specifies the user that created the role capability file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompanyName</maml:name> <maml:Description> <maml:para>Identifies the company that created the role capability file. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copyright</maml:name> <maml:Description> <maml:para>Specifies a copyright for the role capability file. If you omit this parameter, `New-PSRoleCapabilityFile` generates a copyright statement by using the value of the Author parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Specifies a description for the role capability file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnvironmentVariables</maml:name> <maml:Description> <maml:para>Specifies the environment variables for sessions that expose this role capability file. Enter a hash table in which the keys are the environment variable names and the values are the environment variable values.</maml:para> <maml:para>For example: `EnvironmentVariables=@{TestShare="\\Server01\TestShare"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FormatsToProcess</maml:name> <maml:Description> <maml:para>Specifies the formatting files (.ps1xml) that run in sessions that use the role capability file. The value of this parameter must be a full or absolute path of the formatting files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FunctionDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified functions to sessions that expose the role capability. Enter a hash table with the following keys:</maml:para> <maml:para>- Name. Name of the function. This key is required.</maml:para> <maml:para>- ScriptBlock. Function body. Enter a script block. This key is required.</maml:para> <maml:para>- Options. Function options. This key is optional. The default value is None. The acceptable values</maml:para> <maml:para> for this parameter are: are None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example:</maml:para> <maml:para>`@{Name="Get-PowerShellProcess";ScriptBlock={Get-Process PowerShell};Options="AllScope"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Guid</maml:name> <maml:Description> <maml:para>Specifies a unique identifier for the role capability file. If you omit this parameter, `New-PSRoleCapabilityFile` generates a GUID for the file. To create a new GUID in PowerShell, type `[guid]::NewGuid()`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules that are automatically imported into sessions that use the role capability file. By default, all the commands in listed modules are visible. When used with VisibleCmdlets or VisibleFunctions , the commands visible from the specified modules can be restricted.</maml:para> <maml:para>Each module used in the value of this parameter can be represented by a string or by a hash table. A module string consists only of the name of the module. A module hash table can include ModuleName , ModuleVersion , and GUID keys. Only the ModuleName key is required.</maml:para> <maml:para>For example, the following value consists of a string and a hash table. Any combination of strings and hash tables, in any order, is valid.</maml:para> <maml:para>`"TroubleshootingPack", @{ModuleName="PSDiagnostics"; ModuleVersion="1.0.0.0";GUID="c61d6278-02a3-4618-ae37-a524d40a7f44"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of the role capability file. The file must have a `.psrc` filename extension.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptsToProcess</maml:name> <maml:Description> <maml:para>Specifies scripts to add to sessions that use the role capability file. Enter the path and file names of the scripts. The value of this parameter must be a full or absolute path of the script file names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TypesToProcess</maml:name> <maml:Description> <maml:para>Specifies type files (.ps1xml) to add to sessions that use the role capability file. Enter the type filenames. The value of this parameter must be a full or absolute path of the type filenames.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VariableDefinitions</maml:name> <maml:Description> <maml:para>Specifies variables to add to sessions that use the role capability file. Enter a hash table with the following keys:</maml:para> <maml:para>- Name. Name of the variable. This key is required.</maml:para> <maml:para>- Value. Variable value. This key is required.</maml:para> <maml:para>- Options. Variable options. This key is optional. The default value is None. The acceptable values</maml:para> <maml:para> for this parameter are: are None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name="WarningPreference";Value="SilentlyContinue";Options="AllScope"}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleAliases</maml:name> <maml:Description> <maml:para>Limits the aliases in the session to those aliases specified in the value of this parameter, plus any aliases that you define in the AliasDefinition parameter. Wildcard characters are supported. By default, all aliases that are defined by the PowerShell engine and all aliases that modules export are visible in the session.</maml:para> <maml:para>For example, to limit the available aliases to gm and gcm use this syntax: `VisibleAliases="gcm", "gp"`</maml:para> <maml:para>When any Visible parameter is included in the role capability file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleCmdlets</maml:name> <maml:Description> <maml:para>Limits the cmdlets in the session to those specified in the value of this parameter. Wildcard characters and Module Qualified Names are supported.</maml:para> <maml:para>By default, all cmdlets that the modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session. If no modules in ModulesToImport expose the cmdlet, `New-PSRoleCapabilityFile` tries to load the appropriate module.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleExternalCommands</maml:name> <maml:Description> <maml:para>Limits the external binaries, scripts and commands that can be executed in the session to those specified in the value of this parameter.</maml:para> <maml:para>By default, no external commands are visible in this session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleFunctions</maml:name> <maml:Description> <maml:para>Limits the functions in the session to those specified in the value of this parameter, plus any functions that you define in the FunctionDefinitions parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all functions exported by modules in the session are visible in that session. Use the SessionType and ModulesToImport parameters to determine which modules are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleProviders</maml:name> <maml:Description> <maml:para>Limits the PowerShell providers in the session to those specified in the value of this parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all providers exported by a module in the session are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------- Example 1: Create a blank role capability file --------</maml:title> <dev:code>New-PSRoleCapabilityFile -Path ".\ExampleFile.psrc"</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Create a role capability file allowing users to restart services and any VDI computer</maml:title> <dev:code>$roleParameters = @{ Path = ".\Maintenance.psrc" Author = "User01" CompanyName = "Fabrikam Corporation" Description = "This role enables users to restart any service and restart any VDI computer." ModulesToImport = "Microsoft.PowerShell.Core" VisibleCmdlets = "Restart-Service", @{ Name = "Restart-Computer" Parameters = @{ Name = "ComputerName"; ValidatePattern = "VDI\d+" } } } New-PSRoleCapabilityFile @roleParameters</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-psrolecapabilityfile?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionCapability</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-PSSession</command:name> <command:verb>New</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Creates a persistent connection to a local or remote computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `New-PSSession` cmdlet creates a PowerShell session ( PSSession ) on a local or remote computer. When you create a PSSession , PowerShell establishes a persistent connection to the remote computer.</maml:para> <maml:para>Use a PSSession to run multiple commands that share data, such as a function or the value of a variable. To run commands in a PSSession , use the `Invoke-Command` cmdlet. To use the PSSession to interact directly with a remote computer, use the `Enter-PSSession` cmdlet. For more information, see about_PSSessions (about/about_PSSessions.md).</maml:para> <maml:para>You can run commands on a remote computer without creating a PSSession by using the ComputerName parameters of `Enter-PSSession` or `Invoke-Command`. When you use the ComputerName parameter, PowerShell creates a temporary connection that is used for the command and is then closed.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the session. The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a ConnectionURI , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell does not redirect connections, but you can use this parameter to enable it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the $PSSessionOption preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate the user's credentials. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to do this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (.), localhost, or the name of the local computer.</maml:para> <maml:para>By default, this cmdlet creates loopback sessions by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also enable remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created by using the EnableNetworkAccess parameter, can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>New-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. This cmdlet creates a persistent connection ( PSSession ) to the specified computer. If you enter multiple computer names, `New-PSSession` creates multiple PSSession objects, one for each computer. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more remote computers. To specify the local computer, type the computer name, localhost, or a dot (.). When the computer is in a different domain than the user, the fully qualified domain name is required. You can also pipe a computer name, in quotation marks, to `New-PSSession`.</maml:para> <maml:para>To use an IP address in the value of the ComputerName parameter, the command must include the Credential parameter. Also, the computer must be configured for HTTPS transport or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a Computer to the Trusted Host List" in about_Remote_Troubleshooting (about/about_Remote_Troubleshooting.md).</maml:para> <maml:para>To include the local computer in the value of the ComputerName parameter, start Windows PowerShell by using the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you are not using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate the user's credentials. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to do this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (.), localhost, or the name of the local computer.</maml:para> <maml:para>By default, this cmdlet creates loopback sessions by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also enable remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created by using the EnableNetworkAccess parameter, can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this connection. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using another port, you must configure the WinRM listener on the remote computer to listen at that port. Use the following commands to configure the listener:</maml:para> <maml:para>1. `winrm delete winrm/config/listener?Address=*+Transport=HTTP` 2. `winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="<port-number>"}`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port setting in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the SSL protocol to establish a connection to the remote computer. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. The UseSSL parameter offers an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>New-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to do this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>New-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to do this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the `Get-VM` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>New-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet starts an interactive session with each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that the PSSession runs as administrator.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>New-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of PSSession objects that this cmdlet uses as a model for the new PSSession . This parameter creates new PSSession objects that have the same properties as the specified PSSession objects.</maml:para> <maml:para>Enter a variable that contains the PSSession objects or a command that creates or gets the PSSession objects, such as a `New-PSSession` or `Get-PSSession` command.</maml:para> <maml:para>The resulting PSSession objects have the same computer name, application name, connection URI, port, configuration name, throttle limit, and Secure Sockets Layer (SSL) value as the originals, but they have a different display name, ID, and instance ID (GUID).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (.), localhost, or the name of the local computer.</maml:para> <maml:para>By default, this cmdlet creates loopback sessions by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also enable remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created by using the EnableNetworkAccess parameter, can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell does not redirect connections, but you can use this parameter to enable it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the $PSSessionOption preference variable. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies the application name segment of the connection URI. Use this parameter to specify the application name when you are not using the ConnectionURI parameter in the command.</maml:para> <maml:para>The default value is the value of the `$PSSessionApplicationName` preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the URLPrefix property of a listener on the remote computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate the user's credentials. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to perform this action. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. They can be mapped only to local user accounts; they do not work with domain accounts.</maml:para> <maml:para>To get a certificate, use the `Get-Item` or `Get-ChildItem` command in the PowerShell Cert: drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. This cmdlet creates a persistent connection ( PSSession ) to the specified computer. If you enter multiple computer names, `New-PSSession` creates multiple PSSession objects, one for each computer. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more remote computers. To specify the local computer, type the computer name, localhost, or a dot (.). When the computer is in a different domain than the user, the fully qualified domain name is required. You can also pipe a computer name, in quotation marks, to `New-PSSession`.</maml:para> <maml:para>To use an IP address in the value of the ComputerName parameter, the command must include the Credential parameter. Also, the computer must be configured for HTTPS transport or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a Computer to the Trusted Host List" in about_Remote_Troubleshooting (about/about_Remote_Troubleshooting.md).</maml:para> <maml:para>To include the local computer in the value of the ComputerName parameter, start Windows PowerShell by using the Run as administrator option.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the session configuration that is used for the new PSSession .</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended: `http://schemas.microsoft.com/PowerShell`.</maml:para> <maml:para>The session configuration for a session is located on the remote computer. If the specified session configuration does not exist on the remote computer, the command fails.</maml:para> <maml:para>The default value is the value of the `$PSSessionConfigurationName` preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. For more information, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint for the session. The URI must be fully qualified. The format of this string is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you do not specify a ConnectionURI , you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the ConnectionURI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but do not specify a port, the session is created with standards ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri[]</command:parameterValue> <dev:type> <maml:name>System.Uri[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet starts an interactive session with each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to do this action. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnableNetworkAccess</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet adds an interactive security token to loopback sessions. The interactive token lets you run commands in the loopback session that get data from other computers. For example, you can run a command in the session that copies XML files from a remote computer to the local computer.</maml:para> <maml:para>A loopback session is a PSSession that originates and ends on the same computer. To create a loopback session, omit the ComputerName parameter or set its value to dot (.), localhost, or the name of the local computer.</maml:para> <maml:para>By default, this cmdlet creates loopback sessions by using a network token, which might not provide sufficient permission to authenticate to remote computers.</maml:para> <maml:para>The EnableNetworkAccess parameter is effective only in loopback sessions. If you use EnableNetworkAccess when you create a session on a remote computer, the command succeeds, but the parameter is ignored.</maml:para> <maml:para>You can also enable remote access in a loopback session by using the CredSSP value of the Authentication parameter, which delegates the session credentials to other computers.</maml:para> <maml:para>To protect the computer from malicious access, disconnected loopback sessions that have interactive tokens, which are those created by using the EnableNetworkAccess parameter, can be reconnected only from the computer on which the session was created. Disconnected sessions that use CredSSP authentication can be reconnected from other computers. For more information, see `Disconnect-PSSession`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the PSSession .</maml:para> <maml:para>You can use the name to refer to the PSSession when you use other cmdlets, such as `Get-PSSession` and `Enter-PSSession`. The name is not required to be unique to the computer or the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the network port on the remote computer that is used for this connection. To connect to a remote computer, the remote computer must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using another port, you must configure the WinRM listener on the remote computer to listen at that port. Use the following commands to configure the listener:</maml:para> <maml:para>1. `winrm delete winrm/config/listener?Address=*+Transport=HTTP` 2. `winrm create winrm/config/listener?Address=*+Transport=HTTP @{Port="<port-number>"}`</maml:para> <maml:para>Do not use the Port parameter unless you must. The port setting in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsAdministrator</maml:name> <maml:Description> <maml:para>Indicates that the PSSession runs as administrator.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of PSSession objects that this cmdlet uses as a model for the new PSSession . This parameter creates new PSSession objects that have the same properties as the specified PSSession objects.</maml:para> <maml:para>Enter a variable that contains the PSSession objects or a command that creates or gets the PSSession objects, such as a `New-PSSession` or `Get-PSSession` command.</maml:para> <maml:para>The resulting PSSession objects have the same computer name, application name, connection URI, port, configuration name, throttle limit, and Secure Sockets Layer (SSL) value as the originals, but they have a different display name, ID, and instance ID (GUID).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it is set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThrottleLimit</maml:name> <maml:Description> <maml:para>Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0 (zero), the default value, 32, is used.</maml:para> <maml:para>The throttle limit applies only to the current command, not to the session or to the computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the SSL protocol to establish a connection to the remote computer. By default, SSL is not used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. The UseSSL parameter offers an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter, but SSL is not available on the port that is used for the command, the command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the `Get-VM` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String, System.URI, System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a string, URI, or session object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- This cmdlet uses the PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for PowerShell remoting. For more information, see about_Remote_Requirements (About/about_Remote_Requirements.md). - To create a PSSession on the local computer, start PowerShell with the Run as administrator option. - When you are finished with the PSSession , use the `Remove-PSSession` cmdlet to delete the PSSession and release its resources.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------ Example 1: Create a session on the local computer ------</maml:title> <dev:code>$s = New-PSSession</dev:code> <dev:remarks> <maml:para>This command creates a new PSSession on the local computer and saves the PSSession in the `$s` variable.</maml:para> <maml:para>You can now use this PSSession to run commands on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 2: Create a session on a remote computer -------</maml:title> <dev:code>$Server01 = New-PSSession -ComputerName Server01</dev:code> <dev:remarks> <maml:para>This command creates a new PSSession on the Server01 computer and saves it in the `$Server01` variable.</maml:para> <maml:para>When creating multiple PSSession objects, assign them to variables with useful names. This will help you manage the PSSession objects in subsequent commands.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Create sessions on multiple computers -------</maml:title> <dev:code>$s1, $s2, $s3 = New-PSSession -ComputerName Server01,Server02,Server03</dev:code> <dev:remarks> <maml:para>This command creates three PSSession objects, one on each of the computers specified by the ComputerName parameter.</maml:para> <maml:para>The command uses the assignment operator (=) to assign the new PSSession objects to variables: `$s1`, `$s2`, `$s3`. It assigns the Server01 PSSession to `$s1`, the Server02 PSSession to `$s2`, and the Server03 PSSession to `$s3`.</maml:para> <maml:para>When you assign multiple objects to a series of variables, PowerShell assigns each object to a variable in the series respectively. If there are more objects than variables, all remaining objects are assigned to the last variable. If there are more variables than objects, the remaining variables are empty (null).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 4: Create a session with a specified port ------</maml:title> <dev:code>New-PSSession -ComputerName Server01 -Port 8081 -UseSSL -ConfigurationName E12</dev:code> <dev:remarks> <maml:para>This command creates a new PSSession on the Server01 computer that connects to server port 8081 and uses the SSL protocol. The new PSSession uses an alternative session configuration called E12.</maml:para> <maml:para>Before setting the port, you must configure the WinRM listener on the remote computer to listen on port 8081. For more information, see the description of the Port parameter.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 5: Create a session based on an existing session ---</maml:title> <dev:code>New-PSSession -Session $s -Credential Domain01\User01</dev:code> <dev:remarks> <maml:para>This command creates a PSSession with the same properties as an existing PSSession . You can use this command format when the resources of an existing PSSession are exhausted and a new PSSession is needed to offload some of the demand.</maml:para> <maml:para>The command uses the Session parameter of `New-PSSession` to specify the PSSession saved in the `$s` variable. It uses the credentials of the Domain1\Admin01 user to complete the command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: Create a session with a global scope in a different domain</maml:title> <dev:code>$global:s = New-PSSession -ComputerName Server1.Domain44.Corpnet.Fabrikam.com -Credential Domain01\Admin01</dev:code> <dev:remarks> <maml:para>This example shows how to create a PSSession with a global scope on a computer in a different domain.</maml:para> <maml:para>By default, PSSession objects created at the command line are created with local scope and PSSession objects created in a script have script scope.</maml:para> <maml:para>To create a PSSession with global scope, create a new PSSession and then store the PSSession in a variable that is cast to a global scope. In this case, the `$s` variable is cast to a global scope.</maml:para> <maml:para>The command uses the ComputerName parameter to specify the remote computer. Because the computer is in a different domain than the user account, the full name of the computer is specified together with the credentials of the user.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 7: Create sessions for many computers --------</maml:title> <dev:code>$rs = Get-Content C:\Test\Servers.txt | New-PSSession -ThrottleLimit 50</dev:code> <dev:remarks> <maml:para>This command creates a PSSession on each of the 200 computers listed in the Servers.txt file and it stores the resulting PSSession in the `$rs` variable. The PSSession objects have a throttle limit of 50.</maml:para> <maml:para>You can use this command format when the names of computers are stored in a database, spreadsheet, text file, or other text-convertible format.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 8: Create a session by using a URI ----------</maml:title> <dev:code>$s = New-PSSession -URI http://Server01:91/NewSession -Credential Domain01\User01</dev:code> <dev:remarks> <maml:para>This command creates a PSSession on the Server01 computer and stores it in the `$s` variable. It uses the URI parameter to specify the transport protocol, the remote computer, the port, and an alternate session configuration. It also uses the Credential parameter to specify a user account that has permission to create a session on the remote computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 9: Run a background job in a set of sessions -----</maml:title> <dev:code>$s = New-PSSession -ComputerName (Get-Content Servers.txt) -Credential Domain01\Admin01 -ThrottleLimit 16 Invoke-Command -Session $s -ScriptBlock {Get-Process PowerShell} -AsJob</dev:code> <dev:remarks> <maml:para>These commands create a set of PSSession objects and then run a background job in each of the PSSession objects.</maml:para> <maml:para>The first command creates a new PSSession on each of the computers listed in the Servers.txt file. It uses the `New-PSSession` cmdlet to create the PSSession . The value of the ComputerName parameter is a command that uses the `Get-Content` cmdlet to get the list of computer names the Servers.txt file.</maml:para> <maml:para>The command uses the Credential parameter to create the PSSession objects that have the permission of a domain administrator, and it uses the ThrottleLimit parameter to limit the command to 16 concurrent connections. The command saves the PSSession objects in the `$s` variable.</maml:para> <maml:para>The second command uses the AsJob parameter of the `Invoke-Command` cmdlet to start a background job that runs a `Get-Process PowerShell` command in each of the PSSession objects in `$s`.</maml:para> <maml:para>For more information about PowerShell background jobs, see about_Jobs (About/about_Jobs.md) and [about_Remote_Jobs](About/about_Remote_Jobs.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 10: Create a session for a computer by using its URI -</maml:title> <dev:code>New-PSSession -ConnectionURI https://management.exchangelabs.com/Management</dev:code> <dev:remarks> <maml:para>This command creates a PSSession objects that connects to a computer that is specified by a URI instead of a computer name.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 11: Create a session option -------------</maml:title> <dev:code>$so = New-PSSessionOption -SkipCACheck New-PSSession -ConnectionUri https://management.exchangelabs.com/Management -SessionOption $so -Credential Server01\Admin01</dev:code> <dev:remarks> <maml:para>This example shows how to create a session option object and use the SessionOption parameter.</maml:para> <maml:para>The first command uses the `New-PSSessionOption` cmdlet to create a session option. It saves the resulting SessionOption object in the `$so` variable.</maml:para> <maml:para>The second command uses the option in a new session. The command uses the `New-PSSession` cmdlet to create a new session. The value of the SessionOption parameter is the SessionOption object in the `$so` variable.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-PSSessionConfigurationFile</command:name> <command:verb>New</command:verb> <command:noun>PSSessionConfigurationFile</command:noun> <maml:description> <maml:para>Creates a file that defines a session configuration.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `New-PSSessionConfigurationFile` cmdlet creates a file of settings that define a session configuration and the environment of sessions that are created by using the session configuration. To use the file in a session configuration, use the Path parameter of the `Register-PSSessionConfiguration` or `Set-PSSessionConfiguration` cmdlets.</maml:para> <maml:para>The session configuration file that `New-PSSessionConfigurationFile` creates is a human-readable text file that contains a hash table of the session configuration properties and values. The file has a `.pssc` filename extension.</maml:para> <maml:para>All parameters of `New-PSSessionConfigurationFile` are optional, except for the Path parameter. If you omit a parameter, the corresponding key in the session configuration file is commented-out, except where noted in the parameter description.</maml:para> <maml:para>A session configuration, also known as an endpoint, is a collection of settings on the local computer that define the environment for PowerShell sessions ( PSSessions ) that connect to the computer. All PSSessions use a session configuration. To specify a particular session configuration, use the ConfigurationName parameter of cmdlets that create a session, such as the `New-PSSession` cmdlet.</maml:para> <maml:para>A session configuration file makes it easy to define a session configuration without complex scripts or code assemblies. The settings in the file are used with the optional startup script and any assemblies in the session configuration.</maml:para> <maml:para>For more information about session configurations and session configuration files, see about_Session_Configurations (About/about_Session_Configurations.md)and about_Session_Configuration_Files (About/about_Session_Configuration_Files.md).</maml:para> <maml:para>This cmdlet was introduced in PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-PSSessionConfigurationFile</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of the session configuration file. The file must have a `.pssc` file name extension.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AliasDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified aliases to sessions that use the session configuration. Enter a hash table with the following keys:</maml:para> <maml:para>- Name - Name of the alias. This key is required.</maml:para> <maml:para>- Value - The command that the alias represents. This key is required.</maml:para> <maml:para>- Description - A text string that describes the alias. This key is optional.</maml:para> <maml:para>- Options - Alias options. This key is optional. The default value is None . The acceptable values for this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name='hlp';Value='Get-Help';Description='Gets help';Options='ReadOnly'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AssembliesToLoad</maml:name> <maml:Description> <maml:para>Specifies the assemblies to load into the sessions that use the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Author</maml:name> <maml:Description> <maml:para>Specifies the author of the session configuration or the configuration file. The default is the current user. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompanyName</maml:name> <maml:Description> <maml:para>Specifies the company that created the session configuration or the configuration file. The default value is Unknown . The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Unknown</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copyright</maml:name> <maml:Description> <maml:para>Specifies a copyright the session configuration file. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> <maml:para>If you omit this parameter, `New-PSSessionConfigurationFile` generates a copyright statement by using the value of the Author parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Specifies a description of the session configuration or the session configuration file. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnvironmentVariables</maml:name> <maml:Description> <maml:para>Adds environment variables to the session. Enter a hash table in which the keys are the environment variable names and the values are the environment variable values.</maml:para> <maml:para>For example: `EnvironmentVariables=@{TestShare='\Server01\TestShare'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ExecutionPolicy</maml:name> <maml:Description> <maml:para>Specifies the execution policy of sessions that use the session configuration. If you omit this parameter, the value of the ExecutionPolicy key in the session configuration file is Restricted . For information about execution policies in PowerShell, see about_Execution_Policies (about/about_Execution_Policies.md).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Unrestricted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">RemoteSigned</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AllSigned</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Restricted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Bypass</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Undefined</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.ExecutionPolicy</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.ExecutionPolicy</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FormatsToProcess</maml:name> <maml:Description> <maml:para>Specifies the formatting files (.ps1xml) that run in sessions that use the session configuration. The value of this parameter must be a full or absolute path of the formatting files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Full</maml:name> <maml:Description> <maml:para>Indicates that this operation includes all possible configuration properties in the session configuration file.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FunctionDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified functions to sessions that use the session configuration. Enter a hash table with the following keys:</maml:para> <maml:para>- Name - Name of the function. This key is required.</maml:para> <maml:para>- ScriptBlock - Function body. Enter a script block. This key is required.</maml:para> <maml:para>- Options - Function options. This key is optional. The default value is None . The acceptable values for this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name='Get-PowerShellProcess';ScriptBlock={Get-Process PowerShell};Options='AllScope'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>GroupManagedServiceAccount</maml:name> <maml:Description> <maml:para>Configures sessions using this session configuration to run under the context of the specified Group Managed Service Account. The machine where this session configuration is registered must have permission to request the gMSA password in order for sessions to be created successfully. This field cannot be used with the RunAsVirtualAccount parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Guid</maml:name> <maml:Description> <maml:para>Specifies a unique identifier for the session configuration file. If you omit this parameter, `New-PSSessionConfigurationFile` generates a GUID for the file. To create a new GUID in PowerShell, type `New-Guid`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>LanguageMode</maml:name> <maml:Description> <maml:para>Determines which elements of the PowerShell language are permitted in sessions that use this session configuration. You can use this parameter to restrict the commands that particular users can run on the computer.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- FullLanguage - All language elements are permitted.</maml:para> <maml:para>- ConstrainedLanguage - Commands that contain scripts to be evaluated are not allowed. The</maml:para> <maml:para> ConstrainedLanguage mode restricts user access to Microsoft .NET Framework types, objects, or methods. - NoLanguage - Users may run cmdlets and functions, but are not permitted to use any language elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, `$True`, `$False`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted.</maml:para> <maml:para>The default value of the LanguageMode parameter depends on the value of the SessionType parameter.</maml:para> <maml:para>- Empty - NoLanguage</maml:para> <maml:para>- RestrictedRemoteServer - NoLanguage</maml:para> <maml:para>- Default - FullLanguage</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">FullLanguage</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">RestrictedLanguage</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NoLanguage</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ConstrainedLanguage</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSLanguageMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSLanguageMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules and snap-ins that are automatically imported into sessions that use the session configuration.</maml:para> <maml:para>By default, only the Microsoft.PowerShell.Core snap-in is imported into remote sessions, but unless the cmdlets are excluded, users can use the `Import-Module` and `Add-PSSnapin` cmdlets to add modules and snap-ins to the session.</maml:para> <maml:para>Each module or snap-in in the value of this parameter can be represented by a string or as a hash table. A module string consists only of the name of the module or snap-in. A module hash table can include ModuleName , ModuleVersion , and GUID keys. Only the ModuleName key is required.</maml:para> <maml:para>For example, the following value consists of a string and a hash table. Any combination of strings and hash tables, in any order, is valid.</maml:para> <maml:para>`'TroubleshootingPack', @{ModuleName='PSDiagnostics'; ModuleVersion='1.0.0.0';GUID='c61d6278-02a3-4618-ae37-a524d40a7f44'}`</maml:para> <maml:para>The value of the ModulesToImport parameter of the `Register-PSSessionConfiguration` cmdlet takes precedence over the value of the ModulesToImport key in the session configuration file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MountUserDrive</maml:name> <maml:Description> <maml:para>Configures sessions that use this session configuration to expose the `User:` PSDrive. User drives are unique for each connecting user and allow users to copy data to and from PowerShell endpoints even if the File System provider is not exposed. User drive roots are created under `$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\DriveRoots`. For each user connecting to the endpoint, a folder is created with the name `$env:USERDOMAIN_$env:USERNAME`.</maml:para> <maml:para>Contents in the user drive persist across user sessions and are not automatically removed. By default, users can only store up to 50MB of data in the user drive. This can be customized with the UserDriveMaximumSize parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellVersion</maml:name> <maml:Description> <maml:para>Specifies the version of the PowerShell engine in sessions that use the session configuration. The acceptable values for this parameter are: 2.0 and 3.0. If you omit this parameter, the PowerShellVersion key is commented-out and newest version of PowerShell runs in the session.</maml:para> <maml:para>The value of the PSVersion parameter of the `Register-PSSessionConfiguration` cmdlet takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredGroups</maml:name> <maml:Description> <maml:para>Specifies conditional access rules for users connecting to sessions that use this session configuration.</maml:para> <maml:para>Enter a hashtable to compose your list of rules using only 1 key per hashtable, 'And' or 'Or', and set the value to an array of security group names or additional hashtables.</maml:para> <maml:para>Example requiring connecting users to be members of a single group: `@{ And = 'MyRequiredGroup' }`</maml:para> <maml:para>Example requiring users to belong to group A, or both groups B and C, to access the endpoint: `@{ Or = 'GroupA', @{ And = 'GroupB', 'GroupC' } }`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RoleDefinitions</maml:name> <maml:Description> <maml:para>Specifies the mapping between security groups (or users) and role capabilities. Users will be granted access to all role capabilities which apply to their group membership at the time the session is created.</maml:para> <maml:para>Enter a hash table in which the keys are the name of the security group and the values are hash tables that contain a list of role capabilities that should be made available to the security group.</maml:para> <maml:para>For example: `@{'Contoso\Level 2 Helpdesk Users' = @{ RoleCapabilities = 'Maintenance', 'ADHelpDesk' }}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsVirtualAccount</maml:name> <maml:Description> <maml:para>Configures sessions using this session configuration to be run as the computer's (virtual) administrator account. This field cannot be used with the GroupManagedServiceAccount parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsVirtualAccountGroups</maml:name> <maml:Description> <maml:para>Specifies the security groups to be associated with the virtual account when a session that uses the session configuration is run as a virtual account. If omitted, the virtual account belongs to Domain Admins on domain controllers and Administrators on all other computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SchemaVersion</maml:name> <maml:Description> <maml:para>Specifies the version of the session configuration file schema. The default value is "1.0.0.0".</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptsToProcess</maml:name> <maml:Description> <maml:para>Adds the specified scripts to sessions that use the session configuration. Enter the path and file names of the scripts. The value of this parameter must be a full or absolute path of script file names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionType</maml:name> <maml:Description> <maml:para>Specifies the type of session that is created by using the session configuration. The default value is Default. The acceptable values for this parameter are:</maml:para> <maml:para>- Empty - No modules are added to session by default. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session. This option is designed for you to create custom sessions by adding selected commands. If you do not add commands to an empty session, the session is limited to expressions and might not be usable. - Default - Adds the Microsoft.PowerShell.Core module to the session. This module includes the `Import-Module` cmdlet that users can use to import other modules unless you explicitly prohibit this cmdlet. - RestrictedRemoteServer. Includes only the following proxy functions: `Exit-PSSession`, `Get-Command`, `Get-FormatData`, `Get-Help`, `Measure-Object`, `Out-Default`, and `Select-Object`. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Empty</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">RestrictedRemoteServer</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.SessionType</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.SessionType</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TranscriptDirectory</maml:name> <maml:Description> <maml:para>Specifies the directory to place session transcripts for sessions using this session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TypesToProcess</maml:name> <maml:Description> <maml:para>Adds the specified `.ps1xml` type files to sessions that use the session configuration. Enter the type filenames. The value of this parameter must be a full or absolute path to type filenames.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UserDriveMaximumSize</maml:name> <maml:Description> <maml:para>Specifies the maximum size for user drives exposed in sessions that use this session configuration. When omitted, the default size of each `User:` drive root is 50MB.</maml:para> <maml:para>This parameter should be used with MountUserDrive .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int64</command:parameterValue> <dev:type> <maml:name>System.Int64</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VariableDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified variables to sessions that use the session configuration. Enter a hash table with the following keys:</maml:para> <maml:para>- Name - Name of the variable. This key is required.</maml:para> <maml:para>- Value - Variable value. This key is required.</maml:para> <maml:para>- Options - Variable options. This key is optional. The default value is None . The acceptable values for this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name='WarningPreference';Value='SilentlyContinue';Options='AllScope'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleAliases</maml:name> <maml:Description> <maml:para>Limits the aliases in the session to those specified in the value of this parameter, plus any aliases that you define in the AliasDefinition parameter. Wildcard characters are supported. By default, all aliases that are defined by the PowerShell engine and all aliases that modules export are visible in the session.</maml:para> <maml:para>For example: `VisibleAliases='gcm', 'gp'`</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleCmdlets</maml:name> <maml:Description> <maml:para>Limits the cmdlets in the session to those specified in the value of this parameter. Wildcard characters and Module Qualified Names are supported.</maml:para> <maml:para>By default, all cmdlets that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session. If no modules in ModulesToImport expose the cmdlet, the appropriate module will attempt to be autoloaded.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleExternalCommands</maml:name> <maml:Description> <maml:para>Limits the external binaries, scripts, and commands that can be executed in the session to those specified in the value of this parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, no external commands are visible in the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell, removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleFunctions</maml:name> <maml:Description> <maml:para>Limits the functions in the session to those specified in the value of this parameter, plus any functions that you define in the FunctionDefinition parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all functions that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleProviders</maml:name> <maml:Description> <maml:para>Limits the PowerShell providers in the session to those specified in the value of this parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all providers that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AliasDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified aliases to sessions that use the session configuration. Enter a hash table with the following keys:</maml:para> <maml:para>- Name - Name of the alias. This key is required.</maml:para> <maml:para>- Value - The command that the alias represents. This key is required.</maml:para> <maml:para>- Description - A text string that describes the alias. This key is optional.</maml:para> <maml:para>- Options - Alias options. This key is optional. The default value is None . The acceptable values for this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name='hlp';Value='Get-Help';Description='Gets help';Options='ReadOnly'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AssembliesToLoad</maml:name> <maml:Description> <maml:para>Specifies the assemblies to load into the sessions that use the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Author</maml:name> <maml:Description> <maml:para>Specifies the author of the session configuration or the configuration file. The default is the current user. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CompanyName</maml:name> <maml:Description> <maml:para>Specifies the company that created the session configuration or the configuration file. The default value is Unknown . The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Unknown</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Copyright</maml:name> <maml:Description> <maml:para>Specifies a copyright the session configuration file. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> <maml:para>If you omit this parameter, `New-PSSessionConfigurationFile` generates a copyright statement by using the value of the Author parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Description</maml:name> <maml:Description> <maml:para>Specifies a description of the session configuration or the session configuration file. The value of this parameter is visible in the session configuration file, but it is not a property of the session configuration object.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>EnvironmentVariables</maml:name> <maml:Description> <maml:para>Adds environment variables to the session. Enter a hash table in which the keys are the environment variable names and the values are the environment variable values.</maml:para> <maml:para>For example: `EnvironmentVariables=@{TestShare='\Server01\TestShare'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ExecutionPolicy</maml:name> <maml:Description> <maml:para>Specifies the execution policy of sessions that use the session configuration. If you omit this parameter, the value of the ExecutionPolicy key in the session configuration file is Restricted . For information about execution policies in PowerShell, see about_Execution_Policies (about/about_Execution_Policies.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.ExecutionPolicy</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.ExecutionPolicy</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FormatsToProcess</maml:name> <maml:Description> <maml:para>Specifies the formatting files (.ps1xml) that run in sessions that use the session configuration. The value of this parameter must be a full or absolute path of the formatting files.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Full</maml:name> <maml:Description> <maml:para>Indicates that this operation includes all possible configuration properties in the session configuration file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>FunctionDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified functions to sessions that use the session configuration. Enter a hash table with the following keys:</maml:para> <maml:para>- Name - Name of the function. This key is required.</maml:para> <maml:para>- ScriptBlock - Function body. Enter a script block. This key is required.</maml:para> <maml:para>- Options - Function options. This key is optional. The default value is None . The acceptable values for this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name='Get-PowerShellProcess';ScriptBlock={Get-Process PowerShell};Options='AllScope'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary[]</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>GroupManagedServiceAccount</maml:name> <maml:Description> <maml:para>Configures sessions using this session configuration to run under the context of the specified Group Managed Service Account. The machine where this session configuration is registered must have permission to request the gMSA password in order for sessions to be created successfully. This field cannot be used with the RunAsVirtualAccount parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Guid</maml:name> <maml:Description> <maml:para>Specifies a unique identifier for the session configuration file. If you omit this parameter, `New-PSSessionConfigurationFile` generates a GUID for the file. To create a new GUID in PowerShell, type `New-Guid`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>LanguageMode</maml:name> <maml:Description> <maml:para>Determines which elements of the PowerShell language are permitted in sessions that use this session configuration. You can use this parameter to restrict the commands that particular users can run on the computer.</maml:para> <maml:para>The acceptable values for this parameter are:</maml:para> <maml:para>- FullLanguage - All language elements are permitted.</maml:para> <maml:para>- ConstrainedLanguage - Commands that contain scripts to be evaluated are not allowed. The</maml:para> <maml:para> ConstrainedLanguage mode restricts user access to Microsoft .NET Framework types, objects, or methods. - NoLanguage - Users may run cmdlets and functions, but are not permitted to use any language elements, such as script blocks, variables, or operators. - RestrictedLanguage - Users may run cmdlets and functions, but are not permitted to use script blocks or variables except for the following permitted variables: `$PSCulture`, `$PSUICulture`, `$True`, `$False`, and `$Null`. Users may use only the basic comparison operators (`-eq`, `-gt`, `-lt`). Assignment statements, property references, and method calls are not permitted.</maml:para> <maml:para>The default value of the LanguageMode parameter depends on the value of the SessionType parameter.</maml:para> <maml:para>- Empty - NoLanguage</maml:para> <maml:para>- RestrictedRemoteServer - NoLanguage</maml:para> <maml:para>- Default - FullLanguage</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSLanguageMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSLanguageMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules and snap-ins that are automatically imported into sessions that use the session configuration.</maml:para> <maml:para>By default, only the Microsoft.PowerShell.Core snap-in is imported into remote sessions, but unless the cmdlets are excluded, users can use the `Import-Module` and `Add-PSSnapin` cmdlets to add modules and snap-ins to the session.</maml:para> <maml:para>Each module or snap-in in the value of this parameter can be represented by a string or as a hash table. A module string consists only of the name of the module or snap-in. A module hash table can include ModuleName , ModuleVersion , and GUID keys. Only the ModuleName key is required.</maml:para> <maml:para>For example, the following value consists of a string and a hash table. Any combination of strings and hash tables, in any order, is valid.</maml:para> <maml:para>`'TroubleshootingPack', @{ModuleName='PSDiagnostics'; ModuleVersion='1.0.0.0';GUID='c61d6278-02a3-4618-ae37-a524d40a7f44'}`</maml:para> <maml:para>The value of the ModulesToImport parameter of the `Register-PSSessionConfiguration` cmdlet takes precedence over the value of the ModulesToImport key in the session configuration file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MountUserDrive</maml:name> <maml:Description> <maml:para>Configures sessions that use this session configuration to expose the `User:` PSDrive. User drives are unique for each connecting user and allow users to copy data to and from PowerShell endpoints even if the File System provider is not exposed. User drive roots are created under `$env:LOCALAPPDATA\Microsoft\Windows\PowerShell\DriveRoots`. For each user connecting to the endpoint, a folder is created with the name `$env:USERDOMAIN_$env:USERNAME`.</maml:para> <maml:para>Contents in the user drive persist across user sessions and are not automatically removed. By default, users can only store up to 50MB of data in the user drive. This can be customized with the UserDriveMaximumSize parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of the session configuration file. The file must have a `.pssc` file name extension.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PowerShellVersion</maml:name> <maml:Description> <maml:para>Specifies the version of the PowerShell engine in sessions that use the session configuration. The acceptable values for this parameter are: 2.0 and 3.0. If you omit this parameter, the PowerShellVersion key is commented-out and newest version of PowerShell runs in the session.</maml:para> <maml:para>The value of the PSVersion parameter of the `Register-PSSessionConfiguration` cmdlet takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RequiredGroups</maml:name> <maml:Description> <maml:para>Specifies conditional access rules for users connecting to sessions that use this session configuration.</maml:para> <maml:para>Enter a hashtable to compose your list of rules using only 1 key per hashtable, 'And' or 'Or', and set the value to an array of security group names or additional hashtables.</maml:para> <maml:para>Example requiring connecting users to be members of a single group: `@{ And = 'MyRequiredGroup' }`</maml:para> <maml:para>Example requiring users to belong to group A, or both groups B and C, to access the endpoint: `@{ Or = 'GroupA', @{ And = 'GroupB', 'GroupC' } }`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RoleDefinitions</maml:name> <maml:Description> <maml:para>Specifies the mapping between security groups (or users) and role capabilities. Users will be granted access to all role capabilities which apply to their group membership at the time the session is created.</maml:para> <maml:para>Enter a hash table in which the keys are the name of the security group and the values are hash tables that contain a list of role capabilities that should be made available to the security group.</maml:para> <maml:para>For example: `@{'Contoso\Level 2 Helpdesk Users' = @{ RoleCapabilities = 'Maintenance', 'ADHelpDesk' }}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.IDictionary</command:parameterValue> <dev:type> <maml:name>System.Collections.IDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsVirtualAccount</maml:name> <maml:Description> <maml:para>Configures sessions using this session configuration to be run as the computer's (virtual) administrator account. This field cannot be used with the GroupManagedServiceAccount parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsVirtualAccountGroups</maml:name> <maml:Description> <maml:para>Specifies the security groups to be associated with the virtual account when a session that uses the session configuration is run as a virtual account. If omitted, the virtual account belongs to Domain Admins on domain controllers and Administrators on all other computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SchemaVersion</maml:name> <maml:Description> <maml:para>Specifies the version of the session configuration file schema. The default value is "1.0.0.0".</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptsToProcess</maml:name> <maml:Description> <maml:para>Adds the specified scripts to sessions that use the session configuration. Enter the path and file names of the scripts. The value of this parameter must be a full or absolute path of script file names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionType</maml:name> <maml:Description> <maml:para>Specifies the type of session that is created by using the session configuration. The default value is Default. The acceptable values for this parameter are:</maml:para> <maml:para>- Empty - No modules are added to session by default. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session. This option is designed for you to create custom sessions by adding selected commands. If you do not add commands to an empty session, the session is limited to expressions and might not be usable. - Default - Adds the Microsoft.PowerShell.Core module to the session. This module includes the `Import-Module` cmdlet that users can use to import other modules unless you explicitly prohibit this cmdlet. - RestrictedRemoteServer. Includes only the following proxy functions: `Exit-PSSession`, `Get-Command`, `Get-FormatData`, `Get-Help`, `Measure-Object`, `Out-Default`, and `Select-Object`. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.SessionType</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.SessionType</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TranscriptDirectory</maml:name> <maml:Description> <maml:para>Specifies the directory to place session transcripts for sessions using this session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TypesToProcess</maml:name> <maml:Description> <maml:para>Adds the specified `.ps1xml` type files to sessions that use the session configuration. Enter the type filenames. The value of this parameter must be a full or absolute path to type filenames.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UserDriveMaximumSize</maml:name> <maml:Description> <maml:para>Specifies the maximum size for user drives exposed in sessions that use this session configuration. When omitted, the default size of each `User:` drive root is 50MB.</maml:para> <maml:para>This parameter should be used with MountUserDrive .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int64</command:parameterValue> <dev:type> <maml:name>System.Int64</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VariableDefinitions</maml:name> <maml:Description> <maml:para>Adds the specified variables to sessions that use the session configuration. Enter a hash table with the following keys:</maml:para> <maml:para>- Name - Name of the variable. This key is required.</maml:para> <maml:para>- Value - Variable value. This key is required.</maml:para> <maml:para>- Options - Variable options. This key is optional. The default value is None . The acceptable values for this parameter are: None, ReadOnly, Constant, Private, or AllScope.</maml:para> <maml:para>For example: `@{Name='WarningPreference';Value='SilentlyContinue';Options='AllScope'}`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleAliases</maml:name> <maml:Description> <maml:para>Limits the aliases in the session to those specified in the value of this parameter, plus any aliases that you define in the AliasDefinition parameter. Wildcard characters are supported. By default, all aliases that are defined by the PowerShell engine and all aliases that modules export are visible in the session.</maml:para> <maml:para>For example: `VisibleAliases='gcm', 'gp'`</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleCmdlets</maml:name> <maml:Description> <maml:para>Limits the cmdlets in the session to those specified in the value of this parameter. Wildcard characters and Module Qualified Names are supported.</maml:para> <maml:para>By default, all cmdlets that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session. If no modules in ModulesToImport expose the cmdlet, the appropriate module will attempt to be autoloaded.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleExternalCommands</maml:name> <maml:Description> <maml:para>Limits the external binaries, scripts, and commands that can be executed in the session to those specified in the value of this parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, no external commands are visible in the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell, removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleFunctions</maml:name> <maml:Description> <maml:para>Limits the functions in the session to those specified in the value of this parameter, plus any functions that you define in the FunctionDefinition parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all functions that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules and snap-ins are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its ipmo alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="named" aliases="none"> <maml:name>VisibleProviders</maml:name> <maml:Description> <maml:para>Limits the PowerShell providers in the session to those specified in the value of this parameter. Wildcard characters are supported.</maml:para> <maml:para>By default, all providers that modules in the session export are visible in the session. Use the SessionType and ModulesToImport parameters to determine which modules are imported into the session.</maml:para> <maml:para>When any Visible parameter is included in the session configuration file, PowerShell removes the `Import-Module` cmdlet and its `ipmo` alias from the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe any objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- Parameters, such as VisibleCmdlets and VisibleProviders , do not import items into the session. Instead, they select from among the items imported into the session. For example, if the value of the VisibleProviders parameter is the Certificate provider, but the ModulesToImport parameter does not specify the Microsoft.PowerShell.Security module that contains the Certificate provider, the Certificate provider is not visible in the session. - `New-PSSessionConfigurationFile` creates a session configuration file that has a .pssc file name extension in the path that you specify in the Path parameter. When you use the session configuration file to create a session configuration, the `Register-PSSessionConfiguration` cmdlet copies the configuration file and saves an active copy of the file in the SessionConfig subdirectory of the `$PSHOME` directory.</maml:para> <maml:para> The ConfigFilePath property of the session configuration contains the fully qualified path of the active session configuration file. You can modify the active configuration file in the `$PSHOME` directory at any time using any text editor. The changes that you make affect all new sessions that use the session configuration, but not existing sessions.</maml:para> <maml:para> Before using an edited session configuration file, use the `Test-PSSessionConfigurationFile` cmdlet to verify that the configuration file entries are valid.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------ Example 1: Creating and using a NoLanguage session ------</maml:title> <dev:code>New-PSSessionConfigurationFile -Path .\NoLanguage.pssc -LanguageMode NoLanguage Register-PSSessionConfiguration -Path .\NoLanguage.pssc -Name NoLanguage -Force $NoLanguageSession = New-PSSession -ComputerName Srv01 -ConfigurationName NoLanguage Invoke-Command -Session $NoLanguageSession -ScriptBlock { if ((Get-Date) -lt '1January2099') {'Before'} else {'After'} } The syntax is not supported by this runspace. This might be because it is in no-language mode. + CategoryInfo : ParserError: (if ((Get-Date) ...') {'Before'} :String) [], ParseException + FullyQualifiedErrorId : ScriptsNotAllowed + PSComputerName : localhost</dev:code> <dev:remarks> <maml:para>In this example, the `Invoke-Command` fails because the LanguageMode is set to NoLanguage .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 2: Creating and using a RestrictedLanguage session --</maml:title> <dev:code>New-PSSessionConfigurationFile -Path .\NoLanguage.pssc -LanguageMode RestrictedLanguage Register-PSSessionConfiguration -Path .\NoLanguage.pssc -Name RestrictedLanguage -Force $RestrictedSession = New-PSSession -ComputerName Srv01 -ConfigurationName RestrictedLanguage Invoke-Command -Session $RestrictedSession -ScriptBlock { if ((Get-Date) -lt '1January2099') {'Before'} else {'After'} } Before</dev:code> <dev:remarks> <maml:para>In this example, the `Invoke-Command` succeeds because the LanguageMode is set to RestrictedLanguage .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Changing a Session Configuration File -------</maml:title> <dev:code>New-PSSessionConfigurationFile -Path .\New-ITTasks.pssc -ModulesToImport Microsoft*, ITTasks, PSScheduledJob Set-PSSessionConfiguration -Name ITTasks -Path .\New-ITTasks.pssc</dev:code> <dev:remarks> <maml:para>The `New-PSSessionConfigurationFile` cmdlet to create a session configuration file that imports the required modules. The `Set-PSSessionConfiguration` cmdlet replaces the current configuration file with the new one. This new configuration only affects new sessions created after the change. Existing "ITTasks" sessions are not affected.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 4: Editing a Session Configuration File -------</maml:title> <dev:code>$ITConfig = Get-PSSessionConfiguration -Name ITConfig notepad.exe $ITConfig.ConfigFilePath Test-PSSessionConfigurationFile -Path $ITConfig.ConfigFilePath True</dev:code> <dev:remarks> <maml:para>Use the Verbose parameter with `Test-PSSessionConfigurationFile` to display any errors that are detected. The cmdlet returns `$True` if no errors are detected in the file.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 5: Create a sample configuration file --------</maml:title> <dev:code>$configSettings = @{ Path = '.\SampleFile.pssc' SchemaVersion = '1.0.0.0' Author = 'User01' Copyright = '(c) Fabrikam Corporation. All rights reserved.' CompanyName = 'Fabrikam Corporation' Description = 'This is a sample file.' ExecutionPolicy = 'AllSigned' PowerShellVersion = '3.0' LanguageMode = 'FullLanguage' SessionType = 'Default' EnvironmentVariables = @{TESTSHARE='\\Test2\Test'} ModulesToImport = @{ModuleName='PSScheduledJob'; ModuleVersion='1.0.0.0'; GUID='50cdb55f-5ab7-489f-9e94-4ec21ff51e59'},'PSDiagnostics' AssembliesToLoad = 'System.Web.Services','FSharp.Compiler.CodeDom.dll' TypesToProcess = 'Types1.ps1xml','Types2.ps1xml' FormatsToProcess = 'CustomFormats.ps1xml' ScriptsToProcess = 'Get-Inputs.ps1' AliasDefinitions = @{Name='hlp';Value='Get-Help';Description='Gets help.';Options='AllScope'}, @{Name='Update';Value='Update-Help';Description='Updates help';Options='ReadOnly'} FunctionDefinitions = @{Name='Get-Function';ScriptBlock={Get-Command -CommandType Function};Options='ReadOnly'} VariableDefinitions = @{Name='WarningPreference';Value='SilentlyContinue'} VisibleAliases = 'c*','g*','i*','s*' VisibleCmdlets = 'Get*' VisibleFunctions = 'Get*' VisibleProviders = 'FileSystem','Function','Variable' RunAsVirtualAccount = $true RunAsVirtualAccountGroups = 'Backup Operators' } New-PSSessionConfigurationFile @configSettings Get-Content SampleFile.pssc @{ # Version number of the schema used for this document SchemaVersion = '1.0.0.0' # ID used to uniquely identify this document GUID = '1caeff7f-27ca-4360-97cf-37846f594235' # Author of this document Author = 'User01' # Description of the functionality provided by these settings Description = 'This is a sample file.' # Company associated with this document CompanyName = 'Fabrikam Corporation' # Copyright statement for this document Copyright = '(c) Fabrikam Corporation. All rights reserved.' # Session type defaults to apply for this session configuration. Can be 'RestrictedRemoteServer' (recommended), 'Empty', or 'Default' SessionType = 'Default' # Directory to place session transcripts for this session configuration # TranscriptDirectory = 'C:\Transcripts\' # Whether to run this session configuration as the machine's (virtual) administrator account RunAsVirtualAccount = $true # Groups associated with machine's (virtual) administrator account RunAsVirtualAccountGroups = 'Backup Operators' # Scripts to run when applied to a session ScriptsToProcess = 'Get-Inputs.ps1' # User roles (security groups), and the role capabilities that should be applied to them when applied to a session # RoleDefinitions = @{ 'CONTOSO\SqlAdmins' = @{ RoleCapabilities = 'SqlAdministration' }; 'CONTOSO\SqlManaged' = @{ RoleCapabilityFiles = 'C:\RoleCapability\SqlManaged.psrc' }; 'CONTOSO\ServerMonitors' = @{ VisibleCmdlets = 'Get-Process' } } # Language mode to apply when applied to a session. Can be 'NoLanguage' (recommended), 'RestrictedLanguage', 'ConstrainedLanguage', or 'FullLanguage' LanguageMode = 'FullLanguage' # Execution policy to apply when applied to a session ExecutionPolicy = 'AllSigned' # Version of the PowerShell engine to use when applied to a session PowerShellVersion = '3.0' # Modules to import when applied to a session ModulesToImport = @{ 'GUID' = '50cdb55f-5ab7-489f-9e94-4ec21ff51e59' 'ModuleName' = 'PSScheduledJob' 'ModuleVersion' = '1.0.0.0' }, 'PSDiagnostics' # Aliases to make visible when applied to a session VisibleAliases = 'c*', 'g*', 'i*', 's*' # Cmdlets to make visible when applied to a session VisibleCmdlets = 'Get*' # Functions to make visible when applied to a session VisibleFunctions = 'Get*' # Providers to make visible when applied to a session VisibleProviders = 'FileSystem', 'Function', 'Variable' # Aliases to be defined when applied to a session AliasDefinitions = @{ 'Description' = 'Gets help.' 'Name' = 'hlp' 'Options' = 'AllScope' 'Value' = 'Get-Help' }, @{ 'Description' = 'Updates help' 'Name' = 'Update' 'Options' = 'ReadOnly' 'Value' = 'Update-Help' } # Functions to define when applied to a session FunctionDefinitions = @{ 'Name' = 'Get-Function' 'Options' = 'ReadOnly' 'ScriptBlock' = {Get-Command -CommandType Function} } # Variables to define when applied to a session VariableDefinitions = @{ 'Name' = 'WarningPreference' 'Value' = 'SilentlyContinue' } # Environment variables to define when applied to a session EnvironmentVariables = @{ 'TESTSHARE' = '\\Test2\Test' } # Type files (.ps1xml) to load when applied to a session TypesToProcess = 'Types1.ps1xml', 'Types2.ps1xml' # Format files (.ps1xml) to load when applied to a session FormatsToProcess = 'CustomFormats.ps1xml' # Assemblies to load when applied to a session AssembliesToLoad = 'System.Web.Services', 'FSharp.Compiler.CodeDom.dll' }</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionconfigurationfile?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-PSSessionOption</command:name> <command:verb>New</command:verb> <command:noun>PSSessionOption</command:noun> <maml:description> <maml:para>Creates an object that contains advanced options for a PSSession.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `New-PSSessionOption` cmdlet creates an object that contains advanced options for a user-managed session ( PSSession ). You can use the object as the value of the SessionOption parameter of cmdlets that create a PSSession , such as `New-PSSession`, `Enter-PSSession`, and `Invoke-Command`.</maml:para> <maml:para>Without parameters, `New-PSSessionOption` generates an object that contains the default values for all of the options. Because all of the properties can be edited, you can use the resulting object as a template, and create standard option objects for your enterprise.</maml:para> <maml:para>You can also save a session option object in the `$PSSessionOption` preference variable. The values of this variable establish new default values for the session options. They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. For more information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-PSSessionOption</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationArguments</maml:name> <maml:Description> <maml:para>Specifies a primitive dictionary that is sent to the remote session. Commands and scripts in the remote session, including startup scripts in the session configuration, can find this dictionary in the ApplicationArguments property of the `$PSSenderInfo` automatic variable. You can use this parameter to send data to the remote session.</maml:para> <maml:para>For more information, see about_Hash_Tables (about/about_Hash_Tables.md), [about_Session_Configurations](About/about_Session_Configurations.md), and about_Automatic_Variables (about/about_Automatic_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSPrimitiveDictionary</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSPrimitiveDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="CancelTimeoutMSec"> <maml:name>CancelTimeout</maml:name> <maml:Description> <maml:para>Determines how long PowerShell waits for a cancel operation (CTRL+C) to finish before ending it. Enter a value in milliseconds.</maml:para> <maml:para>The default value is 60000 (one minute). A value of 0 (zero) means no time-out; the command continues indefinitely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60000</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for the session. Enter a culture name in `<languagecode2>-<country/regioncode2>` format (like `ja-JP`), a variable that contains a CultureInfo object, or a command that gets a CultureInfo object.</maml:para> <maml:para>The default value is `$Null`, and the culture that is set in the operating system is used in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IdleTimeoutMSec"> <maml:name>IdleTimeout</maml:name> <maml:Description> <maml:para>Determines how long the session stays open if the remote computer does not receive any communication from the local computer. This includes the heartbeat signal. When the interval expires, the session closes.</maml:para> <maml:para>The idle time-out value is of significant importance if you intend to disconnect and reconnect to a session. You can reconnect only if the session has not timed out.</maml:para> <maml:para>Enter a value in milliseconds. The minimum value is 60000 (1 minute). The maximum is the value of the MaxIdleTimeoutms property of the session configuration. The default value, -1, does not set an idle time-out.</maml:para> <maml:para>The session uses the idle time-out that is set in the session options, if any. If none is set (-1), the session uses the value of the IdleTimeoutMs property of the session configuration or the WSMan shell time-out value (`WSMan:<ComputerName>\Shell\IdleTimeout`), whichever is shortest.</maml:para> <maml:para>If the idle timeout set in the session options exceeds the value of the MaxIdleTimeoutMs property of the session configuration, the command to create a session fails.</maml:para> <maml:para>The IdleTimeoutMs value of the default Microsoft.PowerShell session configuration is 7200000 milliseconds (2 hours). Its MaxIdleTimeoutMs value is 2147483647 milliseconds (>24 days). The default value of the WSMan shell idle time-out (`WSMan:<ComputerName>\Shell\IdleTimeout`) is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The idle time-out value of a session can also be changed when disconnecting from a session or reconnecting to a session. For more information, see `Disconnect-PSSession` and `Connect-PSSession`.</maml:para> <maml:para>In Windows PowerShell 2.0, the default value of the IdleTimeout parameter is 240000 (4 minutes).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludePortInSPN</maml:name> <maml:Description> <maml:para>Includes the port number in the Service Principal Name (SPN) used for Kerberos authentication, for example, `HTTP://<ComputerName>:5985`. This option allows a client that uses a non-default SPN to authenticate against a remote computer that uses Kerberos authentication.</maml:para> <maml:para>The option is designed for enterprises where multiple services that support Kerberos authentication are running under different user accounts. For example, an IIS application that allows for Kerberos authentication can require the default SPN to be registered to a user account that differs from the computer account. In such cases, PowerShell remoting cannot use Kerberos to authenticate because it requires an SPN that is registered to the computer account. To resolve this problem, administrators can create different SPNs, such as by using Setspn.exe , that are registered to different user accounts and can distinguish between them by including the port number in the SPN.</maml:para> <maml:para>For more information, see Setspn Overview (/previous-versions/windows/it-pro/windows-server-2003/cc773257(v=ws.10)).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaxConnectionRetryCount</maml:name> <maml:Description> <maml:para>Specifies the number of times that PowerShell attempts to make a connection to a target machine if the current attempt fails due to network issues. The default value is 5.</maml:para> <maml:para>This parameter was added for PowerShell version 5.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommand</maml:name> <maml:Description> <maml:para>Specifies the maximum number of bytes that the local computer can receive from the remote computer in a single command. Enter a value in bytes. By default, there is no data size limit.</maml:para> <maml:para>This option is designed to protect the resources on the client computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSize</maml:name> <maml:Description> <maml:para>Specifies the maximum size of an object that the local computer can receive from the remote computer. This option is designed to protect the resources on the client computer. Enter a value in bytes.</maml:para> <maml:para>In Windows PowerShell 2.0, if you omit this parameter, there is no object size limit. Beginning in Windows PowerShell 3.0, if you omit this parameter, the default value is 200 MB.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>200 MB</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumRedirection</maml:name> <maml:Description> <maml:para>Determines how many times PowerShell redirects a connection to an alternate Uniform Resource Identifier (URI) before the connection fails. The default value is 5. A value of 0 (zero) prevents all redirection.</maml:para> <maml:para>This option is used in the session only when the AllowRedirection parameter is used in the command that creates the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>5</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoCompression</maml:name> <maml:Description> <maml:para>Turns off packet compression in the session. Compression uses more processor cycles, but it makes transmission faster.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoEncryption</maml:name> <maml:Description> <maml:para>Turns off data encryption.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoMachineProfile</maml:name> <maml:Description> <maml:para>Prevents loading the user's Windows user profile. As a result, the session might be created faster, but user-specific registry settings, items such as environment variables, and certificates are not available in the session.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="OpenTimeoutMSec"> <maml:name>OpenTimeout</maml:name> <maml:Description> <maml:para>Determines how long the client computer waits for the session connection to be established. When the interval expires, the command to establish the connection fails. Enter a value in milliseconds.</maml:para> <maml:para>The default value is 180000 (3 minutes). A value of 0 (zero) means no time-out; the command continues indefinitely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>180000 (3 minutes)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="OperationTimeoutMSec"> <maml:name>OperationTimeout</maml:name> <maml:Description> <maml:para>Determines the maximum time that any operation in the session can run. When the interval expires, the operation fails. Enter a value in milliseconds.</maml:para> <maml:para>The default value is 180000 (3 minutes). A value of 0 (zero) means no time-out; the operation continues indefinitely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>180000 (3 minutes)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in disconnected sessions when the output buffer becomes full.</maml:para> <maml:para>If the output buffering mode is not set in the session or in the session configuration, the default value is Block . Users can also change the output buffering mode when disconnecting the session.</maml:para> <maml:para>If you omit this parameter, the value of the OutputBufferingMode of the session option object is None. A value of Block or Drop overrides the output buffering mode transport option set in the session configuration. The acceptable values for this parameter are:</maml:para> <maml:para>- Block. When the output buffer is full, execution is suspended until the buffer is clear.</maml:para> <maml:para>- Drop. When the output buffer is full, execution continues. As new output is saved, the oldest</maml:para> <maml:para> output is discarded. - None. No output buffering mode is specified.</maml:para> <maml:para>For more information about the output buffering mode transport option, see `New-PSTransportOption`.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Drop</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Block</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProxyAccessType</maml:name> <maml:Description> <maml:para>Determines which mechanism is used to resolve the host name. The acceptable values for this parameter are:</maml:para> <maml:para>- IEConfig</maml:para> <maml:para>- WinHttpConfig</maml:para> <maml:para>- AutoDetect</maml:para> <maml:para>- NoProxyServer</maml:para> <maml:para>- None</maml:para> <maml:para></maml:para> <maml:para>The default value is None.</maml:para> <maml:para>For information about the values of this parameter, see ProxyAccessType Enumeration (/dotnet/api/system.management.automation.remoting.proxyaccesstype?redirectedfrom=MSDN&view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">IEConfig</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">WinHttpConfig</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AutoDetect</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NoProxyServer</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.ProxyAccessType</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.ProxyAccessType</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProxyAuthentication</maml:name> <maml:Description> <maml:para>Specifies the authentication method that is used for proxy resolution. The acceptable values for this parameter are: Basic , Digest , and Negotiate . The default value is Negotiate .</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism?redirectedfrom=MSDN&view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Negotiate</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProxyCredential</maml:name> <maml:Description> <maml:para>Specifies the credentials to use for proxy authentication. Enter a variable that contains a PSCredential object or a command that gets a PSCredential object, such as a `Get-Credential` command. If this option is not set, no credentials are specified.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipCACheck</maml:name> <maml:Description> <maml:para>Specifies that when it connects over HTTPS, the client does not validate that the server certificate is signed by a trusted certification authority (CA).</maml:para> <maml:para>Use this option only when the remote computer is trusted by using another mechanism, such as when the remote computer is part of a network that is physically secure and isolated or when the remote computer is listed as a trusted host in a WinRM configuration.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipCNCheck</maml:name> <maml:Description> <maml:para>Specifies that the certificate common name (CN) of the server does not have to match the host name of the server. This option is used only in remote operations that use the HTTPS protocol.</maml:para> <maml:para>Use this option only for trusted computers.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipRevocationCheck</maml:name> <maml:Description> <maml:para>Does not validate the revocation status of the server certificate.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies the UI culture to use for the session.</maml:para> <maml:para>Valid values include:</maml:para> <maml:para>- A culture name in `<languagecode2>-<country/regioncode2>` format, such as `ja-JP`</maml:para> <maml:para>- A variable that contains a CultureInfo object - A command that gets a CultureInfo object, such as `Get-Culture`</maml:para> <maml:para>The default value is `$null`, and the UI culture that is set in the operating system when the session is created is used in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseUTF16</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet encodes the request in UTF16 format instead of UTF8 format.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationArguments</maml:name> <maml:Description> <maml:para>Specifies a primitive dictionary that is sent to the remote session. Commands and scripts in the remote session, including startup scripts in the session configuration, can find this dictionary in the ApplicationArguments property of the `$PSSenderInfo` automatic variable. You can use this parameter to send data to the remote session.</maml:para> <maml:para>For more information, see about_Hash_Tables (about/about_Hash_Tables.md), [about_Session_Configurations](About/about_Session_Configurations.md), and about_Automatic_Variables (about/about_Automatic_Variables.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSPrimitiveDictionary</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSPrimitiveDictionary</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="CancelTimeoutMSec"> <maml:name>CancelTimeout</maml:name> <maml:Description> <maml:para>Determines how long PowerShell waits for a cancel operation (CTRL+C) to finish before ending it. Enter a value in milliseconds.</maml:para> <maml:para>The default value is 60000 (one minute). A value of 0 (zero) means no time-out; the command continues indefinitely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>60000</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Culture</maml:name> <maml:Description> <maml:para>Specifies the culture to use for the session. Enter a culture name in `<languagecode2>-<country/regioncode2>` format (like `ja-JP`), a variable that contains a CultureInfo object, or a command that gets a CultureInfo object.</maml:para> <maml:para>The default value is `$Null`, and the culture that is set in the operating system is used in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IdleTimeoutMSec"> <maml:name>IdleTimeout</maml:name> <maml:Description> <maml:para>Determines how long the session stays open if the remote computer does not receive any communication from the local computer. This includes the heartbeat signal. When the interval expires, the session closes.</maml:para> <maml:para>The idle time-out value is of significant importance if you intend to disconnect and reconnect to a session. You can reconnect only if the session has not timed out.</maml:para> <maml:para>Enter a value in milliseconds. The minimum value is 60000 (1 minute). The maximum is the value of the MaxIdleTimeoutms property of the session configuration. The default value, -1, does not set an idle time-out.</maml:para> <maml:para>The session uses the idle time-out that is set in the session options, if any. If none is set (-1), the session uses the value of the IdleTimeoutMs property of the session configuration or the WSMan shell time-out value (`WSMan:<ComputerName>\Shell\IdleTimeout`), whichever is shortest.</maml:para> <maml:para>If the idle timeout set in the session options exceeds the value of the MaxIdleTimeoutMs property of the session configuration, the command to create a session fails.</maml:para> <maml:para>The IdleTimeoutMs value of the default Microsoft.PowerShell session configuration is 7200000 milliseconds (2 hours). Its MaxIdleTimeoutMs value is 2147483647 milliseconds (>24 days). The default value of the WSMan shell idle time-out (`WSMan:<ComputerName>\Shell\IdleTimeout`) is 7200000 milliseconds (2 hours).</maml:para> <maml:para>The idle time-out value of a session can also be changed when disconnecting from a session or reconnecting to a session. For more information, see `Disconnect-PSSession` and `Connect-PSSession`.</maml:para> <maml:para>In Windows PowerShell 2.0, the default value of the IdleTimeout parameter is 240000 (4 minutes).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IncludePortInSPN</maml:name> <maml:Description> <maml:para>Includes the port number in the Service Principal Name (SPN) used for Kerberos authentication, for example, `HTTP://<ComputerName>:5985`. This option allows a client that uses a non-default SPN to authenticate against a remote computer that uses Kerberos authentication.</maml:para> <maml:para>The option is designed for enterprises where multiple services that support Kerberos authentication are running under different user accounts. For example, an IIS application that allows for Kerberos authentication can require the default SPN to be registered to a user account that differs from the computer account. In such cases, PowerShell remoting cannot use Kerberos to authenticate because it requires an SPN that is registered to the computer account. To resolve this problem, administrators can create different SPNs, such as by using Setspn.exe , that are registered to different user accounts and can distinguish between them by including the port number in the SPN.</maml:para> <maml:para>For more information, see Setspn Overview (/previous-versions/windows/it-pro/windows-server-2003/cc773257(v=ws.10)).</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaxConnectionRetryCount</maml:name> <maml:Description> <maml:para>Specifies the number of times that PowerShell attempts to make a connection to a target machine if the current attempt fails due to network issues. The default value is 5.</maml:para> <maml:para>This parameter was added for PowerShell version 5.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommand</maml:name> <maml:Description> <maml:para>Specifies the maximum number of bytes that the local computer can receive from the remote computer in a single command. Enter a value in bytes. By default, there is no data size limit.</maml:para> <maml:para>This option is designed to protect the resources on the client computer.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSize</maml:name> <maml:Description> <maml:para>Specifies the maximum size of an object that the local computer can receive from the remote computer. This option is designed to protect the resources on the client computer. Enter a value in bytes.</maml:para> <maml:para>In Windows PowerShell 2.0, if you omit this parameter, there is no object size limit. Beginning in Windows PowerShell 3.0, if you omit this parameter, the default value is 200 MB.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>200 MB</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumRedirection</maml:name> <maml:Description> <maml:para>Determines how many times PowerShell redirects a connection to an alternate Uniform Resource Identifier (URI) before the connection fails. The default value is 5. A value of 0 (zero) prevents all redirection.</maml:para> <maml:para>This option is used in the session only when the AllowRedirection parameter is used in the command that creates the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>5</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoCompression</maml:name> <maml:Description> <maml:para>Turns off packet compression in the session. Compression uses more processor cycles, but it makes transmission faster.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoEncryption</maml:name> <maml:Description> <maml:para>Turns off data encryption.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoMachineProfile</maml:name> <maml:Description> <maml:para>Prevents loading the user's Windows user profile. As a result, the session might be created faster, but user-specific registry settings, items such as environment variables, and certificates are not available in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="OpenTimeoutMSec"> <maml:name>OpenTimeout</maml:name> <maml:Description> <maml:para>Determines how long the client computer waits for the session connection to be established. When the interval expires, the command to establish the connection fails. Enter a value in milliseconds.</maml:para> <maml:para>The default value is 180000 (3 minutes). A value of 0 (zero) means no time-out; the command continues indefinitely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>180000 (3 minutes)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="OperationTimeoutMSec"> <maml:name>OperationTimeout</maml:name> <maml:Description> <maml:para>Determines the maximum time that any operation in the session can run. When the interval expires, the operation fails. Enter a value in milliseconds.</maml:para> <maml:para>The default value is 180000 (3 minutes). A value of 0 (zero) means no time-out; the operation continues indefinitely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>180000 (3 minutes)</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in disconnected sessions when the output buffer becomes full.</maml:para> <maml:para>If the output buffering mode is not set in the session or in the session configuration, the default value is Block . Users can also change the output buffering mode when disconnecting the session.</maml:para> <maml:para>If you omit this parameter, the value of the OutputBufferingMode of the session option object is None. A value of Block or Drop overrides the output buffering mode transport option set in the session configuration. The acceptable values for this parameter are:</maml:para> <maml:para>- Block. When the output buffer is full, execution is suspended until the buffer is clear.</maml:para> <maml:para>- Drop. When the output buffer is full, execution continues. As new output is saved, the oldest</maml:para> <maml:para> output is discarded. - None. No output buffering mode is specified.</maml:para> <maml:para>For more information about the output buffering mode transport option, see `New-PSTransportOption`.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.OutputBufferingMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.OutputBufferingMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProxyAccessType</maml:name> <maml:Description> <maml:para>Determines which mechanism is used to resolve the host name. The acceptable values for this parameter are:</maml:para> <maml:para>- IEConfig</maml:para> <maml:para>- WinHttpConfig</maml:para> <maml:para>- AutoDetect</maml:para> <maml:para>- NoProxyServer</maml:para> <maml:para>- None</maml:para> <maml:para></maml:para> <maml:para>The default value is None.</maml:para> <maml:para>For information about the values of this parameter, see ProxyAccessType Enumeration (/dotnet/api/system.management.automation.remoting.proxyaccesstype?redirectedfrom=MSDN&view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.ProxyAccessType</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.ProxyAccessType</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProxyAuthentication</maml:name> <maml:Description> <maml:para>Specifies the authentication method that is used for proxy resolution. The acceptable values for this parameter are: Basic , Digest , and Negotiate . The default value is Negotiate .</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism?redirectedfrom=MSDN&view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Negotiate</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ProxyCredential</maml:name> <maml:Description> <maml:para>Specifies the credentials to use for proxy authentication. Enter a variable that contains a PSCredential object or a command that gets a PSCredential object, such as a `Get-Credential` command. If this option is not set, no credentials are specified.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipCACheck</maml:name> <maml:Description> <maml:para>Specifies that when it connects over HTTPS, the client does not validate that the server certificate is signed by a trusted certification authority (CA).</maml:para> <maml:para>Use this option only when the remote computer is trusted by using another mechanism, such as when the remote computer is part of a network that is physically secure and isolated or when the remote computer is listed as a trusted host in a WinRM configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipCNCheck</maml:name> <maml:Description> <maml:para>Specifies that the certificate common name (CN) of the server does not have to match the host name of the server. This option is used only in remote operations that use the HTTPS protocol.</maml:para> <maml:para>Use this option only for trusted computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SkipRevocationCheck</maml:name> <maml:Description> <maml:para>Does not validate the revocation status of the server certificate.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies the UI culture to use for the session.</maml:para> <maml:para>Valid values include:</maml:para> <maml:para>- A culture name in `<languagecode2>-<country/regioncode2>` format, such as `ja-JP`</maml:para> <maml:para>- A variable that contains a CultureInfo object - A command that gets a CultureInfo object, such as `Get-Culture`</maml:para> <maml:para>The default value is `$null`, and the UI culture that is set in the operating system when the session is created is used in the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseUTF16</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet encodes the request in UTF16 format instead of UTF8 format.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>If the SessionOption parameter is not used in a command to create a PSSession , the session options are determined by the property values of the `$PSSessionOption` preference variable, if it is set. For more information about the `$PSSessionOption` variable, see about_Preference_Variables (About/about_Preference_Variables.md).</maml:para> <maml:para>The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1: Create a default session option ----------</maml:title> <dev:code>New-PSSessionOption MaximumConnectionRedirectionCount : 5 NoCompression : False NoMachineProfile : False ProxyAccessType : IEConfig ProxyAuthentication : Negotiate ProxyCredential : SkipCACheck : False SkipCNCheck : False SkipRevocationCheck : False OperationTimeout : 00:03:00 NoEncryption : False UseUTF16 : False Culture : UICulture : MaximumReceivedDataSizePerCommand : MaximumReceivedObjectSize : ApplicationArguments : OpenTimeout : 00:03:00 CancelTimeout : 00:01:00 IdleTimeout : 00:04:00</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Configure a session by using a session option object</maml:title> <dev:code>$pso = New-PSSessionOption -Culture "fr-fr" -MaximumReceivedObjectSize 10MB New-PSSession -ComputerName Server01 -SessionOption $pso</dev:code> <dev:remarks> <maml:para>The first command creates a new session option object and saves it in the value of the `$pso` variable. The second command uses the `New-PSSession` cmdlet to create a session on the Server01 remote computer. The command uses the session option object in the value of the `$pso` variable as the value of the SessionOption parameter of the command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 3: Start an interactive session -----------</maml:title> <dev:code>Enter-PSSession -ComputerName Server01 -SessionOption (New-PSSessionOption -NoEncryption -NoCompression)</dev:code> <dev:remarks> <maml:para>The value of the SessionOption parameter is a `New-PSSessionOption` command that has the NoEncryption and NoCompression parameters.</maml:para> <maml:para>The `New-PSSessionOption` command is enclosed in parentheses to make sure that it runs before the `Enter-PSSession` command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 4: Modify a session option object ----------</maml:title> <dev:code>$a = New-PSSessionOption $a.OpenTimeout Days : 0 Hours : 0 Minutes : 3 Seconds : 0 Milliseconds : 0 Ticks : 1800000000 TotalDays : 0.00208333333333333 TotalHours : 0.05 TotalMinutes : 3 TotalSeconds : 180 TotalMilliseconds : 180000 $a.UICulture = (Get-UICulture) $a.OpenTimeout = (New-Timespan -Minutes 4) $a.MaximumConnectionRedirectionCount = 1 $a MaximumConnectionRedirectionCount : 1 NoCompression : False NoMachineProfile : False ProxyAccessType : IEConfig ProxyAuthentication : Negotiate ProxyCredential : SkipCACheck : False SkipCNCheck : False SkipRevocationCheck : False OperationTimeout : 00:03:00 NoEncryption : False UseUTF16 : False Culture : UICulture : en-US MaximumReceivedDataSizePerCommand : MaximumReceivedObjectSize : ApplicationArguments : OpenTimeout : 00:04:00 CancelTimeout : 00:01:00 IdleTimeout : 00:04:00</dev:code> <dev:remarks> <maml:para>Use this method to create a standard session object for your enterprise, and then create customized versions of it for particular uses.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 5: Create a preference variable -----------</maml:title> <dev:code>$PSSessionOption = New-PSSessionOption -OpenTimeOut 120000</dev:code> <dev:remarks> <maml:para>When the `$PSSessionOption` preference variable occurs in the session, it establishes default values for options in the sessions that are created by using the `New-PSSession`, `Enter-PSSession`, and `Invoke-Command` cmdlets.</maml:para> <maml:para>To make the `$PSSessionOption` variable available in all sessions, add it to your PowerShell session and to your PowerShell profile.</maml:para> <maml:para>For more information about the `$PSSessionOption` preference variable, see about_Preference_Variables (About/about_Preference_Variables.md). For more information about profiles, see about_Profiles (About/about_Profiles.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: Fulfill the requirements for a remote session configuration</maml:title> <dev:code>$skipCN = New-PSSessionOption -SkipCNCheck New-PSSession -ComputerName 171.09.21.207 -UseSSL -Credential Domain01\User01 -SessionOption $SkipCN</dev:code> <dev:remarks> <maml:para>The first command uses the `New-PSSessionOption` cmdlet to create a session option object that has the SkipCNCheck property. The command saves the resulting session object in the `$skipCN` variable.</maml:para> <maml:para>The second command uses the `New-PSSession` cmdlet to create a new session on a remote computer. The `$skipCN` check variable is used in the value of the SessionOption parameter.</maml:para> <maml:para>Because the computer is identified by its IP address, the value of the ComputerName parameter does not match any of the common names in the certificate that is used for Secure Sockets Layer (SSL). As a result, the SkipCNCheck option is required.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 7: Make arguments available to a remote session ---</maml:title> <dev:code>$team = @{Team="IT"; Use="Testing"} $TeamOption = New-PSSessionOption -ApplicationArguments $team $s = New-PSSession -ComputerName Server01 -SessionOption $TeamOption Invoke-Command -Session $s {$PSSenderInfo.ApplicationArguments} Name Value ---- ----- Team IT Use Testing PSVersionTable {CLRVersion, BuildVersion, PSVersion, WSManStackVersion...} Invoke-Command -Session $s { if ($PSSenderInfo.ApplicationArguments.Use -ne "Testing") { .\logFiles.ps1 } else { "Just testing." } } Just testing.</dev:code> <dev:remarks> <maml:para>The first command creates a hash table with two keys, Team and Use . The command saves the hash table in the `$team` variable. For more information about hash tables, see about_Hash_Tables (about/about_Hash_Tables.md).</maml:para> <maml:para>Next, the `New-PSSessionOption` cmdlet, using the ApplicationArguments parameter, creates a session option object saved in the `$team` variable. When `New-PSSessionOption` creates the session option object, it automatically converts the hash table in the value of the ApplicationArguments parameter to a primitive dictionary so the data can be reliably transmitted to the remote session.</maml:para> <maml:para>The `New-PSSession` cmdlet starts a session on the Server01 computer. It uses the SessionOption parameter to include the options in the `$teamOption` variable.</maml:para> <maml:para>The `Invoke-Command` cmdlet demonstrates that the data in the `$team` variable is available to commands in the remote session. The data appears in the ApplicationArguments property of the `$PSSenderInfo` automatic variable.</maml:para> <maml:para>The final `Invoke-Command` shows how the data might be used.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pssessionoption?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>New-PSTransportOption</command:name> <command:verb>New</command:verb> <command:noun>PSTransportOption</command:noun> <maml:description> <maml:para>Creates an object that contains advanced options for a session configuration.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The New-PSTransportOption cmdlet creates an object that contains transport options for session configurations. You can use the object as the value of the TransportOption parameter of cmdlets that create or change a session configuration, such as the Register-PSSessionConfiguration and Set-PSSessionConfiguration cmdlets.</maml:para> <maml:para>You can also change the transport option settings by editing the values of the session configuration properties in the WSMan: drive. For more information, see WSMan Provider.</maml:para> <maml:para>The session configuration options represent the session values set on the server-side, or receiving end of a remote connection. The client-side, or sending end of the connection, can set session option values when the session is created, or when the client disconnects from or reconnects to the session. Unless stated otherwise, when the setting values conflict, the client-side values take precedence. However, the client-side values cannot violate maximum values and quotas set in the session configuration.</maml:para> <maml:para>Without parameters, New-PSTransportOption generates a transport option object that has null values for all of the options. If you omit a parameter, the object has a null value for the property that the parameter represents. A null value does not affect the session configuration.</maml:para> <maml:para>For more information about session options, see New-PSSessionOption. For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> <maml:para>This cmdlet was introduced in Windows PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>New-PSTransportOption</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Determines how long each session stays open if the remote computer does not receive any communication from the local computer. This includes the heartbeat signal. When the interval expires, the session closes.</maml:para> <maml:para>The idle time-out value is of significant importance when the user intends to disconnect and reconnect to a session. The user can reconnect only if the session has not timed out.</maml:para> <maml:para>The IdleTimeoutSec parameter corresponds to the IdleTimeoutMs property of a session configuration.</maml:para> <maml:para>Enter a value in seconds. The default value is 7200 (2 hours). The minimum value is 60 (1 minute). The maximum is the value of the IdleTimeout property of Shell objects in the WSMan configuration (`WSMan:\<ComputerName>\Shell\IdleTimeout`). The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>If an idle time-out value is set in the session options and in the session configuration, value set in the session options takes precedence, but it cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. To set the value of the MaxIdleTimeoutMs property, use the MaxIdleTimeoutSec parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxConcurrentCommandsPerSession</maml:name> <maml:Description> <maml:para>Limits the number of commands that can run at the same time in each session to the specified value. The default value is 1000.</maml:para> <maml:para>The MaxConcurrentCommandsPerSession parameter corresponds to the MaxConcurrentCommandsPerShell property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxConcurrentUsers</maml:name> <maml:Description> <maml:para>Limits the number of users who can run commands at the same time in each session to the specified value. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxIdleTimeoutSec</maml:name> <maml:Description> <maml:para>Limits the idle time-out set for each session to the specified value. The default value is [Int]::MaxValue (~25 days).</maml:para> <maml:para>The idle time-out value is of significant importance when the user intends to disconnect and reconnect to a session. The user can reconnect only if the session has not timed out.</maml:para> <maml:para>The MaxIdleTimeoutSec parameter corresponds to the MaxIdleTimeoutMs property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxMemoryPerSessionMB</maml:name> <maml:Description> <maml:para>Limits the memory used by each session to the specified value. Enter a value in megabytes. The default value is 1024 megabytes (1 GB).</maml:para> <maml:para>The MaxMemoryPerSessionMB parameter corresponds to the MaxMemoryPerShellMB property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxProcessesPerSession</maml:name> <maml:Description> <maml:para>Limits the number of processes running in each session to the specified value. The default value is 15.</maml:para> <maml:para>The MaxProcessesPerSession parameter corresponds to the MaxProcessesPerShell property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxSessions</maml:name> <maml:Description> <maml:para>Limits the number of sessions that use the session configuration. The default value is 25.</maml:para> <maml:para>The MaxSessions parameter corresponds to the MaxShells property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxSessionsPerUser</maml:name> <maml:Description> <maml:para>Limits the number of sessions that use the session configuration and run with the credentials of a given user to the specified value. The default value is 25.</maml:para> <maml:para>When you specify this value, consider that many users might be using the credentials of a run as user.</maml:para> <maml:para>The MaxSessionsPerUser parameter corresponds to the MaxShellsPerUser property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in disconnected sessions when the output buffer becomes full. The acceptable values for this parameter are:</maml:para> <maml:para>- Block. When the output buffer is full, execution is suspended until the buffer is clear. - Drop. When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None. No output buffering mode is specified.</maml:para> <maml:para>The default value of the OutputBufferingMode property of sessions is Block.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">None</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Drop</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Block</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Management.Automation.Runspaces.OutputBufferingMode]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Management.Automation.Runspaces.OutputBufferingMode]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ProcessIdleTimeoutSec</maml:name> <maml:Description> <maml:para>Limits the time-out for each host process to the specified value. The default value, 0, means that there is no time-out value for the process.</maml:para> <maml:para>Other session configurations have per-process time-out values. For example, the Microsoft.PowerShell.Workflow session configuration has a per-process time-out value of 28800 seconds (8 hours).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>IdleTimeoutSec</maml:name> <maml:Description> <maml:para>Determines how long each session stays open if the remote computer does not receive any communication from the local computer. This includes the heartbeat signal. When the interval expires, the session closes.</maml:para> <maml:para>The idle time-out value is of significant importance when the user intends to disconnect and reconnect to a session. The user can reconnect only if the session has not timed out.</maml:para> <maml:para>The IdleTimeoutSec parameter corresponds to the IdleTimeoutMs property of a session configuration.</maml:para> <maml:para>Enter a value in seconds. The default value is 7200 (2 hours). The minimum value is 60 (1 minute). The maximum is the value of the IdleTimeout property of Shell objects in the WSMan configuration (`WSMan:\<ComputerName>\Shell\IdleTimeout`). The default value is 7200000 milliseconds (2 hours).</maml:para> <maml:para>If an idle time-out value is set in the session options and in the session configuration, value set in the session options takes precedence, but it cannot exceed the value of the MaxIdleTimeoutMs property of the session configuration. To set the value of the MaxIdleTimeoutMs property, use the MaxIdleTimeoutSec parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxConcurrentCommandsPerSession</maml:name> <maml:Description> <maml:para>Limits the number of commands that can run at the same time in each session to the specified value. The default value is 1000.</maml:para> <maml:para>The MaxConcurrentCommandsPerSession parameter corresponds to the MaxConcurrentCommandsPerShell property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxConcurrentUsers</maml:name> <maml:Description> <maml:para>Limits the number of users who can run commands at the same time in each session to the specified value. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxIdleTimeoutSec</maml:name> <maml:Description> <maml:para>Limits the idle time-out set for each session to the specified value. The default value is [Int]::MaxValue (~25 days).</maml:para> <maml:para>The idle time-out value is of significant importance when the user intends to disconnect and reconnect to a session. The user can reconnect only if the session has not timed out.</maml:para> <maml:para>The MaxIdleTimeoutSec parameter corresponds to the MaxIdleTimeoutMs property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxMemoryPerSessionMB</maml:name> <maml:Description> <maml:para>Limits the memory used by each session to the specified value. Enter a value in megabytes. The default value is 1024 megabytes (1 GB).</maml:para> <maml:para>The MaxMemoryPerSessionMB parameter corresponds to the MaxMemoryPerShellMB property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxProcessesPerSession</maml:name> <maml:Description> <maml:para>Limits the number of processes running in each session to the specified value. The default value is 15.</maml:para> <maml:para>The MaxProcessesPerSession parameter corresponds to the MaxProcessesPerShell property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxSessions</maml:name> <maml:Description> <maml:para>Limits the number of sessions that use the session configuration. The default value is 25.</maml:para> <maml:para>The MaxSessions parameter corresponds to the MaxShells property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>MaxSessionsPerUser</maml:name> <maml:Description> <maml:para>Limits the number of sessions that use the session configuration and run with the credentials of a given user to the specified value. The default value is 25.</maml:para> <maml:para>When you specify this value, consider that many users might be using the credentials of a run as user.</maml:para> <maml:para>The MaxSessionsPerUser parameter corresponds to the MaxShellsPerUser property of a session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>OutputBufferingMode</maml:name> <maml:Description> <maml:para>Determines how command output is managed in disconnected sessions when the output buffer becomes full. The acceptable values for this parameter are:</maml:para> <maml:para>- Block. When the output buffer is full, execution is suspended until the buffer is clear. - Drop. When the output buffer is full, execution continues. As new output is saved, the oldest output is discarded. - None. No output buffering mode is specified.</maml:para> <maml:para>The default value of the OutputBufferingMode property of sessions is Block.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Management.Automation.Runspaces.OutputBufferingMode]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Management.Automation.Runspaces.OutputBufferingMode]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ProcessIdleTimeoutSec</maml:name> <maml:Description> <maml:para>Limits the time-out for each host process to the specified value. The default value, 0, means that there is no time-out value for the process.</maml:para> <maml:para>Other session configurations have per-process time-out values. For example, the Microsoft.PowerShell.Workflow session configuration has a per-process time-out value of 28800 seconds (8 hours).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Int32]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Int32]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.WSManConfigurationOption</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>- The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------- Example 1: Generate a default transport option --------</maml:title> <dev:code>PS C:\> New-PSTransportOption ProcessIdleTimeoutSec : MaxIdleTimeoutSec : MaxSessions : MaxConcurrentCommandsPerSession : MaxSessionsPerUser : MaxMemoryPerSessionMB : MaxProcessesPerSession : MaxConcurrentUsers : IdleTimeoutSec : OutputBufferingMode :</dev:code> <dev:remarks> <maml:para>This command runs the New-PSTransportOption without parameters. The output shows that the cmdlet generates a transport option object that has null values for all properties.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 2: Get session configuration options ---------</maml:title> <dev:code>The first command uses the **New-PSTransportOption** cmdlet to create a transport options object, which it saves in the $t variable. The command uses the *MaxSessions* parameter to increase the maximum number of sessions to 40. PS C:\> $t = New-PSTransportOption -MaxSessions 40 The second command uses the **Register-PSSessionConfiguration** cmdlet create the ITTasks session configuration. The command uses the *TransportOption* parameter to specify the transport options object in the $t variable. PS C:\> Register-PSSessionConfiguration -Name ITTasks -TransportOption $t The third command uses the Get-PSSessionConfiguration cmdlet to get the ITTasks session configurations and the Format-List cmdlet to display all of the properties of the session configuration object in a list. The output shows that the value of the **MaxShells** property of the session configuration is 40. PS C:\> Get-PSSessionConfiguration -Name ITTasks | Format-List -Property * Architecture : 64 Filename : %windir%\system32\pwrshplugin.dll ResourceUri : http://schemas.microsoft.com/powershell/ITTasks MaxConcurrentCommandsPerShell : 1000 UseSharedProcess : false ProcessIdleTimeoutSec : 0 xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration MaxConcurrentUsers : 5 lang : en-US SupportsOptions : true ExactMatch : true RunAsUser : IdleTimeoutms : 7200000 PSVersion : 3.0 OutputBufferingMode : Block AutoRestart : false MaxShells : 40 MaxMemoryPerShellMB : 1024 MaxIdleTimeoutms : 43200000 SDKVersion : 2 Name : ITTasks XmlRenderingType : text Capability : {Shell} RunAsPassword : MaxProcessesPerShell : 15 Enabled : True MaxShellsPerUser : 25 Permission :</dev:code> <dev:remarks> <maml:para>This example shows how to use a transport options object to set session configuration options.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 3: Setting a transport option ------------</maml:title> <dev:code>The first command uses the **New-PSTransportOption** cmdlet to create a transport option object. The command uses the *IdleTimeoutSec* parameter to set the **IdleTimeoutSec** property value of the object to one hour (3600 seconds). The command saves the transport objects object in the $t variable. PS C:\> $t = New-PSTransportOption -IdleTimeoutSec 3600 The second command uses the Set-PSSessionConfiguration cmdlet to change the transport options of the ITTasks session configuration. The command uses the *TransportOption* parameter to specify the transport options object in the $t variable. PS C:\> Set-PSSessionConfiguration -Name ITTasks -TransportOption $t The third command uses the New-PSSession cmdlet to create the MyITTasks session on the local computer. The command uses the **ConfigurationName** property to specify the ITTasks session configuration. The command saves the session in the $s variable.Notice that the command does not use the *SessionOption* parameter of **New-PSSession** to set a custom idle time-out for the session. If it did, the idle time-out value set in the session option would take precedence over the idle time-out set in the session configuration. PS C:\> $s = New-PSSession -Name MyITTasks -ConfigurationName ITTasks The fourth command uses the Format-List cmdlet to display all properties of the session in the $s variable in a list. The output shows that the session has an idle time-out of one hour (360,000 milliseconds). PS C:\> $s | Format-List -Property * State : Opened IdleTimeout : 3600000 OutputBufferingMode : Block ComputerName : localhost ConfigurationName : ITTasks InstanceId : 4110c3f5-68ea-40fa-9bbf-04a433dbb02d Id : 1 Name : MyITTasks Availability : Available ApplicationPrivateData : {PSVersionTable} Runspace : System.Management.Automation.RemoteRunspace</dev:code> <dev:remarks> <maml:para>This command shows the effect of setting a transport option in a session configuration on the sessions that use the session configuration.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/new-pstransportoption?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Out-Default</command:name> <command:verb>Out</command:verb> <command:noun>Default</command:noun> <maml:description> <maml:para>Sends the output to the default formatter and to the default output cmdlet.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>PowerShell automatically adds `Out-Default` to the end of every pipeline. `Out-Default` decides how to format and output the object stream. If the object stream is a stream of strings, `Out-Default` pipes these directly to `Out-Host` which calls the appropriate APIs provided by the host. If the object stream does not contain strings, `Out-Default` inspects the object to determine what to do. First it looks at the object type and determines whether there is a registered view for this object type.</maml:para> <maml:para>PowerShell defines XML schema and a mechanism (the `Update-FormatData` cmdlet) where anyone can register views for an object type. You can specify wide , list , table , or custom views for any object type. The views specify which properties to display and how they should be displayed. If a view is registered, it defines which formatter to use. So if the registered view is a table view, `Out-Default` streams the objects to `Format-Table | Out-Host`. `Format-Table` transforms the objects into a stream of Formatting records (driven by the data in the view definition) and `Out-Host` transforms the formatting records into calls on the Host interface.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Out-Default</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Accepts input to the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Transcript</maml:name> <maml:Description> <maml:para>Determines whether the output should be sent to PowerShell's transcription services.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Accepts input to the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Transcript</maml:name> <maml:Description> <maml:para>Determines whether the output should be sent to PowerShell's transcription services.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes /> <command:returnValues /> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>Get-Process | Select-Object -First 5 | Out-Default NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName ------ ----- ----- ------ -- -- ----------- 12 2.56 5.20 0.00 7376 0 aesm_service 48 34.32 18.10 26.64 9320 13 AlertusDesktopAlert 24 13.97 12.74 0.77 12656 13 ApplicationFrameHost 8 1.79 4.41 0.00 8180 0 AppVShNotify 9 1.99 5.07 0.19 19320 13 AppVShNotify</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/out-default?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Format-Custom</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Format-List</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Format-Table</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Format-Wide</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Format.ps1xml</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>How PowerShell Formatting and Outputting REALLY works</maml:linkText> <maml:uri>https://devblogs.microsoft.com/powershell/how-powershell-formatting-and-outputting-really-works/</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Out-Host</command:name> <command:verb>Out</command:verb> <command:noun>Host</command:noun> <maml:description> <maml:para>Sends output to the command line.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Out-Host` cmdlet sends output to the PowerShell host for display. The host displays the output at the command line. Because `Out-Host` is the default, you don't have to specify it unless you want to use its parameters.</maml:para> <maml:para>`Out-Host` is automatically appended to every command that is executed. It passes the output of the pipeline to the host executing the command. `Out-Host` ignores ANSI escape sequences. The escape sequences are handled by the host. `Out-Host` passes ANSI escape sequences to the host without trying to interpret or change them.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Out-Host</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects that are written to the console. Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Paging</maml:name> <maml:Description> <maml:para>Indicates that `Out-Host` displays one page of output at a time, and waits for user input before the remaining pages are displayed. By default, all the output is displayed on a single page. The page size is determined by the characteristics of the host.</maml:para> <maml:para>Press the <kbd>Space</kbd> bar to display the next page of output or the <kbd>Enter</kbd> key to view the next line of output. Press <kbd>Q</kbd> to quit. Paging is similar to the more command.</maml:para> <maml:para>> [!NOTE] > The Paging parameter isn't supported by the PowerShell ISE host.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects that are written to the console. Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Paging</maml:name> <maml:Description> <maml:para>Indicates that `Out-Host` displays one page of output at a time, and waits for user input before the remaining pages are displayed. By default, all the output is displayed on a single page. The page size is determined by the characteristics of the host.</maml:para> <maml:para>Press the <kbd>Space</kbd> bar to display the next page of output or the <kbd>Enter</kbd> key to view the next line of output. Press <kbd>Q</kbd> to quit. Paging is similar to the more command.</maml:para> <maml:para>> [!NOTE] > The Paging parameter isn't supported by the PowerShell ISE host.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para>You can send objects down the pipeline to `Out-Host`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>`Out-Host` doesn't generate any output. It sends objects to the host for display.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The Paging parameter isn't supported by all PowerShell hosts. For example, if you use the Paging parameter in the PowerShell ISE, the following error is displayed: `out-lineoutput : The method or operation is not implemented.`</maml:para> <maml:para>The cmdlets that contain the Out verb, `Out-`, don't format objects. They render objects and send them to the specified display destination. If you send an unformatted object to an `Out-` cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it.</maml:para> <maml:para>The `Out-` cmdlets don't have parameters for names or file paths. To send data to an `Out-` cmdlet, use the pipeline to send a PowerShell command's output to the cmdlet. Or, you can store data in a variable and use the InputObject parameter to pass the data to the cmdlet.</maml:para> <maml:para>`Out-Host` sends data, but it doesn't produce any output objects. If you pipeline the output of `Out-Host` to the `Get-Member` cmdlet, `Get-Member` reports that no objects have been specified.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Display output one page at a time ---------</maml:title> <dev:code>Get-Process | Out-Host -Paging NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName ------ ----- ----- ------ -- -- ----------- 30 24.12 36.95 15.86 21004 14 ApplicationFrameHost 55 24.33 60.48 10.80 12904 14 BCompare <SPACE> next page; <CR> next line; Q quit 9 4.71 8.94 0.00 16864 14 explorer <SPACE> next page; <CR> next line; Q quit</dev:code> <dev:remarks> <maml:para>`Get-Process` gets the system processes and sends the objects down the pipeline. `Out-Host` uses the Paging parameter to display one page of data at a time.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 2: Use a variable as input --------------</maml:title> <dev:code>$io = Get-History Out-Host -InputObject $io</dev:code> <dev:remarks> <maml:para>`Get-History` gets the PowerShell session's history, and stores the objects in the `$io` variable. `Out-Host` uses the InputObject parameter to specify the `$io` variable and displays the history.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/out-host?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Clear-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-Default</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-File</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-Null</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-Printer</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-String</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Write-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Out-Null</command:name> <command:verb>Out</command:verb> <command:noun>Null</command:noun> <maml:description> <maml:para>Hides the output instead of sending it down the pipeline or displaying it.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Out-Null cmdlet sends its output to NULL, in effect, removing it from the pipeline and preventing the output to be displayed at the screen. This only affects the standard output stream. Other output streams, like the Error stream are not affected. Exceptions will be displayed. This makes it easier to test your command for any errors.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Out-Null</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the object to be sent to NULL (removed from pipeline). Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the object to be sent to NULL (removed from pipeline). Enter a variable that contains the objects, or type a command or expression that gets the objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para>You can pipe any object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The cmdlets that contain the Out verb (the Out cmdlets) do not have parameters for names or file paths. To send data to an Out cmdlet, use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. You can also store data in a variable and use the InputObject* parameter to pass the data to the cmdlet. For more information, see the examples. Out-Null does not return any output objects. If you pipe the output of Out-Null to the Get-Member cmdlet, Get-Member * reports that no objects have been specified.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------------- Example 1: Delete output -------------------</maml:title> <dev:code>PS C:\> Get-ChildItem | Out-Null</dev:code> <dev:remarks> <maml:para>This command gets items in the current location/directory, but its output is not passed through the pipeline nor displayed at the command line. This is useful for hiding output that you do not need.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/out-null?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-Default</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Out-Host</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Receive-Job</command:name> <command:verb>Receive</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Gets the results of the PowerShell background jobs in the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Receive-Job` cmdlet gets the results of PowerShell background jobs, such as those started by using the `Start-Job` cmdlet or the AsJob parameter of any cmdlet. You can get the results of all jobs or identify jobs by their name, ID, instance ID, computer name, location, or session, or by submitting a job object.</maml:para> <maml:para>When you start a PowerShell background job, the job starts, but the results do not appear immediately. Instead, the command returns an object that represents the background job. The job object contains useful information about the job, but it does not contain the results. This method lets you continue to work in the session while the job runs. For more information about background jobs in PowerShell, see about_Jobs (./About/about_Jobs.md).</maml:para> <maml:para>The `Receive-Job` cmdlet gets the results that have been generated by the time that the `Receive-Job` command is submitted. If the results are not yet complete, you can run additional `Receive-Job` commands to get the remaining results.</maml:para> <maml:para>By default, job results are deleted from the system when you receive them, but you can use the Keep parameter to save the results so that you can receive them again. To delete the job results, run the `Receive-Job` command again without the Keep parameter, close the session, or use the `Remove-Job` cmdlet to delete the job from the session.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, `Receive-Job` also gets the results of custom job types, such as workflow jobs and instances of scheduled jobs. To enable `Receive-Job` to get the results a custom job type, import the module that supports the custom job type into the session before it runs a `Receive-Job` command, either by using the `Import-Module` cmdlet or by using or getting a cmdlet in the module. For information about a particular custom job type, see the documentation of the custom job type feature.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Receive-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the job for which results are being retrieved.</maml:para> <maml:para>Enter a variable that contains the job or a command that gets the job. You can also pipe a job object to `Receive-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="1" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers.</maml:para> <maml:para>This parameter selects from among the job results that are stored on the local computer. It does not get data for jobs run on remote computers. To get job results that are stored on remote computers, use the `Invoke-Command` cmdlet to run a `Receive-Job` command remotely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All computers available</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs. This cmdlet gets the results of jobs with the specified IDs.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and type than the instance ID, but it is unique only in the current session. You can type one or more IDs separated by commas. To find the ID of a job, use `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs. This cmdlet gets the results of jobs with the specified instance IDs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use the `Get-Job` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All instances</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the job for which results are being retrieved.</maml:para> <maml:para>Enter a variable that contains the job or a command that gets the job. You can also pipe a job object to `Receive-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Location</maml:name> <maml:Description> <maml:para>Specifies an array of locations. This cmdlet gets only the results of jobs in the specified locations.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All locations</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the job for which results are being retrieved.</maml:para> <maml:para>Enter a variable that contains the job or a command that gets the job. You can also pipe a job object to `Receive-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of sessions. This cmdlet gets the results of jobs that were run in the specified PowerShell session ( PSSession ). Enter a variable that contains the PSSession or a command that gets the PSSession , such as a `Get-PSSession` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of friendly names. This cmdlet gets the results of jobs that have the specified names. Wildcard characters are supported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AutoRemoveJob</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet deletes the job after it returns the job results. If the job has more results, the job is still deleted, but `Receive-Job` displays a message.</maml:para> <maml:para>This parameter works only on custom job types. It is designed for instances of job types that save the job or the type outside of the session, such as instances of scheduled jobs.</maml:para> <maml:para>This parameter cannot be used without the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="1" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers.</maml:para> <maml:para>This parameter selects from among the job results that are stored on the local computer. It does not get data for jobs run on remote computers. To get job results that are stored on remote computers, use the `Invoke-Command` cmdlet to run a `Receive-Job` command remotely.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All computers available</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues waiting if jobs are in the Suspended or Disconnected state. By default, the Wait parameter of `Receive-Job` returns, or terminates the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>The Force parameter is valid only when the Wait parameter is also used in the command.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs. This cmdlet gets the results of jobs with the specified IDs.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and type than the instance ID, but it is unique only in the current session. You can type one or more IDs separated by commas. To find the ID of a job, use `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs. This cmdlet gets the results of jobs with the specified instance IDs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use the `Get-Job` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All instances</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the job for which results are being retrieved.</maml:para> <maml:para>Enter a variable that contains the job or a command that gets the job. You can also pipe a job object to `Receive-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Keep</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet saves the aggregated stream data in the system, even after you have received them. By default, aggregated stream data is erased after viewed with `Receive-Job`.</maml:para> <maml:para>Closing the session, or removing the job with the `Remove-Job` cmdlet also deletes aggregated stream data.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Location</maml:name> <maml:Description> <maml:para>Specifies an array of locations. This cmdlet gets only the results of jobs in the specified locations.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All locations</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of friendly names. This cmdlet gets the results of jobs that have the specified names. Wildcard characters are supported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoRecurse</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets results only from the specified job. By default, `Receive-Job` also gets the results of all child jobs of the specified job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies an array of sessions. This cmdlet gets the results of jobs that were run in the specified PowerShell session ( PSSession ). Enter a variable that contains the PSSession or a command that gets the PSSession , such as a `Get-PSSession` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All sessions</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are received. By default, `Receive-Job` immediately returns the available results.</maml:para> <maml:para>By default, the Wait parameter waits until the job is in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected.</maml:para> <maml:para></maml:para> <maml:para>To direct the Wait parameter to continue waiting if the job state is Suspended or Disconnected, use the Force parameter together with the Wait parameter.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteEvents</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet reports changes in the job state while it waits for the job to finish.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>WriteJobInResults</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet returns the job object followed by the results.</maml:para> <maml:para>This parameter is valid only when the Wait parameter is used in the command and the Keep parameter is omitted.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> </dev:type> <maml:description> <maml:para>You can pipe job objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>PSObject</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns the results of the commands in the job.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Get results for a particular job ---------</maml:title> <dev:code>$job = Start-Job -ScriptBlock {Get-Process} Receive-Job -Job $job</dev:code> <dev:remarks> <maml:para>These commands use the Job parameter of `Receive-Job` to get the results of a particular job.</maml:para> <maml:para>The first command starts a job with `Start-Job` and stores the job object in the `$job` variable.</maml:para> <maml:para>The second command uses the `Receive-Job` cmdlet to get the results of the job. It uses the Job parameter to specify the job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 2: Use the Keep parameter --------------</maml:title> <dev:code>$job = Start-Job -ScriptBlock {Get-Service dhcp, fakeservice} $job | Receive-Job -Keep Cannot find any service with service name 'fakeservice'. + CategoryInfo : ObjectNotFound: (fakeservice:String) [Get-Service], ServiceCommandException + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand + PSComputerName : localhost Status Name DisplayName ------ ---- ----------- Running dhcp DHCP Client $job | Receive-Job -Keep Cannot find any service with service name 'fakeservice'. + CategoryInfo : ObjectNotFound: (fakeservice:String) [Get-Service], ServiceCommandException + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetServiceCommand + PSComputerName : localhost Status Name DisplayName ------ ---- ----------- Running dhcp DHCP Client</dev:code> <dev:remarks> <maml:para>This example stores a job in the `$job` variable, and pipes the job to the `Receive-Job` cmdlet. The `-Keep` parameter is also used to allow all aggregated stream data to be retrieved again after first view.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 3: Get results of several background jobs ------</maml:title> <dev:code># Use the Invoke-Command cmdlet with the -AsJob parameter to start a background job that runs a Get-Service command on three remote computers. # Store the resulting job object in the $j variable $j = Invoke-Command -ComputerName Server01, Server02, Server03 -ScriptBlock {Get-Service} -AsJob # Display the value of the **ChildJobs** property of the job object in $j. # The display shows that the command created three child jobs, one for the job on each remote computer. # You could also use the -IncludeChildJobs parameter of the Get-Job cmdlet. $j.ChildJobs Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 2 Job2 Completed True Server01 Get-Service 3 Job3 Completed True Server02 Get-Service 4 Job4 Completed True Server03 Get-Service # Use the Receive-Job cmdlet to get the results of just the Job3 child job that ran on the Server02 computer. # Use the *Keep* parameter to allow you to view the aggregated stream data more than once. Receive-Job -Name Job3 -Keep Status Name DisplayName PSComputerName ------ ----------- ----------- -------------- Running AeLookupSvc Application Experience Server02 Stopped ALG Application Layer Gateway Service Server02 Running Appinfo Application Information Server02 Running AppMgmt Application Management Server02</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 4: Get results of background jobs on multiple remote computers</maml:title> <dev:code># Use the New-PSSession cmdlet to create three user-managed PSSessions on three servers, and save the sessions in the $s variable. $s = New-PSSession -ComputerName Server01, Server02, Server03 # Use Invoke-Command run a Start-Job command in each of the PSSessions in the $s variable. # The job outputs the ComputerName of each server. # Save the job objects in the $j variable. $j = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$env:COMPUTERNAME}} # To confirm that these job objects are from the remote machines, run Get-Job to show no local jobs running. Get-Job # Display the three job objects in $j. # Note that the Localhost location is not the local computer, but instead localhost as it relates to the job on each Server. $j Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 1 Job1 Completed True Localhost $env:COMPUTERNAME 2 Job2 Completed True Localhost $env:COMPUTERNAME 3 Job3 Completed True Localhost $env:COMPUTERNAME # Use Invoke-Command to run a Receive-Job command in each of the sessions in the $s variable and save the results in the $Results variable. # The Receive-Job command must be run in each session because the jobs were run locally on each server. $results = Invoke-Command -Session $s -ScriptBlock {Receive-Job -Job $Using:j} Server01 Server02 Server03</dev:code> <dev:remarks> <maml:para>This example shows how to get the results of background jobs run on three remote computers. Unlike the previous example, using `Invoke-Command` to run the `Start-Job` command actually started three independent jobs on each of the three computers. As a result, the command returned three job objects representing three jobs run locally on three different computers.</maml:para> <maml:para>> [!NOTE] > In the last command, because `$j` is a local variable, the script block uses the Using scope > modifier to identify the `$j` variable. For more information about the Using scope modifier, > see about_Remote_Variables (./About/about_Remote_Variables.md).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------- Example 5: Access child jobs -----------------</maml:title> <dev:code>Start-Job -Name TestJob -ScriptBlock {dir C:\, Z:\} # Without the Keep parameter, aggregated child job data is displayed once. # Then destroyed. Receive-Job -Name TestJob Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d-r--- 1/24/2019 7:11 AM Program Files d-r--- 2/13/2019 8:32 AM Program Files (x86) d-r--- 10/3/2018 11:47 AM Users d----- 2/7/2019 1:52 AM Windows Cannot find drive. A drive with the name 'Z' does not exist. + CategoryInfo : ObjectNotFound: (Z:String) [Get-ChildItem], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand + PSComputerName : localhost # It would seem that the child job data is gone. Receive-Job -Name TestJob # Using the object model, you can still retrieve child job data and streams. $job = Get-Job -Name TestJob $job.ChildJobs[0].Error Cannot find drive. A drive with the name 'Z' does not exist. + CategoryInfo : ObjectNotFound: (Z:String) [Get-ChildItem], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand + PSComputerName : localhost</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/receive-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Receive-PSSession</command:name> <command:verb>Receive</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Gets results of commands in disconnected sessions</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Receive-PSSession` cmdlet gets the results of commands running in PowerShell sessions ( PSSession ) that were disconnected. If the session is currently connected, `Receive-PSSession` gets the results of commands that were running when the session was disconnected. If the session is still disconnected, `Receive-PSSession` connects to the session, resumes any commands that were suspended, and gets the results of commands running in the session.</maml:para> <maml:para>This cmdlet was introduced in PowerShell 3.0.</maml:para> <maml:para>You can use a `Receive-PSSession` in addition to or instead of a `Connect-PSSession` command. `Receive-PSSession` can connect to any disconnected or reconnected session that was started in other sessions or on other computers.</maml:para> <maml:para>`Receive-PSSession` works on PSSessions that were disconnected intentionally using the `Disconnect-PSSession` cmdlet or the `Invoke-Command` InDisconnectedSession parameter. Or disconnected unintentionally by a network interruption.</maml:para> <maml:para>If you use the `Receive-PSSession` cmdlet to connect to a session in which no commands are running or suspended, `Receive-PSSession` connects to the session, but returns no output or errors.</maml:para> <maml:para>For more information about the Disconnected Sessions feature, see about_Remote_Disconnected_Sessions (./About/about_Remote_Disconnected_Sessions.md).</maml:para> <maml:para>Some examples use splatting to reduce the line length and improve readability. For more information, see about_Splatting (./About/about_Splatting.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint that is used to reconnect to the disconnected session.</maml:para> <maml:para>The URI must be fully qualified. The string's format is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you don't specify a connection URI, you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but don't specify a port, the session is created with standard ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell doesn't redirect connections, but you can use this parameter to enable it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user credentials in the command to reconnect to a disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. Certificates can be mapped only to local user accounts, and don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell `Cert:` drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a session configuration. This cmdlet connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended:</maml:para> <maml:para>`http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly name of the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the $PSSessionOption preference variable, see about_Preference_Variables (./About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint that is used to reconnect to the disconnected session.</maml:para> <maml:para>The URI must be fully qualified. The string's format is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you don't specify a connection URI, you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but don't specify a port, the session is created with standard ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell doesn't redirect connections, but you can use this parameter to enable it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user credentials in the command to reconnect to a disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. Certificates can be mapped only to local user accounts, and don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell `Cert:` drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a session configuration. This cmdlet connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended:</maml:para> <maml:para>`http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID of the disconnected session. The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer. The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the $PSSessionOption preference variable, see about_Preference_Variables (./About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computer on which the disconnected session is stored. Sessions are stored on the computer that's at the server-side, or receiving end of a connection. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one computer. Wildcard characters aren't permitted. To specify the local computer, type the computer name, a dot (`.`), `$env:COMPUTERNAME`, or localhost.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, WSMan is the application name: `http://localhost:5985/WSMAN`.</maml:para> <maml:para>The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user credentials in the command to reconnect to a disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. Certificates can be mapped only to local user accounts, and don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell `Cert:` drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a session configuration. This cmdlet connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended:</maml:para> <maml:para>`http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID of the disconnected session. The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer. The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the remote computer's network port that's used to reconnect to the session. To connect to a remote computer, it must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen on that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Don't use the Port parameter unless it's necessary. The port that's set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the $PSSessionOption preference variable, see about_Preference_Variables (./About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to connect to the disconnected session. By default, SSL isn't used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. UseSSL is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter and SSL isn't available on the port that's used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computer on which the disconnected session is stored. Sessions are stored on the computer that's at the server-side, or receiving end of a connection. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one computer. Wildcard characters aren't permitted. To specify the local computer, type the computer name, a dot (`.`), `$env:COMPUTERNAME`, or localhost.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, WSMan is the application name: `http://localhost:5985/WSMAN`.</maml:para> <maml:para>The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user credentials in the command to reconnect to a disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. Certificates can be mapped only to local user accounts, and don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell `Cert:` drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a session configuration. This cmdlet connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended:</maml:para> <maml:para>`http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly name of the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the remote computer's network port that's used to reconnect to the session. To connect to a remote computer, it must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen on that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Don't use the Port parameter unless it's necessary. The port that's set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the $PSSessionOption preference variable, see about_Preference_Variables (./About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to connect to the disconnected session. By default, SSL isn't used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. UseSSL is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter and SSL isn't available on the port that's used for the command, the command fails.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the ID of a disconnected session. The Id parameter works only when the disconnected session was previously connected to the current session.</maml:para> <maml:para>This parameter is valid, but not effective, when the session is stored on the local computer, but wasn't connected to the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID of the disconnected session. The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer. The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly name of the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Receive-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies the disconnected session. Enter a variable that contains the PSSession or a command that creates or gets the PSSession , such as a `Get-PSSession` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Host</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Job</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AllowRedirection</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet allows redirection of this connection to an alternate Uniform Resource Identifier (URI).</maml:para> <maml:para>When you use the ConnectionURI parameter, the remote destination can return an instruction to redirect to a different URI. By default, PowerShell doesn't redirect connections, but you can use this parameter to enable it to redirect the connection.</maml:para> <maml:para>You can also limit the number of times the connection is redirected by changing the MaximumConnectionRedirectionCount session option value. Use the MaximumRedirection parameter of the `New-PSSessionOption` cmdlet or set the MaximumConnectionRedirectionCount property of the `$PSSessionOption` preference variable. The default value is 5.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ApplicationName</maml:name> <maml:Description> <maml:para>Specifies an application. This cmdlet connects only to sessions that use the specified application.</maml:para> <maml:para>Enter the application name segment of the connection URI. For example, in the following connection URI, WSMan is the application name: `http://localhost:5985/WSMAN`.</maml:para> <maml:para>The application name of a session is stored in the Runspace.ConnectionInfo.AppName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the application that the session uses.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that's used to authenticate the user credentials in the command to reconnect to a disconnected session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism Enumeration (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CertificateThumbprint</maml:name> <maml:Description> <maml:para>Specifies the digital public key certificate (X509) of a user account that has permission to connect to the disconnected session. Enter the certificate thumbprint of the certificate.</maml:para> <maml:para>Certificates are used in client certificate-based authentication. Certificates can be mapped only to local user accounts, and don't work with domain accounts.</maml:para> <maml:para>To get a certificate thumbprint, use a `Get-Item` or `Get-ChildItem` command in the PowerShell `Cert:` drive.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies the computer on which the disconnected session is stored. Sessions are stored on the computer that's at the server-side, or receiving end of a connection. The default is the local computer.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one computer. Wildcard characters aren't permitted. To specify the local computer, type the computer name, a dot (`.`), `$env:COMPUTERNAME`, or localhost.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ConfigurationName</maml:name> <maml:Description> <maml:para>Specifies the name of a session configuration. This cmdlet connects only to sessions that use the specified session configuration.</maml:para> <maml:para>Enter a configuration name or the fully qualified resource URI for a session configuration. If you specify only the configuration name, the following schema URI is prepended:</maml:para> <maml:para>`http://schemas.microsoft.com/powershell`.</maml:para> <maml:para>The configuration name of a session is stored in the ConfigurationName property of the session.</maml:para> <maml:para>The parameter's value is used to select and filter sessions. It doesn't change the session configuration that the session uses.</maml:para> <maml:para>For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="URI, CU"> <maml:name>ConnectionUri</maml:name> <maml:Description> <maml:para>Specifies a URI that defines the connection endpoint that is used to reconnect to the disconnected session.</maml:para> <maml:para>The URI must be fully qualified. The string's format is as follows:</maml:para> <maml:para>`<Transport>://<ComputerName>:<Port>/<ApplicationName>`</maml:para> <maml:para>The default value is as follows:</maml:para> <maml:para>`http://localhost:5985/WSMAN`</maml:para> <maml:para>If you don't specify a connection URI, you can use the UseSSL , ComputerName , Port , and ApplicationName parameters to specify the connection URI values.</maml:para> <maml:para>Valid values for the Transport segment of the URI are HTTP and HTTPS. If you specify a connection URI with a Transport segment, but don't specify a port, the session is created with standard ports: 80 for HTTP and 443 for HTTPS. To use the default ports for PowerShell remoting, specify port 5985 for HTTP or 5986 for HTTPS.</maml:para> <maml:para>If the destination computer redirects the connection to a different URI, PowerShell prevents the redirection unless you use the AllowRedirection parameter in the command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Uri</command:parameterValue> <dev:type> <maml:name>System.Uri</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>http://localhost:5985/WSMAN</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to connect to the disconnected session. The default is the current user.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the ID of a disconnected session. The Id parameter works only when the disconnected session was previously connected to the current session.</maml:para> <maml:para>This parameter is valid, but not effective, when the session is stored on the local computer, but wasn't connected to the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance ID of the disconnected session. The instance ID is a GUID that uniquely identifies a PSSession on a local or remote computer. The instance ID is stored in the InstanceID property of the PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid</command:parameterValue> <dev:type> <maml:name>System.Guid</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>JobName</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the job that `Receive-PSSession` returns.</maml:para> <maml:para>`Receive-PSSession` returns a job when the value of the OutTarget parameter is Job or the job that's running in the disconnected session was started in the current session.</maml:para> <maml:para>If the job that's running in the disconnected session was started in the current session, PowerShell reuses the original job object in the session and ignores the value of the JobName parameter.</maml:para> <maml:para>If the job that's running in the disconnected session was started in a different session, PowerShell creates a new job object. It uses a default name, but you can use this parameter to change the name.</maml:para> <maml:para>If the default value or explicit value of the OutTarget parameter isn't Job, the command succeeds, but the JobName parameter has no effect.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the friendly name of the disconnected session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>OutTarget</maml:name> <maml:Description> <maml:para>Determines how the session results are returned. The acceptable values for this parameter are:</maml:para> <maml:para>- Job . Returns the results asynchronously in a job object. You can use the JobName parameter to specify a name or new name for the job. - Host . Returns the results to the command line (synchronously). If the command is being resumed or the results consist of a large number of objects, the response might be delayed.</maml:para> <maml:para>The default value of the OutTarget parameter is Host. If the command that's being received in a disconnected session was started in the current session, the default value of the OutTarget parameter is the form in which the command was started. If the command was started as a job, by default, it's returned as a job. Otherwise, it's returned to the host program by default.</maml:para> <maml:para>Typically, the host program displays returned objects at the command line without delay, but this behavior can vary.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.OutTarget</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.OutTarget</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Port</maml:name> <maml:Description> <maml:para>Specifies the remote computer's network port that's used to reconnect to the session. To connect to a remote computer, it must be listening on the port that the connection uses. The default ports are 5985, which is the WinRM port for HTTP, and 5986, which is the WinRM port for HTTPS.</maml:para> <maml:para>Before using an alternate port, you must configure the WinRM listener on the remote computer to listen on that port. To configure the listener, type the following two commands at the PowerShell prompt:</maml:para> <maml:para>`Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse`</maml:para> <maml:para>`New-Item -Path WSMan:\Localhost\listener -Transport http -Address * -Port <port-number>`</maml:para> <maml:para>Don't use the Port parameter unless it's necessary. The port that's set in the command applies to all computers or sessions on which the command runs. An alternate port setting might prevent the command from running on all computers.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies the disconnected session. Enter a variable that contains the PSSession or a command that creates or gets the PSSession , such as a `Get-PSSession` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionOption</maml:name> <maml:Description> <maml:para>Specifies advanced options for the session. Enter a SessionOption object, such as one that you create by using the `New-PSSessionOption` cmdlet, or a hash table in which the keys are session option names and the values are session option values.</maml:para> <maml:para>The default values for the options are determined by the value of the `$PSSessionOption` preference variable, if it's set. Otherwise, the default values are established by options set in the session configuration.</maml:para> <maml:para>The session option values take precedence over default values for sessions set in the `$PSSessionOption` preference variable and in the session configuration. However, they don't take precedence over maximum values, quotas, or limits set in the session configuration.</maml:para> <maml:para>For a description of the session options that includes the default values, see `New-PSSessionOption`. For information about the $PSSessionOption preference variable, see about_Preference_Variables (./About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (./About/about_Session_Configurations.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Remoting.PSSessionOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Remoting.PSSessionOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSSL</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet uses the Secure Sockets Layer (SSL) protocol to connect to the disconnected session. By default, SSL isn't used.</maml:para> <maml:para>WS-Management encrypts all PowerShell content transmitted over the network. UseSSL is an additional protection that sends the data across an HTTPS connection instead of an HTTP connection.</maml:para> <maml:para>If you use this parameter and SSL isn't available on the port that's used for the command, the command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>You can pipe session objects to this cmdlet, such as objects returned by the `Get-PSSession` cmdlet.</maml:para> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.Int32</maml:name> </dev:type> <maml:description> <maml:para>You can pipe session Ids to this cmdlet.</maml:para> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.Guid</maml:name> </dev:type> <maml:description> <maml:para>You can pipe the instance Ids of sessions this cmdlet.</maml:para> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe session names to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Job or PSObject</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns the results of commands that ran in the disconnected session, if any. If the value or default value of the OutTarget parameter is Job, `Receive-PSSession` returns a job object. Otherwise, it returns objects that represent that command results.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>`Receive-PSSession` gets results only from sessions that were disconnected. Only sessions that are connected to, or terminate at, computers that run PowerShell 3.0 or later versions can be disconnected and reconnected.</maml:para> <maml:para>If the commands that were running in the disconnected session didn't generate results or if the results were already returned to another session, `Receive-PSSession` doesn't generate any output.</maml:para> <maml:para>A session's output buffering mode determines how commands in the session manage output when the session is disconnected. When the value of the OutputBufferingMode option of the session is Drop and the output buffer is full, the command starts to delete output. `Receive-PSSession` can't recover this output. For more information about the output buffering mode option, see the help articles for the New-PSSessionOption (New-PSSessionOption.md)and New-PSTransportOption (New-PSTransportOption.md)cmdlets.</maml:para> <maml:para>You can't change the idle time-out value of a PSSession when you connect to the PSSession or receive results. The SessionOption parameter of `Receive-PSSession` takes a SessionOption object that has an IdleTimeout value. However, the IdleTimeout value of the SessionOption object and the IdleTimeout value of the `$PSSessionOption` variable are ignored when it connects to a PSSession or receiving results.</maml:para> <maml:para>- You can set and change the idle time-out of a PSSession when you create the PSSession , by using the `New-PSSession` or `Invoke-Command` cmdlets, and when you disconnect from the PSSession . - The IdleTimeout property of a PSSession is critical to disconnected sessions because it determines how long a disconnected session is maintained on the remote computer. Disconnected sessions are considered to be idle from the moment that they are disconnected, even if commands are running in the disconnected session.</maml:para> <maml:para>If you start a start a job in a remote session by using the AsJob parameter of the `Invoke-Command` cmdlet, the job object is created in the current session, even though the job runs in the remote session. If you disconnect the remote session, the job object in the current session is disconnected from the job. The job object contains any results that were returned to it, but doesn't receive new results from the job in the disconnected session.</maml:para> <maml:para>If a different client connects to the session that contains the running job, the results that were delivered to the original job object in the original session aren't available in the newly connected session. Only results that were not delivered to the original job object are available in the reconnected session.</maml:para> <maml:para>Similarly, if you start a script in a session and then disconnect from the session, any results that the script delivers to the session before disconnecting aren't available to another client that connects to the session.</maml:para> <maml:para>To prevent data loss in sessions that you intend to disconnect, use the InDisconnectedSession parameter of the `Invoke-Command` cmdlet. Because this parameter prevents results from being returned to the current session, all results are available when the session is reconnected.</maml:para> <maml:para>You can also prevent data loss by using the `Invoke-Command` cmdlet to run a `Start-Job` command in the remote session. In this case, the job object is created in the remote session. You can't use the `Receive-PSSession` cmdlet to get the job results. Instead, use the `Connect-PSSession` cmdlet to connect to the session and then use the `Invoke-Command` cmdlet to run a `Receive-Job` command in the session.</maml:para> <maml:para>When a session that contains a running job is disconnected and then reconnected, the original job object is reused only if the job is disconnected and reconnected to the same session, and the command to reconnect doesn't specify a new job name. If the session is reconnected to a different client session or a new job name is specified, PowerShell creates a new job object for the new session.</maml:para> <maml:para>When you disconnect a PSSession , the session state is Disconnected and the availability is None.</maml:para> <maml:para>- The value of the State property is relative to the current session. A value of Disconnected means that the PSSession isn't connected to the current session. However, it doesn't mean that the PSSession is disconnected from all sessions. It might be connected to a different session. To determine whether you can connect or reconnect to the session, use the Availability property. - An Availability value of None indicates that you can connect to the session. A value of Busy indicates that you can't connect to the PSSession because it's connected to another session. - For more information about the values of the State property of sessions, see RunspaceState (/dotnet/api/system.management.automation.runspaces.runspacestate)in the MSDN library. - For more information about the values of the Availability property of sessions, see RunspaceAvailability (/dotnet/api/system.management.automation.runspaces.runspaceavailability).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------- Example 1: Connect to a PSSession --------------</maml:title> <dev:code>Receive-PSSession -ComputerName Server01 -Name ITTask</dev:code> <dev:remarks> <maml:para>The `Receive-PSSession` specifies the remote computer with the ComputerName parameter. The Name parameter identifies the ITTask session on the Server01 computer. The example gets the results of commands that were running in the ITTask session.</maml:para> <maml:para>Because the command doesn't use the OutTarget parameter, the results appear on the command line.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Get results of all commands on disconnected sessions</maml:title> <dev:code>Get-PSSession -ComputerName Server01, Server02 | Receive-PSSession</dev:code> <dev:remarks> <maml:para>`Get-PSSession` uses the ComputerName parameter to specify the remote computers. The objects are sent down the pipeline to `Receive-PSSession`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 3: Get the results of a script running in a session -</maml:title> <dev:code>$parms = @{ ComputerName = "Server01" Name = "ITTask" OutTarget = "Job" JobName = "ITTaskJob01" Credential = "Domain01\Admin01" } Receive-PSSession @parms Id Name State HasMoreData Location -- ---- ----- ----------- -------- 16 ITTaskJob01 Running True Server01</dev:code> <dev:remarks> <maml:para>The command uses the ComputerName and Name parameters to identify the disconnected session. It uses the OutTarget parameter with a value of Job to direct `Receive-PSSession` to return the results as a job. The JobName parameter specifies a name for the job in the reconnected session. The Credential parameter runs the `Receive-PSSession` command using the permissions of a domain administrator.</maml:para> <maml:para>The output shows that `Receive-PSSession` returned the results as a job in the current session. To get the job results, use a `Receive-Job` command</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 4: Get results after a network outage --------</maml:title> <dev:code>PS> $s = New-PSSession -ComputerName Server01 -Name AD -ConfigurationName ADEndpoint PS> $s Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 8 AD Server01 Opened ADEndpoint Available PS> Invoke-Command -Session $s -FilePath \\Server12\Scripts\SharedScripts\New-ADResolve.ps1 Running "New-ADResolve.ps1" # Network outage # Restart local computer # Network access is not re-established within 4 minutes PS> Get-PSSession -ComputerName Server01 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Backup Server01 Disconnected Microsoft.PowerShell None 8 AD Server01 Disconnected ADEndpoint None PS> Receive-PSSession -ComputerName Server01 -Name AD -OutTarget Job -JobName AD Job Id Name State HasMoreData Location -- ---- ----- ----------- -------- 16 ADJob Running True Server01 PS> Get-PSSession -ComputerName Server01 Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Backup Server01 Disconnected Microsoft.PowerShell Busy 8 AD Server01 Opened ADEndpoint Available</dev:code> <dev:remarks> <maml:para>The `New-PSSession` cmdlet creates a session on the Server01 computer and saves the session in the `$s` variable. The `$s` variable displays that the State is Opened and the Availability is Available. These values indicate that you're connected to the session and can run commands in the session.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs a script in the session in the `$s` variable. The script begins to run and return data, but a network outage occurs that interrupts the session. The user has to exit the session and restart the local computer.</maml:para> <maml:para>When the computer restarts, the user starts PowerShell and runs a `Get-PSSession` command to get sessions on the Server01 computer. The output shows that the AD session still exists on the Server01 computer. The State indicates that the AD session is disconnected. The Availability value of None, indicates that the session isn't connected to any client sessions.</maml:para> <maml:para>The `Receive-PSSession` cmdlet reconnects to the AD session and gets the results of the script that ran in the session. The command uses the OutTarget parameter to request the results in a job named ADJob . The command returns a job object and the output indicates that the script is still running.</maml:para> <maml:para>The `Get-PSSession` cmdlet is used to check the job state. The output confirms that the `Receive-PSSession` cmdlet reconnected to the AD session, which is now open and available for commands. And, the script resumed execution and is getting the script results.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 5: Reconnect to disconnected sessions --------</maml:title> <dev:code>PS> $parms = @{ InDisconnectedSession = $True ComputerName = "Server01", "Server02", "Server30" FilePath = "\\Server12\Scripts\SharedScripts\Get-BugStatus.ps1" Name = "BugStatus" SessionOption = @{IdleTimeout = 86400000} ConfigurationName = "ITTasks" } PS> Invoke-Command @parms PS> Exit PS> $s = Get-PSSession -ComputerName Server01, Server02, Server30 -Name BugStatus PS> $s Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server01 Disconnected ITTasks None 8 ITTask Server02 Disconnected ITTasks None 2 ITTask Server30 Disconnected ITTasks None PS> $Results = Receive-PSSession -Session $s PS> $s Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 ITTask Server01 Opened ITTasks Available 8 ITTask Server02 Opened ITTasks Available 2 ITTask Server30 Opened ITTasks Available PS> $Results Bug Report - Domain 01 ---------------------- ComputerName BugCount LastUpdated -------------- --------- ------------ Server01 121 Friday, December 30, 2011 5:03:34 PM</dev:code> <dev:remarks> <maml:para>The `Invoke-Command` cmdlet runs a script on three remote computers. Because the script gathers and summarizes data from multiple databases, it often takes the script an extended time to finish. The command uses the InDisconnectedSession parameter that starts the scripts and then immediately disconnects the sessions. The SessionOption parameter extends the IdleTimeout value of the disconnected session. Disconnected sessions are considered idle from the moment they're disconnected. It's important to set the idle time-out for long enough so that the commands can complete and you can reconnect to the session. You can set the IdleTimeout only when you create the PSSession and change it only when you disconnect from it. You can't change the IdleTimeout value when you connect to a PSSession or receiving its results. After running the command, the user exits PowerShell and closes the computer.</maml:para> <maml:para>The next day, the user resumes Windows, starts PowerShell, and uses `Get-PSSession` to get the sessions in which the scripts were running. The command identifies the sessions by the computer name, session name, and the name of the session configuration and saves the sessions in the `$s` variable. The value of the `$s` variable is displayed and shows that the sessions are disconnected, but aren't busy.</maml:para> <maml:para>The `Receive-PSSession` cmdlet connects to the sessions in the `$s` variable and gets their results. The command saves the results in the `$Results` variable. The `$s` variable is displayed and shows that the sessions are connected and available for commands.</maml:para> <maml:para>The script results in the `$Results` variable are displayed in the PowerShell console. If any of the results are unexpected, the user can run commands in the sessions to investigate the root cause.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 6: Running a job in a disconnected session ------</maml:title> <dev:code>PS> $s = New-PSSession -ComputerName Server01 -Name Test PS> $j = Invoke-Command -Session $s { 1..1500 | Foreach-Object {"Return $_"; sleep 30}} -AsJob PS> $j Id Name State HasMoreData Location -- ---- ----- ----------- -------- 16 Job1 Running True Server01 PS> $s | Disconnect-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Test Server01 Disconnected Microsoft.PowerShell None PS> $j Id Name State HasMoreData Location -- ---- ----- ----------- -------- 16 Job1 Disconnected True Server01 PS> Receive-Job $j -Keep Return 1 Return 2 PS> $s2 = Connect-PSSession -ComputerName Server01 -Name Test PS> $j2 = Receive-PSSession -ComputerName Server01 -Name Test PS> Receive-Job $j Return 3 Return 4</dev:code> <dev:remarks> <maml:para>The `New-PSSession` cmdlet creates the Test session on the Server01 computer. The command saves the session in the `$s` variable.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs a command in the session in the `$s` variable. The command uses the AsJob parameter to run the command as a job and creates the job object in the current session. The command returns a job object that's saved in the `$j` variable. The `$j` variable displays the job object.</maml:para> <maml:para>The session object in the `$s` variable is sent down the pipeline to `Disconnect-PSSession` and the session is disconnected.</maml:para> <maml:para>The `$j` variable is displayed and shows the effect of disconnecting the job object in the `$j` variable. The job state is now Disconnected.</maml:para> <maml:para>The `Receive-Job` is run on the job in the `$j` variable. The output shows that the job began to return output before the session and the job were disconnected.</maml:para> <maml:para>The `Connect-PSSession` cmdlet is run in the same client session. The command reconnects to the Test session on the Server01 computer and saves the session in the `$s2` variable.</maml:para> <maml:para>The `Receive-PSSession` cmdlet gets the results of the job that was running in the session. Because the command is run in the same session, `Receive-PSSession` returns the results as a job by default and reuses the same job object. The command saves the job in the `$j2` variable. The `Receive-Job` cmdlet gets the results of the job in the `$j` variable.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/receive-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSSessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Disconnected_Sessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSTransportOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Register-ArgumentCompleter</command:name> <command:verb>Register</command:verb> <command:noun>ArgumentCompleter</command:noun> <maml:description> <maml:para>Registers a custom argument completer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Register-ArgumentCompleter` cmdlet registers a custom argument completer. An argument completer allows you to provide dynamic tab completion, at run time for any command that you specify.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Register-ArgumentCompleter</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:Description> <maml:para>Specifies the name of the commands as an array.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Native</maml:name> <maml:Description> <maml:para>Indicates that the argument completer is for a native command where PowerShell cannot complete parameter names.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run to perform tab completion. The script block you provide should return the values that complete the input. The script block must unroll the values using the pipeline (`ForEach-Object`, `Where-Object`, etc.), or another suitable method. Returning an array of values causes PowerShell to treat the entire array as one tab completion value.</maml:para> <maml:para>The script block must accept the following parameters in the order specified below. The names of the parameters aren't important because PowerShell passes in the values by position.</maml:para> <maml:para>- `$commandName` (Position 0) - This parameter is set to the name of the command for which the script block is providing tab completion. - `$parameterName` (Position 1) - This parameter is set to the parameter whose value requires tab completion. - `$wordToComplete` (Position 2) - This parameter is set to value the user has provided before they pressed <kbd>Tab</kbd>. Your script block should use this value to determine tab completion values. - `$commandAst` (Position 3) - This parameter is set to the Abstract Syntax Tree (AST) for the current input line. For more information, see Ast Class (/dotnet/api/system.management.automation.language.ast). - `$fakeBoundParameters` (Position 4) - This parameter is set to a hashtable containing the `$PSBoundParameters` for the cmdlet, before the user pressed <kbd>Tab</kbd>. For more information, see about_Automatic_Variables (./About/about_Automatic_Variables.md).</maml:para> <maml:para>When you specify the Native parameter, the script block must take the following parameters in the specified order. The names of the parameters aren't important because PowerShell passes in the values by position.</maml:para> <maml:para>- `$wordToComplete` (Position 0) - This parameter is set to value the user has provided before they pressed <kbd>Tab</kbd>. Your script block should use this value to determine tab completion values. - `$commandAst` (Position 1) - This parameter is set to the Abstract Syntax Tree (AST) for the current input line. For more information, see Ast Class (/dotnet/api/system.management.automation.language.ast). - `$cursorPosition` (Position 2) - This parameter is set to the position of the cursor when the user pressed <kbd>Tab</kbd>.</maml:para> <maml:para>You can also provide an ArgumentCompleter as a parameter attribute. For more information, see about_Functions_Advanced_Parameters (./About/about_Functions_Advanced_Parameters.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Register-ArgumentCompleter</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:Description> <maml:para>Specifies the name of the commands as an array.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:Description> <maml:para>Specifies the name of the parameter whose argument is being completed. The parameter name specified cannot be an enumerated value, such as the ForegroundColor parameter of the `Write-Host` cmdlet.</maml:para> <maml:para>For more information on enums, see about_Enum (./About/about_Enum.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run to perform tab completion. The script block you provide should return the values that complete the input. The script block must unroll the values using the pipeline (`ForEach-Object`, `Where-Object`, etc.), or another suitable method. Returning an array of values causes PowerShell to treat the entire array as one tab completion value.</maml:para> <maml:para>The script block must accept the following parameters in the order specified below. The names of the parameters aren't important because PowerShell passes in the values by position.</maml:para> <maml:para>- `$commandName` (Position 0) - This parameter is set to the name of the command for which the script block is providing tab completion. - `$parameterName` (Position 1) - This parameter is set to the parameter whose value requires tab completion. - `$wordToComplete` (Position 2) - This parameter is set to value the user has provided before they pressed <kbd>Tab</kbd>. Your script block should use this value to determine tab completion values. - `$commandAst` (Position 3) - This parameter is set to the Abstract Syntax Tree (AST) for the current input line. For more information, see Ast Class (/dotnet/api/system.management.automation.language.ast). - `$fakeBoundParameters` (Position 4) - This parameter is set to a hashtable containing the `$PSBoundParameters` for the cmdlet, before the user pressed <kbd>Tab</kbd>. For more information, see about_Automatic_Variables (./About/about_Automatic_Variables.md).</maml:para> <maml:para>When you specify the Native parameter, the script block must take the following parameters in the specified order. The names of the parameters aren't important because PowerShell passes in the values by position.</maml:para> <maml:para>- `$wordToComplete` (Position 0) - This parameter is set to value the user has provided before they pressed <kbd>Tab</kbd>. Your script block should use this value to determine tab completion values. - `$commandAst` (Position 1) - This parameter is set to the Abstract Syntax Tree (AST) for the current input line. For more information, see Ast Class (/dotnet/api/system.management.automation.language.ast). - `$cursorPosition` (Position 2) - This parameter is set to the position of the cursor when the user pressed <kbd>Tab</kbd>.</maml:para> <maml:para>You can also provide an ArgumentCompleter as a parameter attribute. For more information, see about_Functions_Advanced_Parameters (./About/about_Functions_Advanced_Parameters.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CommandName</maml:name> <maml:Description> <maml:para>Specifies the name of the commands as an array.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Native</maml:name> <maml:Description> <maml:para>Indicates that the argument completer is for a native command where PowerShell cannot complete parameter names.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ParameterName</maml:name> <maml:Description> <maml:para>Specifies the name of the parameter whose argument is being completed. The parameter name specified cannot be an enumerated value, such as the ForegroundColor parameter of the `Write-Host` cmdlet.</maml:para> <maml:para>For more information on enums, see about_Enum (./About/about_Enum.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run to perform tab completion. The script block you provide should return the values that complete the input. The script block must unroll the values using the pipeline (`ForEach-Object`, `Where-Object`, etc.), or another suitable method. Returning an array of values causes PowerShell to treat the entire array as one tab completion value.</maml:para> <maml:para>The script block must accept the following parameters in the order specified below. The names of the parameters aren't important because PowerShell passes in the values by position.</maml:para> <maml:para>- `$commandName` (Position 0) - This parameter is set to the name of the command for which the script block is providing tab completion. - `$parameterName` (Position 1) - This parameter is set to the parameter whose value requires tab completion. - `$wordToComplete` (Position 2) - This parameter is set to value the user has provided before they pressed <kbd>Tab</kbd>. Your script block should use this value to determine tab completion values. - `$commandAst` (Position 3) - This parameter is set to the Abstract Syntax Tree (AST) for the current input line. For more information, see Ast Class (/dotnet/api/system.management.automation.language.ast). - `$fakeBoundParameters` (Position 4) - This parameter is set to a hashtable containing the `$PSBoundParameters` for the cmdlet, before the user pressed <kbd>Tab</kbd>. For more information, see about_Automatic_Variables (./About/about_Automatic_Variables.md).</maml:para> <maml:para>When you specify the Native parameter, the script block must take the following parameters in the specified order. The names of the parameters aren't important because PowerShell passes in the values by position.</maml:para> <maml:para>- `$wordToComplete` (Position 0) - This parameter is set to value the user has provided before they pressed <kbd>Tab</kbd>. Your script block should use this value to determine tab completion values. - `$commandAst` (Position 1) - This parameter is set to the Abstract Syntax Tree (AST) for the current input line. For more information, see Ast Class (/dotnet/api/system.management.automation.language.ast). - `$cursorPosition` (Position 2) - This parameter is set to the position of the cursor when the user pressed <kbd>Tab</kbd>.</maml:para> <maml:para>You can also provide an ArgumentCompleter as a parameter attribute. For more information, see about_Functions_Advanced_Parameters (./About/about_Functions_Advanced_Parameters.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns no output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------- Example 1: Register a custom argument completer -------</maml:title> <dev:code>$scriptBlock = { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) (Get-TimeZone -ListAvailable).Id | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { "'$_'" } } Register-ArgumentCompleter -CommandName Set-TimeZone -ParameterName Id -ScriptBlock $scriptBlock</dev:code> <dev:remarks> <maml:para>The first command creates a script block which takes the required parameters which are passed in when the user presses <kbd>Tab</kbd>. For more information, see the ScriptBlock parameter description.</maml:para> <maml:para>Within the script block, the available values for Id are retrieved using the `Get-TimeZone` cmdlet. The Id property for each Time Zone is piped to the `Where-Object` cmdlet. The `Where-Object` cmdlet filters out any ids that do not start with the value provided by `$wordToComplete`, which represents the text the user typed before they pressed <kbd>Tab</kbd>. The filtered ids are piped to the `For-EachObject` cmdlet which encloses each value in quotes, should the value contain spaces.</maml:para> <maml:para>The second command registers the argument completer by passing the scriptblock, the ParameterName Id and the CommandName `Set-TimeZone`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 2: Add details to your tab completion values -----</maml:title> <dev:code>$s = { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) $services = Get-Service | Where-Object {$_.Status -eq "Running" -and $_.Name -like "$wordToComplete*"} $services | ForEach-Object { New-Object -Type System.Management.Automation.CompletionResult -ArgumentList $_.Name, $_.Name, "ParameterValue", $_.Name } } Register-ArgumentCompleter -CommandName Stop-Service -ParameterName Name -ScriptBlock $s</dev:code> <dev:remarks> <maml:para>The first command creates a script block which takes the required parameters which are passed in when the user presses <kbd>Tab</kbd>. For more information, see the ScriptBlock parameter description.</maml:para> <maml:para>Within the script block, the first command retrieves all running services using the `Where-Object` cmdlet. The services are piped to the `ForEach-Object` cmdlet. The `ForEach-Object` cmdlet creates a new `[System.Management.Automation.CompletionResult]` (/dotnet/api/system.management.automation.completionresult)object and populates it with the values of the current service (represented by the pipeline variable `$_`).</maml:para> <maml:para>The CompletionResult object allows you to provide additional details to each returned value:</maml:para> <maml:para>- completionText (String) - The text to be used as the auto completion result. This is the value sent to the command. - listItemText (String) - The text to be displayed in a list, such as when the user presses <kbd>Ctrl</kbd>+<kbd>Space</kbd>. This is used for display only and is not passed to the command when selected. - resultType ( CompletionResultType (/dotnet/api/system.management.automation.completionresulttype))- The type of completion result. - toolTip (String) - The text for the tooltip with details to be displayed about the object. This is visible when the user selects an item after pressing <kbd>Ctrl</kbd>+<kbd>Space</kbd>.</maml:para> <maml:para>The last command demonstrates that stopped services can still be passed in manually to the `Stop-Service` cmdlet. The tab completion is the only aspect affected.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 3: Register a custom Native argument completer ----</maml:title> <dev:code>$scriptblock = { param($wordToComplete, $commandAst, $cursorPosition) dotnet complete --position $cursorPosition $commandAst.ToString() | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) } } Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock $scriptblock</dev:code> <dev:remarks> <maml:para>The first command creates a script block which takes the required parameters which are passed in when the user presses <kbd>Tab</kbd>. For more information, see the ScriptBlock parameter description.</maml:para> <maml:para>Within the script block, the `dotnet complete` command is used to perform the tab completion. The results are piped to the `ForEach-Object` cmdlet which use the new static method of the System.Management.Automation.CompletionResult (/dotnet/api/system.management.automation.completionresult)class to create a new CompletionResult object for each value.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/register-argumentcompleter?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Register-PSSessionConfiguration</command:name> <command:verb>Register</command:verb> <command:noun>PSSessionConfiguration</command:noun> <maml:description> <maml:para>Creates and registers a new session configuration.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Register-PSSessionConfiguration` cmdlet creates and registers a new session configuration on the local computer. This is an advanced cmdlet that you can use to create custom sessions for remote users.</maml:para> <maml:para>Every PowerShell session ( PSSession ) uses a session configuration, also known as an endpoint. When users create a session that connects to the computer, they can select a session configuration or use the default session configuration that is registered when you enable PowerShell remoting. Users can also set the $PSSessionConfigurationName preference variable, which specifies a default configuration for remote sessions created in the current session.</maml:para> <maml:para>The session configuration defines the environment for the remote session. The configuration can determine which commands and language elements are available in the session, and it can include settings that protect the computer, such as those that limit the amount of data that the session can receive remotely in a single object or command. The security descriptor of the session configuration determines which users have permission to use the session configuration.</maml:para> <maml:para>You can define the elements of configuration by using an assembly that implements a new configuration class and by using a script that runs in the session. Beginning in PowerShell 3.0, you can also use a session configuration file to define the session configuration.</maml:para> <maml:para>For information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md). For information about session configuration files, see about_Session_Configuration_Files (About/about_Session_Configuration_Files.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Register-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a name for the session configuration. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. - Local. Allows users of the local computer to use the session configuration to create a local loopback session on the same computer, but denies access to remote users. - Remote. Allows local and remote users to use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote.</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet allows for remote access to all session configurations, the `Enable-PSSessionConfiguration` cmdlet enables session configurations, and the `Disable-PSRemoting` cmdlet prevents remote access to all session configurations.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Disabled</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Remote</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationBase</maml:name> <maml:Description> <maml:para>Specifies the path of the assembly file (*.dll) that is specified in the value of the AssemblyName parameter. Use this parameter when the value of the AssemblyName parameter does not include a path. The default is the current directory.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, specify the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules that are automatically imported into sessions that use the session configuration.</maml:para> <maml:para>By default, only Microsoft.PowerShell.Core is imported into sessions. Unless the cmdlets are excluded, you can use `Import-Module` to add modules to the session.</maml:para> <maml:para>The modules specified in this parameter value are imported in additions to modules that are specified by the SessionType parameter and those listed in the ModulesToImport key in the session configuration file (`New-PSSessionConfigurationFile`). However, settings in the session configuration file can hide the commands exported by modules or prevent users from using them.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run a `Register-PSSessionConfiguration` command, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, specify the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PA"> <maml:name>ProcessorArchitecture</maml:name> <maml:Description> <maml:para>Determines whether a 32-bit or 64-bit version of the PowerShell process is started in sessions that use this session configuration. The acceptable values for this parameter are: x86 (32-bit) and AMD64 (64-bit). The default value is determined by the processor architecture of the computer that hosts the session configuration.</maml:para> <maml:para>You can use this parameter to create a 32-bit session on a 64-bit computer. Attempts to create a 64-bit process on a 32-bit computer fail.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">x86</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">amd64</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PowerShellVersion"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies the version of PowerShell in sessions that use this session configuration.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute (Invoke) permission for the configuration.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this parameter. You cannot use both parameters in the same command.</maml:para> <maml:para>If you omit this parameter, the root SDDL for the WinRM service is used for this configuration. To view or change the root SDDL, use the WSMan provider. For example `Get-Item wsman:\localhost\service\rootSDDL`. For more information about the WSMan provider, type `Get-Help wsman`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionType</maml:name> <maml:Description> <maml:para>Specifies the type of session that is created by using the session configuration. The acceptable values for this parameter are:</maml:para> <maml:para>- Empty. No modules are added to session by default. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session. - Default. Adds Microsoft.PowerShell.Core to the session. This module includes the `Import-Module` cmdlet that users can use to import other modules unless you explicitly prohibit the cmdlet. - RestrictedRemoteServer. Includes only the following cmdlets: `Exit-PSSession`, `Get-Command`, `Get-FormatData`, `Get-Help`, `Measure-Object`, `Out-Default`, and `Select-Object`. Use a script or assembly, or the keys in the session configuration file, to add modules, functions, scripts, and other features to the session.</maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the SessionType key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">DefaultRemoteShell</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Workflow</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionType</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionType</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionTypeOption</maml:name> <maml:Description> <maml:para>Specifies type-specific options for the session configuration. Enter a session type options object, such as the PSWorkflowExecutionOption object that the `New-PSWorkflowExecutionOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSSessionTypeOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSSessionTypeOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays a property sheet that helps you create the SDDL for the session configuration. The property sheet appears after you enter the `Register-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When setting the permissions for the configuration, remember that users must have at least Execute (Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>You can use the script to additionally configure the session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state of the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">STA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MTA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Unknown</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies how threads are created and used when a command runs in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions?view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseNewThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ReuseThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseCurrentThread</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport option.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Register-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a name for the session configuration. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AssemblyName</maml:name> <maml:Description> <maml:para>Specifies the name of an assembly file (*.dll) in which the configuration type is defined. You can specify the path of the .dll in this parameter or in the value of the ApplicationBase parameter.</maml:para> <maml:para>This parameter is required when you specify the ConfigurationTypeName parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>ConfigurationTypeName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified name of the Microsoft .NET Framework type that is used for this configuration. The type that you specify must implement the System.Management.Automation.Remoting.PSSessionConfiguration class.</maml:para> <maml:para>To specify the assembly file (*.dll) that implements the configuration type, specify the AssemblyName and ApplicationBase parameters.</maml:para> <maml:para>Creating a type lets you control more aspects of the session configuration, such as exposing or hiding certain parameters of cmdlets, or setting data size and object size limits that users cannot override.</maml:para> <maml:para>If you omit this parameter, the DefaultRemotePowerShellConfiguration class is used for the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. - Local. Allows users of the local computer to use the session configuration to create a local loopback session on the same computer, but denies access to remote users. - Remote. Allows local and remote users to use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote.</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet allows for remote access to all session configurations, the `Enable-PSSessionConfiguration` cmdlet enables session configurations, and the `Disable-PSRemoting` cmdlet prevents remote access to all session configurations.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Disabled</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Remote</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationBase</maml:name> <maml:Description> <maml:para>Specifies the path of the assembly file (*.dll) that is specified in the value of the AssemblyName parameter. Use this parameter when the value of the AssemblyName parameter does not include a path. The default is the current directory.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, specify the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules that are automatically imported into sessions that use the session configuration.</maml:para> <maml:para>By default, only Microsoft.PowerShell.Core is imported into sessions. Unless the cmdlets are excluded, you can use `Import-Module` to add modules to the session.</maml:para> <maml:para>The modules specified in this parameter value are imported in additions to modules that are specified by the SessionType parameter and those listed in the ModulesToImport key in the session configuration file (`New-PSSessionConfigurationFile`). However, settings in the session configuration file can hide the commands exported by modules or prevent users from using them.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run a `Register-PSSessionConfiguration` command, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, specify the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PA"> <maml:name>ProcessorArchitecture</maml:name> <maml:Description> <maml:para>Determines whether a 32-bit or 64-bit version of the PowerShell process is started in sessions that use this session configuration. The acceptable values for this parameter are: x86 (32-bit) and AMD64 (64-bit). The default value is determined by the processor architecture of the computer that hosts the session configuration.</maml:para> <maml:para>You can use this parameter to create a 32-bit session on a 64-bit computer. Attempts to create a 64-bit process on a 32-bit computer fail.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">x86</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">amd64</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PowerShellVersion"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies the version of PowerShell in sessions that use this session configuration.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute (Invoke) permission for the configuration.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this parameter. You cannot use both parameters in the same command.</maml:para> <maml:para>If you omit this parameter, the root SDDL for the WinRM service is used for this configuration. To view or change the root SDDL, use the WSMan provider. For example `Get-Item wsman:\localhost\service\rootSDDL`. For more information about the WSMan provider, type `Get-Help wsman`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionTypeOption</maml:name> <maml:Description> <maml:para>Specifies type-specific options for the session configuration. Enter a session type options object, such as the PSWorkflowExecutionOption object that the `New-PSWorkflowExecutionOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSSessionTypeOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSSessionTypeOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays a property sheet that helps you create the SDDL for the session configuration. The property sheet appears after you enter the `Register-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When setting the permissions for the configuration, remember that users must have at least Execute (Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>You can use the script to additionally configure the session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state of the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">STA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MTA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Unknown</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies how threads are created and used when a command runs in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions?view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseNewThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ReuseThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseCurrentThread</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport option.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Register-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a name for the session configuration. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. - Local. Allows users of the local computer to use the session configuration to create a local loopback session on the same computer, but denies access to remote users. - Remote. Allows local and remote users to use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote.</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet allows for remote access to all session configurations, the `Enable-PSSessionConfiguration` cmdlet enables session configurations, and the `Disable-PSRemoting` cmdlet prevents remote access to all session configurations.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Disabled</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Remote</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, specify the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run a `Register-PSSessionConfiguration` command, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, specify the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of a session configuration file (.pssc), such as one created by `New-PSSessionConfigurationFile`. If you omit the path, the default is the current directory.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PA"> <maml:name>ProcessorArchitecture</maml:name> <maml:Description> <maml:para>Determines whether a 32-bit or 64-bit version of the PowerShell process is started in sessions that use this session configuration. The acceptable values for this parameter are: x86 (32-bit) and AMD64 (64-bit). The default value is determined by the processor architecture of the computer that hosts the session configuration.</maml:para> <maml:para>You can use this parameter to create a 32-bit session on a 64-bit computer. Attempts to create a 64-bit process on a 32-bit computer fail.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">x86</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">amd64</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute (Invoke) permission for the configuration.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this parameter. You cannot use both parameters in the same command.</maml:para> <maml:para>If you omit this parameter, the root SDDL for the WinRM service is used for this configuration. To view or change the root SDDL, use the WSMan provider. For example `Get-Item wsman:\localhost\service\rootSDDL`. For more information about the WSMan provider, type `Get-Help wsman`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays a property sheet that helps you create the SDDL for the session configuration. The property sheet appears after you enter the `Register-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When setting the permissions for the configuration, remember that users must have at least Execute (Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>You can use the script to additionally configure the session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state of the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">STA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MTA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Unknown</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies how threads are created and used when a command runs in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions?view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseNewThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ReuseThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseCurrentThread</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport option.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. - Local. Allows users of the local computer to use the session configuration to create a local loopback session on the same computer, but denies access to remote users. - Remote. Allows local and remote users to use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote.</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet allows for remote access to all session configurations, the `Enable-PSSessionConfiguration` cmdlet enables session configurations, and the `Disable-PSRemoting` cmdlet prevents remote access to all session configurations.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationBase</maml:name> <maml:Description> <maml:para>Specifies the path of the assembly file (*.dll) that is specified in the value of the AssemblyName parameter. Use this parameter when the value of the AssemblyName parameter does not include a path. The default is the current directory.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AssemblyName</maml:name> <maml:Description> <maml:para>Specifies the name of an assembly file (*.dll) in which the configuration type is defined. You can specify the path of the .dll in this parameter or in the value of the ApplicationBase parameter.</maml:para> <maml:para>This parameter is required when you specify the ConfigurationTypeName parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>ConfigurationTypeName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified name of the Microsoft .NET Framework type that is used for this configuration. The type that you specify must implement the System.Management.Automation.Remoting.PSSessionConfiguration class.</maml:para> <maml:para>To specify the assembly file (*.dll) that implements the configuration type, specify the AssemblyName and ApplicationBase parameters.</maml:para> <maml:para>Creating a type lets you control more aspects of the session configuration, such as exposing or hiding certain parameters of cmdlets, or setting data size and object size limits that users cannot override.</maml:para> <maml:para>If you omit this parameter, the DefaultRemotePowerShellConfiguration class is used for the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, specify the NoServiceRestart parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies a limit for the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used and the value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules that are automatically imported into sessions that use the session configuration.</maml:para> <maml:para>By default, only Microsoft.PowerShell.Core is imported into sessions. Unless the cmdlets are excluded, you can use `Import-Module` to add modules to the session.</maml:para> <maml:para>The modules specified in this parameter value are imported in additions to modules that are specified by the SessionType parameter and those listed in the ModulesToImport key in the session configuration file (`New-PSSessionConfigurationFile`). However, settings in the session configuration file can hide the commands exported by modules or prevent users from using them.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a name for the session configuration. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run a `Register-PSSessionConfiguration` command, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, specify the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of a session configuration file (.pssc), such as one created by `New-PSSessionConfigurationFile`. If you omit the path, the default is the current directory.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PA"> <maml:name>ProcessorArchitecture</maml:name> <maml:Description> <maml:para>Determines whether a 32-bit or 64-bit version of the PowerShell process is started in sessions that use this session configuration. The acceptable values for this parameter are: x86 (32-bit) and AMD64 (64-bit). The default value is determined by the processor architecture of the computer that hosts the session configuration.</maml:para> <maml:para>You can use this parameter to create a 32-bit session on a 64-bit computer. Attempts to create a 64-bit process on a 32-bit computer fail.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PowerShellVersion"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies the version of PowerShell in sessions that use this session configuration.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute (Invoke) permission for the configuration.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this parameter. You cannot use both parameters in the same command.</maml:para> <maml:para>If you omit this parameter, the root SDDL for the WinRM service is used for this configuration. To view or change the root SDDL, use the WSMan provider. For example `Get-Item wsman:\localhost\service\rootSDDL`. For more information about the WSMan provider, type `Get-Help wsman`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionType</maml:name> <maml:Description> <maml:para>Specifies the type of session that is created by using the session configuration. The acceptable values for this parameter are:</maml:para> <maml:para>- Empty. No modules are added to session by default. Use the parameters of this cmdlet to add modules, functions, scripts, and other features to the session. - Default. Adds Microsoft.PowerShell.Core to the session. This module includes the `Import-Module` cmdlet that users can use to import other modules unless you explicitly prohibit the cmdlet. - RestrictedRemoteServer. Includes only the following cmdlets: `Exit-PSSession`, `Get-Command`, `Get-FormatData`, `Get-Help`, `Measure-Object`, `Out-Default`, and `Select-Object`. Use a script or assembly, or the keys in the session configuration file, to add modules, functions, scripts, and other features to the session.</maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the SessionType key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionType</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionType</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionTypeOption</maml:name> <maml:Description> <maml:para>Specifies type-specific options for the session configuration. Enter a session type options object, such as the PSWorkflowExecutionOption object that the `New-PSWorkflowExecutionOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSSessionTypeOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSSessionTypeOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays a property sheet that helps you create the SDDL for the session configuration. The property sheet appears after you enter the `Register-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When setting the permissions for the configuration, remember that users must have at least Execute (Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>You can use the script to additionally configure the session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state of the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies how threads are created and used when a command runs in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions?view=powershellsdk-1.1.0).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport option.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Microsoft.WSMan.Management.WSManConfigContainerElement</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To run this cmdlet you must start PowerShell by using the Run as administrator option.</maml:para> <maml:para>This cmdlet generates XML that represents a Web Services for Management (WS-Management) plug-in configuration and sends the XML to WS-Management, which registers the plug-in on the local computer (`New-Item wsman:\localhost\plugin`).</maml:para> <maml:para>The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----- Example 1: Register a NewShell session configuration -----</maml:title> <dev:code>$sessionConfiguration = @{ Name='NewShell' ApplicationBase='c:\MyShells\' AssemblyName='MyShell.dll' ConfigurationTypeName='MyClass' } Register-PSSessionConfiguration @sessionConfiguration</dev:code> <dev:remarks> <maml:para>To use this configuration, type `New-PSSession -ConfigurationName newshell`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 2: Register a MaintenanceShell session configuration -</maml:title> <dev:code>Register-PSSessionConfiguration -Name MaintenanceShell -StartupScript C:\ps-test\Maintenance.ps1</dev:code> <dev:remarks> <maml:para>When a user uses a `New-PSSession` command and selects the MaintenanceShell configuration, the `Maintenance.ps1` script runs in the new session. The script can configure the session. This includes importing modules and setting the execution policy for the session. If the script generates any errors, including non-terminating errors, the `New-PSSession` command fails.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 3: Register a session configuration ---------</maml:title> <dev:code>$sddl = "O:NSG:BAD:P(A;;GA;;;BA)S:P(AU;FA;GA;;;WD)(AU;FA;SA;GWGX;;WD)" $sessionParams = @{ Name="AdminShell" SecurityDescriptorSDDL=$sddl MaximumReceivedObjectSizeMB=20 StartupScript="C:\scripts\AdminShell.ps1" } Register-PSSessionConfiguration @sessionParams</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 4: Return a configuration container element -----</maml:title> <dev:code>$s = Register-PSSessionConfiguration -Name MaintenanceShell -StartupScript C:\ps-test\Maintenance.ps1 $s | Format-List -Property * dir WSMan:\LocalHost\Plugin PSPath : Microsoft.WSMan.Management\WSMan::localhost\Plugin\MaintenanceShell PSParentPath : Microsoft.WSMan.Management\WSMan::localhost\Plugin PSChildName : MaintenanceShell PSDrive : WSMan PSProvider : Microsoft.WSMan.Management\WSMan PSIsContainer : True Keys : {Name=MaintenanceShell} Name : MaintenanceShell TypeNameOfElement : Container Name Type Keys ---- ---- ---- MaintenanceShell Container {Name=MaintenanceShell} microsoft.powershell Container {Name=microsoft.powershell} microsoft.powershell32 Container {Name=microsoft.powershell32}</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: Register a session configuration with a startup script</maml:title> <dev:code>Register-PSSessionConfiguration -Name WithProfile -StartupScript Add-Profile.ps1</dev:code> <dev:remarks> <maml:para>The script contains a single command that uses dot sourcing to run the user's CurrentUserAllHosts profile in the current scope of the session.</maml:para> <maml:para>For more information about profiles, see about_Profiles (./About/about_Profiles.md). For more information about dot sourcing, see about_Scopes (./About/about_Scopes.md).</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/register-pssessionconfiguration?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Remove-Job</command:name> <command:verb>Remove</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Deletes a PowerShell background job.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Remove-Job` cmdlet deletes PowerShell background jobs that were started by the `Start-Job` cmdlet or by cmdlets such as `Invoke-Command` that support the AsJob parameter.</maml:para> <maml:para>You can use `Remove-Job` to delete all jobs or delete selected jobs. The jobs are identified by their Name , ID , Instance ID , Command , or State . Or, a job object can be sent down the pipeline to `Remove-Job`. Without parameters or parameter values, `Remove-Job` has no effect.</maml:para> <maml:para>Since PowerShell 3.0, `Remove-Job` can delete custom job types, such as scheduled jobs and workflow jobs. For example, `Remove-Job` deletes the scheduled job, all instances of the scheduled job on disk, and the results of all triggered job instances.</maml:para> <maml:para>If you try to delete a running job, `Remove-Job` fails. Use the `Stop-Job` cmdlet to stop a running job. Or, use `Remove-Job` with the Force parameter to delete a running job.</maml:para> <maml:para>Jobs remain in the global job cache until you delete the background job or close the PowerShell session.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Command</maml:name> <maml:Description> <maml:para>Deletes jobs that include the specified words in the command. You can enter a comma-separated array.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Deletes jobs that satisfy all the conditions established in the associated hash table. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It doesn't work on standard background jobs, such as those created by using the `Start-Job`.</maml:para> <maml:para>This parameter is introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Deletes a job even if the job's state is Running . If the Force parameter isn't specified, `Remove-Job` doesn't delete running jobs.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Deletes background jobs with the specified Id . You can enter a comma-separated array. The job's Id is a unique integer that identifies a job within the current session.</maml:para> <maml:para>To find a job's Id , use `Get-Job` without parameters.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Deletes a job even if the job's state is Running . If the Force parameter isn't specified, `Remove-Job` doesn't delete running jobs.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs to be deleted. Enter a variable that contains the jobs or a command that gets the jobs. You can enter a comma-separated array.</maml:para> <maml:para>You can send job objects down the pipeline to `Remove-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Deletes a job even if the job's state is Running . If the Force parameter isn't specified, `Remove-Job` doesn't delete running jobs.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Only deletes jobs with the specified friendly name. Wildcards are permitted. You can enter a comma-separated array.</maml:para> <maml:para>Friendly names for jobs aren't guaranteed to be unique, even within a PowerShell session. Use the WhatIf and Confirm parameters when you delete files by name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Deletes a job even if the job's state is Running . If the Force parameter isn't specified, `Remove-Job` doesn't delete running jobs.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Deletes jobs with the specified InstanceId . You can enter a comma-separated array. An InstanceId is a unique GUID that identifies a job.</maml:para> <maml:para>To find a job's InstanceId , use `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Deletes a job even if the job's state is Running . If the Force parameter isn't specified, `Remove-Job` doesn't delete running jobs.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Only deletes jobs with the specified state. To delete jobs with a state of Running , use the Force parameter.</maml:para> <maml:para>Accepted values:</maml:para> <maml:para>- AtBreakpoint</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Failed</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Stopping</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Suspending</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Command</maml:name> <maml:Description> <maml:para>Deletes jobs that include the specified words in the command. You can enter a comma-separated array.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before `Remove-Job` is run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Deletes jobs that satisfy all the conditions established in the associated hash table. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It doesn't work on standard background jobs, such as those created by using the `Start-Job`.</maml:para> <maml:para>This parameter is introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Deletes a job even if the job's state is Running . If the Force parameter isn't specified, `Remove-Job` doesn't delete running jobs.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Deletes background jobs with the specified Id . You can enter a comma-separated array. The job's Id is a unique integer that identifies a job within the current session.</maml:para> <maml:para>To find a job's Id , use `Get-Job` without parameters.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Deletes jobs with the specified InstanceId . You can enter a comma-separated array. An InstanceId is a unique GUID that identifies a job.</maml:para> <maml:para>To find a job's InstanceId , use `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs to be deleted. Enter a variable that contains the jobs or a command that gets the jobs. You can enter a comma-separated array.</maml:para> <maml:para>You can send job objects down the pipeline to `Remove-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Only deletes jobs with the specified friendly name. Wildcards are permitted. You can enter a comma-separated array.</maml:para> <maml:para>Friendly names for jobs aren't guaranteed to be unique, even within a PowerShell session. Use the WhatIf and Confirm parameters when you delete files by name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Only deletes jobs with the specified state. To delete jobs with a state of Running , use the Force parameter.</maml:para> <maml:para>Accepted values:</maml:para> <maml:para>- AtBreakpoint</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Failed</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Stopping</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Suspending</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if `Remove-Job` runs. The cmdlet isn't run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> </dev:type> <maml:description> <maml:para>You can send a job object down the pipeline to `Remove-Job`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>`Remove-Job` doesn't generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>A PowerShell job creates a new process. When the job completes, the process exits. When `Remove-Job` is run, the job's state is removed.</maml:para> <maml:para>If a job stops before completion and its process hasn't exited, the process is forcibly terminated.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1: Delete a job by using its name ----------</maml:title> <dev:code>$batch = Get-Job -Name BatchJob $batch | Remove-Job</dev:code> <dev:remarks> <maml:para>`Get-Job` uses the Name parameter to specify the job, BatchJob . The job object is stored in the `$batch` variable. The object in `$batch` is sent down the pipeline to `Remove-Job`.</maml:para> <maml:para>An alternative is to use the Job parameter, such as `Remove-Job -Job $batch`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 2: Delete all jobs in a session -----------</maml:title> <dev:code>Get-job | Remove-Job</dev:code> <dev:remarks> <maml:para>`Get-Job` gets all the jobs in the current PowerShell session. The job objects are sent down the pipeline to `Remove-Job`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 3: Delete NotStarted jobs --------------</maml:title> <dev:code>Remove-Job -State NotStarted</dev:code> <dev:remarks> <maml:para>`Remove-Job` uses the State parameter to specify the job status.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 4: Delete jobs by using a friendly name -------</maml:title> <dev:code>Remove-Job -Name *batch -Force</dev:code> <dev:remarks> <maml:para>`Remove-Job` uses the Name parameter to specify a job name pattern. The pattern includes the asterisk (` `) wildcard to find all job names that end with batch . The Force * parameter deletes jobs that running.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 5: Delete a job that was created by Invoke-Command --</maml:title> <dev:code>$job = Invoke-Command -ComputerName Server01 -ScriptBlock {Get-Process} -AsJob $job | Remove-Job</dev:code> <dev:remarks> <maml:para>`Invoke-Command` runs a job on the Server01 computer. The AsJob parameter runs the ScriptBlock as a background job. The job object is stored in the `$job` variable. The `$job` variable object is sent down the pipeline to `Remove-Job`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: Delete a job that was created by Invoke-Command and Start-Job</maml:title> <dev:code>$S = New-PSSession -ComputerName Server01 Invoke-Command -Session $S -ScriptBlock {Start-Job -ScriptBlock {Get-Process} -Name MyJob} Invoke-Command -Session $S -ScriptBlock {Remove-Job -Name MyJob}</dev:code> <dev:remarks> <maml:para>`New-PSSession` creates a PSSession , a persistent connection, to the Server01 computer. The connection is saved in the `$S` variable.</maml:para> <maml:para>`Invoke-Command` connects to the session saved in `$S`. The ScriptBlock uses `Start-Job` to start a remote job. The job runs a `Get-Process` command and uses the Name parameter to specify a friendly job name, MyJob .</maml:para> <maml:para>`Invoke-Command` uses the `$S` session and runs `Remove-Job`. The Name parameter specifies that the job named MyJob is deleted.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 7: Delete a job by using its InstanceId -------</maml:title> <dev:code>$job = Start-Job -ScriptBlock {Get-Process PowerShell} $job | Format-List -Property * Remove-Job -InstanceId ad02b942-8007-4407-87f3-d23e71955872 State : Completed HasMoreData : True StatusMessage : Location : localhost Command : Get-Process PowerShell JobStateInfo : Completed Finished : System.Threading.ManualResetEvent InstanceId : ad02b942-8007-4407-87f3-d23e71955872 Id : 3 Name : Job3 ChildJobs : {Job4} PSBeginTime : 7/26/2019 11:36:56 PSEndTime : 7/26/2019 11:36:57 PSJobTypeName : BackgroundJob Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} Information : {}</dev:code> <dev:remarks> <maml:para>`Start-Job` starts a background job and the job object is saved in the `$job` variable.</maml:para> <maml:para>The object in `$job` is sent down the pipeline to `Format-List`. The Property parameter uses an asterisk (`*`) to specify that all the object's properties are displayed in a list.</maml:para> <maml:para>`Remove-Job` uses the InstanceId parameter to specify the job to delete.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Job_Details</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Remove-Module</command:name> <command:verb>Remove</command:verb> <command:noun>Module</command:noun> <maml:description> <maml:para>Removes modules from the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Remove-Module cmdlet removes the members of a module, such as cmdlets and functions, from the current session.</maml:para> <maml:para>If the module includes an assembly (.dll), all members that are implemented by the assembly are removed, but the assembly is not unloaded.</maml:para> <maml:para>This cmdlet does not uninstall the module or delete it from the computer. It affects only the current PowerShell session.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Remove-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified names of modules to remove.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet removes read-only modules. By default, Remove-Module removes only read-write modules.</maml:para> <maml:para>The ReadOnly and ReadWrite values are stored in AccessMode property of a module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>ModuleInfo</maml:name> <maml:Description> <maml:para>Specifies the module objects to remove. Enter a variable that contains a module object ( PSModuleInfo ) or a command that gets a module object, such as a Get-Module command. You can also pipe module objects to Remove-Module .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet removes read-only modules. By default, Remove-Module removes only read-write modules.</maml:para> <maml:para>The ReadOnly and ReadWrite values are stored in AccessMode property of a module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-Module</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of modules to remove. Wildcard characters are permitted. You can also pipe name strings to Remove-Module .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet removes read-only modules. By default, Remove-Module removes only read-write modules.</maml:para> <maml:para>The ReadOnly and ReadWrite values are stored in AccessMode property of a module.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet removes read-only modules. By default, Remove-Module removes only read-write modules.</maml:para> <maml:para>The ReadOnly and ReadWrite values are stored in AccessMode property of a module.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>FullyQualifiedName</maml:name> <maml:Description> <maml:para>Specifies the fully qualified names of modules to remove.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>ModuleInfo</maml:name> <maml:Description> <maml:para>Specifies the module objects to remove. Enter a variable that contains a module object ( PSModuleInfo ) or a command that gets a module object, such as a Get-Module command. You can also pipe module objects to Remove-Module .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of modules to remove. Wildcard characters are permitted. You can also pipe name strings to Remove-Module .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String, System.Management.Automation.PSModuleInfo</maml:name> </dev:type> <maml:description> <maml:para>You can pipe module names and module objects to Remove-Module .</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------------ Example 1: Remove a module ------------------</maml:title> <dev:code>Remove-Module -Name "BitsTransfer"</dev:code> <dev:remarks> <maml:para>This command removes the BitsTransfer module from the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------------- Example 2: Remove all modules ----------------</maml:title> <dev:code>Get-Module | Remove-Module</dev:code> <dev:remarks> <maml:para>This command removes all modules from the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Remove modules by using the pipeline -------</maml:title> <dev:code>"FileTransfer", "PSDiagnostics" | Remove-Module -Verbose VERBOSE: Performing operation "Remove-Module" on Target "filetransfer (Path: 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\filetransfer\filetransfer.psd1')". VERBOSE: Performing operation "Remove-Module" on Target "Microsoft.BackgroundIntelligentTransfer.Management (Path: 'C:\Windows\assembly\GAC_MSIL\Microsoft.BackgroundIntelligentTransfer.Management\1.0.0.0__31bf3856ad364e35\Microsoft.BackgroundIntelligentTransfe r.Management.dll')". VERBOSE: Performing operation "Remove-Module" on Target "psdiagnostics (Path: 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\psdiagnostics\psdiagnostics.psd1')". VERBOSE: Removing imported function 'Start-Trace'. VERBOSE: Removing imported function 'Stop-Trace'. VERBOSE: Removing imported function 'Enable-WSManTrace'. VERBOSE: Removing imported function 'Disable-WSManTrace'. VERBOSE: Removing imported function 'Enable-PSWSManCombinedTrace'. VERBOSE: Removing imported function 'Disable-PSWSManCombinedTrace'. VERBOSE: Removing imported function 'Set-LogProperties'. VERBOSE: Removing imported function 'Get-LogProperties'. VERBOSE: Removing imported function 'Enable-PSTrace'. VERBOSE: Removing imported function 'Disable-PSTrace'. VERBOSE: Performing operation "Remove-Module" on Target "PSDiagnostics (Path: 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\psdiagnostics\PSDiagnostics.psm1')".</dev:code> <dev:remarks> <maml:para>This command removes the BitsTransfer and PSDiagnostics modules from the current session.</maml:para> <maml:para>The command uses a pipeline operator (|) to send the module names to Remove-Module . It uses the Verbose common parameter to get detailed information about the members that are removed.</maml:para> <maml:para>The Verbose messages show the items that are removed. The messages differ because the BitsTransfer module includes an assembly that implements its cmdlets and a nested module with its own assembly. The PSDiagnostics module includes a module script file (.psm1) that exports functions.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 4: Remove a module by using ModuleInfo --------</maml:title> <dev:code>$a = Get-Module BitsTransfer Remove-Module -ModuleInfo $a</dev:code> <dev:remarks> <maml:para>This command uses the ModuleInfo parameter to remove the BitsTransfer module.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-module?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Modules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Remove-PSSession</command:name> <command:verb>Remove</command:verb> <command:noun>PSSession</command:noun> <maml:description> <maml:para>Closes one or more PowerShell sessions (PSSessions).</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Remove-PSSession cmdlet closes PowerShell sessions ( PSSessions ) in the current session. It stops any commands that are running in the PSSessions , ends the PSSession , and releases the resources that the PSSession was using. If the PSSession is connected to a remote computer, this cmdlet also closes the connection between the local and remote computers.</maml:para> <maml:para>To remove a PSSession , enter the Name , ComputerName , ID , or InstanceID of the session.</maml:para> <maml:para>If you have saved the PSSession in a variable, the session object remains in the variable, but the state of the PSSession is Closed.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. This cmdlet closes the PSSessions that are connected to the specified computers. Wildcard characters are permitted.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more remote computers. To specify the local computer, type the computer name, localhost, or a dot (.).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet removes sessions for each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of sessions. This cmdlet closes the PSSessions with the specified IDs. Type one or more IDs, separated by commas, or use the range operator (..) to specify a range of IDs.</maml:para> <maml:para>An ID is an integer that uniquely identifies the PSSession in the current session. It is easier to remember and type than the InstanceId , but it is unique only in the current session. To find the ID of a PSSession , run the Get-PSSession cmdlet without parameters.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs. This cmdlet closes the PSSessions that have the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a PSSession in the current session. The instance ID is unique, even when you have multiple sessions running on a single computer.</maml:para> <maml:para>The instance ID is stored in the InstanceID property of the object that represents a PSSession . To find the InstanceID of the PSSessions in the current session, type `Get-PSSession | Format-Table Name, ComputerName, InstanceId`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of friendly names of sessions. This cmdlet closes the PSSessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>Because the friendly name of a PSSession might not be unique, when you use the Name parameter, consider also using the WhatIf or Confirm parameter in the Remove-PSSession command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies the session objects of the PSSessions to close. Enter a variable that contains the PSSessions or a command that creates or gets the PSSessions , such as a New-PSSession or Get-PSSession command. You can also pipe one or more session objects to Remove-PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Remove-PSSession</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the Get-VM cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="Cn"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Specifies an array of names of computers. This cmdlet closes the PSSessions that are connected to the specified computers. Wildcard characters are permitted.</maml:para> <maml:para>Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more remote computers. To specify the local computer, type the computer name, localhost, or a dot (.).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>ContainerId</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of containers. This cmdlet removes sessions for each of the specified containers. Use the `docker ps` command to get a list of container IDs. For more information, see the help for the docker ps (https://docs.docker.com/engine/reference/commandline/ps/)command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of sessions. This cmdlet closes the PSSessions with the specified IDs. Type one or more IDs, separated by commas, or use the range operator (..) to specify a range of IDs.</maml:para> <maml:para>An ID is an integer that uniquely identifies the PSSession in the current session. It is easier to remember and type than the InstanceId , but it is unique only in the current session. To find the ID of a PSSession , run the Get-PSSession cmdlet without parameters.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs. This cmdlet closes the PSSessions that have the specified instance IDs.</maml:para> <maml:para>The instance ID is a GUID that uniquely identifies a PSSession in the current session. The instance ID is unique, even when you have multiple sessions running on a single computer.</maml:para> <maml:para>The instance ID is stored in the InstanceID property of the object that represents a PSSession . To find the InstanceID of the PSSessions in the current session, type `Get-PSSession | Format-Table Name, ComputerName, InstanceId`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of friendly names of sessions. This cmdlet closes the PSSessions that have the specified friendly names. Wildcard characters are permitted.</maml:para> <maml:para>Because the friendly name of a PSSession might not be unique, when you use the Name parameter, consider also using the WhatIf or Confirm parameter in the Remove-PSSession command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Session</maml:name> <maml:Description> <maml:para>Specifies the session objects of the PSSessions to close. Enter a variable that contains the PSSessions or a command that creates or gets the PSSessions , such as a New-PSSession or Get-PSSession command. You can also pipe one or more session objects to Remove-PSSession .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSession[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="VMGuid"> <maml:name>VMId</maml:name> <maml:Description> <maml:para>Specifies an array of ID of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the following command:</maml:para> <maml:para>`Get-VM | Select-Object -Property Name, ID`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>VMName</maml:name> <maml:Description> <maml:para>Specifies an array of names of virtual machines. This cmdlet starts an interactive session with each of the specified virtual machines. To see the virtual machines that are available to you, use the Get-VM cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSession</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not return any objects.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>The Id parameter is mandatory. To delete all the PSSessions * in the current session, type `Get-PSSession | Remove-PSSession`. A PSSession uses a persistent connection to a remote computer. Create a PSSession * to run a series of commands that share data. For more information, type `Get-Help about_PSSessions`. PSSessions are specific to the current session. When you end a session, the PSSessions * that you created in that session are forcibly closed.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------- Example 1: Remove sessions by using IDs -----------</maml:title> <dev:code>Remove-PSSession -Id 1, 2</dev:code> <dev:remarks> <maml:para>This command removes the PSSessions that have IDs 1 and 2.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 2: Remove all the sessions in the current session --</maml:title> <dev:code>Get-PSSession | Remove-PSSession Remove-PSSession -Session (Get-PSSession) $s = Get-PSSession Remove-PSSession -Session $s</dev:code> <dev:remarks> <maml:para>These commands remove all of the PSSessions in the current session. Although the three command formats look different, they have the same effect.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 3: Close sessions by using names -----------</maml:title> <dev:code>$r = Get-PSSession -ComputerName Serv* $r | Remove-PSSession</dev:code> <dev:remarks> <maml:para>These commands close the PSSessions that are connected to computers that have names that begin with Serv.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 4: Close sessions connected to a port --------</maml:title> <dev:code>Get-PSSession | where {$_.port -eq 90} | Remove-PSSession</dev:code> <dev:remarks> <maml:para>This command closes the PSSessions that are connected to port 90. You can use this command format to identify PSSessions by properties other than ComputerName , Name , InstanceID , and ID .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 5: Close a session based on instance ID -------</maml:title> <dev:code>Get-PSSession | Format-Table ComputerName, InstanceID -AutoSize ComputerName InstanceId ------------ ---------------- Server01 875d231b-2788-4f36-9f67-2e50d63bb82a localhost c065ffa0-02c4-406e-84a3-dacb0d677868 Server02 4699cdbc-61d5-4e0d-b916-84f82ebede1f Server03 4e5a3245-4c63-43e4-88d0-a7798bfc2414 TX-TEST-01 fc4e9dfa-f246-452d-9fa3-1adbdd64ae85 PS C:\> Remove-PSSession -InstanceID fc4e9dfa-f246-452d-9fa3-1adbdd64ae85</dev:code> <dev:remarks> <maml:para>These commands show how to close a PSSession based on its instance ID, or RemoteRunspaceID .</maml:para> <maml:para>The first command uses the Get-PSSession cmdlet to get the PSSessions in the current session. It uses a pipeline operator (|) to send the PSSessions to the Format-Table cmdlet, which formats their ComputerName and InstanceID properties in a table. The AutoSize parameter compresses the columns for display.</maml:para> <maml:para>From the resulting display, you can identify the PSSession to be closed, and copy and paste the InstanceID of that PSSession into the second command.</maml:para> <maml:para>The second command uses the Remove-PSSession cmdlet to remove the PSSession with the specified instance ID.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: Create a function that deletes all sessions in the current session</maml:title> <dev:code>Function EndPSS { Get-PSSession | Remove-PSSession }</dev:code> <dev:remarks> <maml:para>This function deletes all of the PSSessions in the current session. After you add this function to your PowerShell profile, to delete all sessions, type `EndPSS`.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Connect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disconnect-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enter-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Exit-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-PSSession</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_PSSessions</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Remove-PSSnapin</command:name> <command:verb>Remove</command:verb> <command:noun>PSSnapin</command:noun> <maml:description> <maml:para>Removes Windows PowerShell snap-ins from the current session.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Remove-PSSnapin cmdlet removes a Windows PowerShell snap-in from the current session. You can use it to remove snap-ins that you have added to Windows PowerShell You cannot use this cmdlet to remove the snap-ins that are installed with Windows PowerShell.</maml:para> <maml:para>After you remove a snap-in from the current session, the snap-in is still loaded, but the cmdlets and providers in the snap-in are no longer available in the session.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Remove-PSSnapin</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of Windows PowerShell snap-ins to remove from the current session. Wildcard characters (*) are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object that represents the snap-in. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of Windows PowerShell snap-ins to remove from the current session. Wildcard characters (*) are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object that represents the snap-in. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSSnapInInfo</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a snap-in object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None, System.Management.Automation.PSSnapInInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet generates a System.Management.Automation.PSSnapInInfo object that represents the snap-in, if you specify the PassThru parameter. By default, Remove-PSSnapin does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para> Remove-PSSnapin * does not check the version of Windows PowerShell before removing a snap-in from the session. If a snap-in cannot be removed, a warning appears and the command fails. Remove-PSSnapin * affects only the current session. If you have added an Add-PSSnapin command to your Windows PowerShell profile, you should delete the command to remove the snap-in from future sessions. For instructions, type `Get-Help about_Profiles`.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------------- Example 1: Remove a snap-in -----------------</maml:title> <dev:code>PS C:\> remove-pssnapin -Name Microsoft.Exchange</dev:code> <dev:remarks> <maml:para>This command removes the Microsoft.Exchange snap-in from the current session. When the command is complete, the cmdlets and providers that the snap-in supported are not available in the session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 2: Remove snap-ins by using names with the pipeline -</maml:title> <dev:code>PS C:\> Get-PSSnapIn smp* | Remove-PSSnapIn</dev:code> <dev:remarks> <maml:para>This command removes the Windows PowerShell snap-ins that have names that start with smp from the current session.</maml:para> <maml:para>The command uses the Get-PSSnapin cmdlet to get objects that represent the snap-ins. The pipeline operator (|) sends the results to the Remove-PSSnapin cmdlet, which removes them from the session. The providers and cmdlets that this snap-in supports are no longer available in the session.</maml:para> <maml:para>When you pipe objects to Remove-PSSnapin , the names of the objects are associated with the Name parameter, which accepts objects from the pipeline that have a Name property.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 3: Remove snap-ins by using names ----------</maml:title> <dev:code>PS C:\> Remove-PSSnapin -Name *event*</dev:code> <dev:remarks> <maml:para>This command removes all Windows PowerShell snap-ins that have names that include event.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-pssnapin?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Add-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSnapin</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Resume-Job</command:name> <command:verb>Resume</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Restarts a suspended job.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Resume-Job cmdlet resumes a workflow job that was suspended, such as by using the Suspend-Job cmdlet or the about_Suspend-Workflow activity. When a workflow job resumes, the job engine reconstructs the state, metadata, and output from saved resources, such as checkpoints. The job is restarted without any loss of state or data. The job state is changed from Suspended to Running .</maml:para> <maml:para>Use the parameters of Resume-Job to select jobs by name, ID, instance ID or pipe a job object, such as one returned by the Get-Job cmdlet, to Resume-Job . You can also use a property filter to select a job to be resumed.</maml:para> <maml:para>By default, Resume-Job returns immediately, even though all jobs might not yet be resumed. To suppress the command prompt until all specified jobs are resumed, use the Wait parameter.</maml:para> <maml:para>The Resume-Job cmdlet works only on custom job types, such as workflow jobs. It does not work on standard background jobs, such as those that are started by using the Start-Job cmdlet. If you submit a job of an unsupported type, Resume-Job generates a terminating error and stops running.</maml:para> <maml:para>To identify a workflow job, look for a value of PSWorkflowJob in the PSJobTypeName property of the job. To determine whether a particular custom job type supports the Resume-Job cmdlet, see the help topics for the custom job type.</maml:para> <maml:para>Before using a Job cmdlet on a custom job type, import the module that supports the custom job type, either by using the Import-Module cmdlet or getting or using a cmdlet in the module.</maml:para> <maml:para>This cmdlet was introduced in Windows PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Resume-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet resumes jobs that satisfy all of the conditions in the hash table. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Resume-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs for jobs that this cmdlet resumes.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and to type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, run Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Resume-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of jobs that this cmdlet resumes. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, run Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Resume-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs to be resumed. Enter a variable that contains the jobs or a command that gets the jobs. You can also pipe jobs to the Resume-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Resume-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of friendly names of jobs that this cmdlet resumes. Enter one or more job names. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Resume-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies the state of jobs to resume. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>This cmdlet resumes only jobs in the Suspended state.</maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet resumes jobs that satisfy all of the conditions in the hash table. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs for jobs that this cmdlet resumes.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and to type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, run Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of jobs that this cmdlet resumes. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, run Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs to be resumed. Enter a variable that contains the jobs or a command that gets the jobs. You can also pipe jobs to the Resume-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies an array of friendly names of jobs that this cmdlet resumes. Enter one or more job names. Wildcard characters are permitted.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies the state of jobs to resume. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>This cmdlet resumes only jobs in the Suspended state.</maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until all job results are restarted. By default, this cmdlet immediately returns the available results.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> </dev:type> <maml:description> <maml:para>You can pipe all types of jobs to this cmdlet. If Resume-Job gets a job of an unsupported type, it returns a terminating error.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None, System.Management.Automation.Job</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns the jobs that it tries to resume, if you use the PassThru parameter. Otherwise, this cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para> Resume-Job can only resume jobs that are suspended. If you submit a job in a different state, Resume-Job runs the resume operation on the job, but generates a warning to notify you that the job could not be resumed. To suppress the warning, use the WarningAction* common parameter with a value of SilentlyContinue. If a job is not of a type that supports resuming, such as a workflow job ( PSWorkflowJob ), Resume-Job * returns a terminating error.</maml:para> <maml:para>* The mechanism and location for saving a suspended job might vary depending on the job type. For example, suspended workflow jobs are saved in a flat file store by default, but can also be saved in a SQL database. When you resume a job, the job state changes from Suspended to Running . To find the jobs that are running, including those that were resumed by this cmdlet, use the State parameter of the Get-Job cmdlet to get jobs in the Running * state.</maml:para> <maml:para>* Some job types have options or properties that prevent Windows PowerShell from suspending the job. If attempts to suspend the job fail, verify that the job options and properties allow for suspending.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------------- Example 1: Resume a job by ID ----------------</maml:title> <dev:code>The first command uses the **Get-Job** cmdlet to get the job. The output shows that the job is a suspended workflow job. PS C:\> Get-Job EventJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 4 EventJob PSWorkflowJob Suspended True Server01 \\Script\Share\Event.ps1 The second command uses the *Id* parameter of the **Resume-Job** cmdlet to resume the job with an *Id* value of 4. PS C:\> Resume-Job -Id 4</dev:code> <dev:remarks> <maml:para>The commands in this example verify that the job is a suspended workflow job and then resume the job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------- Example 2: Resume a job by name ---------------</maml:title> <dev:code>PS C:\> Resume-Job -Name WorkflowJob, InventoryWorkflow, WFTest*</dev:code> <dev:remarks> <maml:para>This command uses the Name parameter to resume several workflow jobs on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------ Example 3: Use custom property values ------------</maml:title> <dev:code>PS C:\> Resume-Job -Filter @{CustomID="T091291"} -State Suspended</dev:code> <dev:remarks> <maml:para>This command uses the value of a custom property to identify the workflow job to resume. It uses the Filter parameter to identify the workflow job by its CustomID property. It also uses the State parameter to verify that the workflow job is suspended, before it tries to resume it.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 4: Resume all suspended jobs on a remote computer --</maml:title> <dev:code>PS C:\> Invoke-Command -ComputerName Srv01 -ScriptBlock {Get-Job -State Suspended | Resume-Job}</dev:code> <dev:remarks> <maml:para>This command resumes all suspended jobs on the Srv01 remote computer.</maml:para> <maml:para>The command uses the Invoke-Command cmdlet to run a command on the Srv01 computer. The remote command uses the State parameter of the Get-Job cmdlet to get all suspended jobs on the computer. A pipeline operator (|) sends the suspended jobs to the Resume-Job cmdlet, which resumes them.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 5: Wait for jobs to resume --------------</maml:title> <dev:code>PS C:\> Resume-Job -Name WorkflowJob, InventoryWorkflow, WFTest* -Wait</dev:code> <dev:remarks> <maml:para>This command uses the Wait parameter to direct Resume-Job to return only after all specified jobs are resumed. The Wait parameter is especially useful in scripts that assume that jobs are resumed before the script continues.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 6: Resume a workflow that suspends itself ------</maml:title> <dev:code>This code sample shows the **Suspend-Workflow** activity in a workflow. #SampleWorkflow Workflow Test-Suspend { $a = Get-Date Suspend-Workflow (Get-Date)- $a } The following command runs the Test-Suspend workflow on the Server01 computer.When you run the workflow, the workflow runs the Get-Date activity and stores the result in the $a variable. Then it runs the Suspend-Workflow activity. In response, it takes a checkpoint, suspends the workflow, and returns a workflow job object. Suspend-Workflow returns a workflow job object even if the workflow is not explicitly run as a job. PS C:\> Test-Suspend -PSComputerName Server01 Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 8 Job8 PSWorkflowJob Suspended True Server01 Test-Suspend The following command resumes the Test-Suspend workflow in Job8. It uses the *Wait* parameter to hold the command prompt until the job is resumed. PS C:\> Resume-Job -Name "Job8" -Wait Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 8 Job8 PSWorkflowJob Running True Server01 Test-Suspend This command uses the **Receive-Job** cmdlet to get the results of the Test-Suspend workflow. The final command in the workflow returns a **TimeSpan** object that represents the elapsed time between the current date and time and the date and time that was saved in the $a variable before the workflow was suspended. PS C:\> Receive-Job -Name Job8 Days : 0 Hours : 0 Minutes : 0 Seconds : 19 Milliseconds : 823 Ticks : 198230041 TotalDays : 0.000229432917824074 TotalHours : 0.00550639002777778 TotalMinutes : 0.330383401666667 TotalSeconds : 19.8230041 TotalMilliseconds : 19823.0041 PSComputerName : Server01</dev:code> <dev:remarks> <maml:para>The Resume-Job cmdlet lets you resume a workflow job that was suspend by using the Suspend-Workflow activity. This activity suspends a workflow from within a workflow. It is valid only in workflows.</maml:para> <maml:para>For information about the Suspend-Workflow, see about_Suspend-Workflow.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/resume-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Save-Help</command:name> <command:verb>Save</command:verb> <command:noun>Help</command:noun> <maml:description> <maml:para>Downloads and saves the newest help files to a file system directory.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Save-Help cmdlet downloads the newest help files for PowerShell modules and saves them to a directory that you specify. This feature lets you update the help files on computers that do not have access to the Internet, and makes it easier to update the help files on multiple computers.</maml:para> <maml:para>In Windows PowerShell 3.0, Save-Help worked only for modules that are installed on the local computer. Although it was possible to import a module from a remote computer, or obtain a reference to a PSModuleInfo object from a remote computer by using PowerShell remoting, the HelpInfoUri property was not preserved, and Save-Help would not work for remote module Help.</maml:para> <maml:para>In Windows PowerShell 4.0, the HelpInfoUri property is preserved over PowerShell remoting, which enables Save-Help to work for modules that are installed on remote computers. It is also possible to save a PSModuleInfo object to disk or removable media by running Export-Clixml on a computer that does not have Internet access, import the object on a computer that does have Internet access, and then run Save-Help on the PSModuleInfo object. The saved help can be transported to the remote computer by using removable storage media, such as a USB drive. The help can be installed on the remote computer by running Update-Help . This process can be used to install help on computers that do not have any kind of network access.</maml:para> <maml:para>To install saved help files, run the Update-Help cmdlet. Add its SourcePath parameter to specify the folder in which you saved the Help files.</maml:para> <maml:para>Without parameters, a Save-Help command downloads the newest help for all modules in the session and for modules that are installed on the computer in a location listed in the PSModulePath environment variable. This action skips modules that do not support Updatable Help without warning.</maml:para> <maml:para>The Save-Help cmdlet checks the version of any help files in the destination folder. If newer help files are available, this cmdlet downloads the newest help files from the Internet, and then saves them in the folder. The Save-Help cmdlet works just like the Update-Help cmdlet, except that it saves the downloaded cabinet (.cab) files, instead of extracting the help files from the cabinet files and installing them on the computer.</maml:para> <maml:para>The saved help for each module consists of one help information (HelpInfo XML) file and one cabinet (.cab) file for the help files each UI culture. You do not have to extract the help files from the cabinet file. The Update-Help cmdlet extracts the help files, validates the XML for safety, and then installs the help files and the help information file in a language-specific subfolder of the module folder.</maml:para> <maml:para>To save the help files for modules in the PowerShell installation folder ($pshome\Modules), start PowerShell by using the Run as administrator option. You must be a member of the Administrators group on the computer to download the help files for these modules.</maml:para> <maml:para>This cmdlet was introduced in Windows PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Save-Help</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>DestinationPath</maml:name> <maml:Description> <maml:para>Specifies the path of the folder in which the help files are saved. Do not specify a file name or file name extension.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="Name"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Specifies modules for which this cmdlet downloads help. Enter one or more module names or name patters in a comma-separated list or in a file that has one module name on each line. Wildcard characters are permitted. You can also pipe module objects from the Get-Module cmdlet to Save-Help .</maml:para> <maml:para>By default, Save-Help downloads help for all modules that support Updatable Help and are installed on the local computer in a location listed in the PSModulePath environment variable.</maml:para> <maml:para>To save help for modules that are not installed on the computer, run a Get-Module command on a remote computer. Then pipe the resulting module objects to the Save-Help cmdlet or submit the module objects as the value of the Module or InputObject parameters.</maml:para> <maml:para>If the module that you specify is installed on the computer, you can enter the module name or a module object. If the module is not installed on the computer, you must enter a module object, such as one returned by the Get-Module cmdlet.</maml:para> <maml:para>The Module parameter of the Save-Help cmdlet does not accept the full path of a module file or module manifest file. To save help for a module that is not in a PSModulePath location, import the module into the current session before you run the Save-Help command.</maml:para> <maml:para>A value of "*" (all) attempts to update help for all modules that are installed on the computer. This includes modules that do not support Updatable Help. This value might generate errors when the command encounters modules that do not support Updatable Help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies UI culture values for which this cmdlet gets updated help files. Enter one or more language codes, such as es-ES, a variable that contains culture objects, or a command that gets culture objects, such as a Get-Culture or Get-UICulture command.</maml:para> <maml:para>Wildcard characters are not permitted. Do not specify a partial language code, such as "de".</maml:para> <maml:para>By default, Save-Help gets help files in the UI culture set for Windows or its fallback culture. If you specify the UICulture parameter, Save-Help looks for help only for the specified UI culture, not in any fallback culture.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo[]</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current UI culture</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command by using credentials of a user who has permission to access the file system location specified by the DestinationPath parameter. This parameter is valid only when the DestinationPath or LiteralPath parameter is used in the command.</maml:para> <maml:para>This parameter enables you to run `Save-Help` commands that use the DestinationPath parameter on remote computers. By providing explicit credentials, you can run the command on a remote computer and access a file share on a third computer without encountering an access denied error or using CredSSP authentication to delegate credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not follow the once-per-day limitation, skips version checking, and downloads files that exceed the 1 GB limit.</maml:para> <maml:para>Without this parameter, only one Save-Help command for each module is permitted in each 24-hour period, downloads are limited to 1 GB of uncompressed content per module, and help files for a module are installed only when they are newer than the files on the computer.</maml:para> <maml:para>The once-per-day limit protects the servers that host the help files, and makes it practical for you to add a Save-Help command to your PowerShell profile.</maml:para> <maml:para>To save help for a module in multiple UI cultures without the Force parameter, include all UI cultures in the same command, such as: `Save-Help -Module PSScheduledJobs -UICulture en-US, fr-FR, pt-BR`</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects. This is described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedModule parameter accepts a module name that is specified in the format @{ModuleName = "modulename"; ModuleVersion = "version_number"} or @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseDefaultCredentials</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command, including the web download, with the credentials of the current user. By default, the command runs without explicit credentials.</maml:para> <maml:para>This parameter is effective only when the web download uses NTLM, negotiate, or Kerberos-based authentication.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Save-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="Name"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Specifies modules for which this cmdlet downloads help. Enter one or more module names or name patters in a comma-separated list or in a file that has one module name on each line. Wildcard characters are permitted. You can also pipe module objects from the Get-Module cmdlet to Save-Help .</maml:para> <maml:para>By default, Save-Help downloads help for all modules that support Updatable Help and are installed on the local computer in a location listed in the PSModulePath environment variable.</maml:para> <maml:para>To save help for modules that are not installed on the computer, run a Get-Module command on a remote computer. Then pipe the resulting module objects to the Save-Help cmdlet or submit the module objects as the value of the Module or InputObject parameters.</maml:para> <maml:para>If the module that you specify is installed on the computer, you can enter the module name or a module object. If the module is not installed on the computer, you must enter a module object, such as one returned by the Get-Module cmdlet.</maml:para> <maml:para>The Module parameter of the Save-Help cmdlet does not accept the full path of a module file or module manifest file. To save help for a module that is not in a PSModulePath location, import the module into the current session before you run the Save-Help command.</maml:para> <maml:para>A value of "*" (all) attempts to update help for all modules that are installed on the computer. This includes modules that do not support Updatable Help. This value might generate errors when the command encounters modules that do not support Updatable Help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies UI culture values for which this cmdlet gets updated help files. Enter one or more language codes, such as es-ES, a variable that contains culture objects, or a command that gets culture objects, such as a Get-Culture or Get-UICulture command.</maml:para> <maml:para>Wildcard characters are not permitted. Do not specify a partial language code, such as "de".</maml:para> <maml:para>By default, Save-Help gets help files in the UI culture set for Windows or its fallback culture. If you specify the UICulture parameter, Save-Help looks for help only for the specified UI culture, not in any fallback culture.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo[]</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current UI culture</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command by using credentials of a user who has permission to access the file system location specified by the DestinationPath parameter. This parameter is valid only when the DestinationPath or LiteralPath parameter is used in the command.</maml:para> <maml:para>This parameter enables you to run `Save-Help` commands that use the DestinationPath parameter on remote computers. By providing explicit credentials, you can run the command on a remote computer and access a file share on a third computer without encountering an access denied error or using CredSSP authentication to delegate credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not follow the once-per-day limitation, skips version checking, and downloads files that exceed the 1 GB limit.</maml:para> <maml:para>Without this parameter, only one Save-Help command for each module is permitted in each 24-hour period, downloads are limited to 1 GB of uncompressed content per module, and help files for a module are installed only when they are newer than the files on the computer.</maml:para> <maml:para>The once-per-day limit protects the servers that host the help files, and makes it practical for you to add a Save-Help command to your PowerShell profile.</maml:para> <maml:para>To save help for a module in multiple UI cultures without the Force parameter, include all UI cultures in the same command, such as: `Save-Help -Module PSScheduledJobs -UICulture en-US, fr-FR, pt-BR`</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects. This is described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedModule parameter accepts a module name that is specified in the format @{ModuleName = "modulename"; ModuleVersion = "version_number"} or @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:Description> <maml:para>Specifies a path of the destination folder. Unlike the value of the DestinationPath parameter, the value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseDefaultCredentials</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command, including the web download, with the credentials of the current user. By default, the command runs without explicit credentials.</maml:para> <maml:para>This parameter is effective only when the web download uses NTLM, negotiate, or Kerberos-based authentication.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user credential. This cmdlet runs the command by using credentials of a user who has permission to access the file system location specified by the DestinationPath parameter. This parameter is valid only when the DestinationPath or LiteralPath parameter is used in the command.</maml:para> <maml:para>This parameter enables you to run `Save-Help` commands that use the DestinationPath parameter on remote computers. By providing explicit credentials, you can run the command on a remote computer and access a file share on a third computer without encountering an access denied error or using CredSSP authentication to delegate credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>DestinationPath</maml:name> <maml:Description> <maml:para>Specifies the path of the folder in which the help files are saved. Do not specify a file name or file name extension.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not follow the once-per-day limitation, skips version checking, and downloads files that exceed the 1 GB limit.</maml:para> <maml:para>Without this parameter, only one Save-Help command for each module is permitted in each 24-hour period, downloads are limited to 1 GB of uncompressed content per module, and help files for a module are installed only when they are newer than the files on the computer.</maml:para> <maml:para>The once-per-day limit protects the servers that host the help files, and makes it practical for you to add a Save-Help command to your PowerShell profile.</maml:para> <maml:para>To save help for a module in multiple UI cultures without the Force parameter, include all UI cultures in the same command, such as: `Save-Help -Module PSScheduledJobs -UICulture en-US, fr-FR, pt-BR`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects. This is described in the Remarks section of ModuleSpecification Constructor (Hashtable) (https://msdn.microsoft.com/library/jj136290)in the MSDN library. For example, the FullyQualifiedModule parameter accepts a module name that is specified in the format @{ModuleName = "modulename"; ModuleVersion = "version_number"} or @{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You cannot specify the FullyQualifiedModule parameter in the same command as a Module parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:Description> <maml:para>Specifies a path of the destination folder. Unlike the value of the DestinationPath parameter, the value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="Name"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Specifies modules for which this cmdlet downloads help. Enter one or more module names or name patters in a comma-separated list or in a file that has one module name on each line. Wildcard characters are permitted. You can also pipe module objects from the Get-Module cmdlet to Save-Help .</maml:para> <maml:para>By default, Save-Help downloads help for all modules that support Updatable Help and are installed on the local computer in a location listed in the PSModulePath environment variable.</maml:para> <maml:para>To save help for modules that are not installed on the computer, run a Get-Module command on a remote computer. Then pipe the resulting module objects to the Save-Help cmdlet or submit the module objects as the value of the Module or InputObject parameters.</maml:para> <maml:para>If the module that you specify is installed on the computer, you can enter the module name or a module object. If the module is not installed on the computer, you must enter a module object, such as one returned by the Get-Module cmdlet.</maml:para> <maml:para>The Module parameter of the Save-Help cmdlet does not accept the full path of a module file or module manifest file. To save help for a module that is not in a PSModulePath location, import the module into the current session before you run the Save-Help command.</maml:para> <maml:para>A value of "*" (all) attempts to update help for all modules that are installed on the computer. This includes modules that do not support Updatable Help. This value might generate errors when the command encounters modules that do not support Updatable Help.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSModuleInfo[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies UI culture values for which this cmdlet gets updated help files. Enter one or more language codes, such as es-ES, a variable that contains culture objects, or a command that gets culture objects, such as a Get-Culture or Get-UICulture command.</maml:para> <maml:para>Wildcard characters are not permitted. Do not specify a partial language code, such as "de".</maml:para> <maml:para>By default, Save-Help gets help files in the UI culture set for Windows or its fallback culture. If you specify the UICulture parameter, Save-Help looks for help only for the specified UI culture, not in any fallback culture.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo[]</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current UI culture</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseDefaultCredentials</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet runs the command, including the web download, with the credentials of the current user. By default, the command runs without explicit credentials.</maml:para> <maml:para>This parameter is effective only when the web download uses NTLM, negotiate, or Kerberos-based authentication.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a module object from the Get-Module cmdlet to the Module parameter of Save-Help .</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>* To save help for modules in the $pshome\Modules folder, start PowerShell by using the Run as administrator option. Only members of the Administrators group on the computer can download help for modules in the $pshome\Modules folder.</maml:para> <maml:para>* The saved help for each module consists of one help information (HelpInfo XML) file and one cabinet (.cab) file for the help files each UI culture. You do not have to extract the help files from the cabinet file. The Update-Help cmdlet extracts the help files, validates the XML, and then installs the help files and the help information file in a language-specific subfolder of the module folder. The Save-Help cmdlet can save help for modules that are not installed on the computer. However, because help files are installed in the module folder, the Update-Help * cmdlet can install updated help file only for modules that are installed on the computer. If Save-Help cannot find updated help files for a module, or cannot find updated help files in the specified language, it continues silently without displaying an error message. To see which files were saved by the command, specify the Verbose* parameter. Modules are the smallest unit of updatable help. You cannot save help for a particular cmdlet, only for all cmdlets in module. To find the module that contains a particular cmdlet, use the ModuleName * property together with the Get-Command cmdlet, for example, `(Get-Command <cmdlet-name>).ModuleName` Save-Help * supports all modules and the PowerShell Core snap-ins. It does not support any other snap-ins. The Update-Help and Save-Help * cmdlets use the following ports to download help files: Port 80 for HTTP and port 443 for HTTPS. The Update-Help and Save-Help * cmdlets are not supported on Windows Preinstallation Environment (Windows PE).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------ Example 1: Save the help for the DhcpServer module ------</maml:title> <dev:code># Option 1: Run Invoke-Command to get the PSModuleInfo object for the remote DHCP Server module, save the PSModuleInfo object in the variable $m, and then run Save-Help. $m = Invoke-Command -ComputerName RemoteServer -ScriptBlock { Get-Module -Name DhcpServer -ListAvailable } Save-Help -Module $m -DestinationPath "C:\SavedHelp" # Option 2: Open a PSSession--targeted at the remote computer that is running the DhcpServer module--to get the PSModuleInfo object for the remote module, and then run Save-Help. $s = New-PSSession -ComputerName "RemoteServer" $m = Get-Module -PSSession $s -Name "DhcpServer" -ListAvailable Save-Help -Module $m -DestinationPath "C:\SavedHelp" # Option 3: Open a CIM session--targeted at the remote computer that is running the DhcpServer module--to get the PSModuleInfo object for the remote module, and then run Save-Help. $c = New-CimSession -ComputerName "RemoteServer" $m = Get-Module -CimSession $c -Name "DhcpServer" -ListAvailable Save-Help -Module $m -DestinationPath "C:\SavedHelp"</dev:code> <dev:remarks> <maml:para>This example shows three different ways to use Save-Help to save the help for the DhcpServer module from an Internet-connected client computer, without installing the DhcpServer module or the DHCP Server role on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 2: Install help for the DhcpServer module ------</maml:title> <dev:code># First, run Export-CliXml to export the PSModuleInfo object to a shared folder or to removable media. $m = Get-Module -Name "DhcpServer" -ListAvailable Export-CliXml -Path "E:\UsbFlashDrive\DhcpModule.xml" -InputObject $m # Next, transport the removable media to a computer that has Internet access, and then import the PSModuleInfo object with Import-CliXml. Run Save-Help to save the Help for the imported DhcpServer module PSModuleInfo object. $deserialized_m = Import-CliXml "E:\UsbFlashDrive\DhcpModule.xml" Save-Help -Module $deserialized_m -DestinationPath "E:\UsbFlashDrive\SavedHelp" # Finally, transport the removable media back to the computer that does not have network access, and then install the help by running Update-Help. Update-Help -Module DhcpServer -SourcePath "E:\UsbFlashDrive\SavedHelp"</dev:code> <dev:remarks> <maml:para>This example shows how to install help that you saved in Example 1 for the DhcpServer module on a computer that does not have Internet access.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 3: Save help for all modules -------------</maml:title> <dev:code>Save-Help -DestinationPath "\\Server01\FileShare01"</dev:code> <dev:remarks> <maml:para>This command downloads the newest help files for all modules in the UI culture set for Windows on the local computer. It saves the help files in the \\Server01\Fileshare01 folder.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 4: Save help for a module on the computer ------</maml:title> <dev:code>Save-Help -Module ServerManager -DestinationPath "\\Server01\FileShare01" -Credential Domain01/Admin01</dev:code> <dev:remarks> <maml:para>This command downloads the newest help files for the ServerManager module, and then saves them in the \\Server01\Fileshare01 folder.</maml:para> <maml:para>When a module is installed on the computer, you can type the module name as the value of the Module parameter, even if the module is not imported into the current session.</maml:para> <maml:para>The command uses the Credential parameter to supply the credentials of a user who has permission to write to the file share.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 5: Save help for a module on a different computer --</maml:title> <dev:code>Invoke-Command -ComputerName Server02 {Get-Module -Name CustomSQL -ListAvailable} | Save-Help -DestinationPath \\Server01\FileShare01 -Credential Domain01\Admin01</dev:code> <dev:remarks> <maml:para>These commands download the newest help files for the CustomSQL module and save them in the \\Server01\Fileshare01 folder.</maml:para> <maml:para>Because the CustomSQL module is not installed on the computer, the sequence includes an Invoke-Command command that gets the module object for the CustomSQL module from the Server02 computer and then pipes the module object to the Save-Help cmdlet.</maml:para> <maml:para>When a module is not installed on the computer, Save-Help needs the module object, which includes information about the location of the newest help files.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 6: Save help for a module in multiple languages ---</maml:title> <dev:code>Save-Help -Module Microsoft.PowerShell* -UICulture de-DE, en-US, fr-FR, ja-JP -DestinationPath "D:\Help"</dev:code> <dev:remarks> <maml:para>This command saves help for the PowerShell Core modules in four different UI cultures. The language packs for these locales do not have to be installed on the computer. Save-Help can download help files for modules in different UI cultures only when the module owner makes the translated files available on the Internet.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 7: Save help more than one time each day -------</maml:title> <dev:code>Save-Help -Force -DestinationPath "\\Server3\AdminShare\Help"</dev:code> <dev:remarks> <maml:para>This command saves help for all modules that are installed on the computer. The command specifies the Force parameter to override the rule that prevents the Save-Help cmdlet from downloading help more than once in each 24-hour period.</maml:para> <maml:para>The Force parameter also overrides the 1 GB restriction and circumvents version checking. Therefore, you can download files even if the version is not later than the version in the destination folder.</maml:para> <maml:para>The command uses the Save-Help cmdlet to download and save the help files to the specified folder. The Force parameter is required when you have to run a Save-Help command more than one time each day.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/save-help?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Update-Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Set-PSDebug</command:name> <command:verb>Set</command:verb> <command:noun>PSDebug</command:noun> <maml:description> <maml:para>Turns script debugging features on and off, sets the trace level, and toggles strict mode.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Set-PSDebug` cmdlet turns script debugging features on and off, sets the trace level, and toggles strict mode. By default, the PowerShell debug features are off.</maml:para> <maml:para>When the Trace parameter has a value of `1`, each line of script is traced as it runs. When the parameter has a value of `2`, variable assignments, function calls, and script calls are also traced. If the Step parameter is specified, you're prompted before each line of the script runs.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Set-PSDebug</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Off</maml:name> <maml:Description> <maml:para>Turns off all script debugging features.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Set-PSDebug</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Step</maml:name> <maml:Description> <maml:para>Turns on script stepping. Before each line runs, PowerShell prompts you to stop, continue, or enter a new interpreter level to inspect the state of the script.</maml:para> <maml:para>Specifying the Step parameter automatically sets a trace level of `1`.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Strict</maml:name> <maml:Description> <maml:para>Specifies that variables must be assigned a value before being referenced in a script. If a variable is referenced before a value is assigned, PowerShell returns an exception error. This is equivalent to `Set-StrictMode -Version 1`. For more information, see Set-StrictMode (Set-StrictMode.md).</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Trace</maml:name> <maml:Description> <maml:para>Specifies the trace level for each line in a script. Each line is traced as it's run.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- 0: Turn script tracing off.</maml:para> <maml:para>- 1: Trace script lines as they run.</maml:para> <maml:para>- 2: Trace script lines, variable assignments, function calls, and scripts.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Off</maml:name> <maml:Description> <maml:para>Turns off all script debugging features.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Step</maml:name> <maml:Description> <maml:para>Turns on script stepping. Before each line runs, PowerShell prompts you to stop, continue, or enter a new interpreter level to inspect the state of the script.</maml:para> <maml:para>Specifying the Step parameter automatically sets a trace level of `1`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Strict</maml:name> <maml:Description> <maml:para>Specifies that variables must be assigned a value before being referenced in a script. If a variable is referenced before a value is assigned, PowerShell returns an exception error. This is equivalent to `Set-StrictMode -Version 1`. For more information, see Set-StrictMode (Set-StrictMode.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Trace</maml:name> <maml:Description> <maml:para>Specifies the trace level for each line in a script. Each line is traced as it's run.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- 0: Turn script tracing off.</maml:para> <maml:para>- 1: Trace script lines as they run.</maml:para> <maml:para>- 2: Trace script lines, variable assignments, function calls, and scripts.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You can't pipeline input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet doesn't return any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------------- Example 1: Set the trace level ----------------</maml:title> <dev:code>Set-PSDebug -Trace 2; foreach ($i in 1..3) {$i} DEBUG: 1+ Set-PSDebug -Trace 2; foreach ($i in >>>> 1..3) {$i} DEBUG: ! SET $foreach = 'IEnumerator'. DEBUG: 1+ Set-PSDebug -Trace 2; foreach ( >>>> $i in 1..3) {$i} DEBUG: ! SET $i = '1'. DEBUG: 1+ Set-PSDebug -Trace 2; foreach ($i in 1..3) { >>>> $i} 1 DEBUG: 1+ Set-PSDebug -Trace 2; foreach ( >>>> $i in 1..3) {$i} DEBUG: ! SET $i = '2'. DEBUG: 1+ Set-PSDebug -Trace 2; foreach ($i in 1..3) { >>>> $i} 2 DEBUG: 1+ Set-PSDebug -Trace 2; foreach ( >>>> $i in 1..3) {$i} DEBUG: ! SET $i = '3'. DEBUG: 1+ Set-PSDebug -Trace 2; foreach ($i in 1..3) { >>>> $i} 3 DEBUG: 1+ Set-PSDebug -Trace 2; foreach ( >>>> $i in 1..3) {$i} DEBUG: ! SET $foreach = ''.</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------------- Example 2: Turn on stepping -----------------</maml:title> <dev:code>Set-PSDebug -Step; foreach ($i in 1..3) {$i} Continue with this operation? 1+ Set-PSDebug -Step; foreach ($i in >>>> 1..3) {$i} [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A DEBUG: 1+ Set-PSDebug -Step; foreach ($i in >>>> 1..3) {$i} 1 2 3</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------------ Example 3: Use strict mode ------------------</maml:title> <dev:code>Set-PSDebug -Strict; $NewVar The variable '$NewVar' cannot be retrieved because it has not been set. At line:1 char:22 + Set-PSDebug -Strict; $NewVar</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 4: Turn off debug features --------------</maml:title> <dev:code>Set-PSDebug -Off; foreach ($i in 1..3) {$i} 1 2 3</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/set-psdebug?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Debuggers</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Debug-Process</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSBreakpoint</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-StrictMode</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Write-Debug</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Set-PSSessionConfiguration</command:name> <command:verb>Set</command:verb> <command:noun>PSSessionConfiguration</command:noun> <maml:description> <maml:para>Changes the properties of a registered session configuration.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Set-PSSessionConfiguration` cmdlet changes the properties of the session configurations on the local computer.</maml:para> <maml:para>Use the Name parameter to identify the session configuration that you want to change. Use the other parameters to specify new values for the properties of the session configuration. To delete a property value from the configuration, and use the default value, enter an empty string ("") or a value of `$Null` for the corresponding parameter.</maml:para> <maml:para>Starting in PowerShell 3.0, you can use a session configuration file to define a session configuration. This feature provides a simple and discoverable method for setting and changing the properties of sessions that use the session configuration. To specify a session configuration file, use the Path parameter of `Set-PSSessionConfiguration`. For information about session configuration files, see about_Session_Configuration_Files (About/about_Session_Configuration_Files.md). For information about how to create and modify a session configuration file, see the `New-PSSessionConfigurationFile` cmdlet.</maml:para> <maml:para>Session configurations define the environment of remote sessions ( PSSessions ) that connect to the local computer. Every PSSession uses a session configuration. The session configuration determines the features of the PSSession , such as the modules that are available in the session, the cmdlets that are permitted to run, the language mode, quotas, and timeouts. The security descriptor of the session configuration determines who can use the session configuration to connect to the local computer. For more information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> <maml:para>To see the properties of a session configuration, use the `Get-PSSessionConfiguration` cmdlet or the WSMan Provider. For more information about the WSMan Provider, type `Get-Help WSMan`.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Set-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the name of the session configuration that you want to change.</maml:para> <maml:para>You cannot use this parameter to change the name of the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. This value sets the Enabled property of the session configuration (`WSMan:<ComputerName>\PlugIn<SessionConfigurationName>\Enabled`) to False . - Local. Adds a Network_Deny_All entry to security descriptor of the session configuration. Users of the local computer can use the session configuration to create a local loopback session on the same computer, but remote users are denied access. - Remote. Removes Deny_All and Network_Deny_All entries from the security descriptors of the session configuration. Users of local and remote computers can use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote .</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet enables all session configurations on the computer and permits remote access to them, and the `Disable-PSRemoting` cmdlet permits only local access to all session configurations on the computer.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Disabled</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Remote</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationBase</maml:name> <maml:Description> <maml:para>Specifies the path of the assembly file (*.dll) that is specified in the value of the AssemblyName parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies the limit on the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies the limits on the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules and snap-ins that are automatically imported into sessions that use the session configuration. Enter the module and snap-in names.</maml:para> <maml:para>By default, only the Microsoft.PowerShell.Core snap-in is imported into sessions, but unless the cmdlets are excluded, you can use the `Import-Module` and Add-PSSnapin cmdlets to add modules and snap-ins to the session.</maml:para> <maml:para>The modules specified in this parameter value are imported in additions to modules specified in the session configuration file (`New-PSSessionConfigurationFile`). However, settings in the session configuration file can hide the commands exported by modules or prevent users from using them.</maml:para> <maml:para>The modules specified in this parameter value replace the list of modules specified by using the ModulesToImport parameter of the `Register-PSSessionConfiguration` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run `Set-PSSessionConfiguration`, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, use the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PowerShellVersion"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies the version of PowerShell in sessions that use this session configuration.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a different Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute(Invoke) permission for the configuration.</maml:para> <maml:para>To use the default security descriptor for the configuration, enter an empty string ("") or a value of `$Null`. The default is the root SDDL in the WSMan: drive.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this one. You cannot use both parameters in the same command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionTypeOption</maml:name> <maml:Description> <maml:para>Specifies type-specific options for the session configuration. Enter a session type options object, such as the PSWorkflowExecutionOption object that the `New-PSWorkflowExecutionOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSSessionTypeOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSSessionTypeOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet a property sheet that helps you create a new SDDL for the session configuration. The property sheet appears after you run the `Set-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When you set permissions to the configuration, remember that users must have at least Execute(Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the startup script for the configuration. Enter the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>To delete a startup script from a session configuration, enter an empty string ("") or a value of `$Null`.</maml:para> <maml:para>You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state setting for the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">STA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MTA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Unknown</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies the thread options setting in the configuration. This setting defines how threads are created and used when a command is executed in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseNewThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ReuseThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseCurrentThread</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport options for the session configuration. Enter a transport options object, such as the WSManConfigurationOption object that the `New-PSTransportOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Set-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the name of the session configuration that you want to change.</maml:para> <maml:para>You cannot use this parameter to change the name of the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AssemblyName</maml:name> <maml:Description> <maml:para>Specifies the assembly name. This cmdlet creates a session configuration based on a class that is defined in an assembly.</maml:para> <maml:para>Enter the filename or full path of an assembly .dll file that defines a session configuration. If you enter only the file name, you can enter the path in the value of the ApplicationBase parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>ConfigurationTypeName</maml:name> <maml:Description> <maml:para>Specifies the type of the session configuration that is defined in the assembly in the AssemblyName parameter. The type that you specify must implement the System.Management.Automation.Remoting.PSSessionConfiguration class.</maml:para> <maml:para>This parameter is required when you specify an assembly name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. This value sets the Enabled property of the session configuration (`WSMan:<ComputerName>\PlugIn<SessionConfigurationName>\Enabled`) to False . - Local. Adds a Network_Deny_All entry to security descriptor of the session configuration. Users of the local computer can use the session configuration to create a local loopback session on the same computer, but remote users are denied access. - Remote. Removes Deny_All and Network_Deny_All entries from the security descriptors of the session configuration. Users of local and remote computers can use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote .</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet enables all session configurations on the computer and permits remote access to them, and the `Disable-PSRemoting` cmdlet permits only local access to all session configurations on the computer.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Disabled</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Remote</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationBase</maml:name> <maml:Description> <maml:para>Specifies the path of the assembly file (*.dll) that is specified in the value of the AssemblyName parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies the limit on the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies the limits on the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules and snap-ins that are automatically imported into sessions that use the session configuration. Enter the module and snap-in names.</maml:para> <maml:para>By default, only the Microsoft.PowerShell.Core snap-in is imported into sessions, but unless the cmdlets are excluded, you can use the `Import-Module` and Add-PSSnapin cmdlets to add modules and snap-ins to the session.</maml:para> <maml:para>The modules specified in this parameter value are imported in additions to modules specified in the session configuration file (`New-PSSessionConfigurationFile`). However, settings in the session configuration file can hide the commands exported by modules or prevent users from using them.</maml:para> <maml:para>The modules specified in this parameter value replace the list of modules specified by using the ModulesToImport parameter of the `Register-PSSessionConfiguration` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run `Set-PSSessionConfiguration`, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, use the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PowerShellVersion"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies the version of PowerShell in sessions that use this session configuration.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a different Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute(Invoke) permission for the configuration.</maml:para> <maml:para>To use the default security descriptor for the configuration, enter an empty string ("") or a value of `$Null`. The default is the root SDDL in the WSMan: drive.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this one. You cannot use both parameters in the same command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionTypeOption</maml:name> <maml:Description> <maml:para>Specifies type-specific options for the session configuration. Enter a session type options object, such as the PSWorkflowExecutionOption object that the `New-PSWorkflowExecutionOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSSessionTypeOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSSessionTypeOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet a property sheet that helps you create a new SDDL for the session configuration. The property sheet appears after you run the `Set-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When you set permissions to the configuration, remember that users must have at least Execute(Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the startup script for the configuration. Enter the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>To delete a startup script from a session configuration, enter an empty string ("") or a value of `$Null`.</maml:para> <maml:para>You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state setting for the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">STA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MTA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Unknown</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies the thread options setting in the configuration. This setting defines how threads are created and used when a command is executed in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseNewThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ReuseThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseCurrentThread</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport options for the session configuration. Enter a transport options object, such as the WSManConfigurationOption object that the `New-PSTransportOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Set-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the name of the session configuration that you want to change.</maml:para> <maml:para>You cannot use this parameter to change the name of the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. This value sets the Enabled property of the session configuration (`WSMan:<ComputerName>\PlugIn<SessionConfigurationName>\Enabled`) to False . - Local. Adds a Network_Deny_All entry to security descriptor of the session configuration. Users of the local computer can use the session configuration to create a local loopback session on the same computer, but remote users are denied access. - Remote. Removes Deny_All and Network_Deny_All entries from the security descriptors of the session configuration. Users of local and remote computers can use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote .</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet enables all session configurations on the computer and permits remote access to them, and the `Disable-PSRemoting` cmdlet permits only local access to all session configurations on the computer.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Disabled</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Local</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Remote</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies the limit on the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies the limits on the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run `Set-PSSessionConfiguration`, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, use the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path of a session configuration file (.pssc), such as one created by the `New-PSSessionConfigurationFile` cmdlet. If you omit the path, the default is the current directory.</maml:para> <maml:para>For information about how to modify a session configuration file, see the help topic for the `New-PSSessionConfigurationFile` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a different Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute(Invoke) permission for the configuration.</maml:para> <maml:para>To use the default security descriptor for the configuration, enter an empty string ("") or a value of `$Null`. The default is the root SDDL in the WSMan: drive.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this one. You cannot use both parameters in the same command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet a property sheet that helps you create a new SDDL for the session configuration. The property sheet appears after you run the `Set-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When you set permissions to the configuration, remember that users must have at least Execute(Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the startup script for the configuration. Enter the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>To delete a startup script from a session configuration, enter an empty string ("") or a value of `$Null`.</maml:para> <maml:para>You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state setting for the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">STA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">MTA</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Unknown</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies the thread options setting in the configuration. This setting defines how threads are created and used when a command is executed in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions).</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseNewThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">ReuseThread</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">UseCurrentThread</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport options for the session configuration. Enter a transport options object, such as the WSManConfigurationOption object that the `New-PSTransportOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>AccessMode</maml:name> <maml:Description> <maml:para>Enables and disables the session configuration and determines whether it can be used for remote or local sessions on the computer. The acceptable values for this parameter are:</maml:para> <maml:para>- Disabled. Disables the session configuration. It cannot be used for remote or local access to the computer. This value sets the Enabled property of the session configuration (`WSMan:<ComputerName>\PlugIn<SessionConfigurationName>\Enabled`) to False . - Local. Adds a Network_Deny_All entry to security descriptor of the session configuration. Users of the local computer can use the session configuration to create a local loopback session on the same computer, but remote users are denied access. - Remote. Removes Deny_All and Network_Deny_All entries from the security descriptors of the session configuration. Users of local and remote computers can use the session configuration to create sessions and run commands on this computer.</maml:para> <maml:para>The default value is Remote .</maml:para> <maml:para>Other cmdlets can override the value of this parameter later. For example, the `Enable-PSRemoting` cmdlet enables all session configurations on the computer and permits remote access to them, and the `Disable-PSRemoting` cmdlet permits only local access to all session configurations on the computer.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSSessionConfigurationAccessMode</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ApplicationBase</maml:name> <maml:Description> <maml:para>Specifies the path of the assembly file (*.dll) that is specified in the value of the AssemblyName parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>AssemblyName</maml:name> <maml:Description> <maml:para>Specifies the assembly name. This cmdlet creates a session configuration based on a class that is defined in an assembly.</maml:para> <maml:para>Enter the filename or full path of an assembly .dll file that defines a session configuration. If you enter only the file name, you can enter the path in the value of the ApplicationBase parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>ConfigurationTypeName</maml:name> <maml:Description> <maml:para>Specifies the type of the session configuration that is defined in the assembly in the AssemblyName parameter. The type that you specify must implement the System.Management.Automation.Remoting.PSSessionConfiguration class.</maml:para> <maml:para>This parameter is required when you specify an assembly name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suppresses all user prompts, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedDataSizePerCommandMB</maml:name> <maml:Description> <maml:para>Specifies the limit on the amount of data that can be sent to this computer in any single remote command. Enter the data size in megabytes (MB). The default is 50 MB.</maml:para> <maml:para>If a data size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>50</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>MaximumReceivedObjectSizeMB</maml:name> <maml:Description> <maml:para>Specifies the limits on the amount of data that can be sent to this computer in any single object. Enter the data size in megabytes. The default is 10 MB.</maml:para> <maml:para>If an object size limit is defined in the configuration type that is specified in the ConfigurationTypeName parameter, the limit in the configuration type is used. The value of this parameter is ignored.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Nullable`1[System.Double]</command:parameterValue> <dev:type> <maml:name>System.Nullable`1[System.Double]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>10</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ModulesToImport</maml:name> <maml:Description> <maml:para>Specifies the modules and snap-ins that are automatically imported into sessions that use the session configuration. Enter the module and snap-in names.</maml:para> <maml:para>By default, only the Microsoft.PowerShell.Core snap-in is imported into sessions, but unless the cmdlets are excluded, you can use the `Import-Module` and Add-PSSnapin cmdlets to add modules and snap-ins to the session.</maml:para> <maml:para>The modules specified in this parameter value are imported in additions to modules specified in the session configuration file (`New-PSSessionConfigurationFile`). However, settings in the session configuration file can hide the commands exported by modules or prevent users from using them.</maml:para> <maml:para>The modules specified in this parameter value replace the list of modules specified by using the ModulesToImport parameter of the `Register-PSSessionConfiguration` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the name of the session configuration that you want to change.</maml:para> <maml:para>You cannot use this parameter to change the name of the session configuration.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run `Set-PSSessionConfiguration`, you are prompted to restart the WinRM service to make the new session configuration effective. Until the WinRM service is restarted, the new session configuration is not effective.</maml:para> <maml:para>To restart the WinRM service without prompting, use the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path of a session configuration file (.pssc), such as one created by the `New-PSSessionConfigurationFile` cmdlet. If you omit the path, the default is the current directory.</maml:para> <maml:para>For information about how to modify a session configuration file, see the help topic for the `New-PSSessionConfigurationFile` cmdlet.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PowerShellVersion"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies the version of PowerShell in sessions that use this session configuration.</maml:para> <maml:para>The value of this parameter takes precedence over the value of the PowerShellVersion key in the session configuration file.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAsCredential</maml:name> <maml:Description> <maml:para>Specifies credentials for commands in the session. By default, commands run with the permissions of the current user.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SecurityDescriptorSddl</maml:name> <maml:Description> <maml:para>Specifies a different Security Descriptor Definition Language (SDDL) string for the configuration.</maml:para> <maml:para>This string determines the permissions that are required to use the new session configuration. To use a session configuration in a session, users must have at least Execute(Invoke) permission for the configuration.</maml:para> <maml:para>To use the default security descriptor for the configuration, enter an empty string ("") or a value of `$Null`. The default is the root SDDL in the WSMan: drive.</maml:para> <maml:para>If the security descriptor is complex, consider using the ShowSecurityDescriptorUI parameter instead of this one. You cannot use both parameters in the same command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>SessionTypeOption</maml:name> <maml:Description> <maml:para>Specifies type-specific options for the session configuration. Enter a session type options object, such as the PSWorkflowExecutionOption object that the `New-PSWorkflowExecutionOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSSessionTypeOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSSessionTypeOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowSecurityDescriptorUI</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet a property sheet that helps you create a new SDDL for the session configuration. The property sheet appears after you run the `Set-PSSessionConfiguration` command and then restart the WinRM service.</maml:para> <maml:para>When you set permissions to the configuration, remember that users must have at least Execute(Invoke) permission to use the session configuration in a session.</maml:para> <maml:para>You cannot use the SecurityDescriptorSDDL parameter and this parameter in the same command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>StartupScript</maml:name> <maml:Description> <maml:para>Specifies the startup script for the configuration. Enter the fully qualified path of a PowerShell script. The specified script runs in the new session that uses the session configuration.</maml:para> <maml:para>To delete a startup script from a session configuration, enter an empty string ("") or a value of `$Null`.</maml:para> <maml:para>You can use a startup script to further configure the user session. If the script generates an error, even a non-terminating error, the session is not created and the `New-PSSession` command fails.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadApartmentState</maml:name> <maml:Description> <maml:para>Specifies the apartment state setting for the threads in the session. The acceptable values for this parameter are: STA, MTA, and Unknown. The default value is Unknown.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Threading.ApartmentState</command:parameterValue> <dev:type> <maml:name>System.Threading.ApartmentState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ThreadOptions</maml:name> <maml:Description> <maml:para>Specifies the thread options setting in the configuration. This setting defines how threads are created and used when a command is executed in the session. The acceptable values for this parameter are:</maml:para> <maml:para>- Default</maml:para> <maml:para>- ReuseThread</maml:para> <maml:para>- UseCurrentThread</maml:para> <maml:para>- UseNewThread</maml:para> <maml:para></maml:para> <maml:para>The default value is UseCurrentThread .</maml:para> <maml:para>For more information, see PSThreadOptions Enumeration (/dotnet/api/system.management.automation.runspaces.psthreadoptions).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.PSThreadOptions</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.PSThreadOptions</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>TransportOption</maml:name> <maml:Description> <maml:para>Specifies the transport options for the session configuration. Enter a transport options object, such as the WSManConfigurationOption object that the `New-PSTransportOption` cmdlet returns.</maml:para> <maml:para>The options of sessions that use the session configuration are determined by the values of session options and the session configuration options. Unless specified, options set in the session, such as by using the `New-PSSessionOption` cmdlet, take precedence over options set in the session configuration. However, session option values cannot exceed maximum values set in the session configuration.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSTransportOption</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSTransportOption</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseSharedProcess</maml:name> <maml:Description> <maml:para>Use only one process to host all sessions that are started by the same user and use the same session configuration. By default, each session is hosted in its own process.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Microsoft.WSMan.Management.WSManConfigLeafElement</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To run this cmdlet, start PowerShell by using the Run as administrator option.</maml:para> <maml:para>The `Set-PSSessionConfiguration` cmdlet does not change the configuration name and the WSMan provider does not support the `Rename-Item` cmdlet. To change the name of a session configuration, use the `Unregister-PSSessionConfiguration` cmdlet to delete the configuration and then use the `Register-PSSessionConfiguration` cmdlet to create and register a new session configuration.</maml:para> <maml:para>You can use the `Set-PSSessionConfiguration` cmdlet to change the default Microsoft.PowerShell and Microsoft.PowerShell32 session configurations. They are not protected. To revert to the original version of a default session configuration, use the `Unregister-PSSessionConfiguration` cmdlet to delete the default session configuration and then use the `Enable-PSRemoting` cmdlet to restore it.</maml:para> <maml:para>The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties.</maml:para> <maml:para>You can use commands in the WSMan: drive to change the properties of session configurations. However, you cannot use the WSMan: drive in PowerShell 2.0 to change session configuration properties that are introduced in PowerShell 3.0, such as OutputBufferingMode . Windows PowerShell 2.0 commands do not generate an error, but they are ineffective. To change properties introduced in PowerShell 3.0, use the WSMan: drive in PowerShell 3.0.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Change the thread apartment state ---------</maml:title> <dev:code>PS C:\> Set-PSSessionConfiguration -Name "MaintenanceShell" -ThreadApartmentState STA</dev:code> <dev:remarks> <maml:para>This command changes the thread apartment state in the MaintenanceShell configuration to STA. The change is effective when you restart the WinRM service.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 2: Create and change a session configuration -----</maml:title> <dev:code>Register-PSSessionConfiguration -Name "AdminShell" -AssemblyName "C:\Shells\AdminShell.dll" -ConfigurationTypeName "AdminClass" Set-PSSessionConfiguration -Name "AdminShell" -StartupScript "AdminConfig.ps1" Set-PSSessionConfiguration -Name "AdminShell" -StartupScript $Null</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------------ Example 3: Display results ------------------</maml:title> <dev:code>Set-PSSessionConfiguration -Name "IncObj" -MaximumReceivedObjectSizeMB 20 WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin\IncObj\InitializationParameters ParamName ParamValue --------- ---------- psmaximumreceivedobjectsizemb 20 "Restart WinRM service" WinRM service need to be restarted to make the changes effective. Do you want to run the command "restart-service winrm"? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 4: Display results in different ways ---------</maml:title> <dev:code>PS> Set-PSSessionConfiguration -Name "MaintenanceShell" -StartupScript "C:\ps-test\Maintenance.ps1" WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Plugin\MaintenanceShell\InitializationParameters ParamName ParamValue --------- ---------- startupscript c:\ps-test\Mainte... "Restart WinRM service" WinRM service need to be restarted to make the changes effective. Do you want to run the command "restart-service winrm"? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y PS> Get-PSSessionConfiguration MaintenanceShell | Format-List -Property * xmlns : http://schemas.microsoft.com/wbem/wsman/1/config/PluginConfiguration Name : MaintenanceShell Filename : %windir%\system32\pwrshplugin.dll SDKVersion : 1 XmlRenderingType : text lang : en-US PSVersion : 2.0 startupscript : c:\ps-test\Maintenance.ps1 ResourceUri : http://schemas.microsoft.com/powershell/MaintenanceShell SupportsOptions : true ExactMatch : true Capability : {Shell} Permission : PS> dir WSMan:\localhost\Plugin\MaintenanceShell\InitializationParameters ParamName ParamValue --------- ---------- PSVersion 2.0 startupscript c:\ps-test\Maintenance.ps1</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/set-pssessionconfiguration?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSTransportOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSWorkflowExecutionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Set-StrictMode</command:name> <command:verb>Set</command:verb> <command:noun>StrictMode</command:noun> <maml:description> <maml:para>Establishes and enforces coding rules in expressions, scripts, and script blocks.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Set-StrictMode` cmdlet configures strict mode for the current scope and all child scopes, and turns it on and off. When strict mode is on, PowerShell generates a terminating error when the content of an expression, script, or script block violates basic best-practice coding rules.</maml:para> <maml:para>Use the Version parameter to determine which coding rules are enforced.</maml:para> <maml:para>`Set-PSDebug -Strict` cmdlet turns on strict mode for the global scope. `Set-StrictMode` affects only the current scope and its child scopes. Therefore, you can use it in a script or function to override the setting inherited from the global scope.</maml:para> <maml:para>When `Set-StrictMode` is off, PowerShell has the following behaviors:</maml:para> <maml:para>- Uninitialized variables are assumed to have a value of 0 (zero) or `$Null`, depending on type</maml:para> <maml:para>- References to non-existent properties return `$Null`</maml:para> <maml:para>- Results of improper function syntax vary with the error conditions</maml:para> <maml:para>- Attempting to retrieve a value using an invalid index in an array returns `$Null`</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Set-StrictMode</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Off</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet turns strict mode off for the current scope and all child scopes.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Set-StrictMode</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="v"> <maml:name>Version</maml:name> <maml:Description> <maml:para>Specifies the conditions that cause an error in strict mode. This parameter accepts any valid PowerShell version number. Any number higher than 3 is treated as Latest .</maml:para> <maml:para>The effective values for this parameter are:</maml:para> <maml:para>- 1.0 - Prohibits references to uninitialized variables, except for uninitialized variables in strings. - 2.0 - Prohibits references to uninitialized variables. This includes uninitialized variables in strings. - Prohibits references to non-existent properties of an object. - Prohibits function calls that use the syntax for calling methods. - 3.0 - Prohibits references to uninitialized variables. This includes uninitialized variables in strings. - Prohibits references to non-existent properties of an object. - Prohibits function calls that use the syntax for calling methods. - Prohibit out of bounds or unresolvable array indexes. - Latest - Selects the latest version available. The latest version is the most strict. Use this value to make sure that scripts use the strictest available version, even when new versions are added to PowerShell.</maml:para> <maml:para>> [!CAUTION] > Using a Version of Latest in scripts. The meaning of Latest can change in new releases > of PowerShell. Therefore, a script written for an older version of PowerShell that uses > `Set-StrictMode -Version Latest` is subject to more restrictive rules when run in a newer version > of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Off</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet turns strict mode off for the current scope and all child scopes.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="v"> <maml:name>Version</maml:name> <maml:Description> <maml:para>Specifies the conditions that cause an error in strict mode. This parameter accepts any valid PowerShell version number. Any number higher than 3 is treated as Latest .</maml:para> <maml:para>The effective values for this parameter are:</maml:para> <maml:para>- 1.0 - Prohibits references to uninitialized variables, except for uninitialized variables in strings. - 2.0 - Prohibits references to uninitialized variables. This includes uninitialized variables in strings. - Prohibits references to non-existent properties of an object. - Prohibits function calls that use the syntax for calling methods. - 3.0 - Prohibits references to uninitialized variables. This includes uninitialized variables in strings. - Prohibits references to non-existent properties of an object. - Prohibits function calls that use the syntax for calling methods. - Prohibit out of bounds or unresolvable array indexes. - Latest - Selects the latest version available. The latest version is the most strict. Use this value to make sure that scripts use the strictest available version, even when new versions are added to PowerShell.</maml:para> <maml:para>> [!CAUTION] > Using a Version of Latest in scripts. The meaning of Latest can change in new releases > of PowerShell. Therefore, a script written for an older version of PowerShell that uses > `Set-StrictMode -Version Latest` is subject to more restrictive rules when run in a newer version > of PowerShell.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>You cannot pipe input to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not return any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>`Set-StrictMode` is effective only in the scope in which it is set and in its child scopes. For more information about scopes in PowerShell, see about_Scopes (about/about_Scopes.md).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------- Example 1: Turn on strict mode as version 1.0 --------</maml:title> <dev:code># Strict mode is off by default. $a -gt 5 False Set-StrictMode -Version 1.0 $a -gt 5 The variable $a cannot be retrieved because it has not been set yet. At line:1 char:3 + $a <<<< -gt 5 + CategoryInfo : InvalidOperation: (a:Token) [], RuntimeException + FullyQualifiedErrorId : VariableIsUndefined</dev:code> <dev:remarks> <maml:para>With strict mode set to version 1.0, attempts to reference variables that are not initialized fail.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 2: Turn on strict mode as version 2.0 --------</maml:title> <dev:code># Strict mode is off by default. function add ($a, $b) { '$a = ' + $a '$b = ' + $b '$a+$b = ' + ($a + $b) } add 3 4 $a = 3 $b = 4 $a+$b = 7 add(3,4) $a = 3 4 $b = $a+$b = 3 4 Set-StrictMode -Version 2.0 add(3,4) The function or command was called like a method. Parameters should be separated by spaces, as described in 'Get-Help about_Parameter.' At line:1 char:4 + add <<<< (3,4) + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : StrictModeFunctionCallWithParens Set-StrictMode -Off $string = "This is a string." $string.Month -eq $null True Set-StrictMode -Version 2.0 $string = "This is a string." $string.Month -eq $null Property 'Month' cannot be found on this object; make sure it exists. At line:1 char:9 + $string. <<<< month + CategoryInfo : InvalidOperation: (.:OperatorToken) [], RuntimeException + FullyQualifiedErrorId : PropertyNotFoundStrict</dev:code> <dev:remarks> <maml:para>This command turns strict mode on and sets it to version 2.0. As a result, PowerShell returns an error if you use method syntax, which uses parentheses and commas, for a function call or reference uninitialized variables or non-existent properties.</maml:para> <maml:para>The sample output shows the effect of version 2.0 strict mode.</maml:para> <maml:para>Without version 2.0 strict mode, the "(3,4)" value is interpreted as a single array object to which nothing is added. By using version 2.0 strict mode, it is correctly interpreted as faulty syntax for submitting two values.</maml:para> <maml:para>Without version 2.0, the reference to the non-existent Month property of a string returns only `$Null`. By using version 2.0, it is interpreted correctly as a reference error.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 3: Turn on strict mode as version 3.0 --------</maml:title> <dev:code># Strict mode is off by default. $a = @(1) $a[2] -eq $null $a['abc'] -eq $null True True Set-StrictMode -Version 3 $a = @(1) $a[2] -eq $null $a['abc'] -eq $null Index was outside the bounds of the array. At line:1 char:1 + $a[2] -eq $null + ~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], IndexOutOfRangeException + FullyQualifiedErrorId : System.IndexOutOfRangeException Cannot convert value "abc" to type "System.Int32". Error: "Input string was not in a correct format." At line:1 char:1 + $a['abc'] -eq $null + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [], RuntimeException + FullyQualifiedErrorId : InvalidCastFromStringToInteger</dev:code> <dev:remarks> <maml:para>With strict mode set to version 3 or higher, invalid or out of bounds indexes result in errors.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/set-strictmode?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSDebug</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Start-Job</command:name> <command:verb>Start</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Starts a PowerShell background job.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Start-Job` cmdlet starts a PowerShell background job on the local computer.</maml:para> <maml:para>A PowerShell background job runs a command without interacting with the current session. When you start a background job, a job object returns immediately, even if the job takes an extended time to finish. You can continue to work in the session without interruption while the job runs.</maml:para> <maml:para>The job object contains useful information about the job, but it doesn't contain the job results. When the job finishes, use the `Receive-Job` cmdlet to get the results of the job. For more information about background jobs, see about_Jobs (./About/about_Jobs.md).</maml:para> <maml:para>To run a background job on a remote computer, use the AsJob parameter that is available on many cmdlets, or use the `Invoke-Command` cmdlet to run a `Start-Job` command on the remote computer. For more information, see about_Remote_Jobs (./About/about_Remote_Jobs.md).</maml:para> <maml:para>Starting in PowerShell 3.0, `Start-Job` can start instances of custom job types, such as scheduled jobs. For information about how to use `Start-Job` to start jobs with custom types, see the help documents for the job type feature.</maml:para> <maml:para>The default working directory for jobs is hardcoded. The Windows default is `$HOME\Documents` and on Linux or macOS the default is `$HOME`. The script code running in the background job needs to manage the working directory as needed.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Start-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run in the background job. To create a script block, enclose the commands in curly braces (`{}`). Use the `$input` automatic variable to access the value of the InputObject parameter. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>InitializationScript</maml:name> <maml:Description> <maml:para>Specifies commands that run before the job starts. To create a script block, enclose the commands in curly braces (`{}`).</maml:para> <maml:para>Use this parameter to prepare the session in which the job runs. For example, you can use it to add functions, snap-ins, and modules to the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, for the script that is specified by the FilePath parameter or a command specified with the ScriptBlock parameter.</maml:para> <maml:para>Arguments must be passed to ArgumentList as single-dimension array argument. For example, a comma-separated list. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. If the Credential parameter isn't specified, the command uses the current user's credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects, or type a command or expression that generates the objects.</maml:para> <maml:para>In the value of the ScriptBlock parameter, use the `$input` automatic variable to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the new job. You can use the name to identify the job to other job cmdlets, such as the `Stop-Job` cmdlet.</maml:para> <maml:para>The default friendly name is `Job#`, where `#` is an ordinal number that is incremented for each job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies a version. `Start-Job` runs the job with the version of PowerShell. The acceptable values for this parameter are: `2.0` and `3.0`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAs32</maml:name> <maml:Description> <maml:para>Indicates that `Start-Job` runs the job in a 32-bit process. RunAs32 forces the job to run in a 32-bit process, even on a 64-bit operating system.</maml:para> <maml:para>On 64-bit versions of Windows 7 and Windows Server 2008 R2, when the `Start-Job` command includes the RunAs32 parameter, you can't use the Credential parameter to specify the credentials of another user.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Start-Job</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>InitializationScript</maml:name> <maml:Description> <maml:para>Specifies commands that run before the job starts. To create a script block, enclose the commands in curly braces (`{}`).</maml:para> <maml:para>Use this parameter to prepare the session in which the job runs. For example, you can use it to add functions, snap-ins, and modules to the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, for the script that is specified by the FilePath parameter or a command specified with the ScriptBlock parameter.</maml:para> <maml:para>Arguments must be passed to ArgumentList as single-dimension array argument. For example, a comma-separated list. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. If the Credential parameter isn't specified, the command uses the current user's credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects, or type a command or expression that generates the objects.</maml:para> <maml:para>In the value of the ScriptBlock parameter, use the `$input` automatic variable to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs as a background job. Enter the path of a script on the local computer.</maml:para> <maml:para>`Start-Job` uses the value of the LiteralPath parameter exactly as it's typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the new job. You can use the name to identify the job to other job cmdlets, such as the `Stop-Job` cmdlet.</maml:para> <maml:para>The default friendly name is `Job#`, where `#` is an ordinal number that is incremented for each job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies a version. `Start-Job` runs the job with the version of PowerShell. The acceptable values for this parameter are: `2.0` and `3.0`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAs32</maml:name> <maml:Description> <maml:para>Indicates that `Start-Job` runs the job in a 32-bit process. RunAs32 forces the job to run in a 32-bit process, even on a 64-bit operating system.</maml:para> <maml:para>On 64-bit versions of Windows 7 and Windows Server 2008 R2, when the `Start-Job` command includes the RunAs32 parameter, you can't use the Credential parameter to specify the credentials of another user.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Start-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that `Start-Job` runs as a background job. Enter the path and file name of the script or use the pipeline to send a script path to `Start-Job`. The script must be on the local computer or in a folder that the local computer can access.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block and runs the script block as a background job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>InitializationScript</maml:name> <maml:Description> <maml:para>Specifies commands that run before the job starts. To create a script block, enclose the commands in curly braces (`{}`).</maml:para> <maml:para>Use this parameter to prepare the session in which the job runs. For example, you can use it to add functions, snap-ins, and modules to the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, for the script that is specified by the FilePath parameter or a command specified with the ScriptBlock parameter.</maml:para> <maml:para>Arguments must be passed to ArgumentList as single-dimension array argument. For example, a comma-separated list. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">Default</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Basic</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Negotiate</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">NegotiateWithImplicitCredential</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Credssp</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Digest</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Kerberos</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. If the Credential parameter isn't specified, the command uses the current user's credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects, or type a command or expression that generates the objects.</maml:para> <maml:para>In the value of the ScriptBlock parameter, use the `$input` automatic variable to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the new job. You can use the name to identify the job to other job cmdlets, such as the `Stop-Job` cmdlet.</maml:para> <maml:para>The default friendly name is `Job#`, where `#` is an ordinal number that is incremented for each job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies a version. `Start-Job` runs the job with the version of PowerShell. The acceptable values for this parameter are: `2.0` and `3.0`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAs32</maml:name> <maml:Description> <maml:para>Indicates that `Start-Job` runs the job in a 32-bit process. RunAs32 forces the job to run in a 32-bit process, even on a 64-bit operating system.</maml:para> <maml:para>On 64-bit versions of Windows 7 and Windows Server 2008 R2, when the `Start-Job` command includes the RunAs32 parameter, you can't use the Credential parameter to specify the credentials of another user.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Start-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>DefinitionName</maml:name> <maml:Description> <maml:para>Specifies the definition name of the job that this cmdlet starts. Use this parameter to start custom job types that have a definition name, such as scheduled jobs.</maml:para> <maml:para>When you use `Start-Job` to start an instance of a scheduled job, the job starts immediately, regardless of job triggers or job options. The resulting job instance is a scheduled job, but it isn't saved to disk like triggered scheduled jobs. You can't use the ArgumentList parameter of `Start-Job` to provide values for parameters of scripts that run in a scheduled job. For more information, see about_Scheduled_Jobs (../PSScheduledJob/About/about_Scheduled_Jobs.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>DefinitionPath</maml:name> <maml:Description> <maml:para>Specifies path of the definition for the job that this cmdlet starts. Enter the definition path. The concatenation of the values of the DefinitionPath and DefinitionName parameters is the fully qualified path of the job definition. Use this parameter to start custom job types that have a definition path, such as scheduled jobs.</maml:para> <maml:para>For scheduled jobs, the value of the DefinitionPath parameter is `$home\AppData\Local\Windows\PowerShell\ScheduledJob`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Type</maml:name> <maml:Description> <maml:para>Specifies the custom type for jobs started by `Start-Job`. Enter a custom job type name, such as PSScheduledJob for scheduled jobs or PSWorkflowJob for workflows jobs. This parameter isn't valid for standard background jobs.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="Args"> <maml:name>ArgumentList</maml:name> <maml:Description> <maml:para>Specifies an array of arguments, or parameter values, for the script that is specified by the FilePath parameter or a command specified with the ScriptBlock parameter.</maml:para> <maml:para>Arguments must be passed to ArgumentList as single-dimension array argument. For example, a comma-separated list. For more information about the behavior of ArgumentList , see about_Splatting (about/about_Splatting.md#splatting-with-arrays).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object[]</command:parameterValue> <dev:type> <maml:name>System.Object[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Authentication</maml:name> <maml:Description> <maml:para>Specifies the mechanism that is used to authenticate user credentials.</maml:para> <maml:para>The acceptable values for this parameter are as follows:</maml:para> <maml:para>- Default</maml:para> <maml:para>- Basic</maml:para> <maml:para>- Credssp</maml:para> <maml:para>- Digest</maml:para> <maml:para>- Kerberos</maml:para> <maml:para>- Negotiate</maml:para> <maml:para>- NegotiateWithImplicitCredential</maml:para> <maml:para></maml:para> <maml:para>The default value is Default.</maml:para> <maml:para>CredSSP authentication is available only in Windows Vista, Windows Server 2008, and later versions of the Windows operating system.</maml:para> <maml:para>For more information about the values of this parameter, see AuthenticationMechanism (/dotnet/api/system.management.automation.runspaces.authenticationmechanism).</maml:para> <maml:para>> [!CAUTION] > Credential Security Support Provider (CredSSP) authentication, in which the user's credentials are > passed to a remote computer to be authenticated, is designed for commands that require > authentication on more than one resource, such as accessing a remote network share. This mechanism > increases the security risk of the remote operation. If the remote computer is compromised, the > credentials that are passed to it can be used to control the network session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Runspaces.AuthenticationMechanism</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Runspaces.AuthenticationMechanism</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Default</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies a user account that has permission to perform this action. If the Credential parameter isn't specified, the command uses the current user's credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>DefinitionName</maml:name> <maml:Description> <maml:para>Specifies the definition name of the job that this cmdlet starts. Use this parameter to start custom job types that have a definition name, such as scheduled jobs.</maml:para> <maml:para>When you use `Start-Job` to start an instance of a scheduled job, the job starts immediately, regardless of job triggers or job options. The resulting job instance is a scheduled job, but it isn't saved to disk like triggered scheduled jobs. You can't use the ArgumentList parameter of `Start-Job` to provide values for parameters of scripts that run in a scheduled job. For more information, see about_Scheduled_Jobs (../PSScheduledJob/About/about_Scheduled_Jobs.md).</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>DefinitionPath</maml:name> <maml:Description> <maml:para>Specifies path of the definition for the job that this cmdlet starts. Enter the definition path. The concatenation of the values of the DefinitionPath and DefinitionName parameters is the fully qualified path of the job definition. Use this parameter to start custom job types that have a definition path, such as scheduled jobs.</maml:para> <maml:para>For scheduled jobs, the value of the DefinitionPath parameter is `$home\AppData\Local\Windows\PowerShell\ScheduledJob`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>FilePath</maml:name> <maml:Description> <maml:para>Specifies a local script that `Start-Job` runs as a background job. Enter the path and file name of the script or use the pipeline to send a script path to `Start-Job`. The script must be on the local computer or in a folder that the local computer can access.</maml:para> <maml:para>When you use this parameter, PowerShell converts the contents of the specified script file to a script block and runs the script block as a background job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>InitializationScript</maml:name> <maml:Description> <maml:para>Specifies commands that run before the job starts. To create a script block, enclose the commands in curly braces (`{}`).</maml:para> <maml:para>Use this parameter to prepare the session in which the job runs. For example, you can use it to add functions, snap-ins, and modules to the session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies input to the command. Enter a variable that contains the objects, or type a command or expression that generates the objects.</maml:para> <maml:para>In the value of the ScriptBlock parameter, use the `$input` automatic variable to represent the input objects.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:Description> <maml:para>Specifies a local script that this cmdlet runs as a background job. Enter the path of a script on the local computer.</maml:para> <maml:para>`Start-Job` uses the value of the LiteralPath parameter exactly as it's typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies a friendly name for the new job. You can use the name to identify the job to other job cmdlets, such as the `Stop-Job` cmdlet.</maml:para> <maml:para>The default friendly name is `Job#`, where `#` is an ordinal number that is incremented for each job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PSVersion</maml:name> <maml:Description> <maml:para>Specifies a version. `Start-Job` runs the job with the version of PowerShell. The acceptable values for this parameter are: `2.0` and `3.0`.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Version</command:parameterValue> <dev:type> <maml:name>System.Version</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>RunAs32</maml:name> <maml:Description> <maml:para>Indicates that `Start-Job` runs the job in a 32-bit process. RunAs32 forces the job to run in a 32-bit process, even on a 64-bit operating system.</maml:para> <maml:para>On 64-bit versions of Windows 7 and Windows Server 2008 R2, when the `Start-Job` command includes the RunAs32 parameter, you can't use the Credential parameter to specify the credentials of another user.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="Command"> <maml:name>ScriptBlock</maml:name> <maml:Description> <maml:para>Specifies the commands to run in the background job. To create a script block, enclose the commands in curly braces (`{}`). Use the `$input` automatic variable to access the value of the InputObject parameter. This parameter is required.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Type</maml:name> <maml:Description> <maml:para>Specifies the custom type for jobs started by `Start-Job`. Enter a custom job type name, such as PSScheduledJob for scheduled jobs or PSWorkflowJob for workflows jobs. This parameter isn't valid for standard background jobs.</maml:para> <maml:para>This parameter was introduced in PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can use the pipeline to send an object with the Name property to the Name parameter. For example, you can pipeline a FileInfo object from `Get-ChildItem` to `Start-Job`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSRemotingJob</maml:name> </dev:type> <maml:description> <maml:para>`Start-Job` returns a PSRemotingJob object that represents the job that it started.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To run in the background, `Start-Job` runs in its own session in the current session. When you use the `Invoke-Command` cmdlet to run a `Start-Job` command in a session on a remote computer, `Start-Job` runs in a session in the remote session.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------- Example 1: Start a background job --------------</maml:title> <dev:code>Start-Job -ScriptBlock { Get-Process -Name powershell } Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 1 Job1 BackgroundJob Running True localhost Get-Process -Name powershell</dev:code> <dev:remarks> <maml:para>`Start-Job` uses the ScriptBlock parameter to run `Get-Process` as a background job. The Name parameter specifies to find PowerShell processes, `powershell`. The job information is displayed and PowerShell returns to a prompt while the job runs in the background.</maml:para> <maml:para>To view the job's output, use the `Receive-Job` cmdlet. For example, `Receive-Job -Id 1`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 2: Start a job using Invoke-Command ---------</maml:title> <dev:code>$jobWRM = Invoke-Command -ComputerName (Get-Content -Path C:\Servers.txt) -ScriptBlock { Get-Service -Name WinRM } -JobName WinRM -ThrottleLimit 16 -AsJob</dev:code> <dev:remarks> <maml:para>A job that uses `Invoke-Command` is created and stored in the `$jobWRM` variable. `Invoke-Command` uses the ComputerName parameter to specify the computers where the job runs. `Get-Content` gets the server names from the `C:\Servers.txt` file.</maml:para> <maml:para>The ScriptBlock parameter specifies a command that `Get-Service` gets the WinRM service. The JobName parameter specifies a friendly name for the job, WinRM . The ThrottleLimit parameter limits the number of concurrent commands to 16. The AsJob parameter starts a background job that runs the command on the servers.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------------- Example 3: Get job information ----------------</maml:title> <dev:code>$j = Start-Job -ScriptBlock { Get-WinEvent -Log System } -Credential Domain01\User01 $j | Select-Object -Property * State : Completed HasMoreData : True StatusMessage : Location : localhost Command : Get-WinEvent -Log System JobStateInfo : Completed Finished : System.Threading.ManualResetEvent InstanceId : 27ce3fd9-40ed-488a-99e5-679cd91b9dd3 Id : 18 Name : Job18 ChildJobs : {Job19} PSBeginTime : 8/8/2019 14:41:57 PSEndTime : 8/8/2019 14:42:07 PSJobTypeName : BackgroundJob Output : {} Error : {} Progress : {} Verbose : {} Debug : {} Warning : {} Information : {}</dev:code> <dev:remarks> <maml:para>`Start-Job` uses the ScriptBlock parameter to run a command that specifies `Get-WinEvent` to get the System log. The Credential parameter specifies a domain user account with permission to run the job on the computer. The job object is stored in the `$j` variable.</maml:para> <maml:para>The object in the `$j` variable is sent down the pipeline to `Select-Object`. The Property parameter specifies an asterisk (`*`) to display all the job object's properties.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 4: Run a script as a background job ---------</maml:title> <dev:code>Start-Job -FilePath C:\Scripts\Sample.ps1</dev:code> <dev:remarks> <maml:para>`Start-Job` uses the FilePath parameter to specify a script file that's stored on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 5: Get a process using a background job -------</maml:title> <dev:code>Start-Job -Name PShellJob -ScriptBlock { Get-Process -Name PowerShell }</dev:code> <dev:remarks> <maml:para>`Start-Job` uses the Name parameter to specify a friendly job name, PShellJob . The ScriptBlock parameter specifies `Get-Process` to get processes with the name PowerShell .</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-- Example 6: Collect and save data by using a background job --</maml:title> <dev:code>Start-Job -Name GetMappingFiles -InitializationScript {Import-Module MapFunctions} -ScriptBlock { Get-Map -Name * | Set-Content -Path D:\Maps.tif } -RunAs32</dev:code> <dev:remarks> <maml:para>`Start-Job` uses the Name parameter to specify a friendly job name, GetMappingFiles . The InitializationScript parameter runs a script block that imports the MapFunctions module. The ScriptBlock parameter runs `Get-Map` and `Set-Content` saves the data in the location specified by the Path parameter. The RunAs32 parameter runs the process as 32-bit, even on a 64-bit operating system.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 7: Pass input to a background job ----------</maml:title> <dev:code>Start-Job -ScriptBlock { Get-Content $input } -InputObject "C:\Servers.txt" Receive-Job -Name Job45 -Keep Server01 Server02 Server03 Server04</dev:code> <dev:remarks> <maml:para>`Start-Job` uses the ScriptBlock parameter to run `Get-Content` with the `$input` automatic variable. The `$input` variable gets objects from the InputObject parameter. `Receive-Job` uses the Name parameter to specify the job and outputs the results. The Keep parameter saves the job output so it can be viewed again during the PowerShell session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title> Example 8: Use the ArgumentList parameter to specify an array </maml:title> <dev:code>Start-Job -ScriptBlock { Get-Process -Name $args } -ArgumentList powershell, pwsh, notepad Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 1 Job1 BackgroundJob Running True localhost Get-Process -Name $args</dev:code> <dev:remarks> <maml:para>The `Start-Job` cmdlet uses the ScriptBlock parameter to run a command. `Get-Process` uses the Name parameter to specify the automatic variable `$args`. The ArgumentList parameter passes the array of process names to `$args`. The process names powershell, pwsh, and notepad are processes running on the local computer.</maml:para> <maml:para>To view the job's output, use the `Receive-Job` cmdlet. For example, `Receive-Job -Id 1`.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/start-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Arrays</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Automatic_Variables</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Job_Details</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Stop-Job</command:name> <command:verb>Stop</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Stops a PowerShell background job.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Stop-Job cmdlet stops PowerShell background jobs that are in progress. You can use this cmdlet to stop all jobs or stop selected jobs based on their name, ID, instance ID, or state, or by passing a job object to Stop-Job .</maml:para> <maml:para>You can use Stop-Job to stop background jobs, such as those that were started by using the Start-Job cmdlet or the AsJob parameter of any cmdlet. When you stop a background job, PowerShell completes all tasks that are pending in that job queue and then ends the job. No new tasks are added to the queue after this command is submitted.</maml:para> <maml:para>This cmdlet does not delete background jobs. To delete a job, use the Remove-Job cmdlet.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, Stop-Job also stops custom job types, such as workflow jobs and instances of scheduled jobs. To enable Stop-Job to stop a job with custom job type, import the module that supports the custom job type into the session before you run a Stop-Job command, either by using the Import-Module cmdlet or by using or getting a cmdlet in the module. For information about a particular custom job type, see the documentation of the custom job type feature.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Stop-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet stops jobs that satisfy all of the conditions. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Stop-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the IDs of jobs that this cmdlet stops. The default is all jobs in the current session.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, type `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Stop-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of jobs that this cmdlet stops. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Stop-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs that this cmdlet stops. Enter a variable that contains the jobs or a command that gets the jobs. You can also use a pipeline operator to submit jobs to the Stop-Job cmdlet. By default, Stop-Job deletes all jobs that were started in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Stop-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies friendly names of jobs that this cmdlet stops. Enter the job names in a comma-separated list or use wildcard characters (*) to enter a job name pattern. By default, Stop-Job stops all jobs created in the current session.</maml:para> <maml:para>Because the friendly name is not guaranteed to be unique, use the WhatIf and Confirm parameters when stopping jobs by name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Stop-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet stops only jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet stops jobs that satisfy all of the conditions. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the IDs of jobs that this cmdlet stops. The default is all jobs in the current session.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, type `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of jobs that this cmdlet stops. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs that this cmdlet stops. Enter a variable that contains the jobs or a command that gets the jobs. You can also use a pipeline operator to submit jobs to the Stop-Job cmdlet. By default, Stop-Job deletes all jobs that were started in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies friendly names of jobs that this cmdlet stops. Enter the job names in a comma-separated list or use wildcard characters (*) to enter a job name pattern. By default, Stop-Job stops all jobs created in the current session.</maml:para> <maml:para>Because the friendly name is not guaranteed to be unique, use the WhatIf and Confirm parameters when stopping jobs by name.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>PassThru</maml:name> <maml:Description> <maml:para>Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet stops only jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>All jobs</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.RemotingJob</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a job object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None, System.Management.Automation.PSRemotingJob</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a job object, if you specify the PassThru parameter. Otherwise, this cmdlet does not generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>Example 1: Stop a job on a remote computer by using Invoke-Command</maml:title> <dev:code>$s = New-PSSession -ComputerName Server01 -Credential Domain01\Admin02 $j = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-EventLog System}} Invoke-Command -Session $s -ScriptBlock { Stop-job -Job $Using:j }</dev:code> <dev:remarks> <maml:para>This example shows how to use the Stop-Job cmdlet to stop a job that is running on a remote computer.</maml:para> <maml:para>Because the job was started by using the Invoke-Command cmdlet to run a Start-Job command remotely, the job object is stored on the remote computer. You must use another Invoke-Command command to run a Stop-Job command remotely. For more information about remote background jobs, see about_Remote_Jobs.</maml:para> <maml:para>The first command creates a PowerShell session ( PSSession ) on the Server01 computer, and then stores the session object in the $s variable. The command uses the credentials of a domain administrator.</maml:para> <maml:para>The second command uses the Invoke-Command cmdlet to run a Start-Job command in the session. The command in the job gets all of the events in the System event log. The resulting job object is stored in the $j variable.</maml:para> <maml:para>The third command stops the job. It uses the Invoke-Command cmdlet to run a Stop-Job command in the PSSession on Server01. Because the job objects are stored in $j, which is a variable on the local computer, the command uses the Using scope modifier to identify $j as a local variable. For more information about the Using scope modifier, see about_Remote_Variables (about/about_Remote_Variables.md).</maml:para> <maml:para>When the command finishes, the job is stopped and the PSSession in $s is available for use.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------------- Example 2: Stop a background job ---------------</maml:title> <dev:code>Stop-Job -Name "Job1"</dev:code> <dev:remarks> <maml:para>This command stops the Job1 background job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 3: Stop several background jobs -----------</maml:title> <dev:code>Stop-Job -Id 1, 3, 4</dev:code> <dev:remarks> <maml:para>This command stops three jobs. It identifies them by their IDs.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------------- Example 4: Stop all background jobs -------------</maml:title> <dev:code>Get-Job | Stop-Job</dev:code> <dev:remarks> <maml:para>This command stops all of the background jobs in the current session.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 5: Stop all blocked background jobs ---------</maml:title> <dev:code>Stop-Job -State Blocked</dev:code> <dev:remarks> <maml:para>This command stops all the jobs that are blocked.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 6: Stop a job by using an instance ID --------</maml:title> <dev:code>Get-Job | Format-Table ID, Name, Command, @{Label="State";Expression={$_.JobStateInfo.State}}, InstanceID -Auto Id Name Command State InstanceId -- ---- ------- ----- ---------- 1 Job1 start-service schedule Running 05abb67a-2932-4bd5-b331-c0254b8d9146 3 Job3 start-service schedule Running c03cbd45-19f3-4558-ba94-ebe41b68ad03 5 Job5 get-service s* Blocked e3bbfed1-9c53-401a-a2c3-a8db34336adf Stop-Job -InstanceId e3bbfed1-9c53-401a-a2c3-a8db34336adf</dev:code> <dev:remarks> <maml:para>These commands show how to stop a job based on its instance ID.</maml:para> <maml:para>The first command uses the Get-Job cmdlet to get the jobs in the current session. The command uses a pipeline operator (|) to send the jobs to a Format-Table command, which displays a table of the specified properties of each job. The table includes the Instance ID of each job. It uses a calculated property to display the job state.</maml:para> <maml:para>The second command uses a Stop-Job command that has the InstanceID parameter to stop a selected job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 7: Stop a job on a remote computer ----------</maml:title> <dev:code>$j = Invoke-Command -ComputerName Server01 -ScriptBlock {Get-EventLog System} -AsJob $j | Stop-Job -PassThru Id Name State HasMoreData Location Command -- ---- ---- ----------- -------- ------- 5 Job5 Stopped True user01-tablet get-eventlog system</dev:code> <dev:remarks> <maml:para>This example shows how to use the Stop-Job cmdlet to stop a job that is running on a remote computer.</maml:para> <maml:para>Because the job was started by using the AsJob parameter of the Invoke-Command cmdlet, the job object is located on the local computer, even though the job runs on the remote computer. Therefore, you can use a local Stop-Job command to stop the job.</maml:para> <maml:para>The first command uses the Invoke-Command cmdlet to start a background job on the Server01 computer. The command uses the AsJob parameter to run the remote command as a background job.</maml:para> <maml:para>This command returns a job object, which is the same job object that the Start-Job cmdlet returns. The command saves the job object in the $j variable.</maml:para> <maml:para>The second command uses a pipeline operator to send the job in the $j variable to Stop-Job. The command uses the PassThru parameter to direct Stop-Job to return a job object. The job object display confirms that the state of the job is Stopped.</maml:para> <maml:para>For more information about remote background jobs, see about_Remote_Jobs.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/stop-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Job_Details</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Remote_Variables</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Jobs</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Scopes</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Suspend-Job</command:name> <command:verb>Suspend</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Temporarily stops workflow jobs.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Suspend-Job cmdlet suspends workflow jobs. Suspend means to temporarily interrupt or pause a workflow job. This cmdlet allows users who are running workflows to suspend the workflow. It complements the Suspend-Workflowhttps://go.microsoft.com/fwlink/?LinkId=267141 activity, which is a command in the workflow that suspends the workflow.</maml:para> <maml:para>The Suspend-Job cmdlet works only on workflow jobs. It does not work on standard background jobs, such as those that are started by using the Start-Job cmdlet.</maml:para> <maml:para>To identify a workflow job, look for a value of PSWorkflowJob in the PSJobTypeName property of the job. To determine whether a particular custom job type supports the Suspend-Job cmdlet, see the help topics for the custom job type.</maml:para> <maml:para>When you suspend a workflow job, the workflow job runs to the next checkpoint, suspends, and immediately returns a workflow job object. To wait for the suspension to complete before getting the job, use the Wait parameter of Suspend-Job or the Wait-Job cmdlet. When the workflow job is suspended, the value of the State property of the job is Suspended.</maml:para> <maml:para>Suspending correctly relies on checkpoints. The current job state, metadata, and output are saved in the checkpoint so the workflow job can be resumed without loss of state or data. If the workflow job does not have checkpoints, it cannot be suspended correctly. To add checkpoints to a workflow that you are running, use the PSPersist workflow common parameter. You can use the Force parameter to suspend any workflow job immediately and to suspend a workflow job that does not have checkpoints, but the action could cause loss of state and data.</maml:para> <maml:para>Before you use a Job cmdlet on a custom job type, such as a workflow job ( PSWorkflowJob ) import the module that supports the custom job type, either by using the Import-Module cmdlet or using or using a cmdlet in the module.</maml:para> <maml:para>This cmdlet was introduced in Windows PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Suspend-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet suspends jobs that satisfy all of the conditions. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Suspend-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the IDs of jobs that this cmdlet suspends.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and to type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, use the Get-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Suspend-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of jobs that this cmdlet suspends. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Suspend-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the workflow jobs that this cmdlet stops. Enter a variable that contains the workflow jobs or a command that gets the workflow jobs. You can also pipe workflow jobs to the Suspend-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Suspend-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies friendly names of jobs that this cmdlet suspends. Enter one or more workflow job names. Wildcard characters are supported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Suspend-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet stops only jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping Suspend-Job suspends only workflow jobs in the Running state.</maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet suspends jobs that satisfy all of the conditions. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="F"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Suspends the workflow job immediately. This action could cause a loss of state and data.</maml:para> <maml:para>By default, Suspend-Job lets the workflow job run until the next checkpoint and then suspends it. You can also use this parameter to suspend workflow jobs that do not have checkpoints.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies the IDs of jobs that this cmdlet suspends.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and to type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, use the Get-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies the instance IDs of jobs that this cmdlet suspends. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the workflow jobs that this cmdlet stops. Enter a variable that contains the workflow jobs or a command that gets the workflow jobs. You can also pipe workflow jobs to the Suspend-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies friendly names of jobs that this cmdlet suspends. Enter one or more workflow job names. Wildcard characters are supported.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet stops only jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping Suspend-Job suspends only workflow jobs in the Running state.</maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Wait</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet suppresses the command prompt until the workflow job is in the suspended state. By default, Suspend-Job returns immediately, even if the workflow job is not yet in the suspended state.</maml:para> <maml:para>The Wait parameter is equivalent to piping a Suspend-Job command to the Wait-Job cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> </dev:type> <maml:description> <maml:para>You can pipe all types of jobs to this cmdlet. However, if Suspend-Job gets a job of an unsupported type, it returns a terminating error.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.Job</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns the jobs that it suspended.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>* The mechanism and location for saving a suspended job might vary depending on the job type. For example, suspended workflow jobs are saved in a flat file store by default, but can also be saved in a database. If you submit a workflow job that is not in the Running state, Suspend-Job displays a warning message. To suppress the warning, use the WarningAction* common parameter with a value of SilentlyContinue.</maml:para> <maml:para> If a job is not of a type that supports suspending, Suspend-Job returns a terminating error. To find the workflow jobs that are suspended, including those that were suspended by this cmdlet, use the State parameter of the Get-Job * cmdlet to get workflow jobs in the Suspended state.</maml:para> <maml:para>* Some job types have options or properties that prevent Windows PowerShell from suspending the job. If attempts to suspend the job fail, verify that the job options and properties allow for suspending.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1: Suspend a workflow job by name ----------</maml:title> <dev:code>The first command creates the Get-SystemLog workflow. The workflow uses the CheckPoint-Workflow activity to define a checkpoint in the workflow. #Sample WorkflowWorkflow Get-SystemLog { $Events = Get-WinEvent -LogName System CheckPoint-Workflow InlineScript {\\Server01\Scripts\Analyze-SystemEvents.ps1 -Events $Events} } The second command uses the *AsJob* parameter that is common to all workflows to run the Get-SystemLog workflow as a background job. The command uses the *JobName* workflow common parameter to specify a friendly name for the workflow job. PS C:\> Get-SystemLog -AsJob -JobName "Get-SystemLogJob" The third command uses the **Get-Job** cmdlet to get the Get-SystemLogJob workflow job. The output shows that the value of the **PSJobTypeName** property is PSWorkflowJob. PS C:\> Get-Job -Name Get-SystemLogJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 4 Get-SystemLogJob PSWorkflowJob Running True localhost Get-SystemLog The fourth command uses the **Suspend-Job** cmdlet to suspend the Get-SystemLogJob job. The job runs to the checkpoint and then suspends. PS C:\> Suspend-Job -Name Get-SystemLogJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 4 Get-SystemLogJob PSWorkflowJob Suspended True localhost Get-SystemLog</dev:code> <dev:remarks> <maml:para>This example shows how to suspend a workflow job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 2: Suspend and resume a workflow job ---------</maml:title> <dev:code>The first command suspends the LogWorkflowJob job.The command returns immediately. The output shows that the workflow job is still running, even though it is being suspended. PS C:\> Suspend-Job -Name LogWorkflowJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 67 LogflowJob PSWorkflowJob Running True localhost LogWorkflow The second command uses the **Get-Job** cmdlet to get the LogWorkflowJob job. The output shows that the workflow job suspended successfully. PS C:\> Get-Job -Name LogWorkflowJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 67 LogflowJob PSWorkflowJob Suspended True localhost LogWorkflow The third command uses the **Get-Job** cmdlet to get the LogWorkflowJob job and the Resume-Job cmdlet to resume it. The output shows that the workflow job resumed successfully and is now running. PS C:\> Get-Job -Name LogWorkflowJob | Resume-Job Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 67 LogflowJob PSWorkflowJob Running True localhost LogWorkflow</dev:code> <dev:remarks> <maml:para>This example shows how to suspend and resume a workflow job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 3: Suspend a workflow job on a remote computer ----</maml:title> <dev:code>PS C:\> Invoke-Command -ComputerName Srv01 -Scriptblock {Suspend-Job -Filter @{CustomID="031589"}</dev:code> <dev:remarks> <maml:para>This command uses the Invoke-Command cmdlet to suspend a workflow job on the Srv01 remote computer. The value of the Filter parameter is a hash table that specifies a CustomID value. This CustomID is job metadata ( PSPrivateMetadata ).</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 4: Wait for the workflow job to suspend -------</maml:title> <dev:code>PS C:\> Suspend-Job VersionCheck -Wait Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 5 VersionCheck PSWorkflowJob Suspended True localhost LogWorkflow</dev:code> <dev:remarks> <maml:para>This command suspends the VersionCheck workflow job. The command uses the Wait parameter to wait until the workflow job is suspended. When the workflow job runs to the next checkpoint and is suspended, the command finishes and returns the job object.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 5: Force a workflow job to suspend ----------</maml:title> <dev:code>PS C:\> Suspend-Job Maintenance -Force</dev:code> <dev:remarks> <maml:para>This command suspends the Maintenance workflow job forcibly. The Maintenance job does not have checkpoints. It cannot be suspended correctly and might not resume correctly.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/suspend-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Wait-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Test-ModuleManifest</command:name> <command:verb>Test</command:verb> <command:noun>ModuleManifest</command:noun> <maml:description> <maml:para>Verifies that a module manifest file accurately describes the contents of a module.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Test-ModuleManifest cmdlet verifies that the files that are listed in the module manifest (.psd1) file are actually in the specified paths.</maml:para> <maml:para>This cmdlet is designed to help module authors test their manifest files. Module users can also use this cmdlet in scripts and commands to detect errors before they run scripts that depend on the module. Test-ModuleManifest returns an object that represents the module. This is the same type of object that Get-Module returns. If any files are not in the locations specified in the manifest, the cmdlet also generates an error for each missing file.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-ModuleManifest</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies a path and file name for the manifest file. Enter an optional path and name of the module manifest file that has the .psd1 file name extension. The default location is the current directory. Wildcard characters are supported, but must resolve to a single module manifest file. This parameter is required. You can also pipe a path to Test-ModuleManifest .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies a path and file name for the manifest file. Enter an optional path and name of the module manifest file that has the .psd1 file name extension. The default location is the current directory. Wildcard characters are supported, but must resolve to a single module manifest file. This parameter is required. You can also pipe a path to Test-ModuleManifest .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe the path to a module manifest to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns a PSModuleInfo object that represents the module. It returns this object even if the manifest has errors.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>------------------ Example 1: Test a manifest ------------------</maml:title> <dev:code>test-ModuleManifest -Path "$pshome\Modules\TestModule.psd1"</dev:code> <dev:remarks> <maml:para>This command tests the TestModule.psd1 module manifest.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 2: Test a manifest by using the pipeline -------</maml:title> <dev:code>"$pshome\Modules\TestModule.psd1" | test-modulemanifest Test-ModuleManifest : The specified type data file 'C:\Windows\System32\Wi ndowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml' could not be processed because the file was not found. Please correct the path and try again. At line:1 char:34 + "$pshome\Modules\TestModule.psd1" | test-modulemanifest <<<< + CategoryInfo : ResourceUnavailable: (C:\Windows\System32\WindowsPowerShell\v1.0\Modules\TestModule\TestTypes.ps1xml:String) [Test-ModuleManifest], FileNotFoundException + FullyQualifiedErrorId : Modules_TypeDataFileNotFound,Microsoft.PowerShell.Commands.TestModuleManifestCommandName Name : TestModule Path : C:\Windows\system32\WindowsPowerShell\v1.0\Modules\TestModule\TestModule.psd1 Description : Guid : 6f0f1387-cd25-4902-b7b4-22cff6aefa7b Version : 1.0 ModuleBase : C:\Windows\system32\WindowsPowerShell\v1.0\Modules\TestModule ModuleType : Manifest PrivateData : AccessMode : ReadWrite ExportedAliases : {} ExportedCmdlets : {} ExportedFunctions : {} ExportedVariables : {} NestedModules : {}</dev:code> <dev:remarks> <maml:para>This command uses a pipeline operator (|) to send a path string to Test-ModuleManifest .</maml:para> <maml:para>The command output shows that the test failed, because the TestTypes.ps1xml file, which was listed in the manifest, was not found.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---- Example 3: Write a function to test a module manifest ----</maml:title> <dev:code>function Test-ManifestBool ($path) {$a = dir $path | Test-ModuleManifest -ErrorAction SilentlyContinue; $?}</dev:code> <dev:remarks> <maml:para>This function is like Test-ModuleManifest , but it returns a Boolean value. The function returns $True if the manifest passed the test and $False otherwise.</maml:para> <maml:para>The function uses the Get-ChildItem cmdlet, alias = dir, to get the module manifest specified by the $path variable. The command uses a pipeline operator (|) to pass the file object to Test-ModuleManifest . Test-ModuleManifest uses the ErrorAction common parameter with a value of SilentlyContinue to suppress the display of any errors that the command generates. It also saves the PSModuleInfo object that Test-ModuleManifest returns in the $a variable. Therefore, the object is not displayed.</maml:para> <maml:para>Then, in a separate command, the function displays the value of the $? automatic variable. If the previous command generates no error, the command displays $True, and $False otherwise.</maml:para> <maml:para>You can use this function in conditional statements, such as those that might precede an Import-Module command or a command that uses the module.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/test-modulemanifest?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Export-ModuleMember</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Import-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-ModuleManifest</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Modules</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Test-PSSessionConfigurationFile</command:name> <command:verb>Test</command:verb> <command:noun>PSSessionConfigurationFile</command:noun> <maml:description> <maml:para>Verifies the keys and values in a session configuration file.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>This cmdlet verifies that a session configuration file contains valid keys and the values are of the correct type. For enumerated values, the cmdlet verifies that the specified values are valid.</maml:para> <maml:para>The cmdlet returns `$True` if the file passes all tests and `$False` if it does not. To find any errors, use the Verbose parameter.</maml:para> <maml:para>`Test-PSSessionConfigurationFile` verifies the session configuration files, such as those created by the `New-PSSessionConfigurationFile` cmdlet. For information about session configurations, see about_Session_Configurations (About/about_Session_Configurations.md). For information about session configuration files, see about_Session_Configuration_Files (About/about_Session_Configuration_Files.md).</maml:para> <maml:para>This cmdlet was introduced in PowerShell 3.0.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-PSSessionConfigurationFile</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of a session configuration file (.pssc). If you omit the path, the default is the current folder. Wildcard characters are supported, but they must resolve to a single file. You can also pipe a session configuration file path to `Test-PSSessionConfigurationFile`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:Description> <maml:para>Specifies the path and filename of a session configuration file (.pssc). If you omit the path, the default is the current folder. Wildcard characters are supported, but they must resolve to a single file. You can also pipe a session configuration file path to `Test-PSSessionConfigurationFile`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session configuration file path to `Test-PSSessionConfigurationFile`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Boolean</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Test a session configuration file ---------</maml:title> <dev:code>Test-PSSessionConfigurationFile -Path "FullLanguage.pssc" True</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Test the session configuration file of a session configuration</maml:title> <dev:code>Test-PSSessionConfigurationFile -Path (Get-PSSessionConfiguration -Name Restricted).ConfigFilePath</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 3: Test all session configuration files -------</maml:title> <dev:code>function Test-AllConfigFiles { Get-PSSessionConfiguration | ForEach-Object { if ($_.ConfigFilePath) { $_.ConfigFilePath Test-PSSessionConfigurationFile -Verbose -Path $_.ConfigFilePath } } } Test-AllConfigFiles C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Empty_6fd77bf6-e084-4372-bd8a-af3e207354d3.pssc True C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Full_1e9cb265-dae0-4bd3-89a9-8338a47698a1.pssc VERBOSE: The member 'AliasDefinitions' must contain the required key 'Description'. Add the require key to the fileC:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\Full_1e9cb265-dae0-4bd3-89a9-8338a47698a1.pssc. False C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\NoLanguage_0c115179-ff2a-4f66-a5eb-e56e5692ba22.pssc True C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\RestrictedLang_b6bd9474-0a6c-4e06-8722-c2c95bb10d3e.pssc True C:\WINDOWS\System32\WindowsPowerShell\v1.0\SessionConfig\RRS_3fb29420-2c87-46e5-a402-e21436331efc.pssc True</dev:code> <dev:remarks> <maml:para>The ConfigFilePath property of a session configuration contains the path of the session configuration file that is used in the session configuration, if any.</maml:para> <maml:para>If the value of the ConfigFilePath property is populated (is true), the command gets (prints) the ConfigFilePath property value. Then it uses the `Test-PSSessionConfigurationFile` cmdlet to test the file in the ConfigFilePath value. The Verbose parameter returns the file error when the file fails the test.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/test-pssessionconfigurationfile?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Unregister-PSSessionConfiguration</command:name> <command:verb>Unregister</command:verb> <command:noun>PSSessionConfiguration</command:noun> <maml:description> <maml:para>Deletes registered session configurations from the computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Unregister-PSSessionConfiguration` cmdlet deletes registered session configurations from the computer. This cmdlet is designed for system administrators to manage customized session configurations for users.</maml:para> <maml:para>To make the change effective, `Unregister-PSSessionConfiguration` restarts the WinRM service. To prevent the restart, specify the NoServiceRestart parameter.</maml:para> <maml:para>If you accidentally delete the default Microsoft.PowerShell or Microsoft.PowerShell32 session configurations, use the `Enable-PSRemoting` cmdlet to restore them. For more information, see about_Session_Configurations (About/about_Session_Configurations.md).</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Unregister-PSSessionConfiguration</maml:name> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of the session configurations to delete. Enter one session configuration name or a configuration name pattern. Wildcard characters are permitted. This parameter is required.</maml:para> <maml:para>You can also pipe a session configurations to `Unregister-PSSessionConfiguration`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that the cmdlet does not prompt you for confirmation, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run an `Unregister-PSSessionConfiguration` command, you are prompted to restart the WinRM service to make the change effective. Until the WinRM service is restarted, users can still use the unregistered session configuration, even though `Get-PSSessionConfiguration` does not find it.</maml:para> <maml:para>To restart the WinRM service without prompting, specify the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that the cmdlet does not prompt you for confirmation, and restarts the WinRM service without prompting. Restarting the service makes the configuration change effective.</maml:para> <maml:para>To prevent a restart and suppress the restart prompt, use the NoServiceRestart parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies the names of the session configurations to delete. Enter one session configuration name or a configuration name pattern. Wildcard characters are permitted. This parameter is required.</maml:para> <maml:para>You can also pipe a session configurations to `Unregister-PSSessionConfiguration`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>NoServiceRestart</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet does not restart the WinRM service, and suppresses the prompt to restart the service.</maml:para> <maml:para>By default, when you run an `Unregister-PSSessionConfiguration` command, you are prompted to restart the WinRM service to make the change effective. Until the WinRM service is restarted, users can still use the unregistered session configuration, even though `Get-PSSessionConfiguration` does not find it.</maml:para> <maml:para>To restart the WinRM service without prompting, specify the Force parameter. To restart the WinRM service manually, use the `Restart-Service` cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>Microsoft.PowerShell.Commands.PSSessionConfigurationCommands#PSSessionConfiguration</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a session configuration object from `Get-PSSessionConfiguration` to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet does not return any objects.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To run this cmdlet you must start PowerShell by using the Run as administrator option.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1: Delete a session configuration ----------</maml:title> <dev:code>Unregister-PSSessionConfiguration -Name "MaintenanceShell"</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Delete a session configuration and restart the WinRM service</maml:title> <dev:code>Unregister-PSSessionConfiguration -Name MaintenanceShell -Force</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 3: Delete all session configurations ---------</maml:title> <dev:code>Unregister-PSSessionConfiguration -Name * Get-PSSessionConfiguration -Name * | Unregister-PSSessionConfiguration</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 4: Unregister without a restart -----------</maml:title> <dev:code>PS> Unregister-PSSessionConfiguration -Name "MaintenanceShell" -NoServiceRestart PS> Get-PSSessionConfiguration -Name "MaintenanceShell" Get-PSSessionConfiguration -Name MaintenanceShell : No Session Configuration matches criteria "MaintenanceShell". + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException PS> New-PSSession -ConfigurationName "MaintenanceShell" Id Name ComputerName State Configuration Availability -- ---- ------------ ----- ------------- ------------ 1 Session1 localhost Opened MaintenanceShell Available PS> Restart-Service winrm PS> New-PSSession -ConfigurationName MaintenanceShell [localhost] Connecting to remote server failed with the following error message : The WS-Management service cannot process the request. The resource URI (http://schemas.microsoft.com/powershell/MaintenanceShell) was not found in the WS-Management catalog. The catalog contains the metadata that describes resources, or logical endpoints. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionOpenFailed</dev:code> <dev:remarks> <maml:para>The `Unregister-PSSessionConfiguration` deletes the MaintenanceShell session configuration. However, because the command uses the NoServiceRestart parameter, the WinRM service is not restarted and the change is not yet completely effective.</maml:para> <maml:para>Next, the `Get-PSSessionConfiguration` tries to get the MaintenanceShell session. Because the session has been removed from the WS-Management resource table, `Get-PSSessionConfiguration` cannot return it.</maml:para> <maml:para>The `New-PSSession` cmdlet creates a session using the MaintenanceShell configuration. The command succeeds. Next, we restart the WinRM service.</maml:para> <maml:para>Finally, the `New-PSSession` cmdlet tries to create a session that uses the MaintenanceShell configuration. This time, the session fails because the MaintenanceShell configuration was deleted when the WinRM service restarted.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/unregister-pssessionconfiguration?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Disable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Enable-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-PSSessionOption</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Register-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Set-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Test-PSSessionConfigurationFile</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Unregister-PSSessionConfiguration</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>WSMan Provider</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configurations</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>about_Session_Configuration_Files</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Update-Help</command:name> <command:verb>Update</command:verb> <command:noun>Help</command:noun> <maml:description> <maml:para>Downloads and installs the newest help files on your computer.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Update-Help` cmdlet downloads the newest help files for PowerShell modules and installs them on your computer. You don't need to restart PowerShell to make the change effective. You can use the `Get-Help` cmdlet to view the new help files immediately.</maml:para> <maml:para>`Update-Help` checks the version of the help files on your computer. If you don't have help files for a module or if your help files are outdated, `Update-Help` downloads the newest help files. The help files can be downloaded and installed from the internet or a file share.</maml:para> <maml:para>Without parameters, `Update-Help` updates the help files for modules in the session and for all installed modules that support Updatable Help. Modules that are installed but not loaded in the current session are included. PowerShell modules are stored in a location listed in the `$env:PSModulePath` environment variable. For more information, see about_Updatable_Help (./About/about_Updatable_Help.md).</maml:para> <maml:para>You can use the Module parameter to update help files for a particular module. Use the UICulture parameter to download help files in multiple languages and locales.</maml:para> <maml:para>You can't use `Update-Help` on computers that aren't connected to the internet. Use the `Save-Help` cmdlet to download help files from the internet and save them in a file system location, such as a shared folder or file system directory. Then use the SourcePath parameter of `Update-Help` to download the updated help files from a file system location and install them on the computer.</maml:para> <maml:para>You can automate help updates by adding the `Update-Help` cmdlet to your PowerShell profile. By default, `Update-Help` runs only one time per day on each computer. To override the once-per-day limit, use the Force parameter.</maml:para> <maml:para>The `Update-Help` cmdlet was introduced in Windows PowerShell 3.0.</maml:para> <maml:para>> [!IMPORTANT] > `Update-Help` requires administrative privileges. > > You must be a member of the Administrators group on the computer > to update the help files for the PowerShell Core modules. > > To download or update the help files for modules in the PowerShell > installation directory (`$PSHOME\Modules`), including the PowerShell > Core modules, start PowerShell by using the Run as administrator option. > For example: `Start-Process powershell.exe -Verb RunAs`. > > You can also update help files by using the Update Windows PowerShell Help > menu item in the Help menu in Windows PowerShell Integrated Scripting > Environment (ISE). > > The Update Windows PowerShell Help item runs an `Update-Help` cmdlet > without parameters. > To update help for modules in the `$PSHOME` directory, > start Windows PowerShell ISE by using the Run as administrator option.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Update-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="Name"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Updates help for the specified modules. Enter one or more module names or name patterns in a comma-separated list, or specify a file that lists one module name on each line. Wildcard characters are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Update-Help` cmdlet.</maml:para> <maml:para>The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that is installed in a location listed in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the command encounters modules that don't support Updatable Help. Instead, run `Update-Help` without parameters.</maml:para> <maml:para>The Module parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies UI culture values that `Update-Help` uses to get updated help files. Enter one or more language codes, such as es-ES , a variable that contains culture objects, or a command that gets culture objects, such as a `Get-Culture` or `Get-UICulture` command. Wildcard characters aren't permitted and you can't submit a partial language code, such as de .</maml:para> <maml:para>By default, `Update-Help` gets help files in the UI culture set for the operating system. If you specify the UICulture parameter, `Update-Help` looks for help only for the specified UI culture.</maml:para> <maml:para>Commands that use the UICulture parameter succeed only when the module provides help files for the specified UI culture. If the command fails because the specified UI culture isn't supported, an error message is displayed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo[]</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies credentials of a user who has permission to access the file system location specified by SourcePath . This parameter is valid only when the SourcePath or LiteralPath parameter is used in the command.</maml:para> <maml:para>The Credential parameter enables you to run `Update-Help` commands with the SourcePath parameter on remote computers. By providing explicit credentials, you can run the command on a remote computer and access a file share on a third computer without encountering an access denied error or using CredSSP authentication to delegate credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet doesn't follow the once-per-day limitation, skips version checking, and downloads files that exceed the 1 GB limit.</maml:para> <maml:para>Without this parameter, `Update-Help` runs only once in each 24-hour period. Downloads are limited to 1 GB of uncompressed content per module and help files are only installed when they're newer than the existing files on the computer.</maml:para> <maml:para>The once-per-day limit protects the servers that host the help files and makes it practical for you to add an `Update-Help` command to your PowerShell profile without incurring the resource cost of repeated connections or downloads.</maml:para> <maml:para>To update help for a module in multiple UI cultures without the Force parameter, include all UI cultures in the same command, such as:</maml:para> <maml:para>`Update-Help -Module PSScheduledJobs -UICulture en-US, fr-FR, pt-BR`</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects. These modules are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_).</maml:para> <maml:para>For example, the FullyQualifiedModule parameter accepts a module name that is specified in the format:</maml:para> <maml:para>`@{ModuleName = "modulename"; ModuleVersion = "version_number"}`</maml:para> <maml:para>or</maml:para> <maml:para>`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You can't specify the FullyQualifiedModule parameter in the same command as a Module parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:Description> <maml:para>Specifies the folder for updated help files instead of downloading them from the internet. Use this parameter or SourcePath if you've used the `Save-Help` cmdlet to download help files to a directory.</maml:para> <maml:para>You can pipeline a directory object, such as from the `Get-Item` or `Get-ChildItem` cmdlets, to `Update-Help`.</maml:para> <maml:para>Unlike the value of SourcePath , the value of LiteralPath is used exactly as it's typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Recurse</maml:name> <maml:Description> <maml:para>Performs a recursive search for help files in the specified directory. This parameter is valid only when the command uses the SourcePath parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseDefaultCredentials</maml:name> <maml:Description> <maml:para>Indicates that `Update-Help` runs the command, including the internet download, by using the credentials of the current user. By default, the command runs without explicit credentials.</maml:para> <maml:para>This parameter is effective only when the web download uses NT LAN Manager (NTLM), negotiate, or Kerberos-based authentication.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Update-Help</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="Name"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Updates help for the specified modules. Enter one or more module names or name patterns in a comma-separated list, or specify a file that lists one module name on each line. Wildcard characters are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Update-Help` cmdlet.</maml:para> <maml:para>The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that is installed in a location listed in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the command encounters modules that don't support Updatable Help. Instead, run `Update-Help` without parameters.</maml:para> <maml:para>The Module parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>SourcePath</maml:name> <maml:Description> <maml:para>Specifies a file system folder where `Update-Help` gets updated help files, instead of downloading them from the internet. Enter the path of a folder. Don't specify a file name or file name extension. You can pipeline a folder, such as one from the `Get-Item` or `Get-ChildItem` cmdlets, to `Update-Help`.</maml:para> <maml:para>By default, `Update-Help` downloads updated help files from the internet. Use SourcePath when you've used the `Save-Help` cmdlet to download updated help files to a directory.</maml:para> <maml:para>To specify a default value for SourcePath , go to Group Policy , Computer Configuration , and Set the default source path for Update-Help . This Group Policy setting prevents users from using `Update-Help` to download help files from the internet. For more information, see about_Group_Policy_Settings (./About/about_Group_Policy_Settings.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies UI culture values that `Update-Help` uses to get updated help files. Enter one or more language codes, such as es-ES , a variable that contains culture objects, or a command that gets culture objects, such as a `Get-Culture` or `Get-UICulture` command. Wildcard characters aren't permitted and you can't submit a partial language code, such as de .</maml:para> <maml:para>By default, `Update-Help` gets help files in the UI culture set for the operating system. If you specify the UICulture parameter, `Update-Help` looks for help only for the specified UI culture.</maml:para> <maml:para>Commands that use the UICulture parameter succeed only when the module provides help files for the specified UI culture. If the command fails because the specified UI culture isn't supported, an error message is displayed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo[]</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies credentials of a user who has permission to access the file system location specified by SourcePath . This parameter is valid only when the SourcePath or LiteralPath parameter is used in the command.</maml:para> <maml:para>The Credential parameter enables you to run `Update-Help` commands with the SourcePath parameter on remote computers. By providing explicit credentials, you can run the command on a remote computer and access a file share on a third computer without encountering an access denied error or using CredSSP authentication to delegate credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet doesn't follow the once-per-day limitation, skips version checking, and downloads files that exceed the 1 GB limit.</maml:para> <maml:para>Without this parameter, `Update-Help` runs only once in each 24-hour period. Downloads are limited to 1 GB of uncompressed content per module and help files are only installed when they're newer than the existing files on the computer.</maml:para> <maml:para>The once-per-day limit protects the servers that host the help files and makes it practical for you to add an `Update-Help` command to your PowerShell profile without incurring the resource cost of repeated connections or downloads.</maml:para> <maml:para>To update help for a module in multiple UI cultures without the Force parameter, include all UI cultures in the same command, such as:</maml:para> <maml:para>`Update-Help -Module PSScheduledJobs -UICulture en-US, fr-FR, pt-BR`</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects. These modules are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_).</maml:para> <maml:para>For example, the FullyQualifiedModule parameter accepts a module name that is specified in the format:</maml:para> <maml:para>`@{ModuleName = "modulename"; ModuleVersion = "version_number"}`</maml:para> <maml:para>or</maml:para> <maml:para>`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You can't specify the FullyQualifiedModule parameter in the same command as a Module parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Recurse</maml:name> <maml:Description> <maml:para>Performs a recursive search for help files in the specified directory. This parameter is valid only when the command uses the SourcePath parameter.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseDefaultCredentials</maml:name> <maml:Description> <maml:para>Indicates that `Update-Help` runs the command, including the internet download, by using the credentials of the current user. By default, the command runs without explicit credentials.</maml:para> <maml:para>This parameter is effective only when the web download uses NT LAN Manager (NTLM), negotiate, or Kerberos-based authentication.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Credential</maml:name> <maml:Description> <maml:para>Specifies credentials of a user who has permission to access the file system location specified by SourcePath . This parameter is valid only when the SourcePath or LiteralPath parameter is used in the command.</maml:para> <maml:para>The Credential parameter enables you to run `Update-Help` commands with the SourcePath parameter on remote computers. By providing explicit credentials, you can run the command on a remote computer and access a file share on a third computer without encountering an access denied error or using CredSSP authentication to delegate credentials.</maml:para> <maml:para>Type a user name, such as User01 or Domain01\User01 , or enter a PSCredential object generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password.</maml:para> <maml:para>Credentials are stored in a PSCredential (/dotnet/api/system.management.automation.pscredential)object and the password is stored as a SecureString (/dotnet/api/system.security.securestring).</maml:para> <maml:para>> [!NOTE] > For more information about SecureString data protection, see > How secure is SecureString? (/dotnet/api/system.security.securestring#how-secure-is-securestring).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSCredential</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSCredential</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>Current user</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet doesn't follow the once-per-day limitation, skips version checking, and downloads files that exceed the 1 GB limit.</maml:para> <maml:para>Without this parameter, `Update-Help` runs only once in each 24-hour period. Downloads are limited to 1 GB of uncompressed content per module and help files are only installed when they're newer than the existing files on the computer.</maml:para> <maml:para>The once-per-day limit protects the servers that host the help files and makes it practical for you to add an `Update-Help` command to your PowerShell profile without incurring the resource cost of repeated connections or downloads.</maml:para> <maml:para>To update help for a module in multiple UI cultures without the Force parameter, include all UI cultures in the same command, such as:</maml:para> <maml:para>`Update-Help -Module PSScheduledJobs -UICulture en-US, fr-FR, pt-BR`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="none"> <maml:name>FullyQualifiedModule</maml:name> <maml:Description> <maml:para>Specifies modules with names that are specified in the form of ModuleSpecification objects. These modules are described in the Remarks section of ModuleSpecification Constructor (Hashtable) (/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_).</maml:para> <maml:para>For example, the FullyQualifiedModule parameter accepts a module name that is specified in the format:</maml:para> <maml:para>`@{ModuleName = "modulename"; ModuleVersion = "version_number"}`</maml:para> <maml:para>or</maml:para> <maml:para>`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` ModuleName and ModuleVersion are required, but Guid is optional.</maml:para> <maml:para>You can't specify the FullyQualifiedModule parameter in the same command as a Module parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">Microsoft.PowerShell.Commands.ModuleSpecification[]</command:parameterValue> <dev:type> <maml:name>Microsoft.PowerShell.Commands.ModuleSpecification[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="named" aliases="PSPath"> <maml:name>LiteralPath</maml:name> <maml:Description> <maml:para>Specifies the folder for updated help files instead of downloading them from the internet. Use this parameter or SourcePath if you've used the `Save-Help` cmdlet to download help files to a directory.</maml:para> <maml:para>You can pipeline a directory object, such as from the `Get-Item` or `Get-ChildItem` cmdlets, to `Update-Help`.</maml:para> <maml:para>Unlike the value of SourcePath , the value of LiteralPath is used exactly as it's typed. No characters are interpreted as wildcard characters. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="True (ByPropertyName)" position="0" aliases="Name"> <maml:name>Module</maml:name> <maml:Description> <maml:para>Updates help for the specified modules. Enter one or more module names or name patterns in a comma-separated list, or specify a file that lists one module name on each line. Wildcard characters are permitted. You can pipeline modules from the `Get-Module` cmdlet to the `Update-Help` cmdlet.</maml:para> <maml:para>The modules that you specify must be installed on the computer, but they don't have to be imported into the current session. You can specify any module in the session or any module that is installed in a location listed in the `$env:PSModulePath` environment variable.</maml:para> <maml:para>A value of `*` (all) attempts to update help for all modules that are installed on the computer. Modules that don't support Updatable Help are included. This value might generate errors when the command encounters modules that don't support Updatable Help. Instead, run `Update-Help` without parameters.</maml:para> <maml:para>The Module parameter of the `Update-Help` cmdlet doesn't accept the full path of a module file or module manifest file. To update help for a module that isn't in a `$env:PSModulePath` location, import the module into the current session before you run the `Update-Help` command.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Recurse</maml:name> <maml:Description> <maml:para>Performs a recursive search for help files in the specified directory. This parameter is valid only when the command uses the SourcePath parameter.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>SourcePath</maml:name> <maml:Description> <maml:para>Specifies a file system folder where `Update-Help` gets updated help files, instead of downloading them from the internet. Enter the path of a folder. Don't specify a file name or file name extension. You can pipeline a folder, such as one from the `Get-Item` or `Get-ChildItem` cmdlets, to `Update-Help`.</maml:para> <maml:para>By default, `Update-Help` downloads updated help files from the internet. Use SourcePath when you've used the `Save-Help` cmdlet to download updated help files to a directory.</maml:para> <maml:para>To specify a default value for SourcePath , go to Group Policy , Computer Configuration , and Set the default source path for Update-Help . This Group Policy setting prevents users from using `Update-Help` to download help files from the internet. For more information, see about_Group_Policy_Settings (./About/about_Group_Policy_Settings.md).</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>UICulture</maml:name> <maml:Description> <maml:para>Specifies UI culture values that `Update-Help` uses to get updated help files. Enter one or more language codes, such as es-ES , a variable that contains culture objects, or a command that gets culture objects, such as a `Get-Culture` or `Get-UICulture` command. Wildcard characters aren't permitted and you can't submit a partial language code, such as de .</maml:para> <maml:para>By default, `Update-Help` gets help files in the UI culture set for the operating system. If you specify the UICulture parameter, `Update-Help` looks for help only for the specified UI culture.</maml:para> <maml:para>Commands that use the UICulture parameter succeed only when the module provides help files for the specified UI culture. If the command fails because the specified UI culture isn't supported, an error message is displayed.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Globalization.CultureInfo[]</command:parameterValue> <dev:type> <maml:name>System.Globalization.CultureInfo[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>UseDefaultCredentials</maml:name> <maml:Description> <maml:para>Indicates that `Update-Help` runs the command, including the internet download, by using the credentials of the current user. By default, the command runs without explicit credentials.</maml:para> <maml:para>This parameter is effective only when the web download uses NT LAN Manager (NTLM), negotiate, or Kerberos-based authentication.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet isn't run.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.IO.DirectoryInfo</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a directory path to `Update-Help`.</maml:para> </maml:description> </command:inputType> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSModuleInfo</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a module object from the `Get-Module` cmdlet to `Update-Help`.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>None</maml:name> </dev:type> <maml:description> <maml:para>`Update-Help` doesn't generate any output.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>To update help for the PowerShell Core modules, that contain the commands that are installed with PowerShell, or any module in the `$PSHOME\Modules` directory, start PowerShell with the option to Run as administrator .</maml:para> <maml:para>Only members of the Administrators group on the computer can update help for the PowerShell Core modules, the commands that are installed together with PowerShell, and for modules in the `$PSHOME\Modules` folder. If you don't have permission to update help files, you can read the help files online. For example, `Get-Help Update-Help -Online`.</maml:para> <maml:para>Modules are the smallest unit of updatable help. You can't update help for a particular cmdlet. To find the module that contains a particular cmdlet, use the ModuleName property of the `Get-Command` cmdlet, for example, `(Get-Command Update-Help).ModuleName`.</maml:para> <maml:para>Because help files are installed in the module directory, the `Update-Help` cmdlet can install updated help file only for modules that are installed on the computer. However, the `Save-Help` cmdlet can save help for modules that aren't installed on the computer.</maml:para> <maml:para>If `Update-Help` can't find updated help files for a module, or can't find updated help in the specified language, it continues silently without displaying an error message. To see status and progress details, use the Verbose parameter.</maml:para> <maml:para>The `Update-Help` cmdlet was introduced in Windows PowerShell 3.0. It doesn't work in earlier versions of PowerShell. On computers that have both Windows PowerShell 2.0 and Windows PowerShell 3.0, use the `Update-Help` cmdlet in a Windows PowerShell 3.0 session to download and update help files. The help files are available to both Windows PowerShell 2.0 and Windows PowerShell 3.0.</maml:para> <maml:para>The `Update-Help` and `Save-Help` cmdlets use the following ports to download help files: Port 80 for HTTP and port 443 for HTTPS.</maml:para> <maml:para>`Update-Help` supports all modules and the PowerShell Core snap-ins. It doesn't support any other snap-ins.</maml:para> <maml:para>To update help for a module in a location that isn't listed in the `$env:PSModulePath` environment variable, import the module into the current session and then run an `Update-Help` command. Run `Update-Help` without parameters or use the Module parameter to specify the module name. The Module parameter of the `Update-Help` and `Save-Help` cmdlets doesn't accept the full path of a module file or module manifest file.</maml:para> <maml:para>Any module can support Updatable Help. For instructions for supporting Updatable Help in the modules that you author, see Supporting Updatable Help (/powershell/scripting/developer/module/supporting-updatable-help).</maml:para> <maml:para>The `Update-Help` and `Save-Help` cmdlets are not supported on Windows Preinstallation Environment (Windows PE).</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------- Example 1: Update help files for all modules ---------</maml:title> <dev:code>Update-Help</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 2: Update help files for specified modules ------</maml:title> <dev:code>Update-Help -Module Microsoft.PowerShell*</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 3: Update help files for different languages -----</maml:title> <dev:code>Update-Help -UICulture ja-JP, en-US Update-Help : Failed to update Help for the module(s) 'Microsoft.PowerShell.Utility' with UI culture(s) {ja-JP} No UI culture was found that matches the following pattern: ja-JP.</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 4: Update help files automatically ----------</maml:title> <dev:code>$jobParams = @{ Name = 'UpdateHelpJob' Credential = 'Domain01\User01' ScriptBlock = '{Update-Help}' Trigger = (New-JobTrigger -Daily -At "3 AM") } Register-ScheduledJob @jobParams Id Name JobTriggers Command Enabled -- ---- ----------- ------- ------- 1 UpdateHelpJob 1 Update-Help True</dev:code> <dev:remarks> <maml:para>The `Register-ScheduledJob` cmdlet creates a scheduled job that runs an `Update-Help` command. The command uses the Credential parameter to run `Update-Help` by using the credentials of a member of the Administrators group on the computer. The value of the Trigger parameter is a `New-JobTrigger` command that creates a job trigger that starts the job every day at 3:00 AM.</maml:para> <maml:para>To run the `Register-ScheduledJob` command, start PowerShell by using the Run as administrator option. PowerShell prompts you for the password of the user specified in the Credential parameter. The credentials are stored with the scheduled job. You aren't prompted when the job runs.</maml:para> <maml:para>You can use the `Get-ScheduledJob` cmdlet to view the scheduled job, use the `Set-ScheduledJob` cmdlet to change it, and use the `Unregister-ScheduledJob` cmdlet to delete it. You can also view and manage the scheduled job in Task Scheduler in the following path:</maml:para> <maml:para>`Task Scheduler Library\Microsoft\Windows\PowerShell\ScheduledJobs`.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 5: Update help files on multiple computers from a file share</maml:title> <dev:code>Save-Help -DestinationPath \\Server01\Share\PSHelp -Credential Domain01\Admin01 Invoke-Command -ComputerName (Get-Content Servers.txt) -ScriptBlock { Update-Help -SourcePath \\Server01\Share\PSHelp -Credential Domain01\Admin01 }</dev:code> <dev:remarks> <maml:para>The `Save-Help` command downloads the newest help files for all modules that support Updatable Help. The DestinationPath parameter saves the files in the `\Server01\Share\PSHelp` file share. The Credential parameter specifies a user who has permission to access the file share.</maml:para> <maml:para>The `Invoke-Command` cmdlet runs remote `Update-Help` commands on multiple computers. The ComputerName parameter gets a list of remote computers from the Servers.txt file. The ScriptBlock parameter runs the `Update-Help` command and uses the SourcePath parameter to specify the file share that contains the updated help files. The Credential parameter specifies a user who can access the file share and run the remote `Update-Help` command.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 6: Get a list of updated help files ---------</maml:title> <dev:code>Update-Help -Module Microsoft.PowerShell.Utility -Verbose</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----- Example 7: Find modules that support Updatable Help -----</maml:title> <dev:code>Get-Module -ListAvailable | Where-Object -Property HelpInfoUri Directory: C:\program files\powershell\6\Modules ModuleType Version Name PSEdition ExportedCommands ---------- ------- ---- --------- ---------------- Manifest 6.1.0.0 CimCmdlets Core {Get-CimAssociatedInstance... } Manifest 1.2.2.0 Microsoft.PowerShell.Archive Desk {Compress-Archive... } Manifest 6.1.0.0 Microsoft.PowerShell.Diagnostics Core {Get-WinEvent, New-WinEvent} Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules ModuleType Version Name PSEdition ExportedCommands ---------- ------- ---- --------- ---------------- Manifest 2.0.1.0 Appx Core,Desk {Add-AppxPackage, ... } Script 1.0.0.0 AssignedAccess Core,Desk {Clear-AssignedAccess, ... } Manifest 1.0.0.0 BitLocker Core,Desk {Unlock-BitLocker, ... }</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>----------- Example 8: Inventory updated help files -----------</maml:title> <dev:code># Get-UpdateHelpVersion.ps1 Param( [parameter(Mandatory=$False)] [String[]] $Module ) $HelpInfoNamespace = @{helpInfo='http://schemas.microsoft.com/powershell/help/2010/05'} if ($Module) { $Modules = Get-Module $Module -ListAvailable | where {$_.HelpInfoUri} } else { $Modules = Get-Module -ListAvailable | where {$_.HelpInfoUri} } foreach ($mModule in $Modules) { $mDir = $mModule.ModuleBase if (Test-Path $mdir\*helpinfo.xml) { $mName=$mModule.Name $mNodes = dir $mdir\*helpinfo.xml -ErrorAction SilentlyContinue | Select-Xml -Namespace $HelpInfoNamespace -XPath "//helpInfo:UICulture" foreach ($mNode in $mNodes) { $mCulture=$mNode.Node.UICultureName $mVer=$mNode.Node.UICultureVersion [PSCustomObject]@{"ModuleName"=$mName; "Culture"=$mCulture; "Version"=$mVer} } } } ModuleName Culture Version ---------- ------- ------- ActiveDirectory en-US 3.0.0.0 ADCSAdministration en-US 3.0.0.0 ADCSDeployment en-US 3.0.0.0 ADDSDeployment en-US 3.0.0.0 ADFS en-US 3.0.0.0</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/update-help?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Culture</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Module</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-UICulture</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Save-Help</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Wait-Job</command:name> <command:verb>Wait</command:verb> <command:noun>Job</command:noun> <maml:description> <maml:para>Suppresses the command prompt until one or all of the Windows PowerShell background jobs running in the session are completed.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Wait-Job cmdlet waits for Windows PowerShell background jobs to finish before it displays the command prompt. You can wait until any background job is complete, or until all background jobs are complete, and you can set a maximum wait time for the job.</maml:para> <maml:para>When the commands in the job are complete, Wait-Job displays the command prompt and returns a job object so that you can pipe it to another command.</maml:para> <maml:para>You can use Wait-Job cmdlet to wait for background jobs, such as those that were started by using the Start-Job cmdlet or the AsJob parameter of the Invoke-Command cmdlet. For more information about Windows PowerShell background jobs, see about_Jobs.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, the Wait-Job cmdlet also waits for custom job types, such as workflow jobs and instances of scheduled jobs. To enable Wait-Job to wait for jobs of a particular type, import the module that supports the custom job type into the session before you run the Get-Job cmdlet, either by using the Import-Module cmdlet or by using or getting a cmdlet in the module. For information about a particular custom job type, see the documentation of the custom job type feature.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Wait-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet waits for jobs that satisfy all of the conditions in the hash table. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Wait-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of jobs for which this cmdlet waits.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, type `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Wait-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of jobs for which this cmdlet waits. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Wait-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs for which this cmdlet waits. Enter a variable that contains the job objects or a command that gets the job objects. You can also use a pipeline operator to send job objects to the Wait-Job cmdlet. By default, Wait-Job waits for all jobs created in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Wait-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies friendly names of jobs for which this cmdlet waits.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Wait-Job</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet waits only for jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValueGroup> <command:parameterValue required="false" command:variableLength="false">NotStarted</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Running</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Completed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Failed</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopped</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Blocked</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspended</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Disconnected</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Suspending</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">Stopping</command:parameterValue> <command:parameterValue required="false" command:variableLength="false">AtBreakpoint</command:parameterValue> </command:parameterValueGroup> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Any</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet displays the command prompt, and returns the job object, when any job finishes. By default, Wait-Job waits until all of the specified jobs are complete before it displays the prompt.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Filter</maml:name> <maml:Description> <maml:para>Specifies a hash table of conditions. This cmdlet waits for jobs that satisfy all of the conditions in the hash table. Enter a hash table where the keys are job properties and the values are job property values.</maml:para> <maml:para>This parameter works only on custom job types, such as workflow jobs and scheduled jobs. It does not work on standard background jobs, such as those created by using the Start-Job cmdlet. For information about support for this parameter, see the help topic for the job type.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Collections.Hashtable</command:parameterValue> <dev:type> <maml:name>System.Collections.Hashtable</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Force</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet continues to wait for jobs in the Suspended or Disconnected state. By default, Wait-Job returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para></maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Id</maml:name> <maml:Description> <maml:para>Specifies an array of IDs of jobs for which this cmdlet waits.</maml:para> <maml:para>The ID is an integer that uniquely identifies the job in the current session. It is easier to remember and type than the instance ID, but it is unique only in the current session. You can type one or more IDs, separated by commas. To find the ID of a job, type `Get-Job`.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32[]</command:parameterValue> <dev:type> <maml:name>System.Int32[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>InstanceId</maml:name> <maml:Description> <maml:para>Specifies an array of instance IDs of jobs for which this cmdlet waits. The default is all jobs.</maml:para> <maml:para>An instance ID is a GUID that uniquely identifies the job on the computer. To find the instance ID of a job, use Get-Job .</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Guid[]</command:parameterValue> <dev:type> <maml:name>System.Guid[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Job</maml:name> <maml:Description> <maml:para>Specifies the jobs for which this cmdlet waits. Enter a variable that contains the job objects or a command that gets the job objects. You can also use a pipeline operator to send job objects to the Wait-Job cmdlet. By default, Wait-Job waits for all jobs created in the current session.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.Job[]</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.Job[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>Name</maml:name> <maml:Description> <maml:para>Specifies friendly names of jobs for which this cmdlet waits.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String[]</command:parameterValue> <dev:type> <maml:name>System.String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="0" aliases="none"> <maml:name>State</maml:name> <maml:Description> <maml:para>Specifies a job state. This cmdlet waits only for jobs in the specified state. The acceptable values for this parameter are:</maml:para> <maml:para>- NotStarted</maml:para> <maml:para>- Running</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Blocked</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected</maml:para> <maml:para>- Suspending</maml:para> <maml:para>- Stopping</maml:para> <maml:para></maml:para> <maml:para>For more information about job states, see JobState Enumeration (https://msdn.microsoft.com/library/system.management.automation.jobstate)in the MSDN library.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.JobState</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.JobState</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="TimeoutSec"> <maml:name>Timeout</maml:name> <maml:Description> <maml:para>Specifies the maximum wait time for each background job, in seconds. The default value, -1, indicates that the cmdlet waits until the job finishes. The timing starts when you submit the Wait-Job command, not the Start-Job command.</maml:para> <maml:para>If this time is exceeded, the wait ends and the command prompt returns, even if the job is still running. The command does not display any error message.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Int32</command:parameterValue> <dev:type> <maml:name>System.Int32</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.RemotingJob</maml:name> </dev:type> <maml:description> <maml:para>You can pipe a job object to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Management.Automation.PSRemotingJob</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns job objects that represent the completed jobs. If the wait ends because the value of the Timeout parameter is exceeded, Wait-Job does not return any objects.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>By default, Wait-Job * returns, or ends the wait, when jobs are in one of the following states:</maml:para> <maml:para>- Completed</maml:para> <maml:para>- Failed</maml:para> <maml:para>- Stopped</maml:para> <maml:para>- Suspended</maml:para> <maml:para>- Disconnected To direct Wait-Job to continue to wait for Suspended and Disconnected jobs, use the Force parameter.</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----------------- Example 1: Wait for all jobs -----------------</maml:title> <dev:code>PS C:\> Get-Job | Wait-Job</dev:code> <dev:remarks> <maml:para>This command waits for all of the background jobs running in the session to finish.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 2: Wait for jobs started on remote computers by using Start-Job</maml:title> <dev:code>PS C:\> $s = New-PSSession Server01, Server02, Server03 PS C:\> Invoke-Command -Session $s -ScriptBlock {Start-Job -Name Date1 -ScriptBlock {Get-Date}} PS C:\> $done = Invoke-Command -Session $s -Command {Wait-Job -Name Date1} PS C:\> $done.Count 3</dev:code> <dev:remarks> <maml:para>This example shows how to use the Wait-Job cmdlet with jobs started on remote computers by using the Start-Job cmdlet. Both Start-Job and Wait-Job commands are submitted to the remote computer by using the Invoke-Command cmdlet.</maml:para> <maml:para>This example uses Wait-Job to determine whether a Get-Date command running as a background job on three different computers is finished.</maml:para> <maml:para>The first command creates a Windows PowerShell session ( PSSession ) on each of the three remote computers and stores them in the $s variable.</maml:para> <maml:para>The second command uses Invoke-Command to run Start-Job in each of the three sessions in $s. All of the jobs are named Date1.</maml:para> <maml:para>The third command uses Invoke-Command to run Wait-Job . This command waits for the Date1 jobs on each computer to finish. It stores the resulting collection (array) of job objects in the $done variable.</maml:para> <maml:para>The fourth command uses the Count property of the array of job objects in the $done variable to determine how many of the jobs are finished.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>- Example 3: Determine when the first background job finishes -</maml:title> <dev:code>PS C:\> $s = New-PSSession (Get-Content Machines.txt) PS C:\> $c = 'Get-EventLog -LogName System | where {$_.EntryType -eq "error" --and $_.Source -eq "LSASRV"} | Out-File Errors.txt' PS C:\> Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {$Using:c} PS C:\> Invoke-Command -Session $s -ScriptBlock {Wait-Job -Any}</dev:code> <dev:remarks> <maml:para>This example uses the Any parameter of Wait-Job to determine when the first of many background jobs running in the current session are completed. It also shows how to use the Wait-Job cmdlet to wait for remote jobs to finish.</maml:para> <maml:para>The first command creates a PSSession on each of the computers listed in the Machines.txt file and stores the PSSession objects in the $s variable. The command uses the Get-Content cmdlet to get the contents of the file. The Get-Content command is enclosed in parentheses to make sure that it runs before the New-PSSession command.</maml:para> <maml:para>The second command stores a Get-EventLog command string, in quotation marks, in the $c variable.</maml:para> <maml:para>The third command uses Invoke-Command cmdlet to run Start-Job in each of the sessions in $s. The Start-Job command starts a background job that runs the Get-EventLog command in the $c variable.</maml:para> <maml:para>The command uses the Using scope modifier to indicate that the $c variable was defined on the local computer. The Using scope modifier is introduced in Windows PowerShell 3.0. For more information about the Using scope modifier, see about_Remote_Variables (https://go.microsoft.com/fwlink/?LinkID=252653).</maml:para> <maml:para>The fourth command uses Invoke-Command to run a Wait-Job command in the sessions. It uses the Any parameter to wait until the first job on the remote computers is completed.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--- Example 4: Set a wait time for jobs on remote computers ---</maml:title> <dev:code>PS C:\> $s = New-PSSession Server01, Server02, Server03 PS C:\> $jobs = Invoke-Command -Session $s -ScriptBlock {Start-Job -ScriptBlock {Get-Date}} PS C:\> $done = Invoke-Command -Session $s -ScriptBlock {Wait-Job -Timeout 30}</dev:code> <dev:remarks> <maml:para>This example shows how to use the Timeout parameter of Wait-Job to set a maximum wait time for the jobs running on remote computers.</maml:para> <maml:para>The first command creates a PSSession on each of three remote computers (Server01, Server02, and Server03), and then stores the PSSession objects in the $s variable.</maml:para> <maml:para>The second command uses Invoke-Command to run Start-Job in each of the PSSession objects in $s. It stores the resulting job objects in the $jobs variable.</maml:para> <maml:para>The third command uses Invoke-Command to run Wait-Job in each of the sessions in $s. The Wait-Job command determines whether all of the commands have completed within 30 seconds. It uses the Timeout parameter with a value of 30 to establish the maximum wait time, and then stores the results of the command in the $done variable.</maml:para> <maml:para>In this case, after 30 seconds, only the command on the Server02 computer has completed. Wait-Job ends the wait, displays the command prompt, and returns the object that represents the job that was completed.</maml:para> <maml:para>The $done variable contains a job object that represents the job that ran on Server02.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------ Example 5: Wait until one of several jobs finishes ------</maml:title> <dev:code>PS C:\> Wait-Job -id 1,2,5 -Any</dev:code> <dev:remarks> <maml:para>This command identifies three jobs by their IDs and waits until any one of them are completed. The command prompt returns when the first job finishes.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 6: Wait for a period, then allow job to continue in background</maml:title> <dev:code>PS C:\> Wait-Job -Name "DailyLog" -Timeout 120</dev:code> <dev:remarks> <maml:para>This command waits 120 seconds (two minutes) for the DailyLog job to finish. If the job does not finish in the next two minutes, the command prompt returns anyway, and the job continues to run in the background.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 7: Wait for a job by name --------------</maml:title> <dev:code>PS C:\> Wait-Job -Name "Job3"</dev:code> <dev:remarks> <maml:para>This command uses the job name to identify the job for which to wait.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 8: Wait for jobs on local computer started with Start-Job</maml:title> <dev:code>PS C:\> $j = Start-Job -ScriptBlock {Get-ChildItem *.ps1| where {$_lastwritetime -gt ((Get-Date) - (New-TimeSpan -Days 7))}} PS C:\> $j | Wait-Job</dev:code> <dev:remarks> <maml:para>This example shows how to use the Wait-Job cmdlet with jobs started on the local computer by using Start-Job .</maml:para> <maml:para>These commands start a job that gets the Windows PowerShell script files that were added or updated in the last week.</maml:para> <maml:para>The first command uses Start-Job to start a background job on the local computer. The job runs a Get-ChildItem command that gets all of the files that have a .ps1 file name extension that were added or updated in the last week.</maml:para> <maml:para>The third command uses Wait-Job to wait until the job is completed. When the job finishes, the command displays the job object, which contains information about the job.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>Example 9: Wait for jobs started on remote computers by using Invoke-Command</maml:title> <dev:code>PS C:\> $s = New-PSSession Server01, Server02, Server03 PS C:\> $j = Invoke-Command -Session $s -ScriptBlock {Get-Process} -AsJob PS C:\> $j | Wait-Job</dev:code> <dev:remarks> <maml:para>This example shows how to use Wait-Job with jobs started on remote computers by using the AsJob parameter of Invoke-Command . When using AsJob , the job is created on the local computer and the results are automatically returned to the local computer, even though the job runs on the remote computers.</maml:para> <maml:para>This example uses Wait-Job to determine whether a Get-Process command running in the sessions on three remote computers is completed.</maml:para> <maml:para>The first command creates PSSession objects on three computers and stores them in the $s variable.</maml:para> <maml:para>The second command uses Invoke-Command to run Get-Process in each of the three sessions in $s. The command uses the AsJob parameter to run the command asynchronously as a background job. The command returns a job object, just like the jobs started by using Start-Job , and the job object is stored in the $j variable.</maml:para> <maml:para>The third command uses a pipeline operator (|) to send the job object in $j to the Wait-Job cmdlet. An Invoke-Command command is not required in this case, because the job resides on the local computer.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------- Example 10: Wait for a job that has an ID ----------</maml:title> <dev:code>PS C:\> Get-Job Id Name State HasMoreData Location Command -- ---- ----- ----------- -------- ------- 1 Job1 Completed True localhost,Server01.. get-service 4 Job4 Completed True localhost dir | where PS C:\> Wait-Job -Id 1</dev:code> <dev:remarks> <maml:para>This command waits for the job with an ID value of 1.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/wait-job?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Get-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Invoke-Command</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Receive-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Remove-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Resume-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Start-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Stop-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Suspend-Job</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Where-Object</command:name> <command:verb>Where</command:verb> <command:noun>Object</command:noun> <maml:description> <maml:para>Selects objects from a collection based on their property values.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The `Where-Object` cmdlet selects objects that have particular property values from the collection of objects that are passed to it. For example, you can use the `Where-Object` cmdlet to select files that were created after a certain date, events with a particular ID, or computers that use a particular version of Windows.</maml:para> <maml:para>Starting in Windows PowerShell 3.0, there are two different ways to construct a `Where-Object` command.</maml:para> <maml:para>- Script block . You can use a script block to specify the property name, a comparison operator, and a property value. `Where-Object` returns all objects for which the script block statement is true.</maml:para> <maml:para> For example, the following command gets processes in the Normal priority class, that is, processes where the value of the PriorityClass property equals Normal.</maml:para> <maml:para> `Get-Process | Where-Object {$_.PriorityClass -eq "Normal"}`</maml:para> <maml:para> All PowerShell comparison operators are valid in the script block format. For more information about comparison operators, see about_Comparison_Operators (./About/about_Comparison_Operators.md).</maml:para> <maml:para>- Comparison statement . You can also write a comparison statement, which is much more like natural language. Comparison statements were introduced in Windows PowerShell 3.0.</maml:para> <maml:para> For example, the following commands also get processes that have a priority class of Normal. These commands are equivalent and can be used interchangeably.</maml:para> <maml:para> `Get-Process | Where-Object -Property PriorityClass -eq -Value "Normal"`</maml:para> <maml:para> `Get-Process | Where-Object PriorityClass -eq "Normal"`</maml:para> <maml:para> Starting in Windows PowerShell 3.0, `Where-Object` adds comparison operators as parameters in a `Where-Object` command. Unless specified, all operators are case-insensitive. Prior to Windows PowerShell 3.0, the comparison operators in the PowerShell language could be used only in script blocks.</maml:para> <maml:para>When you provide a single Property to `Where-Object`, the value of the property is treated as a boolean expression. When the value of Length is not zero, the expression evaluates to True . For example: `('hi', '', 'there') | Where-Object Length`</maml:para> <maml:para>The previous example is functionally equivalent to:</maml:para> <maml:para>- `('hi', '', 'there') | Where-Object Length -GT 0`</maml:para> <maml:para>- `('hi', '', 'there') | Where-Object {$_.Length -gt 0}`</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CContains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects from a collection if the property value of the object is an exact match for the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CContains "svchost"` CContains refers to a collection of values and is true if the collection contains an item that is an exact match for the specified value. If the input is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CEQ</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is the same as the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CGE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than or equal to the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CGT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CIn</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value includes the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where -Value "svchost" -CIn ProcessName` CIn resembles CContains , except that the property and value positions are reversed. For example, the following statements are both true.</maml:para> <maml:para>`"abc", "def" -CContains "abc"`</maml:para> <maml:para>`"abc" -CIn "abc", "def"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CLE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less-than or equal to the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CLike</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches a value that includes wildcard characters. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CLike "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CLT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less-than the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CMatch</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches the specified regular expression. This operation is case-sensitive. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CMatch "Shell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is different than the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotContains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value of the object is not an exact match for the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CNotContains "svchost"` NotContains and CNotContains refer to a collection of values and are true when the collection does not contains any items that are an exact match for the specified value. If the input is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotIn</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is not an exact match for the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where -Value "svchost" -CNotIn -Property ProcessName` NotIn and CNotIn operators resemble NotContains and CNotContains , except that the property and value positions are reversed. For example, the following statements are true.</maml:para> <maml:para>`"abc", "def" -CNotContains "Abc"`</maml:para> <maml:para>`"abc" -CNotIn "Abc", "def"`</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotLike</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value does not match a value that includes wildcard characters. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CNotLike "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotMatch</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value does not match the specified regular expression. This operation is case-sensitive. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CNotMatch "Shell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IContains"> <maml:name>Contains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if any item in the property value of the object is an exact match for the specified value.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -Contains "Svchost"`</maml:para> <maml:para>If the property value contains a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IEQ"> <maml:name>EQ</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is the same as the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>FilterScript</maml:name> <maml:Description> <maml:para>Specifies the script block that is used to filter the objects. Enclose the script block in braces (`{}`).</maml:para> <maml:para>The parameter name, FilterScript , is optional.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IGE"> <maml:name>GE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than or equal to the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IGT"> <maml:name>GT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IIn"> <maml:name>In</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches any of the specified values. For example:</maml:para> <maml:para>`Get-Process | where -Property ProcessName -in -Value "Svchost", "TaskHost", "WsmProvHost"`</maml:para> <maml:para>If the value of the Value parameter is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>If the property value of an object is an array, PowerShell uses reference equality to determine a match. `Where-Object` returns the object only if the value of the Property parameter and any value of Value are the same instance of an object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Is</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET type. Enclose the type name in square brackets.</maml:para> <maml:para>For example, `Get-Process | where StartTime -Is [DateTime]`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IsNot</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is not an instance of the specified .NET type.</maml:para> <maml:para>For example, `Get-Process | where StartTime -IsNot [DateTime]`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ILE"> <maml:name>LE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less than or equal to the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ILike"> <maml:name>Like</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches a value that includes wildcard characters.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -Like "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ILT"> <maml:name>LT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less than the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IMatch"> <maml:name>Match</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches the specified regular expression. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -Match "shell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INE"> <maml:name>NE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is different than the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotContains"> <maml:name>NotContains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if none of the items in the property value is an exact match for the specified value.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -NotContains "Svchost"` NotContains refers to a collection of values and is true if the collection does not contain any items that are an exact match for the specified value. If the input is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotIn"> <maml:name>NotIn</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is not an exact match for any of the specified values.</maml:para> <maml:para>For example: `Get-Process | where -Value "svchost" -NotIn -Property ProcessName`</maml:para> <maml:para>If the value of Value is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>If the property value of an object is an array, PowerShell uses reference equality to determine a match. `Where-Object` returns the object only if the value of Property and any value of Value are not the same instance of an object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotLike"> <maml:name>NotLike</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value does not match a value that includes wildcard characters.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -NotLike "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> <command:syntaxItem> <maml:name>Where-Object</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotMatch"> <maml:name>NotMatch</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects when the property value does not match the specified regular expression. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -NotMatch "PowerShell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CContains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects from a collection if the property value of the object is an exact match for the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CContains "svchost"` CContains refers to a collection of values and is true if the collection contains an item that is an exact match for the specified value. If the input is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CEQ</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is the same as the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CGE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than or equal to the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CGT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CIn</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value includes the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where -Value "svchost" -CIn ProcessName` CIn resembles CContains , except that the property and value positions are reversed. For example, the following statements are both true.</maml:para> <maml:para>`"abc", "def" -CContains "abc"`</maml:para> <maml:para>`"abc" -CIn "abc", "def"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CLE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less-than or equal to the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CLike</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches a value that includes wildcard characters. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CLike "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CLT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less-than the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CMatch</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches the specified regular expression. This operation is case-sensitive. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CMatch "Shell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is different than the specified value. This operation is case-sensitive.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotContains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value of the object is not an exact match for the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CNotContains "svchost"` NotContains and CNotContains refer to a collection of values and are true when the collection does not contains any items that are an exact match for the specified value. If the input is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotIn</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is not an exact match for the specified value. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where -Value "svchost" -CNotIn -Property ProcessName` NotIn and CNotIn operators resemble NotContains and CNotContains , except that the property and value positions are reversed. For example, the following statements are true.</maml:para> <maml:para>`"abc", "def" -CNotContains "Abc"`</maml:para> <maml:para>`"abc" -CNotIn "Abc", "def"`</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotLike</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value does not match a value that includes wildcard characters. This operation is case-sensitive.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CNotLike "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>CNotMatch</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value does not match the specified regular expression. This operation is case-sensitive. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -CNotMatch "Shell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IContains"> <maml:name>Contains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if any item in the property value of the object is an exact match for the specified value.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -Contains "Svchost"`</maml:para> <maml:para>If the property value contains a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IEQ"> <maml:name>EQ</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is the same as the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>FilterScript</maml:name> <maml:Description> <maml:para>Specifies the script block that is used to filter the objects. Enclose the script block in braces (`{}`).</maml:para> <maml:para>The parameter name, FilterScript , is optional.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.ScriptBlock</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.ScriptBlock</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IGE"> <maml:name>GE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than or equal to the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IGT"> <maml:name>GT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is greater than the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IIn"> <maml:name>In</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches any of the specified values. For example:</maml:para> <maml:para>`Get-Process | where -Property ProcessName -in -Value "Svchost", "TaskHost", "WsmProvHost"`</maml:para> <maml:para>If the value of the Value parameter is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>If the property value of an object is an array, PowerShell uses reference equality to determine a match. `Where-Object` returns the object only if the value of the Property parameter and any value of Value are the same instance of an object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="named" aliases="none"> <maml:name>InputObject</maml:name> <maml:Description> <maml:para>Specifies the objects to be filtered. You can also pipe the objects to `Where-Object`.</maml:para> <maml:para>When you use the InputObject parameter with `Where-Object`, instead of piping command results to `Where-Object`, the InputObject value is treated as a single object. This is true even if the value is a collection that is the result of a command, such as `-InputObject (Get-Process)`. Because InputObject cannot return individual properties from an array or collection of objects, we recommend that, if you use `Where-Object` to filter a collection of objects for those objects that have specific values in defined properties, you use `Where-Object` in the pipeline, as shown in the examples in this topic.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.PSObject</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Is</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET type. Enclose the type name in square brackets.</maml:para> <maml:para>For example, `Get-Process | where StartTime -Is [DateTime]`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>IsNot</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is not an instance of the specified .NET type.</maml:para> <maml:para>For example, `Get-Process | where StartTime -IsNot [DateTime]`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ILE"> <maml:name>LE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less than or equal to the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ILike"> <maml:name>Like</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches a value that includes wildcard characters.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -Like "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="ILT"> <maml:name>LT</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is less than the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="IMatch"> <maml:name>Match</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value matches the specified regular expression. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -Match "shell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INE"> <maml:name>NE</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is different than the specified value.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotContains"> <maml:name>NotContains</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if none of the items in the property value is an exact match for the specified value.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -NotContains "Svchost"` NotContains refers to a collection of values and is true if the collection does not contain any items that are an exact match for the specified value. If the input is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotIn"> <maml:name>NotIn</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value is not an exact match for any of the specified values.</maml:para> <maml:para>For example: `Get-Process | where -Value "svchost" -NotIn -Property ProcessName`</maml:para> <maml:para>If the value of Value is a single object, PowerShell converts it to a collection of one object.</maml:para> <maml:para>If the property value of an object is an array, PowerShell uses reference equality to determine a match. `Where-Object` returns the object only if the value of Property and any value of Value are not the same instance of an object.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotLike"> <maml:name>NotLike</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects if the property value does not match a value that includes wildcard characters.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -NotLike "*host"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="INotMatch"> <maml:name>NotMatch</maml:name> <maml:Description> <maml:para>Indicates that this cmdlet gets objects when the property value does not match the specified regular expression. When the input is scalar, the matched value is saved in `$Matches` automatic variable.</maml:para> <maml:para>For example: `Get-Process | where ProcessName -NotMatch "PowerShell"`</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Management.Automation.SwitchParameter</command:parameterValue> <dev:type> <maml:name>System.Management.Automation.SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none"> <maml:name>Property</maml:name> <maml:Description> <maml:para>Specifies the name of an object property. The parameter name, Property , is optional.</maml:para> <maml:para>This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.String</command:parameterValue> <dev:type> <maml:name>System.String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="1" aliases="none"> <maml:name>Value</maml:name> <maml:Description> <maml:para>Specifies a property value. The parameter name, Value , is optional. This parameter accepts wildcard characters when used with the following comparison parameters:</maml:para> <maml:para>- CLike - CNotLike - Like - NotLike This parameter was introduced in Windows PowerShell 3.0.</maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">System.Object</command:parameterValue> <dev:type> <maml:name>System.Object</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.Management.Automation.PSObject</maml:name> </dev:type> <maml:description> <maml:para>You can pipe the objects to this cmdlet.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>Object</maml:name> </dev:type> <maml:description> <maml:para>This cmdlet returns selected items from the input object set.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para>Starting in Windows PowerShell 4.0, `Where` and `ForEach` methods were added for use with collections.</maml:para> <maml:para>You can read more about these new methods here about_arrays (./About/about_Arrays.md)</maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>--------------- Example 1: Get stopped services ---------------</maml:title> <dev:code>Get-Service | Where-Object {$_.Status -eq "Stopped"} Get-Service | where Status -eq "Stopped"</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 2: Get processes based on working set --------</maml:title> <dev:code>Get-Process | Where-Object {$_.WorkingSet -GT 250MB} Get-Process | Where-Object WorkingSet -GT (250MB)</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 3: Get processes based on process name --------</maml:title> <dev:code>Get-Process | Where-Object {$_.ProcessName -Match "^p.*"} Get-Process | Where-Object ProcessName -Match "^p.*"</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------- Example 4: Use the comparison statement format --------</maml:title> <dev:code>Get-Process | Where-Object -Property Handles -GE -Value 1000 Get-Process | where Handles -GE 1000</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>--------- Example 5: Get commands based on properties ---------</maml:title> <dev:code># Use Where-Object to get commands that have any value for the OutputType property of the command. # This omits commands that do not have an OutputType property and those that have an OutputType property, but no property value. Get-Command | where OutputType Get-Command | where {$_.OutputType} # Use Where-Object to get objects that are containers. # This gets objects that have the **PSIsContainer** property with a value of $True and excludes all others. Get-ChildItem | where PSIsContainer Get-ChildItem | where {$_.PSIsContainer} # Finally, use the Not operator (!) to get objects that are not containers. # This gets objects that do have the **PSIsContainer** property and those that have a value of $False for the **PSIsContainer** property. Get-ChildItem | where {!$_.PSIsContainer} # You cannot use the Not operator (!) in the comparison statement format of the command. Get-ChildItem | where PSIsContainer -eq $False</dev:code> <dev:remarks> <maml:para></maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------- Example 6: Use multiple conditions --------------</maml:title> <dev:code>Get-Module -ListAvailable | where {($_.Name -notlike "Microsoft*" -and $_.Name -notlike "PS*") -and $_.HelpInfoUri}</dev:code> <dev:remarks> <maml:para>This example shows how to create a `Where-Object` command with multiple conditions.</maml:para> <maml:para>This command gets non-core modules that support the Updatable Help feature. The command uses the ListAvailable parameter of the `Get-Module` cmdlet to get all modules on the computer. A pipeline operator (`|`) sends the modules to the `Where-Object` cmdlet, which gets modules whose names do not begin with Microsoft or PS, and have a value for the HelpInfoURI property, which tells PowerShell where to find updated help files for the module. The comparison statements are connected by the And logical operator.</maml:para> <maml:para>The example uses the script block command format. Logical operators, such as And and Or , are valid only in script blocks. You cannot use them in the comparison statement format of a `Where-Object` command.</maml:para> <maml:para>- For more information about PowerShell logical operators, see about_Logical_Operators (./About/about_logical_operators.md). - For more information about the Updatable Help feature, see about_Updatable_Help (./About/about_Updatable_Help.md).</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://docs.microsoft.com/powershell/module/microsoft.powershell.core/where-object?view=powershell-5.1&WT.mc_id=ps-gethelp</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Compare-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>ForEach-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Group-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Measure-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>New-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Select-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Sort-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Tee-Object</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems>