diff --git a/reference/5.1/CimCmdlets/New-CimInstance.md b/reference/5.1/CimCmdlets/New-CimInstance.md index 6602b51d5dd4..615c56591734 100644 --- a/reference/5.1/CimCmdlets/New-CimInstance.md +++ b/reference/5.1/CimCmdlets/New-CimInstance.md @@ -19,46 +19,48 @@ Creates a CIM instance. ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - -CimSession [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] -CimSession [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ### CimClassComputerSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - [-ComputerName ] [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -75,7 +77,12 @@ This example creates an instance of a CIM Class named win32_environment in the r on the computer. ```powershell -New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";VariableValue="testvalue";UserName="domain\user"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "domain\user" +} +New-CimInstance -ClassName Win32_Environment -Property $prop ``` No client side validation is performed if the class does not exist, the properties are wrong, or if @@ -89,7 +96,12 @@ of the variable are then passed to the `New-CimInstance` cmdlet. ```powershell $class = Get-CimClass -ClassName Win32_Environment -New-CimInstance -CimClass $class -Property @{Name="testvar";VariableValue="testvalue";UserName="Contoso\User1"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "Contoso\User1" +} +New-CimInstance -CimClass $class -Property $prop ``` ### Example 3: Create a dynamic instance on the client @@ -100,7 +112,16 @@ computer without getting the instance from the server. The new instance is store on the server. ```powershell -$a = New-CimInstance -ClassName Win32_Process -Property @{Handle=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Property = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$a = New-CimInstance @instance + Get-CimInstance -CimInstance $a Invoke-CimMethod -CimInstance $a -MethodName GetOwner ``` @@ -385,7 +406,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/CimCmdlets/New-CimSession.md b/reference/5.1/CimCmdlets/New-CimSession.md index f5a69cd816fe..4c91492c9e4e 100644 --- a/reference/5.1/CimCmdlets/New-CimSession.md +++ b/reference/5.1/CimCmdlets/New-CimSession.md @@ -17,16 +17,17 @@ Creates a CIM session. ### CredentialParameterSet (Default) ``` -New-CimSession [-Authentication ] [[-Credential] ] - [[-ComputerName] ] [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] - [-Port ] [-SessionOption ] [] +New-CimSession [-Authentication ] + [[-Credential] ] [[-ComputerName] ] [-Name ] + [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] + [-SessionOption ] [] ``` ### CertificateParameterSet ``` -New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] [-Name ] - [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] +New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] + [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] [-SessionOption ] [] ``` @@ -65,7 +66,7 @@ This example creates a CIM session to each of the computers specified by **Compu comma separated list. ```powershell -New-CimSession -ComputerName Server01,Server02,Server03 +New-CimSession -ComputerName Server01, Server02, Server03 ``` ### Example 4: Create a CIM session with a friendly name @@ -74,7 +75,7 @@ This example creates a remote CIM session to each of the computers specified by the comma separated list, and assigns a friendly name to the new sessions, by specifying **Name**. ```powershell -New-CimSession -ComputerName Server01,Server02 -Name FileServers +New-CimSession -ComputerName Server01, Server02 -Name FileServers Get-CimSession -Name File* ``` @@ -237,8 +238,8 @@ Accept wildcard characters: False Specifies a friendly name for the CIM session. You can use the name to refer to the CIM session when using other cmdlets, such as the -[`Get-CimSession`](Get-CimSession.md) cmdlet. -The name is not required to be unique to the computer or the current session. +[Get-CimSession](Get-CimSession.md) cmdlet. The name is not required to be unique to the computer +or the current session. ```yaml Type: System.String @@ -348,7 +349,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/CimCmdlets/New-CimSessionOption.md b/reference/5.1/CimCmdlets/New-CimSessionOption.md index bba0cadfd195..2d84d37a831b 100644 --- a/reference/5.1/CimCmdlets/New-CimSessionOption.md +++ b/reference/5.1/CimCmdlets/New-CimSessionOption.md @@ -18,8 +18,8 @@ Specifies advanced options for the New-CimSession cmdlet. ### ProtocolTypeSet (Default) ``` -New-CimSessionOption [-Protocol] [-UICulture ] [-Culture ] - [] +New-CimSessionOption [-Protocol] [-UICulture ] + [-Culture ] [] ``` ### WSManParameterSet @@ -28,15 +28,16 @@ New-CimSessionOption [-Protocol] [-UICulture ] [-Cul New-CimSessionOption [-NoEncryption] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck] [-EncodePortInServicePrincipalName] [-Encoding ] [-HttpPrefix ] [-MaxEnvelopeSizeKB ] [-ProxyAuthentication ] - [-ProxyCertificateThumbprint ] [-ProxyCredential ] [-ProxyType ] - [-UseSsl] [-UICulture ] [-Culture ] [] + [-ProxyCertificateThumbprint ] [-ProxyCredential ] + [-ProxyType ] [-UseSsl] [-UICulture ] [-Culture ] + [] ``` ### DcomParameterSet ``` -New-CimSessionOption [-Impersonation ] [-PacketIntegrity] [-PacketPrivacy] - [-UICulture ] [-Culture ] [] +New-CimSessionOption [-Impersonation ] [-PacketIntegrity] + [-PacketPrivacy] [-UICulture ] [-Culture ] [] ``` ## DESCRIPTION @@ -71,7 +72,14 @@ parameter, the credentials specified by the **ProxyCredential** parameter, and s command is to skip the CA check, skip the CN check, and use SSL. ```powershell -New-CimSessionOption -ProxyAuthentication Kerberos -ProxyCredential $cred -SkipCACheck -SkipCNCheck -UseSsl +$option = @{ + ProxyAuthentication = 'Kerberos' + ProxyCredential = $cred + SkipCACheck = $true + SkipCNCheck = $true + UseSsl = $true +} +New-CimSessionOption @option ``` ### Example 3: Create a CIM session options object with the culture specified diff --git a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md index 2d0c6403f1a4..d619ecd815d6 100644 --- a/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/5.1/CimCmdlets/Register-CimIndicationEvent.md @@ -36,19 +36,19 @@ Register-CimIndicationEvent [-Namespace ] [-ClassName] ### QueryExpressionSessionSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] -CimSession [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] -CimSession + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ### QueryExpressionComputerSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] [-ComputerName ] [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] [-ComputerName ] + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ## DESCRIPTION @@ -67,7 +67,11 @@ This example subscribes to the events generated by the class named **Win32_Proce class raises an event whenever a process starts. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -98,7 +102,12 @@ $action = { $id = $event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + Action = $action +} +Register-CimIndicationEvent @event ``` For more information, see @@ -111,7 +120,12 @@ CIM server are stored in the event queue in the current PowerShell session and t `Get-Event` to retrieve the events. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01 +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + ComputerName = 'Server01' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -126,7 +140,7 @@ event is raised, instead of sending the event to the event queue. Enclose the co The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`, `$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event to the **Action** script block. For more information, see -[About Automatic Variables](../microsoft.powershell.core/about/about_automatic_variables.md). +[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ```yaml Type: System.Management.Automation.ScriptBlock @@ -401,4 +415,3 @@ This cmdlet returns an **EventSubscription** object. [Get-CimSession](Get-CimSession.md) [New-CimSession](New-CimSession.md) - diff --git a/reference/5.1/CimCmdlets/Remove-CimInstance.md b/reference/5.1/CimCmdlets/Remove-CimInstance.md index c1a6b74f4a4c..07dea4673abe 100644 --- a/reference/5.1/CimCmdlets/Remove-CimInstance.md +++ b/reference/5.1/CimCmdlets/Remove-CimInstance.md @@ -17,31 +17,33 @@ Removes a CIM instance from a computer. ### CimInstanceComputerSet (Default) ``` -Remove-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### CimInstanceSessionSet ``` -Remove-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### QuerySessionSet ``` Remove-CimInstance -CimSession [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ### QueryComputerSet ``` Remove-CimInstance [-ComputerName ] [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/5.1/CimCmdlets/Set-CimInstance.md b/reference/5.1/CimCmdlets/Set-CimInstance.md index 53dffb7dd817..de58c8f0fb70 100644 --- a/reference/5.1/CimCmdlets/Set-CimInstance.md +++ b/reference/5.1/CimCmdlets/Set-CimInstance.md @@ -17,33 +17,33 @@ Modifies a CIM instance on a CIM server by calling the ModifyInstance method of ### CimInstanceComputerSet (Default) ``` -Set-CimInstance [-ComputerName ] [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Set-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QuerySessionSet ``` -Set-CimInstance -CimSession [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet ``` -Set-CimInstance [-ComputerName ] [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -76,7 +76,11 @@ parameter. You can modify instances matching a Windows Management Instrumentatio (WQL) query. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} +$instance = @ { + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} +} +Set-CimInstance @instance ``` ### Example 2: Set the CIM instance property using pipeline @@ -121,7 +125,12 @@ This example uses the common parameter **WhatIf** to specify that the modificati done, but only output what would happen if it were done. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -WhatIf +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + WhatIf = $true +} +Set-CimInstance @instance ``` ### Example 6: Set the CIM instance after confirmation from the user @@ -130,7 +139,12 @@ This example uses the common parameter **Confirm** to specify that the modificat only after confirmation from the user. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -Confirm +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + Confirm = $true +} +Set-CimInstance @instance ``` ### Example 7: Set the created CIM instance @@ -141,7 +155,16 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly +$instance = @{ + ClassName = 'Win32_Environment' + Property = @{ + Name="testvar" + UserName="domain\user" + } + Key = 'Name', 'UserName' + ClientOnly = $true +} +$x = New-CimInstance @instance Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -154,7 +177,7 @@ of a `New-CimSession` or `Get-CimSession` cmdlet. ```yaml Type: Microsoft.Management.Infrastructure.CimSession[] -Parameter Sets: QuerySessionSet, CimInstanceSessionSet +Parameter Sets: CimInstanceSessionSet, QuerySessionSet Aliases: Required: True @@ -395,7 +418,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/ISE/Get-IseSnippet.md b/reference/5.1/ISE/Get-IseSnippet.md index aeea7b94d36a..e350820c459b 100644 --- a/reference/5.1/ISE/Get-IseSnippet.md +++ b/reference/5.1/ISE/Get-IseSnippet.md @@ -45,10 +45,13 @@ Get-IseSnippet ### Example 2: Copy all user-defined snippets from remote computers to a shared directory -This example copies all of the user-created snippets from a group of remote computers to a shared Snippets directory. +This example copies all of the user-created snippets from a group of remote computers to a shared +Snippets directory. ```powershell -Invoke-Command -Computer (Get-Content Servers.txt) {Get-IseSnippet | Copy-Item -Destination \\Server01\Share01\Snippets} +Invoke-Command -Computer (Get-Content Servers.txt) -ScriptBlock { + Get-IseSnippet | Copy-Item -Destination \\Server01\Share01\Snippets +} ``` `Invoke-Command` runs `Get-IseSnippet` on the computers in the `Servers.txt` file. A pipeline @@ -57,8 +60,8 @@ that is specified by the **Destination** parameter. ### Example 3: Display the title and text of each snippet on a local computer -This example uses the `Get-IseSnippet` and `Select-Xml` cmdlets to display the title and text of each -snippet on the local computer. +This example uses the `Get-IseSnippet` and `Select-Xml` cmdlets to display the title and text of +each snippet on the local computer. ```powershell #Parse-Snippet Function @@ -93,7 +96,8 @@ Text: (c) Fabrikam, Inc. 2012 ### Example 4: Display the title and description of all snippets in the session -This example displays the title and description of all snippets in the session, including built-in snippets, user-defined snippets, and imported snippets. +This example displays the title and description of all snippets in the session, including built-in +snippets, user-defined snippets, and imported snippets. ```powershell $PSISE.CurrentPowerShellTab.Snippets | Format-Table DisplayTitle, Description diff --git a/reference/5.1/ISE/ISE.md b/reference/5.1/ISE/ISE.md index d8efad512614..231b762be8cf 100644 --- a/reference/5.1/ISE/ISE.md +++ b/reference/5.1/ISE/ISE.md @@ -19,10 +19,13 @@ that add features to Windows PowerShell ISE. ## ISE Cmdlets ### [Get-IseSnippet](Get-IseSnippet.md) + Gets snippets that the user created. ### [Import-IseSnippet](Import-IseSnippet.md) + Imports ISE snippets into the current session ### [New-IseSnippet](New-IseSnippet.md) + Creates a Windows PowerShell ISE code snippet. diff --git a/reference/5.1/ISE/Import-IseSnippet.md b/reference/5.1/ISE/Import-IseSnippet.md index ea0c866049e4..109e7c562147 100644 --- a/reference/5.1/ISE/Import-IseSnippet.md +++ b/reference/5.1/ISE/Import-IseSnippet.md @@ -80,7 +80,7 @@ This example gets snippets in all installed modules in the **PSModulePath** envi ```powershell ($env:PSModulePath).split(";") | ForEach-Object {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | - ForEach-Object {$_.fullname} + ForEach-Object {$_.Fullname} ``` ### Example 4: Import all module snippets diff --git a/reference/5.1/ISE/New-IseSnippet.md b/reference/5.1/ISE/New-IseSnippet.md index e11592ebb71d..9d283d33b3a4 100644 --- a/reference/5.1/ISE/New-IseSnippet.md +++ b/reference/5.1/ISE/New-IseSnippet.md @@ -15,8 +15,8 @@ Creates a Windows PowerShell ISE code snippet. ## SYNTAX ``` -New-IseSnippet [-Title] [-Description] [-Text] [-Author ] - [-CaretOffset ] [-Force] [] +New-IseSnippet [-Title] [-Description] [-Text] + [-Author ] [-CaretOffset ] [-Force] [] ``` ## DESCRIPTION @@ -45,7 +45,7 @@ This cmdlet was introduced in Windows PowerShell 3.0. ### Example 1: Create a Comment-Based help snippet -``` +```powershell New-IseSnippet -Title Comment-BasedHelp -Description "A template for comment-based help." -Text "<# .SYNOPSIS @@ -64,7 +64,7 @@ This command creates a Comment-BasedHelp snippet for Windows PowerShell ISE. It ### Example 2: Create a mandatory snippet -``` +```powershell $M = @' Param ( @@ -74,7 +74,14 @@ Param ) '@ -New-ISESnippet -Text $M -Title Mandatory -Description "Adds a mandatory function parameter." -Author "Patti Fuller, Fabrikam Corp." -Force +$snippet = @{ + Text = $M + Title = 'Mandatory' + Description = 'Adds a mandatory function parameter.' + Author = 'Patti Fuller, Fabrikam Corp.' + Force = $true +} +New-ISESnippet @snippet ``` This example creates a snippet named **Mandatory** for Windows PowerShell ISE. The first command @@ -84,8 +91,10 @@ the same name. ### Example 3: Copy a mandatory snippet from a folder to a destination folder -``` -Copy-Item "$HOME\Documents\WindowsPowerShell\Snippets\Mandatory.Snippets.ps1xml" -Destination "\\Server\Share" +```powershell +$path = "$HOME\Documents\WindowsPowerShell\Snippets\Mandatory.Snippets.ps1xml" +$destination = "\\Server\Share" +Copy-Item -Path $path -Destination $destination ``` This command uses the `Copy-Item` cmdlet to copy the **Mandatory** snippet from the folder where @@ -228,7 +237,8 @@ is created, but an error message appears when Windows PowerShell tries to add th snippet to the session. To use the new snippet (and other unsigned user-created snippets), change the execution policy, and then restart Windows PowerShell ISE. -For more information about Windows PowerShell execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/About/about_Execution_Policies.md). +For more information about Windows PowerShell execution policies, see +[about_Execution_Policies](../Microsoft.PowerShell.Core/About/about_Execution_Policies.md). - To change a snippet, edit the snippet file. You can edit snippet files in the Script pane of Windows PowerShell ISE. diff --git a/reference/5.1/Microsoft.PowerShell.Archive/Compress-Archive.md b/reference/5.1/Microsoft.PowerShell.Archive/Compress-Archive.md index a10e3fd19945..0e76150410c0 100644 --- a/reference/5.1/Microsoft.PowerShell.Archive/Compress-Archive.md +++ b/reference/5.1/Microsoft.PowerShell.Archive/Compress-Archive.md @@ -18,43 +18,43 @@ Creates a compressed archive, or zipped file, from specified files and directori ### Path (Default) ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] [-WhatIf] [-Confirm] [] ``` ### PathWithUpdate ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] -Update - [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Update [-WhatIf] [-Confirm] [] ``` ### PathWithForce ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] -Force - [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Force [-WhatIf] [-Confirm] [] ``` ### LiteralPathWithUpdate ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Update [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Update [-WhatIf] [-Confirm] [] ``` ### LiteralPathWithForce ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Force [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Force [-WhatIf] [-Confirm] [] ``` ### LiteralPath ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -184,7 +184,8 @@ This example sends a directory down the pipeline to create an archive. Files are doesn't include the root directory, but its files and subdirectories are included in the archive. ```powershell -Get-ChildItem -Path C:\LogFiles | Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip +Get-ChildItem -Path C:\LogFiles | + Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip ``` `Get-ChildItem` uses the **Path** parameter to specify the `C:\LogFiles` root directory. Each diff --git a/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md b/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md index b6ceed6511ca..cb660e29469a 100644 --- a/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md +++ b/reference/5.1/Microsoft.PowerShell.Archive/Expand-Archive.md @@ -18,15 +18,15 @@ Extracts files from a specified archive (zipped) file. ### Path (Default) ``` -Expand-Archive [-Path] [[-DestinationPath] ] [-Force] [-WhatIf] [-Confirm] - [] +Expand-Archive [-Path] [[-DestinationPath] ] [-Force] [-WhatIf] + [-Confirm] [] ``` ### LiteralPath ``` -Expand-Archive -LiteralPath [[-DestinationPath] ] [-Force] [-WhatIf] [-Confirm] - [] +Expand-Archive -LiteralPath [[-DestinationPath] ] [-Force] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md index 8d3e6d963782..1fc16acad8f0 100644 --- a/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md +++ b/reference/5.1/Microsoft.PowerShell.Host/Start-Transcript.md @@ -266,6 +266,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### None @@ -285,6 +286,13 @@ To stop a transcript, use the `Stop-Transcript` cmdlet. To record an entire session, add the `Start-Transcript` command to your profile. For more information, see [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). +> [!NOTE] +> When you use `Start-Transcript`, the default value of `$InformationPreference` is changed to +> `Continue`. Output from `Write-Information` is written to the console, but not to the transcript +> file. If the `$InformationPreference` is set to `SilentlyContinue`, Information messages aren't +> written to the console, but are written to the transcript file. This is fixed in PowerShell 6 and +> higher. + ## RELATED LINKS [Stop-Transcript](Stop-Transcript.md) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md index 2d2a85723121..61612aa3b1d8 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -520,6 +520,10 @@ For example, `-Depth 2` includes the **Path** parameter's directory, first level and second level of subdirectories. By default directory names and filenames are included in the output. +> [!NOTE] +> The **Depth** parameter has no effect when used with the **Include** parameter. To work around +> this issue, use the **Filter** parameter instead. This is fixed in PowerShell 6 and higher. + > [!NOTE] > On a Windows computer from PowerShell or **cmd.exe**, you can display a graphical view of a > directory structure with the **tree.com** command. @@ -802,6 +806,10 @@ after the inclusions, which can affect the final output. > The **Include** and **Exclude** parameters have no effect when used with the **LiteralPath** > parameter. This is fixed in PowerShell 7. +> [!NOTE] +> The **Depth** parameter has no effect when used with the **Include** parameter. To work around +> this issue, use the **Filter** parameter instead. This is fixed in PowerShell 6. + ```yaml Type: System.String[] Parameter Sets: (All) diff --git a/reference/7.4/CimCmdlets/New-CimInstance.md b/reference/7.4/CimCmdlets/New-CimInstance.md index 3d17aa2690ce..35051a9fb7f1 100644 --- a/reference/7.4/CimCmdlets/New-CimInstance.md +++ b/reference/7.4/CimCmdlets/New-CimInstance.md @@ -19,46 +19,48 @@ Creates a CIM instance. ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - -CimSession [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] -CimSession [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ### CimClassComputerSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - [-ComputerName ] [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -77,7 +79,12 @@ This example creates an instance of a CIM Class named win32_environment in the r on the computer. ```powershell -New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";VariableValue="testvalue";UserName="domain\user"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "domain\user" +} +New-CimInstance -ClassName Win32_Environment -Property $prop ``` No client side validation is performed if the class does not exist, the properties are wrong, or if @@ -91,7 +98,12 @@ of the variable are then passed to the `New-CimInstance` cmdlet. ```powershell $class = Get-CimClass -ClassName Win32_Environment -New-CimInstance -CimClass $class -Property @{Name="testvar";VariableValue="testvalue";UserName="Contoso\User1"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "Contoso\User1" +} +New-CimInstance -CimClass $class -Property $prop ``` ### Example 3: Create a dynamic instance on the client @@ -102,7 +114,16 @@ computer without getting the instance from the server. The new instance is store on the server. ```powershell -$a = New-CimInstance -ClassName Win32_Process -Property @{Handle=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Property = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$a = New-CimInstance @instance + Get-CimInstance -CimInstance $a Invoke-CimMethod -CimInstance $a -MethodName GetOwner ``` @@ -387,7 +408,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/CimCmdlets/New-CimSession.md b/reference/7.4/CimCmdlets/New-CimSession.md index 812340fe1904..b509da082fbe 100644 --- a/reference/7.4/CimCmdlets/New-CimSession.md +++ b/reference/7.4/CimCmdlets/New-CimSession.md @@ -17,16 +17,17 @@ Creates a CIM session. ### CredentialParameterSet (Default) ``` -New-CimSession [-Authentication ] [[-Credential] ] - [[-ComputerName] ] [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] - [-Port ] [-SessionOption ] [] +New-CimSession [-Authentication ] + [[-Credential] ] [[-ComputerName] ] [-Name ] + [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] + [-SessionOption ] [] ``` ### CertificateParameterSet ``` -New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] [-Name ] - [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] +New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] + [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] [-SessionOption ] [] ``` @@ -350,7 +351,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/CimCmdlets/New-CimSessionOption.md b/reference/7.4/CimCmdlets/New-CimSessionOption.md index 8d18c180a2af..189798cfd147 100644 --- a/reference/7.4/CimCmdlets/New-CimSessionOption.md +++ b/reference/7.4/CimCmdlets/New-CimSessionOption.md @@ -18,8 +18,8 @@ Specifies advanced options for the New-CimSession cmdlet. ### ProtocolTypeSet (Default) ``` -New-CimSessionOption [-Protocol] [-UICulture ] [-Culture ] - [] +New-CimSessionOption [-Protocol] [-UICulture ] + [-Culture ] [] ``` ### WSManParameterSet @@ -28,15 +28,16 @@ New-CimSessionOption [-Protocol] [-UICulture ] [-Cul New-CimSessionOption [-NoEncryption] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck] [-EncodePortInServicePrincipalName] [-Encoding ] [-HttpPrefix ] [-MaxEnvelopeSizeKB ] [-ProxyAuthentication ] - [-ProxyCertificateThumbprint ] [-ProxyCredential ] [-ProxyType ] - [-UseSsl] [-UICulture ] [-Culture ] [] + [-ProxyCertificateThumbprint ] [-ProxyCredential ] + [-ProxyType ] [-UseSsl] [-UICulture ] [-Culture ] + [] ``` ### DcomParameterSet ``` -New-CimSessionOption [-Impersonation ] [-PacketIntegrity] [-PacketPrivacy] - [-UICulture ] [-Culture ] [] +New-CimSessionOption [-Impersonation ] [-PacketIntegrity] + [-PacketPrivacy] [-UICulture ] [-Culture ] [] ``` ## DESCRIPTION @@ -73,7 +74,14 @@ parameter, the credentials specified by the **ProxyCredential** parameter, and s command is to skip the CA check, skip the CN check, and use SSL. ```powershell -New-CimSessionOption -ProxyAuthentication Kerberos -ProxyCredential $cred -SkipCACheck -SkipCNCheck -UseSsl +$option = @{ + ProxyAuthentication = 'Kerberos' + ProxyCredential = $cred + SkipCACheck = $true + SkipCNCheck = $true + UseSsl = $true +} +New-CimSessionOption @option ``` ### Example 3: Create a CIM session options object with the culture specified diff --git a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md index e28caf6c67d0..575d23798867 100644 --- a/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.4/CimCmdlets/Register-CimIndicationEvent.md @@ -36,19 +36,19 @@ Register-CimIndicationEvent [-Namespace ] [-ClassName] ### QueryExpressionSessionSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] -CimSession [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] -CimSession + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ### QueryExpressionComputerSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] [-ComputerName ] [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] [-ComputerName ] + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ## DESCRIPTION @@ -69,7 +69,11 @@ This example subscribes to the events generated by the class named **Win32_Proce class raises an event whenever a process starts. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -100,7 +104,12 @@ $action = { $id = $event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + Action = $action +} +Register-CimIndicationEvent @event ``` For more information, see @@ -113,7 +122,12 @@ CIM server are stored in the event queue in the current PowerShell session and t `Get-Event` to retrieve the events. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01 +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + ComputerName = 'Server01' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -128,7 +142,7 @@ event is raised, instead of sending the event to the event queue. Enclose the co The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`, `$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event to the **Action** script block. For more information, see -[About Automatic Variables](../microsoft.powershell.core/about/about_automatic_variables.md). +[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ```yaml Type: System.Management.Automation.ScriptBlock diff --git a/reference/7.4/CimCmdlets/Remove-CimInstance.md b/reference/7.4/CimCmdlets/Remove-CimInstance.md index c33db4b2a311..5f632ff9a5e1 100644 --- a/reference/7.4/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.4/CimCmdlets/Remove-CimInstance.md @@ -17,31 +17,33 @@ Removes a CIM instance from a computer. ### CimInstanceComputerSet (Default) ``` -Remove-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### CimInstanceSessionSet ``` -Remove-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### QuerySessionSet ``` Remove-CimInstance -CimSession [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ### QueryComputerSet ``` Remove-CimInstance [-ComputerName ] [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.4/CimCmdlets/Set-CimInstance.md b/reference/7.4/CimCmdlets/Set-CimInstance.md index a241fc87f52d..3b10e826c2ac 100644 --- a/reference/7.4/CimCmdlets/Set-CimInstance.md +++ b/reference/7.4/CimCmdlets/Set-CimInstance.md @@ -17,33 +17,33 @@ Modifies a CIM instance on a CIM server by calling the ModifyInstance method of ### CimInstanceComputerSet (Default) ``` -Set-CimInstance [-ComputerName ] [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Set-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QuerySessionSet ``` -Set-CimInstance -CimSession [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet ``` -Set-CimInstance [-ComputerName ] [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -78,7 +78,11 @@ parameter. You can modify instances matching a Windows Management Instrumentatio (WQL) query. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} +$instance = @ { + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} +} +Set-CimInstance @instance ``` ### Example 2: Set the CIM instance property using pipeline @@ -123,7 +127,12 @@ This example uses the common parameter **WhatIf** to specify that the modificati done, but only output what would happen if it were done. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -WhatIf +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + WhatIf = $true +} +Set-CimInstance @instance ``` ### Example 6: Set the CIM instance after confirmation from the user @@ -132,7 +141,12 @@ This example uses the common parameter **Confirm** to specify that the modificat only after confirmation from the user. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -Confirm +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + Confirm = $true +} +Set-CimInstance @instance ``` ### Example 7: Set the created CIM instance @@ -143,7 +157,16 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly +$instance = @{ + ClassName = 'Win32_Environment' + Property = @{ + Name="testvar" + UserName="domain\user" + } + Key = 'Name', 'UserName' + ClientOnly = $true +} +$x = New-CimInstance @instance Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -397,7 +420,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Archive/Compress-Archive.md b/reference/7.4/Microsoft.PowerShell.Archive/Compress-Archive.md index 0f544fd0ce8c..475e19913c36 100644 --- a/reference/7.4/Microsoft.PowerShell.Archive/Compress-Archive.md +++ b/reference/7.4/Microsoft.PowerShell.Archive/Compress-Archive.md @@ -18,43 +18,45 @@ Creates a compressed ZIP archive from specified files and directories. ### Path (Default) ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### PathWithUpdate ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - -Update [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Update [-PassThru] [-WhatIf] [-Confirm] + [] ``` ### PathWithForce ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - -Force [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Force [-PassThru] [-WhatIf] [-Confirm] [] ``` ### LiteralPathWithUpdate ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Update [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Update [-PassThru] [-WhatIf] [-Confirm] + [] ``` ### LiteralPathWithForce ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Force [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Force [-PassThru] [-WhatIf] [-Confirm] [] ``` ### LiteralPath ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -186,7 +188,8 @@ This example sends a directory down the pipeline to create an archive. Files are doesn't include the root directory, but its files and subdirectories are included in the archive. ```powershell -Get-ChildItem -Path C:\LogFiles | Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip +Get-ChildItem -Path C:\LogFiles | + Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip ``` `Get-ChildItem` uses the **Path** parameter to specify the `C:\LogFiles` root directory. Each diff --git a/reference/7.5/CimCmdlets/New-CimInstance.md b/reference/7.5/CimCmdlets/New-CimInstance.md index 0a7f7c537585..7ad2d6c79ba0 100644 --- a/reference/7.5/CimCmdlets/New-CimInstance.md +++ b/reference/7.5/CimCmdlets/New-CimInstance.md @@ -19,46 +19,48 @@ Creates a CIM instance. ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - -CimSession [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] -CimSession [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ### CimClassComputerSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - [-ComputerName ] [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -77,7 +79,12 @@ This example creates an instance of a CIM Class named win32_environment in the r on the computer. ```powershell -New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";VariableValue="testvalue";UserName="domain\user"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "domain\user" +} +New-CimInstance -ClassName Win32_Environment -Property $prop ``` No client side validation is performed if the class does not exist, the properties are wrong, or if @@ -91,7 +98,12 @@ of the variable are then passed to the `New-CimInstance` cmdlet. ```powershell $class = Get-CimClass -ClassName Win32_Environment -New-CimInstance -CimClass $class -Property @{Name="testvar";VariableValue="testvalue";UserName="Contoso\User1"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "Contoso\User1" +} +New-CimInstance -CimClass $class -Property $prop ``` ### Example 3: Create a dynamic instance on the client @@ -102,7 +114,16 @@ computer without getting the instance from the server. The new instance is store on the server. ```powershell -$a = New-CimInstance -ClassName Win32_Process -Property @{Handle=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Property = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$a = New-CimInstance @instance + Get-CimInstance -CimInstance $a Invoke-CimMethod -CimInstance $a -MethodName GetOwner ``` @@ -387,7 +408,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/CimCmdlets/New-CimSession.md b/reference/7.5/CimCmdlets/New-CimSession.md index 273d6806489d..bf4bd53d02a7 100644 --- a/reference/7.5/CimCmdlets/New-CimSession.md +++ b/reference/7.5/CimCmdlets/New-CimSession.md @@ -17,16 +17,17 @@ Creates a CIM session. ### CredentialParameterSet (Default) ``` -New-CimSession [-Authentication ] [[-Credential] ] - [[-ComputerName] ] [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] - [-Port ] [-SessionOption ] [] +New-CimSession [-Authentication ] + [[-Credential] ] [[-ComputerName] ] [-Name ] + [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] + [-SessionOption ] [] ``` ### CertificateParameterSet ``` -New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] [-Name ] - [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] +New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] + [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] [-SessionOption ] [] ``` @@ -76,7 +77,7 @@ This example creates a remote CIM session to each of the computers specified by the comma separated list, and assigns a friendly name to the new sessions, by specifying **Name**. ```powershell -New-CimSession -ComputerName Server01,Server02 -Name FileServers +New-CimSession -ComputerName Server01, Server02 -Name FileServers Get-CimSession -Name File* ``` @@ -350,7 +351,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/CimCmdlets/New-CimSessionOption.md b/reference/7.5/CimCmdlets/New-CimSessionOption.md index fa3eb5995404..9014cd74b3eb 100644 --- a/reference/7.5/CimCmdlets/New-CimSessionOption.md +++ b/reference/7.5/CimCmdlets/New-CimSessionOption.md @@ -18,8 +18,8 @@ Specifies advanced options for the New-CimSession cmdlet. ### ProtocolTypeSet (Default) ``` -New-CimSessionOption [-Protocol] [-UICulture ] [-Culture ] - [] +New-CimSessionOption [-Protocol] [-UICulture ] + [-Culture ] [] ``` ### WSManParameterSet @@ -28,15 +28,16 @@ New-CimSessionOption [-Protocol] [-UICulture ] [-Cul New-CimSessionOption [-NoEncryption] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck] [-EncodePortInServicePrincipalName] [-Encoding ] [-HttpPrefix ] [-MaxEnvelopeSizeKB ] [-ProxyAuthentication ] - [-ProxyCertificateThumbprint ] [-ProxyCredential ] [-ProxyType ] - [-UseSsl] [-UICulture ] [-Culture ] [] + [-ProxyCertificateThumbprint ] [-ProxyCredential ] + [-ProxyType ] [-UseSsl] [-UICulture ] [-Culture ] + [] ``` ### DcomParameterSet ``` -New-CimSessionOption [-Impersonation ] [-PacketIntegrity] [-PacketPrivacy] - [-UICulture ] [-Culture ] [] +New-CimSessionOption [-Impersonation ] [-PacketIntegrity] + [-PacketPrivacy] [-UICulture ] [-Culture ] [] ``` ## DESCRIPTION @@ -73,7 +74,14 @@ parameter, the credentials specified by the **ProxyCredential** parameter, and s command is to skip the CA check, skip the CN check, and use SSL. ```powershell -New-CimSessionOption -ProxyAuthentication Kerberos -ProxyCredential $cred -SkipCACheck -SkipCNCheck -UseSsl +$option = @{ + ProxyAuthentication = 'Kerberos' + ProxyCredential = $cred + SkipCACheck = $true + SkipCNCheck = $true + UseSsl = $true +} +New-CimSessionOption @option ``` ### Example 3: Create a CIM session options object with the culture specified diff --git a/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md index 837e2b12a407..46816b9697dc 100644 --- a/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.5/CimCmdlets/Register-CimIndicationEvent.md @@ -36,19 +36,19 @@ Register-CimIndicationEvent [-Namespace ] [-ClassName] ### QueryExpressionSessionSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] -CimSession [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] -CimSession + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ### QueryExpressionComputerSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] [-ComputerName ] [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] [-ComputerName ] + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ## DESCRIPTION @@ -69,7 +69,11 @@ This example subscribes to the events generated by the class named **Win32_Proce class raises an event whenever a process starts. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -100,7 +104,12 @@ $action = { $id = $event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + Action = $action +} +Register-CimIndicationEvent @event ``` For more information, see @@ -113,7 +122,12 @@ CIM server are stored in the event queue in the current PowerShell session and t `Get-Event` to retrieve the events. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01 +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + ComputerName = 'Server01' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -128,7 +142,7 @@ event is raised, instead of sending the event to the event queue. Enclose the co The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`, `$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event to the **Action** script block. For more information, see -[About Automatic Variables](../microsoft.powershell.core/about/about_automatic_variables.md). +[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ```yaml Type: System.Management.Automation.ScriptBlock diff --git a/reference/7.5/CimCmdlets/Remove-CimInstance.md b/reference/7.5/CimCmdlets/Remove-CimInstance.md index 7787a946205a..dd77ab2d9766 100644 --- a/reference/7.5/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.5/CimCmdlets/Remove-CimInstance.md @@ -17,31 +17,33 @@ Removes a CIM instance from a computer. ### CimInstanceComputerSet (Default) ``` -Remove-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### CimInstanceSessionSet ``` -Remove-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### QuerySessionSet ``` Remove-CimInstance -CimSession [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ### QueryComputerSet ``` Remove-CimInstance [-ComputerName ] [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.5/CimCmdlets/Set-CimInstance.md b/reference/7.5/CimCmdlets/Set-CimInstance.md index f7cda96c2aa8..2fafa248fc89 100644 --- a/reference/7.5/CimCmdlets/Set-CimInstance.md +++ b/reference/7.5/CimCmdlets/Set-CimInstance.md @@ -17,33 +17,33 @@ Modifies a CIM instance on a CIM server by calling the ModifyInstance method of ### CimInstanceComputerSet (Default) ``` -Set-CimInstance [-ComputerName ] [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Set-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QuerySessionSet ``` -Set-CimInstance -CimSession [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet ``` -Set-CimInstance [-ComputerName ] [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -78,7 +78,11 @@ parameter. You can modify instances matching a Windows Management Instrumentatio (WQL) query. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} +$instance = @ { + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} +} +Set-CimInstance @instance ``` ### Example 2: Set the CIM instance property using pipeline @@ -123,7 +127,12 @@ This example uses the common parameter **WhatIf** to specify that the modificati done, but only output what would happen if it were done. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -WhatIf +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + WhatIf = $true +} +Set-CimInstance @instance ``` ### Example 6: Set the CIM instance after confirmation from the user @@ -132,7 +141,12 @@ This example uses the common parameter **Confirm** to specify that the modificat only after confirmation from the user. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -Confirm +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + Confirm = $true +} +Set-CimInstance @instance ``` ### Example 7: Set the created CIM instance @@ -143,7 +157,16 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly +$instance = @{ + ClassName = 'Win32_Environment' + Property = @{ + Name="testvar" + UserName="domain\user" + } + Key = 'Name', 'UserName' + ClientOnly = $true +} +$x = New-CimInstance @instance Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -397,7 +420,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Archive/Compress-Archive.md b/reference/7.5/Microsoft.PowerShell.Archive/Compress-Archive.md index 1a3c9dda4987..1b2d6498f059 100644 --- a/reference/7.5/Microsoft.PowerShell.Archive/Compress-Archive.md +++ b/reference/7.5/Microsoft.PowerShell.Archive/Compress-Archive.md @@ -18,43 +18,45 @@ Creates a compressed archive, or zipped file, from specified files and directori ### Path (Default) ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### PathWithUpdate ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - -Update [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Update [-PassThru] [-WhatIf] [-Confirm] + [] ``` ### PathWithForce ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - -Force [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Force [-PassThru] [-WhatIf] [-Confirm] [] ``` ### LiteralPathWithUpdate ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Update [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Update [-PassThru] [-WhatIf] [-Confirm] + [] ``` ### LiteralPathWithForce ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Force [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Force [-PassThru] [-WhatIf] [-Confirm] [] ``` ### LiteralPath ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -185,7 +187,8 @@ This example sends a directory down the pipeline to create an archive. Files are doesn't include the root directory, but its files and subdirectories are included in the archive. ```powershell -Get-ChildItem -Path C:\LogFiles | Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip +Get-ChildItem -Path C:\LogFiles | + Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip ``` `Get-ChildItem` uses the **Path** parameter to specify the `C:\LogFiles` root directory. Each diff --git a/reference/7.6/CimCmdlets/New-CimInstance.md b/reference/7.6/CimCmdlets/New-CimInstance.md index 042918d72400..a5eebefad636 100644 --- a/reference/7.6/CimCmdlets/New-CimInstance.md +++ b/reference/7.6/CimCmdlets/New-CimInstance.md @@ -19,46 +19,48 @@ Creates a CIM instance. ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ClassNameSessionSet ``` New-CimInstance [-ClassName] [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-ClientOnly] - [-WhatIf] [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-ClientOnly] [-WhatIf] [-Confirm] [] ``` ### ResourceUriSessionSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] -CimSession [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] -CimSession + [-WhatIf] [-Confirm] [] ``` ### ResourceUriComputerSet ``` New-CimInstance -ResourceUri [-Key ] [[-Property] ] - [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] [-WhatIf] - [-Confirm] [] + [-Namespace ] [-OperationTimeoutSec ] [-ComputerName ] + [-WhatIf] [-Confirm] [] ``` ### CimClassSessionSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - -CimSession [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] -CimSession [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ### CimClassComputerSet ``` -New-CimInstance [-CimClass] [[-Property] ] [-OperationTimeoutSec ] - [-ComputerName ] [-ClientOnly] [-WhatIf] [-Confirm] [] +New-CimInstance [-CimClass] [[-Property] ] + [-OperationTimeoutSec ] [-ComputerName ] [-ClientOnly] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -77,7 +79,12 @@ This example creates an instance of a CIM Class named win32_environment in the r on the computer. ```powershell -New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";VariableValue="testvalue";UserName="domain\user"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "domain\user" +} +New-CimInstance -ClassName Win32_Environment -Property $prop ``` No client side validation is performed if the class does not exist, the properties are wrong, or if @@ -91,7 +98,12 @@ of the variable are then passed to the `New-CimInstance` cmdlet. ```powershell $class = Get-CimClass -ClassName Win32_Environment -New-CimInstance -CimClass $class -Property @{Name="testvar";VariableValue="testvalue";UserName="Contoso\User1"} +$prop = @{ + Name = "testvar" + VariableValue = "testvalue" + UserName = "Contoso\User1" +} +New-CimInstance -CimClass $class -Property $prop ``` ### Example 3: Create a dynamic instance on the client @@ -102,7 +114,16 @@ computer without getting the instance from the server. The new instance is store on the server. ```powershell -$a = New-CimInstance -ClassName Win32_Process -Property @{Handle=0} -Key Handle -ClientOnly +$instance = @{ + ClassName = 'Win32_Process' + Property = @{ + Handle = 0 + } + Key = 'Handle' + ClientOnly = $true +} +$a = New-CimInstance @instance + Get-CimInstance -CimInstance $a Invoke-CimMethod -CimInstance $a -MethodName GetOwner ``` @@ -387,7 +408,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/CimCmdlets/New-CimSession.md b/reference/7.6/CimCmdlets/New-CimSession.md index 3e60357a9505..8f8bde961e0d 100644 --- a/reference/7.6/CimCmdlets/New-CimSession.md +++ b/reference/7.6/CimCmdlets/New-CimSession.md @@ -17,16 +17,17 @@ Creates a CIM session. ### CredentialParameterSet (Default) ``` -New-CimSession [-Authentication ] [[-Credential] ] - [[-ComputerName] ] [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] - [-Port ] [-SessionOption ] [] +New-CimSession [-Authentication ] + [[-Credential] ] [[-ComputerName] ] [-Name ] + [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] + [-SessionOption ] [] ``` ### CertificateParameterSet ``` -New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] [-Name ] - [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] +New-CimSession [-CertificateThumbprint ] [[-ComputerName] ] + [-Name ] [-OperationTimeoutSec ] [-SkipTestConnection] [-Port ] [-SessionOption ] [] ``` @@ -350,7 +351,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/CimCmdlets/New-CimSessionOption.md b/reference/7.6/CimCmdlets/New-CimSessionOption.md index 81107a1f5d0b..dd628f97efbe 100644 --- a/reference/7.6/CimCmdlets/New-CimSessionOption.md +++ b/reference/7.6/CimCmdlets/New-CimSessionOption.md @@ -18,8 +18,8 @@ Specifies advanced options for the New-CimSession cmdlet. ### ProtocolTypeSet (Default) ``` -New-CimSessionOption [-Protocol] [-UICulture ] [-Culture ] - [] +New-CimSessionOption [-Protocol] [-UICulture ] + [-Culture ] [] ``` ### WSManParameterSet @@ -28,15 +28,16 @@ New-CimSessionOption [-Protocol] [-UICulture ] [-Cul New-CimSessionOption [-NoEncryption] [-SkipCACheck] [-SkipCNCheck] [-SkipRevocationCheck] [-EncodePortInServicePrincipalName] [-Encoding ] [-HttpPrefix ] [-MaxEnvelopeSizeKB ] [-ProxyAuthentication ] - [-ProxyCertificateThumbprint ] [-ProxyCredential ] [-ProxyType ] - [-UseSsl] [-UICulture ] [-Culture ] [] + [-ProxyCertificateThumbprint ] [-ProxyCredential ] + [-ProxyType ] [-UseSsl] [-UICulture ] [-Culture ] + [] ``` ### DcomParameterSet ``` -New-CimSessionOption [-Impersonation ] [-PacketIntegrity] [-PacketPrivacy] - [-UICulture ] [-Culture ] [] +New-CimSessionOption [-Impersonation ] [-PacketIntegrity] + [-PacketPrivacy] [-UICulture ] [-Culture ] [] ``` ## DESCRIPTION @@ -73,7 +74,14 @@ parameter, the credentials specified by the **ProxyCredential** parameter, and s command is to skip the CA check, skip the CN check, and use SSL. ```powershell -New-CimSessionOption -ProxyAuthentication Kerberos -ProxyCredential $cred -SkipCACheck -SkipCNCheck -UseSsl +$option = @{ + ProxyAuthentication = 'Kerberos' + ProxyCredential = $cred + SkipCACheck = $true + SkipCNCheck = $true + UseSsl = $true +} +New-CimSessionOption @option ``` ### Example 3: Create a CIM session options object with the culture specified diff --git a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md index 5b23f3048e27..379be06226e4 100644 --- a/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md +++ b/reference/7.6/CimCmdlets/Register-CimIndicationEvent.md @@ -36,19 +36,19 @@ Register-CimIndicationEvent [-Namespace ] [-ClassName] ### QueryExpressionSessionSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] -CimSession [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] -CimSession + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ### QueryExpressionComputerSet ``` -Register-CimIndicationEvent [-Namespace ] [-Query] [-QueryDialect ] - [-OperationTimeoutSec ] [-ComputerName ] [[-SourceIdentifier] ] - [[-Action] ] [-MessageData ] [-SupportEvent] [-Forward] - [-MaxTriggerCount ] [] +Register-CimIndicationEvent [-Namespace ] [-Query] + [-QueryDialect ] [-OperationTimeoutSec ] [-ComputerName ] + [[-SourceIdentifier] ] [[-Action] ] [-MessageData ] + [-SupportEvent] [-Forward] [-MaxTriggerCount ] [] ``` ## DESCRIPTION @@ -69,7 +69,11 @@ This example subscribes to the events generated by the class named **Win32_Proce class raises an event whenever a process starts. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -100,7 +104,12 @@ $action = { $id = $event.SourceEventArgs.NewEvent.ProcessId Write-Host -Object "New Process Started : Name = $name ID = $id" } -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -Action $action +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + Action = $action +} +Register-CimIndicationEvent @event ``` For more information, see @@ -113,7 +122,12 @@ CIM server are stored in the event queue in the current PowerShell session and t `Get-Event` to retrieve the events. ```powershell -Register-CimIndicationEvent -ClassName 'Win32_ProcessStartTrace' -SourceIdentifier "ProcessStarted" -ComputerName Server01 +$event = @{ + ClassName = 'Win32_ProcessStartTrace' + SourceIdentifier = 'ProcessStarted' + ComputerName = 'Server01' +} +Register-CimIndicationEvent @event Get-Event -SourceIdentifier "ProcessStarted" ``` @@ -128,7 +142,7 @@ event is raised, instead of sending the event to the event queue. Enclose the co The script block specified with **Action** can include the `$Event`, `$EventSubscriber`, `$Sender`, `$SourceEventArgs`, and `$SourceArgs` automatic variables, which provide information about the event to the **Action** script block. For more information, see -[About Automatic Variables](../microsoft.powershell.core/about/about_automatic_variables.md). +[About Automatic Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ```yaml Type: System.Management.Automation.ScriptBlock diff --git a/reference/7.6/CimCmdlets/Remove-CimInstance.md b/reference/7.6/CimCmdlets/Remove-CimInstance.md index f52e154ace1b..ac0f9d745f1b 100644 --- a/reference/7.6/CimCmdlets/Remove-CimInstance.md +++ b/reference/7.6/CimCmdlets/Remove-CimInstance.md @@ -17,31 +17,33 @@ Removes a CIM instance from a computer. ### CimInstanceComputerSet (Default) ``` -Remove-CimInstance [-ResourceUri ] [-ComputerName ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance [-ResourceUri ] [-ComputerName ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### CimInstanceSessionSet ``` -Remove-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-WhatIf] [-Confirm] [] +Remove-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-WhatIf] [-Confirm] + [] ``` ### QuerySessionSet ``` Remove-CimInstance -CimSession [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ### QueryComputerSet ``` Remove-CimInstance [-ComputerName ] [[-Namespace] ] - [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] [-Confirm] - [] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.6/CimCmdlets/Set-CimInstance.md b/reference/7.6/CimCmdlets/Set-CimInstance.md index 6566f790ce30..ffb7ccd87334 100644 --- a/reference/7.6/CimCmdlets/Set-CimInstance.md +++ b/reference/7.6/CimCmdlets/Set-CimInstance.md @@ -17,33 +17,33 @@ Modifies a CIM instance on a CIM server by calling the ModifyInstance method of ### CimInstanceComputerSet (Default) ``` -Set-CimInstance [-ComputerName ] [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### CimInstanceSessionSet ``` -Set-CimInstance -CimSession [-ResourceUri ] [-OperationTimeoutSec ] - [-InputObject] [-Property ] [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-ResourceUri ] + [-OperationTimeoutSec ] [-InputObject] [-Property ] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QuerySessionSet ``` -Set-CimInstance -CimSession [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance -CimSession [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ### QueryComputerSet ``` -Set-CimInstance [-ComputerName ] [-Namespace ] [-OperationTimeoutSec ] - [-Query] [-QueryDialect ] -Property [-PassThru] [-WhatIf] [-Confirm] - [] +Set-CimInstance [-ComputerName ] [-Namespace ] + [-OperationTimeoutSec ] [-Query] [-QueryDialect ] + -Property [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -78,7 +78,11 @@ parameter. You can modify instances matching a Windows Management Instrumentatio (WQL) query. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} +$instance = @ { + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} +} +Set-CimInstance @instance ``` ### Example 2: Set the CIM instance property using pipeline @@ -123,7 +127,12 @@ This example uses the common parameter **WhatIf** to specify that the modificati done, but only output what would happen if it were done. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -WhatIf +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + WhatIf = $true +} +Set-CimInstance @instance ``` ### Example 6: Set the CIM instance after confirmation from the user @@ -132,7 +141,12 @@ This example uses the common parameter **Confirm** to specify that the modificat only after confirmation from the user. ```powershell -Set-CimInstance -Query 'Select * from Win32_Environment where name LIKE "testvar%"' -Property @{VariableValue="abcd"} -Confirm +$instance = @{ + Query = 'Select * from Win32_Environment where name LIKE "testvar%"' + Property = @{VariableValue="abcd"} + Confirm = $true +} +Set-CimInstance @instance ``` ### Example 7: Set the created CIM instance @@ -143,7 +157,16 @@ cmdlet, and retrieves its contents in to a variable `$x`. The variable is then p Because the **PassThru** parameter is used, This example returns a modified CIM instance object. ```powershell -$x = New-CimInstance -ClassName Win32_Environment -Property @{Name="testvar";UserName="domain\user"} -Key Name, UserName -ClientOnly +$instance = @{ + ClassName = 'Win32_Environment' + Property = @{ + Name="testvar" + UserName="domain\user" + } + Key = 'Name', 'UserName' + ClientOnly = $true +} +$x = New-CimInstance @instance Set-CimInstance -CimInstance $x -Property @{VariableValue="somevalue"} -PassThru ``` @@ -397,7 +420,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Archive/Compress-Archive.md b/reference/7.6/Microsoft.PowerShell.Archive/Compress-Archive.md index 6f5b17d46d0b..0259e34a3fa5 100644 --- a/reference/7.6/Microsoft.PowerShell.Archive/Compress-Archive.md +++ b/reference/7.6/Microsoft.PowerShell.Archive/Compress-Archive.md @@ -18,43 +18,45 @@ Creates a compressed archive, or zipped file, from specified files and directori ### Path (Default) ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### PathWithUpdate ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - -Update [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Update [-PassThru] [-WhatIf] [-Confirm] + [] ``` ### PathWithForce ``` -Compress-Archive [-Path] [-DestinationPath] [-CompressionLevel ] - -Force [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive [-Path] [-DestinationPath] + [-CompressionLevel ] -Force [-PassThru] [-WhatIf] [-Confirm] [] ``` ### LiteralPathWithUpdate ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Update [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Update [-PassThru] [-WhatIf] [-Confirm] + [] ``` ### LiteralPathWithForce ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - -Force [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] -Force [-PassThru] [-WhatIf] [-Confirm] [] ``` ### LiteralPath ``` -Compress-Archive -LiteralPath [-DestinationPath] [-CompressionLevel ] - [-PassThru] [-WhatIf] [-Confirm] [] +Compress-Archive -LiteralPath [-DestinationPath] + [-CompressionLevel ] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -185,7 +187,8 @@ This example sends a directory down the pipeline to create an archive. Files are doesn't include the root directory, but its files and subdirectories are included in the archive. ```powershell -Get-ChildItem -Path C:\LogFiles | Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip +Get-ChildItem -Path C:\LogFiles | + Compress-Archive -DestinationPath C:\Archives\PipelineDir.zip ``` `Get-ChildItem` uses the **Path** parameter to specify the `C:\LogFiles` root directory. Each diff --git a/reference/docs-conceptual/community/2021-updates.md b/reference/docs-conceptual/community/2021-updates.md index e403bbe1e4ca..aedfd8d3213e 100644 --- a/reference/docs-conceptual/community/2021-updates.md +++ b/reference/docs-conceptual/community/2021-updates.md @@ -259,7 +259,7 @@ New content Content updates - Converted [about_remote_faq](/powershell/scripting/learn/remoting/powershell-remoting-faq) to new - Yaml format and moved to conceptual TOC + YAML format and moved to conceptual TOC - Moved **PSDesiredStateConfiguration** out of 7.2 docs and into PowerShell-Docs-Modules - DSC is being removed from PowerShell to become an optional module that is loaded from the PowerShell Gallery diff --git a/reference/docs-conceptual/community/contributing/managing-pull-requests.md b/reference/docs-conceptual/community/contributing/managing-pull-requests.md index e883da168570..27838619d13d 100644 --- a/reference/docs-conceptual/community/contributing/managing-pull-requests.md +++ b/reference/docs-conceptual/community/contributing/managing-pull-requests.md @@ -94,7 +94,7 @@ Can't find service name for `//About/About.md` ``` ``` -Metadata with following name(s) are not allowed to be set in Yaml header, or as file level +Metadata with following name(s) are not allowed to be set in YAML header, or as file level metadata in docfx.json, or as global metadata in docfx.json: `locale`. They are generated by Docs platform, so the values set in these 3 places will be ignored. Please remove them from all 3 places to resolve the warning.