Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions reference/5.1/ISE/Get-IseSnippet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions reference/5.1/ISE/ISE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion reference/5.1/ISE/Import-IseSnippet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 18 additions & 8 deletions reference/5.1/ISE/New-IseSnippet.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Creates a Windows PowerShell ISE code snippet.
## SYNTAX

```
New-IseSnippet [-Title] <String> [-Description] <String> [-Text] <String> [-Author <String>]
[-CaretOffset <Int32>] [-Force] [<CommonParameters>]
New-IseSnippet [-Title] <String> [-Description] <String> [-Text] <String>
[-Author <String>] [-CaretOffset <Int32>] [-Force] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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

Expand All @@ -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
(
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
27 changes: 14 additions & 13 deletions reference/5.1/Microsoft.PowerShell.Archive/Compress-Archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@ Creates a compressed archive, or zipped file, from specified files and directori
### Path (Default)

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
[-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### PathWithUpdate

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>] -Update
[-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Update [-WhatIf] [-Confirm] [<CommonParameters>]
```

### PathWithForce

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>] -Force
[-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Force [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPathWithUpdate

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Update [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Update [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPathWithForce

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Force [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Force [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPath

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
[-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Extracts files from a specified archive (zipped) file.
### Path (Default)

```
Expand-Archive [-Path] <String> [[-DestinationPath] <String>] [-Force] [-WhatIf] [-Confirm]
[<CommonParameters>]
Expand-Archive [-Path] <String> [[-DestinationPath] <String>] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

### LiteralPath

```
Expand-Archive -LiteralPath <String> [[-DestinationPath] <String>] [-Force] [-WhatIf] [-Confirm]
[<CommonParameters>]
Expand-Archive -LiteralPath <String> [[-DestinationPath] <String>] [-Force] [-WhatIf]
[-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down
29 changes: 16 additions & 13 deletions reference/7.4/Microsoft.PowerShell.Archive/Compress-Archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,45 @@ Creates a compressed ZIP archive from specified files and directories.
### Path (Default)

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### PathWithUpdate

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Update [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Update [-PassThru] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### PathWithForce

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPathWithUpdate

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Update [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Update [-PassThru] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### LiteralPathWithForce

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPath

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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
Expand Down
29 changes: 16 additions & 13 deletions reference/7.5/Microsoft.PowerShell.Archive/Compress-Archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,45 @@ Creates a compressed archive, or zipped file, from specified files and directori
### Path (Default)

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### PathWithUpdate

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Update [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Update [-PassThru] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### PathWithForce

```
Compress-Archive [-Path] <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive [-Path] <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPathWithUpdate

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Update [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Update [-PassThru] [-WhatIf] [-Confirm]
[<CommonParameters>]
```

### LiteralPathWithForce

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
-Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] -Force [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### LiteralPath

```
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String> [-CompressionLevel <String>]
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Compress-Archive -LiteralPath <String[]> [-DestinationPath] <String>
[-CompressionLevel <String>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -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
Expand Down
Loading