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/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/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/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