From 2a3ccf3ce770bfe537328c4eaf0097ea3847e476 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 8 Nov 2017 02:42:13 +0900 Subject: [PATCH 001/145] Update the example of `Where-Object -IsNot` (#1841) --- reference/3.0/Microsoft.PowerShell.Core/Where-Object.md | 4 ++-- reference/4.0/Microsoft.PowerShell.Core/Where-Object.md | 4 ++-- reference/5.0/Microsoft.PowerShell.Core/Where-Object.md | 4 ++-- reference/5.1/Microsoft.PowerShell.Core/Where-Object.md | 4 ++-- reference/6/Microsoft.PowerShell.Core/Where-Object.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/Where-Object.md b/reference/3.0/Microsoft.PowerShell.Core/Where-Object.md index fe6405119d6e..0e20d28acf73 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Where-Object.md @@ -428,7 +428,7 @@ Accept wildcard characters: False Specifies the Is operator, which gets objects when the property value is an instance of the specified .NET Framework type. Enclose the type name in square brackets. -For example, `Get-Process | where StartTime -is \[DateTime\]` +For example, `Get-Process | where StartTime -Is [DateTime]` This parameter is introduced in Windows PowerShell 3.0. @@ -447,7 +447,7 @@ Accept wildcard characters: False ### -IsNot Specifies the Is-Not operator, which gets objects when the property value is not an instance of the specified .NET Framework type. -For example, `Get-Process | where StartTime -IsNot \[System.String\]` +For example, `Get-Process | where StartTime -IsNot [DateTime]` This parameter is introduced in Windows PowerShell 3.0. diff --git a/reference/4.0/Microsoft.PowerShell.Core/Where-Object.md b/reference/4.0/Microsoft.PowerShell.Core/Where-Object.md index 6f3fd361f8f4..c1d95481b976 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Where-Object.md @@ -713,7 +713,7 @@ Accept wildcard characters: False Specifies the Is operator, which gets objects when the property value is an instance of the specified .NET Framework type. Enclose the type name in square brackets. -For example, `Get-Process | where StartTime -Is \[DateTime\]` +For example, `Get-Process | where StartTime -Is [DateTime]` This parameter is introduced in Windows PowerShell 3.0. @@ -732,7 +732,7 @@ Accept wildcard characters: False ### -IsNot Specifies the Is-Not operator, which gets objects when the property value is not an instance of the specified .NET Framework type. -For example, `Get-Process | where StartTime -IsNot \[System.String\]` +For example, `Get-Process | where StartTime -IsNot [DateTime]` This parameter is introduced in Windows PowerShell 3.0. diff --git a/reference/5.0/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.0/Microsoft.PowerShell.Core/Where-Object.md index b104b14f37ab..a27311f44647 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Where-Object.md @@ -729,7 +729,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET Framework type. Enclose the type name in square brackets. -For example, `Get-Process | where StartTime -Is \[DateTime\]` +For example, `Get-Process | where StartTime -Is [DateTime]` This parameter was introduced in Windows PowerShell 3.0. @@ -748,7 +748,7 @@ Accept wildcard characters: False ### -IsNot Indicates that this cmdlet gets objects if the property value is not an instance of the specified .NET Framework type. -For example, `Get-Process | where StartTime -IsNot \[System.String\]` +For example, `Get-Process | where StartTime -IsNot [DateTime]` This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md index 4595a4b2bb0c..07bb47dbde5e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Where-Object.md @@ -729,7 +729,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET Framework type. Enclose the type name in square brackets. -For example, `Get-Process | where StartTime -Is \[DateTime\]` +For example, `Get-Process | where StartTime -Is [DateTime]` This parameter was introduced in Windows PowerShell 3.0. @@ -748,7 +748,7 @@ Accept wildcard characters: False ### -IsNot Indicates that this cmdlet gets objects if the property value is not an instance of the specified .NET Framework type. -For example, `Get-Process | where StartTime -IsNot \[System.String\]` +For example, `Get-Process | where StartTime -IsNot [DateTime]` This parameter was introduced in Windows PowerShell 3.0. diff --git a/reference/6/Microsoft.PowerShell.Core/Where-Object.md b/reference/6/Microsoft.PowerShell.Core/Where-Object.md index 4595a4b2bb0c..07bb47dbde5e 100644 --- a/reference/6/Microsoft.PowerShell.Core/Where-Object.md +++ b/reference/6/Microsoft.PowerShell.Core/Where-Object.md @@ -729,7 +729,7 @@ Accept wildcard characters: False Indicates that this cmdlet gets objects if the property value is an instance of the specified .NET Framework type. Enclose the type name in square brackets. -For example, `Get-Process | where StartTime -Is \[DateTime\]` +For example, `Get-Process | where StartTime -Is [DateTime]` This parameter was introduced in Windows PowerShell 3.0. @@ -748,7 +748,7 @@ Accept wildcard characters: False ### -IsNot Indicates that this cmdlet gets objects if the property value is not an instance of the specified .NET Framework type. -For example, `Get-Process | where StartTime -IsNot \[System.String\]` +For example, `Get-Process | where StartTime -IsNot [DateTime]` This parameter was introduced in Windows PowerShell 3.0. From f778a37db8799d2c8f0a52eff72df09cdf127d36 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 9 Nov 2017 00:24:22 +0900 Subject: [PATCH 002/145] Update Example 5 in Group-Object.md (#1845) --- .../Group-Object.md | 28 ++++++++++--------- .../Group-Object.md | 28 ++++++++++--------- .../Group-Object.md | 28 +++++++++++-------- .../Group-Object.md | 28 +++++++++++-------- .../Group-Object.md | 28 +++++++++++-------- 5 files changed, 81 insertions(+), 59 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md index 5017d9b84e94..21ab7f95fcd4 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -67,24 +67,26 @@ The command uses the Property parameter to specify that the events should be gro In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group. ### Example 5 +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass + +Count Name Group +----- ---- ----- + 55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti... + 1 {System.Diagnostics.Process (Idle)} + 3 High {System.Diagnostics.Process (Newproc), System.Diagnostic... + 2 BelowNormal {System.Diagnostics.Process (winperf), ``` -PS C:\> get-process | group-object -property priorityclass -Count Name Group ------ ---- ----- -55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia... -1 {System.Diagnostics.Process (Idle)} -3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D... -2 BelowNormal {System.Diagnostics.Process (winperf), - -PS C:\> get-process | group-object -property company -noelement +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement Count Name ----- ---- -55 Normal -1 -3 High -2 BelowNormal + 55 Normal + 1 + 3 High + 2 BelowNormal ``` This example demonstrates the effect of the NoElement parameter. diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md index 5053394e660b..d504fce222a0 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -74,24 +74,26 @@ The command uses the Property parameter to specify that the events should be gro In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group. ### Example 5 +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass + +Count Name Group +----- ---- ----- + 55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti... + 1 {System.Diagnostics.Process (Idle)} + 3 High {System.Diagnostics.Process (Newproc), System.Diagnostic... + 2 BelowNormal {System.Diagnostics.Process (winperf), ``` -PS C:\> get-process | group-object -property priorityclass -Count Name Group ------ ---- ----- -55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia... -1 {System.Diagnostics.Process (Idle)} -3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D... -2 BelowNormal {System.Diagnostics.Process (winperf), - -PS C:\> get-process | group-object -property company -noelement +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement Count Name ----- ---- -55 Normal -1 -3 High -2 BelowNormal + 55 Normal + 1 + 3 High + 2 BelowNormal ``` This example demonstrates the effect of the NoElement parameter. diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md index d2ba6ca1314a..1dc7b6a684c2 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -73,20 +73,26 @@ The command uses the *Property* parameter to specify that the events should be g In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group. ### Example 5: Group processes by priority class -``` +```powershell PS C:\> Get-Process | Group-Object -Property PriorityClass -Count Name Group ------ ---- ----- -55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia... -1 {System.Diagnostics.Process (Idle)} -3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D... -2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement + +Count Name Group +----- ---- ----- + 55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti... + 1 {System.Diagnostics.Process (Idle)} + 3 High {System.Diagnostics.Process (Newproc), System.Diagnostic... + 2 BelowNormal {System.Diagnostics.Process (winperf), +``` + +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement + Count Name ----- ---- -55 Normal -1 -3 High -2 BelowNormal + 55 Normal + 1 + 3 High + 2 BelowNormal ``` This example demonstrates the effect of the *NoElement* parameter. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md index 2d60f1516e56..454e3d84d85b 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md @@ -73,20 +73,26 @@ The command uses the *Property* parameter to specify that the events should be g In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group. ### Example 5: Group processes by priority class -``` +```powershell PS C:\> Get-Process | Group-Object -Property PriorityClass -Count Name Group ------ ---- ----- -55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia... -1 {System.Diagnostics.Process (Idle)} -3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D... -2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement + +Count Name Group +----- ---- ----- + 55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti... + 1 {System.Diagnostics.Process (Idle)} + 3 High {System.Diagnostics.Process (Newproc), System.Diagnostic... + 2 BelowNormal {System.Diagnostics.Process (winperf), +``` + +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement + Count Name ----- ---- -55 Normal -1 -3 High -2 BelowNormal + 55 Normal + 1 + 3 High + 2 BelowNormal ``` This example demonstrates the effect of the *NoElement* parameter. diff --git a/reference/6/Microsoft.PowerShell.Utility/Group-Object.md b/reference/6/Microsoft.PowerShell.Utility/Group-Object.md index 28e1b749cdf5..9f93095351f9 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Group-Object.md @@ -74,20 +74,26 @@ The command uses the *Property* parameter to specify that the events should be g In the output, the Count column represents the number of entries in each group, the Name column represents the EventID values that define a group, and the Group column represents the objects in each group. ### Example 5: Group processes by priority class -``` +```powershell PS C:\> Get-Process | Group-Object -Property PriorityClass -Count Name Group ------ ---- ----- -55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnostics.Process (alg), System.Dia... -1 {System.Diagnostics.Process (Idle)} -3 High {System.Diagnostics.Process (Newproc), System.Diagnostics.Process (winlogon), System.D... -2 BelowNormal {System.Diagnostics.Process (winperf), PS C:\> Get-Process | Group-Object -Property company -NoElement + +Count Name Group +----- ---- ----- + 55 Normal {System.Diagnostics.Process (AdtAgent), System.Diagnosti... + 1 {System.Diagnostics.Process (Idle)} + 3 High {System.Diagnostics.Process (Newproc), System.Diagnostic... + 2 BelowNormal {System.Diagnostics.Process (winperf), +``` + +```powershell +PS C:\> Get-Process | Group-Object -Property PriorityClass -NoElement + Count Name ----- ---- -55 Normal -1 -3 High -2 BelowNormal + 55 Normal + 1 + 3 High + 2 BelowNormal ``` This example demonstrates the effect of the *NoElement* parameter. From 1357977e649f583c4e73102cb3d0774dd068fa01 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 10:43:17 -0800 Subject: [PATCH 003/145] removing @{Text=} tags --- .../Enter-PSHostProcess.md | 4 ++-- .../Microsoft.PowerShell.Core/Out-Default.md | 2 +- .../Unprotect-CmsMessage.md | 4 ++-- .../Disable-RunspaceDebug.md | 10 ++++----- .../Enable-RunspaceDebug.md | 12 +++++----- .../Get-Runspace.md | 4 ++-- .../Get-RunspaceDebug.md | 10 ++++----- .../Select-Object.md | 2 +- reference/5.0/PowershellGet/Find-Command.md | 2 +- reference/5.0/PowershellGet/Publish-Module.md | 2 +- .../Enter-PSHostProcess.md | 4 ++-- .../Microsoft.PowerShell.Core/Get-Module.md | 4 ++-- .../Get-PSHostProcessInfo.md | 4 ++-- .../Microsoft.PowerShell.Core/Out-Default.md | 2 +- .../Get-AuthenticodeSignature.md | 2 +- .../Unprotect-CmsMessage.md | 4 ++-- .../Disable-RunspaceDebug.md | 10 ++++----- .../Enable-RunspaceDebug.md | 12 +++++----- .../Format-Hex.md | 2 +- .../Get-FormatData.md | 2 +- .../Get-Runspace.md | 4 ++-- .../Get-RunspaceDebug.md | 10 ++++----- .../Select-Object.md | 2 +- .../PSScheduledJob/Register-ScheduledJob.md | 2 +- .../5.1/PSScheduledJob/Set-ScheduledJob.md | 2 +- .../5.1/PackageManagement/Get-Package.md | 6 ++--- .../5.1/PackageManagement/Install-Package.md | 6 ++--- .../PackageManagement/Uninstall-Package.md | 6 ++--- reference/5.1/PowershellGet/Find-Command.md | 2 +- .../5.1/PowershellGet/Find-DscResource.md | 2 +- reference/5.1/PowershellGet/Find-Module.md | 2 +- .../5.1/PowershellGet/Find-RoleCapability.md | 2 +- reference/5.1/PowershellGet/Find-Script.md | 4 ++-- reference/5.1/PowershellGet/Install-Module.md | 4 ++-- reference/5.1/PowershellGet/Install-Script.md | 6 ++--- reference/5.1/PowershellGet/Publish-Module.md | 4 ++-- reference/5.1/PowershellGet/Publish-Script.md | 2 +- .../PowershellGet/Register-PSRepository.md | 4 ++-- reference/5.1/PowershellGet/Save-Module.md | 2 +- reference/5.1/PowershellGet/Save-Script.md | 2 +- .../5.1/PowershellGet/Set-PSRepository.md | 2 +- reference/5.1/PowershellGet/Update-Module.md | 2 +- reference/5.1/PowershellGet/Update-Script.md | 2 +- .../Compress-Archive.md | 2 +- .../Disable-PSSessionConfiguration.md | 2 +- .../Enter-PSHostProcess.md | 4 ++-- .../6/Microsoft.PowerShell.Core/Get-Module.md | 4 ++-- .../Get-PSHostProcessInfo.md | 6 ++--- .../New-ModuleManifest.md | 12 +++++----- .../Microsoft.PowerShell.Core/Out-Default.md | 2 +- reference/6/Microsoft.PowerShell.Core/oss.md | 4 ++-- .../New-WinEvent.md | 8 +++---- .../Convert-Path.md | 4 ++-- .../Get-ItemPropertyValue.md | 4 ++-- .../Get-PSProvider.md | 4 ++-- .../New-Service.md | 6 ++--- .../Remove-PSDrive.md | 4 ++-- .../Restart-Service.md | 6 ++--- .../Resume-Service.md | 6 ++--- .../Start-Process.md | 4 ++-- .../Start-Service.md | 6 ++--- .../Stop-Service.md | 6 ++--- .../Suspend-Service.md | 6 ++--- .../Wait-Process.md | 4 ++-- .../Get-AuthenticodeSignature.md | 4 ++-- .../Add-Member.md | 4 ++-- .../Clear-Variable.md | 4 ++-- .../Compare-Object.md | 4 ++-- .../Debug-Runspace.md | 4 ++-- .../Disable-PSBreakpoint.md | 4 ++-- .../Disable-RunspaceDebug.md | 16 +++++++------- .../Enable-PSBreakpoint.md | 4 ++-- .../Enable-RunspaceDebug.md | 18 +++++++-------- .../Export-FormatData.md | 4 ++-- .../Format-Custom.md | 4 ++-- .../Format-Hex.md | 2 +- .../Format-Table.md | 4 ++-- .../Format-Wide.md | 4 ++-- .../Get-Culture.md | 4 ++-- .../Microsoft.PowerShell.Utility/Get-Event.md | 4 ++-- .../Get-EventSubscriber.md | 4 ++-- .../Get-FormatData.md | 6 ++--- .../Microsoft.PowerShell.Utility/Get-Host.md | 4 ++-- .../Get-PSCallStack.md | 4 ++-- .../Get-Random.md | 4 ++-- .../Get-Runspace.md | 10 ++++----- .../Get-RunspaceDebug.md | 16 +++++++------- .../Get-TraceSource.md | 4 ++-- .../Get-UICulture.md | 4 ++-- .../Get-Unique.md | 4 ++-- .../Get-Variable.md | 4 ++-- .../Import-Clixml.md | 4 ++-- .../Import-LocalizedData.md | 4 ++-- .../Invoke-Expression.md | 4 ++-- .../Measure-Object.md | 4 ++-- .../Microsoft.PowerShell.Utility/New-Alias.md | 4 ++-- .../Microsoft.PowerShell.Utility/New-Event.md | 4 ++-- .../New-Object.md | 4 ++-- .../New-TimeSpan.md | 4 ++-- .../New-Variable.md | 4 ++-- .../Microsoft.PowerShell.Utility/Out-File.md | 6 ++--- .../Out-String.md | 4 ++-- .../Remove-Event.md | 4 ++-- .../Remove-PSBreakpoint.md | 4 ++-- .../Remove-Variable.md | 4 ++-- .../Select-Object.md | 2 +- .../Select-Xml.md | 4 ++-- .../Microsoft.PowerShell.Utility/Set-Alias.md | 4 ++-- .../Microsoft.PowerShell.Utility/Set-Date.md | 4 ++-- .../Set-TraceSource.md | 4 ++-- .../Set-Variable.md | 4 ++-- .../Sort-Object.md | 4 ++-- .../Trace-Command.md | 4 ++-- .../Unblock-File.md | 4 ++-- .../Unregister-Event.md | 4 ++-- .../Update-TypeData.md | 4 ++-- .../Wait-Debugger.md | 4 ++-- .../Wait-Event.md | 4 ++-- .../Write-Debug.md | 4 ++-- .../Write-Host.md | 4 ++-- .../Write-Output.md | 4 ++-- .../Write-Progress.md | 4 ++-- .../Write-Verbose.md | 4 ++-- .../Write-Warning.md | 4 ++-- reference/6/PackageManagement/Find-Package.md | 6 ++--- .../PackageManagement/Find-PackageProvider.md | 4 ++-- reference/6/PackageManagement/Get-Package.md | 6 ++--- .../6/PackageManagement/Install-Package.md | 12 +++++----- .../Install-PackageProvider.md | 4 ++-- .../Register-PackageSource.md | 4 ++-- reference/6/PackageManagement/Save-Package.md | 6 ++--- .../6/PackageManagement/Set-PackageSource.md | 4 ++-- .../6/PackageManagement/Uninstall-Package.md | 6 ++--- reference/6/PowerShellGet/Find-Command.md | 6 ++--- reference/6/PowerShellGet/Find-DscResource.md | 6 ++--- reference/6/PowerShellGet/Find-Module.md | 6 ++--- .../6/PowerShellGet/Find-RoleCapability.md | 6 ++--- reference/6/PowerShellGet/Find-Script.md | 8 +++---- reference/6/PowerShellGet/Install-Module.md | 10 ++++----- reference/6/PowerShellGet/Install-Script.md | 12 +++++----- reference/6/PowerShellGet/Publish-Module.md | 6 ++--- reference/6/PowerShellGet/Publish-Script.md | 4 ++-- .../6/PowerShellGet/Register-PSRepository.md | 22 +++++++++---------- reference/6/PowerShellGet/Save-Module.md | 6 ++--- reference/6/PowerShellGet/Save-Script.md | 6 ++--- reference/6/PowerShellGet/Set-PSRepository.md | 10 ++++----- reference/6/PowerShellGet/Update-Module.md | 6 ++--- reference/6/PowerShellGet/Update-Script.md | 6 ++--- 148 files changed, 369 insertions(+), 369 deletions(-) diff --git a/reference/5.0/Microsoft.PowerShell.Core/Enter-PSHostProcess.md b/reference/5.0/Microsoft.PowerShell.Core/Enter-PSHostProcess.md index 87e377c45c35..402fe8ff5955 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Enter-PSHostProcess.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Enter-PSHostProcess.md @@ -103,7 +103,7 @@ PS C:\> ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String @@ -118,7 +118,7 @@ Accept wildcard characters: False ``` ### -HostProcessInfo -@{Text=} + ```yaml Type: PSHostProcessInfo diff --git a/reference/5.0/Microsoft.PowerShell.Core/Out-Default.md b/reference/5.0/Microsoft.PowerShell.Core/Out-Default.md index f4f02142a169..6ca8749f6f6f 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Out-Default.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Out-Default.md @@ -49,7 +49,7 @@ Accept wildcard characters: False ``` ### -Transcript -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 4bd0b4d82954..5a56a41010e8 100644 --- a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -56,7 +56,7 @@ The **Unprotect-CmsMessage** cmdlet returns the decrypted content. ### Example 1: Decrypt a message ``` -PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '‎0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' +PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '???????0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' Try the new Break All command ``` @@ -97,7 +97,7 @@ Accept wildcard characters: False ``` ### -IncludeContext -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md b/reference/5.0/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md index 32b62fd41ed7..8d5fdcfe4c18 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md @@ -58,7 +58,7 @@ The **Disable-RunspaceDebug** cmdlet disables debugging on one or more runspaces ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -73,7 +73,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -104,7 +104,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -119,7 +119,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md b/reference/5.0/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md index d53ee2c4ab42..7e7b4c4640ed 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md @@ -58,7 +58,7 @@ The **Enable-RunspaceDebug** cmdlet enables debugging on runspaces where any bre ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -73,7 +73,7 @@ Accept wildcard characters: False ``` ### -BreakAll -@{Text=} + ```yaml Type: SwitchParameter @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -119,7 +119,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -149,7 +149,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-Runspace.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-Runspace.md index cc52ad350a03..ab90a6d68f3a 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-Runspace.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-Runspace.md @@ -48,7 +48,7 @@ The **Get-Runspace** cmdlet gets active runspaces in a Windows PowerShell host p ## PARAMETERS ### -Id -@{Text=} + ```yaml Type: Int32[] @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -Name -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index 23d63c3bd0c1..9fcb9f34939a 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -58,7 +58,7 @@ The **Get-RunspaceDebug** cmdlet shows runspace debugging options. ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -73,7 +73,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -104,7 +104,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -119,7 +119,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md index 265609e99f03..a4c27a971c6a 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md @@ -313,7 +313,7 @@ Accept wildcard characters: False ``` ### -SkipLast -@{Text=} + ```yaml Type: Int32 diff --git a/reference/5.0/PowershellGet/Find-Command.md b/reference/5.0/PowershellGet/Find-Command.md index 0903376d9a76..af29fdd558f8 100644 --- a/reference/5.0/PowershellGet/Find-Command.md +++ b/reference/5.0/PowershellGet/Find-Command.md @@ -115,7 +115,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.0/PowershellGet/Publish-Module.md b/reference/5.0/PowershellGet/Publish-Module.md index 0bced0f1b219..6be02e89a614 100644 --- a/reference/5.0/PowershellGet/Publish-Module.md +++ b/reference/5.0/PowershellGet/Publish-Module.md @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -FormatVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.1/Microsoft.PowerShell.Core/Enter-PSHostProcess.md b/reference/5.1/Microsoft.PowerShell.Core/Enter-PSHostProcess.md index be51178cf5ee..3be07ee1258f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Enter-PSHostProcess.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Enter-PSHostProcess.md @@ -103,7 +103,7 @@ PS C:\> ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String @@ -118,7 +118,7 @@ Accept wildcard characters: False ``` ### -HostProcessInfo -@{Text=} + ```yaml Type: PSHostProcessInfo diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md index 0c77199bcfe8..72ecec08ab61 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md @@ -212,7 +212,7 @@ PS C:\> Get-Content $m.Path GUID="{8FA5064B-8479-4c5c-86EA-0D311FE48875}" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" -Copyright="© Microsoft Corporation. All rights reserved." +Copyright="???? Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0.0" Description="Windows Powershell File Transfer Module" PowerShellVersion="2.0" @@ -448,7 +448,7 @@ Accept wildcard characters: False ``` ### -PSEdition -@{Text=} + ```yaml Type: String diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index 7ea1fee4fa89..aa6468da76ef 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -46,7 +46,7 @@ PS C:\> ## PARAMETERS ### -Id -@{Text=} + ```yaml Type: Int32[] @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### -Name -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.1/Microsoft.PowerShell.Core/Out-Default.md b/reference/5.1/Microsoft.PowerShell.Core/Out-Default.md index 53e941bf60d4..0b497ebe34d3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Out-Default.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Out-Default.md @@ -49,7 +49,7 @@ Accept wildcard characters: False ``` ### -Transcript -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md b/reference/5.1/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md index 37b9d1d844a5..0ecc731bfb26 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md @@ -70,7 +70,7 @@ The results of the **Get-AuthenticodeSignature** command are sent to a Where-Obj ## PARAMETERS ### -Content -@{Text=} + ```yaml Type: Byte[] diff --git a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 4bd0b4d82954..5a56a41010e8 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -56,7 +56,7 @@ The **Unprotect-CmsMessage** cmdlet returns the decrypted content. ### Example 1: Decrypt a message ``` -PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '‎0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' +PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '???????0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' Try the new Break All command ``` @@ -97,7 +97,7 @@ Accept wildcard characters: False ``` ### -IncludeContext -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md b/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md index 32b62fd41ed7..8d5fdcfe4c18 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md @@ -58,7 +58,7 @@ The **Disable-RunspaceDebug** cmdlet disables debugging on one or more runspaces ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -73,7 +73,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -104,7 +104,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -119,7 +119,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md b/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md index 4886c9e38a80..4ab106448d1d 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md @@ -58,7 +58,7 @@ The **Enable-RunspaceDebug** cmdlet enables debugging on runspaces where any bre ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -73,7 +73,7 @@ Accept wildcard characters: False ``` ### -BreakAll -@{Text=} + ```yaml Type: SwitchParameter @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -119,7 +119,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -149,7 +149,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md index 1592b1367322..125545cb9096 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md @@ -147,7 +147,7 @@ Accept wildcard characters: False ``` ### -Raw -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md index f2fcf649d863..da166c6085be 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -91,7 +91,7 @@ The final command shows an excerpt of the format.ps1xml file content. ## PARAMETERS ### -PowerShellVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md index 453de800bd66..252801918821 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Runspace.md @@ -48,7 +48,7 @@ The **Get-Runspace** cmdlet gets active runspaces in a Windows PowerShell host p ## PARAMETERS ### -Id -@{Text=} + ```yaml Type: Int32[] @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -Name -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index 23d63c3bd0c1..9fcb9f34939a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -58,7 +58,7 @@ The **Get-RunspaceDebug** cmdlet shows runspace debugging options. ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -73,7 +73,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -104,7 +104,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -119,7 +119,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md index 237d14badeae..2b7b70b965e6 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md @@ -313,7 +313,7 @@ Accept wildcard characters: False ``` ### -SkipLast -@{Text=} + ```yaml Type: Int32 diff --git a/reference/5.1/PSScheduledJob/Register-ScheduledJob.md b/reference/5.1/PSScheduledJob/Register-ScheduledJob.md index e8976550516d..382fb81623b2 100644 --- a/reference/5.1/PSScheduledJob/Register-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Register-ScheduledJob.md @@ -309,7 +309,7 @@ Accept wildcard characters: False ``` ### -RunEvery -@{Text=} + ```yaml Type: TimeSpan diff --git a/reference/5.1/PSScheduledJob/Set-ScheduledJob.md b/reference/5.1/PSScheduledJob/Set-ScheduledJob.md index 6b99f0df51e1..1abcf98a0e1d 100644 --- a/reference/5.1/PSScheduledJob/Set-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Set-ScheduledJob.md @@ -337,7 +337,7 @@ Accept wildcard characters: False ``` ### -RunEvery -@{Text=} + ```yaml Type: TimeSpan diff --git a/reference/5.1/PackageManagement/Get-Package.md b/reference/5.1/PackageManagement/Get-Package.md index a36490c0f0af..a1f1c51ffdb8 100644 --- a/reference/5.1/PackageManagement/Get-Package.md +++ b/reference/5.1/PackageManagement/Get-Package.md @@ -123,7 +123,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -291,7 +291,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -385,7 +385,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/PackageManagement/Install-Package.md b/reference/5.1/PackageManagement/Install-Package.md index d918c3795779..6e1888b776f6 100644 --- a/reference/5.1/PackageManagement/Install-Package.md +++ b/reference/5.1/PackageManagement/Install-Package.md @@ -154,7 +154,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -509,7 +509,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -697,7 +697,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/PackageManagement/Uninstall-Package.md b/reference/5.1/PackageManagement/Uninstall-Package.md index 206f206f6dff..2b0c05a512c5 100644 --- a/reference/5.1/PackageManagement/Uninstall-Package.md +++ b/reference/5.1/PackageManagement/Uninstall-Package.md @@ -131,7 +131,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -329,7 +329,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -427,7 +427,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/PowershellGet/Find-Command.md b/reference/5.1/PowershellGet/Find-Command.md index 0903376d9a76..af29fdd558f8 100644 --- a/reference/5.1/PowershellGet/Find-Command.md +++ b/reference/5.1/PowershellGet/Find-Command.md @@ -115,7 +115,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.1/PowershellGet/Find-DscResource.md b/reference/5.1/PowershellGet/Find-DscResource.md index 4bb2d12dbb59..819ac715c9eb 100644 --- a/reference/5.1/PowershellGet/Find-DscResource.md +++ b/reference/5.1/PowershellGet/Find-DscResource.md @@ -137,7 +137,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.1/PowershellGet/Find-Module.md b/reference/5.1/PowershellGet/Find-Module.md index ad0c6d0ff7c7..5cad7bbacf01 100644 --- a/reference/5.1/PowershellGet/Find-Module.md +++ b/reference/5.1/PowershellGet/Find-Module.md @@ -140,7 +140,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Find-RoleCapability.md b/reference/5.1/PowershellGet/Find-RoleCapability.md index 9999d8b05520..8a51ffebfd58 100644 --- a/reference/5.1/PowershellGet/Find-RoleCapability.md +++ b/reference/5.1/PowershellGet/Find-RoleCapability.md @@ -118,7 +118,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.1/PowershellGet/Find-Script.md b/reference/5.1/PowershellGet/Find-Script.md index def0ff3285e8..3ad8164e86c5 100644 --- a/reference/5.1/PowershellGet/Find-Script.md +++ b/reference/5.1/PowershellGet/Find-Script.md @@ -74,7 +74,7 @@ Type : Script Description : Description for the Required-Script2 script Author : pattif CompanyName : Microsoft Corporation -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/14/2015 2:37:01 PM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ @@ -204,7 +204,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Install-Module.md b/reference/5.1/PowershellGet/Install-Module.md index ff8ffd9d58a5..c12a2ecd7139 100644 --- a/reference/5.1/PowershellGet/Install-Module.md +++ b/reference/5.1/PowershellGet/Install-Module.md @@ -82,7 +82,7 @@ This example installs the newest version of the module ContosoServer to $home\Do ## PARAMETERS ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -297,7 +297,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/PowershellGet/Install-Script.md b/reference/5.1/PowershellGet/Install-Script.md index c05f1a1bf647..7eb13f6da42a 100644 --- a/reference/5.1/PowershellGet/Install-Script.md +++ b/reference/5.1/PowershellGet/Install-Script.md @@ -57,7 +57,7 @@ Type : Script Description : Description for the Required-Script2 script Author : pattif CompanyName : -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:39 AM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ @@ -96,7 +96,7 @@ Type : Script Description : Description for the Required-Script3 script Author : pattif CompanyName : -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:45 AM LicenseUri : http://required-script3.com/license ProjectUri : http://required-script3.com/ @@ -280,7 +280,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/PowershellGet/Publish-Module.md b/reference/5.1/PowershellGet/Publish-Module.md index 8dfb6adcddd4..8676f1185398 100644 --- a/reference/5.1/PowershellGet/Publish-Module.md +++ b/reference/5.1/PowershellGet/Publish-Module.md @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -108,7 +108,7 @@ Accept wildcard characters: False ``` ### -FormatVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/5.1/PowershellGet/Publish-Script.md b/reference/5.1/PowershellGet/Publish-Script.md index b85aa89333ed..a663d405d989 100644 --- a/reference/5.1/PowershellGet/Publish-Script.md +++ b/reference/5.1/PowershellGet/Publish-Script.md @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Register-PSRepository.md b/reference/5.1/PowershellGet/Register-PSRepository.md index d8f83d95c7ce..e39918b6286b 100644 --- a/reference/5.1/PowershellGet/Register-PSRepository.md +++ b/reference/5.1/PowershellGet/Register-PSRepository.md @@ -63,7 +63,7 @@ The second command gets registered repositories and displays the results. ## PARAMETERS ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -Default -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/5.1/PowershellGet/Save-Module.md b/reference/5.1/PowershellGet/Save-Module.md index 78a91d64b7ff..57ddded050d4 100644 --- a/reference/5.1/PowershellGet/Save-Module.md +++ b/reference/5.1/PowershellGet/Save-Module.md @@ -116,7 +116,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Save-Script.md b/reference/5.1/PowershellGet/Save-Script.md index 56882ea8b267..205405419d24 100644 --- a/reference/5.1/PowershellGet/Save-Script.md +++ b/reference/5.1/PowershellGet/Save-Script.md @@ -79,7 +79,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Set-PSRepository.md b/reference/5.1/PowershellGet/Set-PSRepository.md index 6e20cf6aa137..cccc151df005 100644 --- a/reference/5.1/PowershellGet/Set-PSRepository.md +++ b/reference/5.1/PowershellGet/Set-PSRepository.md @@ -44,7 +44,7 @@ This command sets the source location and publish location for myInternalSource ## PARAMETERS ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Update-Module.md b/reference/5.1/PowershellGet/Update-Module.md index 9e5664157c32..80fd9c7f7422 100644 --- a/reference/5.1/PowershellGet/Update-Module.md +++ b/reference/5.1/PowershellGet/Update-Module.md @@ -90,7 +90,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/5.1/PowershellGet/Update-Script.md b/reference/5.1/PowershellGet/Update-Script.md index 423785e848a4..e0225067158e 100644 --- a/reference/5.1/PowershellGet/Update-Script.md +++ b/reference/5.1/PowershellGet/Update-Script.md @@ -57,7 +57,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/Microsoft.PowerShell.Archive/Compress-Archive.md b/reference/6/Microsoft.PowerShell.Archive/Compress-Archive.md index 2f4bedaa9afa..3ce111c58c13 100644 --- a/reference/6/Microsoft.PowerShell.Archive/Compress-Archive.md +++ b/reference/6/Microsoft.PowerShell.Archive/Compress-Archive.md @@ -226,7 +226,7 @@ Accept wildcard characters: False ``` ### -Force -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Core/Disable-PSSessionConfiguration.md b/reference/6/Microsoft.PowerShell.Core/Disable-PSSessionConfiguration.md index 90734a505b83..e500b62eed57 100644 --- a/reference/6/Microsoft.PowerShell.Core/Disable-PSSessionConfiguration.md +++ b/reference/6/Microsoft.PowerShell.Core/Disable-PSSessionConfiguration.md @@ -165,7 +165,7 @@ Accept wildcard characters: False ``` ### -NoServiceRestart -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Core/Enter-PSHostProcess.md b/reference/6/Microsoft.PowerShell.Core/Enter-PSHostProcess.md index be51178cf5ee..3be07ee1258f 100644 --- a/reference/6/Microsoft.PowerShell.Core/Enter-PSHostProcess.md +++ b/reference/6/Microsoft.PowerShell.Core/Enter-PSHostProcess.md @@ -103,7 +103,7 @@ PS C:\> ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String @@ -118,7 +118,7 @@ Accept wildcard characters: False ``` ### -HostProcessInfo -@{Text=} + ```yaml Type: PSHostProcessInfo diff --git a/reference/6/Microsoft.PowerShell.Core/Get-Module.md b/reference/6/Microsoft.PowerShell.Core/Get-Module.md index 36461fb4aeac..8b69589bd0a6 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-Module.md @@ -212,7 +212,7 @@ PS C:\> Get-Content $m.Path GUID="{8FA5064B-8479-4c5c-86EA-0D311FE48875}" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" -Copyright="© Microsoft Corporation. All rights reserved." +Copyright="???? Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0.0" Description="Windows Powershell File Transfer Module" PowerShellVersion="2.0" @@ -493,7 +493,7 @@ Accept wildcard characters: False ``` ### -PSEdition -@{Text=} + ```yaml Type: String diff --git a/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md b/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md index f70fb68b1f98..a82402055cf2 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.md @@ -46,7 +46,7 @@ PS C:\> ## PARAMETERS ### -Id -@{Text=} + ```yaml Type: Int32[] @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### -Name -@{Text=} + ```yaml Type: String[] @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### -Process -@{Text=} + ```yaml Type: Process[] diff --git a/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md index 26616f97d663..39f47a75b26c 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -210,7 +210,7 @@ IscsiTarget 4.0 Kds 4.0 Microsoft.PowerShell.Diagnostics 4.0 Microsoft.PowerShell.Host 4.0 -Microsoft.PowerShell.Management 4.0… +Microsoft.PowerShell.Management 4.0??????? ``` This example shows how to get the module manifest values of a module. @@ -401,7 +401,7 @@ Accept wildcard characters: False ``` ### -DscResourcesToExport -@{Text=} + ```yaml Type: String[] @@ -516,7 +516,7 @@ Accept wildcard characters: False ``` ### -IconUri -@{Text=} + ```yaml Type: Uri @@ -531,7 +531,7 @@ Accept wildcard characters: False ``` ### -LicenseUri -@{Text=} + ```yaml Type: Uri @@ -740,7 +740,7 @@ Accept wildcard characters: False ``` ### -ProjectUri -@{Text=} + ```yaml Type: Uri @@ -858,7 +858,7 @@ Accept wildcard characters: False ``` ### -Tags -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/Microsoft.PowerShell.Core/Out-Default.md b/reference/6/Microsoft.PowerShell.Core/Out-Default.md index 53e941bf60d4..0b497ebe34d3 100644 --- a/reference/6/Microsoft.PowerShell.Core/Out-Default.md +++ b/reference/6/Microsoft.PowerShell.Core/Out-Default.md @@ -49,7 +49,7 @@ Accept wildcard characters: False ``` ### -Transcript -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Core/oss.md b/reference/6/Microsoft.PowerShell.Core/oss.md index 945c661d1143..6b08a8fccde0 100644 --- a/reference/6/Microsoft.PowerShell.Core/oss.md +++ b/reference/6/Microsoft.PowerShell.Core/oss.md @@ -64,7 +64,7 @@ If you omit the Stream parameter, the command displays all of the aliases, becau ## PARAMETERS ### -InformationAction -@{Text=} + ```yaml Type: ActionPreference @@ -80,7 +80,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=} + ```yaml Type: String diff --git a/reference/6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md b/reference/6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md index ffa8c505f434..1160aaa87900 100644 --- a/reference/6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md +++ b/reference/6/Microsoft.PowerShell.Diagnostics/New-WinEvent.md @@ -36,7 +36,7 @@ This command uses the **New-WinEvent** cmdlet to create event 45090 for the Micr ## PARAMETERS ### -Id -@{Text=} + ```yaml Type: Int32 @@ -51,7 +51,7 @@ Accept wildcard characters: False ``` ### -Payload -@{Text=} + ```yaml Type: Object[] @@ -66,7 +66,7 @@ Accept wildcard characters: False ``` ### -ProviderName -@{Text=} + ```yaml Type: String @@ -81,7 +81,7 @@ Accept wildcard characters: False ``` ### -Version -@{Text=} + ```yaml Type: Byte diff --git a/reference/6/Microsoft.PowerShell.Management/Convert-Path.md b/reference/6/Microsoft.PowerShell.Management/Convert-Path.md index 76f45341cdbb..93ad90c9629b 100644 --- a/reference/6/Microsoft.PowerShell.Management/Convert-Path.md +++ b/reference/6/Microsoft.PowerShell.Management/Convert-Path.md @@ -57,7 +57,7 @@ This command converts the path to the home directory of the current provider, wh ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -71,7 +71,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md b/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md index 256d47af6866..1ee26202a558 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md @@ -169,7 +169,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -183,7 +183,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Management/Get-PSProvider.md b/reference/6/Microsoft.PowerShell.Management/Get-PSProvider.md index b512fa391f55..6d02e16f2428 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-PSProvider.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-PSProvider.md @@ -94,7 +94,7 @@ The Home property value is optional, but for the FileSystem provider, it is defi ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -108,7 +108,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Management/New-Service.md b/reference/6/Microsoft.PowerShell.Management/New-Service.md index 93ecd973ca8d..7c7329bb66aa 100644 --- a/reference/6/Microsoft.PowerShell.Management/New-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/New-Service.md @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -156,7 +156,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -274,4 +274,4 @@ This cmdlet returns an object that represents the new service. [Suspend-Service](Suspend-Service.md) -[Remove-Service](Remove-Service.md) \ No newline at end of file +[Remove-Service](Remove-Service.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md index a1c321d1af50..3b9ce5609e23 100644 --- a/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -90,7 +90,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Management/Restart-Service.md b/reference/6/Microsoft.PowerShell.Management/Restart-Service.md index 889c1e4c9349..4961451a4a8d 100644 --- a/reference/6/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Restart-Service.md @@ -140,7 +140,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -154,7 +154,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -278,4 +278,4 @@ Otherwise, this cmdlet does not generate any output. [Suspend-Service](Suspend-Service.md) -[Remove-Service](Remove-Service.md) \ No newline at end of file +[Remove-Service](Remove-Service.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Resume-Service.md b/reference/6/Microsoft.PowerShell.Management/Resume-Service.md index 39e93623664c..1a021d3214c5 100644 --- a/reference/6/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Resume-Service.md @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -259,4 +259,4 @@ Otherwise, this cmdlet does not generate any output. [Suspend-Service](Suspend-Service.md) -[Remove-Service](Remove-Service.md) \ No newline at end of file +[Remove-Service](Remove-Service.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Start-Process.md b/reference/6/Microsoft.PowerShell.Management/Start-Process.md index aba4aa71623d..e1173db45a80 100644 --- a/reference/6/Microsoft.PowerShell.Management/Start-Process.md +++ b/reference/6/Microsoft.PowerShell.Management/Start-Process.md @@ -179,7 +179,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -193,7 +193,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Management/Start-Service.md b/reference/6/Microsoft.PowerShell.Management/Start-Service.md index 28a85326b151..d0d997a40172 100644 --- a/reference/6/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Start-Service.md @@ -161,7 +161,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -175,7 +175,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -305,4 +305,4 @@ Otherwise, this cmdlet does not generate any output. [Suspend-Service](Suspend-Service.md) -[Remove-Service](Remove-Service.md) \ No newline at end of file +[Remove-Service](Remove-Service.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Stop-Service.md b/reference/6/Microsoft.PowerShell.Management/Stop-Service.md index cb0fe1742407..86220491d566 100644 --- a/reference/6/Microsoft.PowerShell.Management/Stop-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Stop-Service.md @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -160,7 +160,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -307,4 +307,4 @@ The service names appear in the **Name** column and the display names appear in [Suspend-Service](Suspend-Service.md) -[Remove-Service](Remove-Service.md) \ No newline at end of file +[Remove-Service](Remove-Service.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/6/Microsoft.PowerShell.Management/Suspend-Service.md index 84c6894fe8d5..94eec91a72a7 100644 --- a/reference/6/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Suspend-Service.md @@ -132,7 +132,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -275,4 +275,4 @@ Otherwise, this cmdlet does not generate any output. [Stop-Service](Stop-Service.md) -[Remove-Service](Remove-Service.md) \ No newline at end of file +[Remove-Service](Remove-Service.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Wait-Process.md b/reference/6/Microsoft.PowerShell.Management/Wait-Process.md index 925f769e1f8a..3d9ca6cacb66 100644 --- a/reference/6/Microsoft.PowerShell.Management/Wait-Process.md +++ b/reference/6/Microsoft.PowerShell.Management/Wait-Process.md @@ -102,7 +102,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -116,7 +116,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md b/reference/6/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md index c0685057b781..48db0b7037e5 100644 --- a/reference/6/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md +++ b/reference/6/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### -Content -@{Text=} + ```yaml Type: Byte[] @@ -121,7 +121,7 @@ Accept wildcard characters: False ``` ### -SourcePathOrExtension -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/Microsoft.PowerShell.Utility/Add-Member.md b/reference/6/Microsoft.PowerShell.Utility/Add-Member.md index 2a939951f93d..d119a02b4ece 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/6/Microsoft.PowerShell.Utility/Add-Member.md @@ -262,7 +262,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -276,7 +276,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Clear-Variable.md b/reference/6/Microsoft.PowerShell.Utility/Clear-Variable.md index bfedfb53753c..00a3de8b7a69 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Clear-Variable.md +++ b/reference/6/Microsoft.PowerShell.Utility/Clear-Variable.md @@ -112,7 +112,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -126,7 +126,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Compare-Object.md b/reference/6/Microsoft.PowerShell.Utility/Compare-Object.md index 921382ec667b..39b32095b6c2 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Compare-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Compare-Object.md @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -160,7 +160,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Debug-Runspace.md b/reference/6/Microsoft.PowerShell.Utility/Debug-Runspace.md index 03b103868f34..b9a664f7bc46 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Debug-Runspace.md +++ b/reference/6/Microsoft.PowerShell.Utility/Debug-Runspace.md @@ -104,7 +104,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -118,7 +118,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index 0bb3d54976cd..695ba81eb707 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -125,7 +125,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -139,7 +139,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md b/reference/6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md index 7bcba07c65d1..7c9c99825ae5 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md +++ b/reference/6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md @@ -63,7 +63,7 @@ The **Disable-RunspaceDebug** cmdlet disables debugging on one or more runspaces ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -92,7 +92,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -105,7 +105,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -Runspace -@{Text=} + ```yaml Type: Runspace[] @@ -135,7 +135,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -165,7 +165,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index 4001fefff458..85399df3b192 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -160,7 +160,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md b/reference/6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md index 66e887b88c75..a044019eab58 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md +++ b/reference/6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md @@ -63,7 +63,7 @@ The **Enable-RunspaceDebug** cmdlet enables debugging on runspaces where any bre ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -BreakAll -@{Text=} + ```yaml Type: SwitchParameter @@ -93,7 +93,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -107,7 +107,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -135,7 +135,7 @@ Accept wildcard characters: False ``` ### -Runspace -@{Text=} + ```yaml Type: Runspace[] @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -165,7 +165,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -180,7 +180,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/Microsoft.PowerShell.Utility/Export-FormatData.md b/reference/6/Microsoft.PowerShell.Utility/Export-FormatData.md index a4a5fb278c2e..a90d1520a03a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Export-FormatData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Export-FormatData.md @@ -128,7 +128,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -142,7 +142,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md index 664d23081f01..332b3f7cda9b 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md @@ -152,7 +152,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -166,7 +166,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md index 1592b1367322..125545cb9096 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md @@ -147,7 +147,7 @@ Accept wildcard characters: False ``` ### -Raw -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Table.md b/reference/6/Microsoft.PowerShell.Utility/Format-Table.md index e84614c799c5..c49e5a3c9694 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Table.md @@ -248,7 +248,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -262,7 +262,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md index ba6d66ba8bc2..2ecf27f13eac 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md @@ -172,7 +172,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -186,7 +186,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Culture.md b/reference/6/Microsoft.PowerShell.Utility/Get-Culture.md index 18f35ab09123..1905e1e15f89 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Culture.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Culture.md @@ -120,7 +120,7 @@ The fifth command uses dot notation to display the value of the FirstDayOfWeek p ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Event.md b/reference/6/Microsoft.PowerShell.Utility/Get-Event.md index dc0399f047ad..cb570b346359 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Event.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Event.md @@ -113,7 +113,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -127,7 +127,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md b/reference/6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md index 150063e7ad72..0f417e2c2db3 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-EventSubscriber.md @@ -147,7 +147,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -161,7 +161,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md index 15fe0ff721b4..788d1a6b930d 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -92,7 +92,7 @@ The final command shows an excerpt of the format.ps1xml file content. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -136,7 +136,7 @@ Accept wildcard characters: False ``` ### -PowerShellVersion -@{Text=} + ```yaml Type: Version diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Host.md b/reference/6/Microsoft.PowerShell.Utility/Get-Host.md index c3ea486b6cce..789e75c103be 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Host.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Host.md @@ -197,7 +197,7 @@ To see all of the properties of the object in the $Host.PrivateData property, ty ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -211,7 +211,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-PSCallStack.md b/reference/6/Microsoft.PowerShell.Utility/Get-PSCallStack.md index fde39f639b58..b61402ad084d 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-PSCallStack.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-PSCallStack.md @@ -79,7 +79,7 @@ The final command is a Step-Out command (o) that exits the debugger and continue ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -93,7 +93,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Random.md b/reference/6/Microsoft.PowerShell.Utility/Get-Random.md index 35f87130e40c..6f30a86f451b 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Random.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Random.md @@ -225,7 +225,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -239,7 +239,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Runspace.md b/reference/6/Microsoft.PowerShell.Utility/Get-Runspace.md index 744479089417..9daccb771d37 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Runspace.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Runspace.md @@ -51,7 +51,7 @@ The **Get-Runspace** cmdlet gets active runspaces in a Windows PowerShell host p ## PARAMETERS ### -Id -@{Text=} + ```yaml Type: Int32[] @@ -66,7 +66,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -80,7 +80,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -93,7 +93,7 @@ Accept wildcard characters: False ``` ### -InstanceId -@{Text=} + ```yaml Type: Guid[] @@ -108,7 +108,7 @@ Accept wildcard characters: False ``` ### -Name -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index 588e5fddf2b9..ae1684ddfc48 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -63,7 +63,7 @@ The **Get-RunspaceDebug** cmdlet shows runspace debugging options. ## PARAMETERS ### -AppDomainName -@{Text=} + ```yaml Type: String[] @@ -78,7 +78,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -92,7 +92,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -105,7 +105,7 @@ Accept wildcard characters: False ``` ### -ProcessName -@{Text=} + ```yaml Type: String @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -Runspace -@{Text=} + ```yaml Type: Runspace[] @@ -135,7 +135,7 @@ Accept wildcard characters: False ``` ### -RunspaceId -@{Text=} + ```yaml Type: Int32[] @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -RunspaceInstanceId -@{Text=} + ```yaml Type: Guid[] @@ -165,7 +165,7 @@ Accept wildcard characters: False ``` ### -RunspaceName -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-TraceSource.md b/reference/6/Microsoft.PowerShell.Utility/Get-TraceSource.md index 247a8804062d..f49eb60283a7 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-TraceSource.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-TraceSource.md @@ -47,7 +47,7 @@ This command gets all of the Windows PowerShell components that can be traced. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-UICulture.md b/reference/6/Microsoft.PowerShell.Utility/Get-UICulture.md index 4c9ae29fd9a7..aeb1b670b429 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-UICulture.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-UICulture.md @@ -62,7 +62,7 @@ To see all of the subproperties of the DateTimeFormat property of the UI culture ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Unique.md b/reference/6/Microsoft.PowerShell.Utility/Get-Unique.md index 6f4c64650a42..103424343727 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Unique.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Unique.md @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Variable.md b/reference/6/Microsoft.PowerShell.Utility/Get-Variable.md index 964515f7b62d..64676007ca87 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Variable.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Variable.md @@ -94,7 +94,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -108,7 +108,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/6/Microsoft.PowerShell.Utility/Import-Clixml.md index 82d3f2863d8c..9b10800a07a1 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/6/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -69,7 +69,7 @@ This eliminates the risk of exposing plain-text passwords in your script. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -83,7 +83,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Import-LocalizedData.md b/reference/6/Microsoft.PowerShell.Utility/Import-LocalizedData.md index 055fc2db63e3..906bc16b031a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Import-LocalizedData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Import-LocalizedData.md @@ -237,7 +237,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -251,7 +251,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-Expression.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-Expression.md index d9f97bad12e6..b0bee8675608 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-Expression.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-Expression.md @@ -107,7 +107,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -121,7 +121,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Measure-Object.md b/reference/6/Microsoft.PowerShell.Utility/Measure-Object.md index 8d49ecb819e2..1ba952372c8f 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Measure-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Measure-Object.md @@ -143,7 +143,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -157,7 +157,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/New-Alias.md b/reference/6/Microsoft.PowerShell.Utility/New-Alias.md index a66d539083c7..876d163cde33 100644 --- a/reference/6/Microsoft.PowerShell.Utility/New-Alias.md +++ b/reference/6/Microsoft.PowerShell.Utility/New-Alias.md @@ -81,7 +81,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/New-Event.md b/reference/6/Microsoft.PowerShell.Utility/New-Event.md index 55ea99449932..049ace2fe5d4 100644 --- a/reference/6/Microsoft.PowerShell.Utility/New-Event.md +++ b/reference/6/Microsoft.PowerShell.Utility/New-Event.md @@ -81,7 +81,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/New-Object.md b/reference/6/Microsoft.PowerShell.Utility/New-Object.md index 6a333cd16809..9deba2f7082a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/New-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/New-Object.md @@ -210,7 +210,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -224,7 +224,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/New-TimeSpan.md b/reference/6/Microsoft.PowerShell.Utility/New-TimeSpan.md index ec416b5c51dd..415053a4fd01 100644 --- a/reference/6/Microsoft.PowerShell.Utility/New-TimeSpan.md +++ b/reference/6/Microsoft.PowerShell.Utility/New-TimeSpan.md @@ -135,7 +135,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -149,7 +149,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/New-Variable.md b/reference/6/Microsoft.PowerShell.Utility/New-Variable.md index edd6fc46c3e7..62cb1b804e0f 100644 --- a/reference/6/Microsoft.PowerShell.Utility/New-Variable.md +++ b/reference/6/Microsoft.PowerShell.Utility/New-Variable.md @@ -136,7 +136,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Out-File.md b/reference/6/Microsoft.PowerShell.Utility/Out-File.md index 9580006481a5..5b7cc06f3a6d 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/6/Microsoft.PowerShell.Utility/Out-File.md @@ -175,7 +175,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -189,7 +189,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv @@ -303,7 +303,7 @@ Accept wildcard characters: False ``` ### -NoNewline -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Out-String.md b/reference/6/Microsoft.PowerShell.Utility/Out-String.md index daea29da2343..c8a93b0eb622 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Out-String.md +++ b/reference/6/Microsoft.PowerShell.Utility/Out-String.md @@ -88,7 +88,7 @@ It should be noted that `-NoNewLine` does not strip newlines embedded within a s ## PARAMETERS ### -InformationAction -@{Text=} + ```yaml Type: ActionPreference @@ -104,7 +104,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=} + ```yaml Type: String diff --git a/reference/6/Microsoft.PowerShell.Utility/Remove-Event.md b/reference/6/Microsoft.PowerShell.Utility/Remove-Event.md index a404953ea5ab..f155bdfaf0dc 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Remove-Event.md +++ b/reference/6/Microsoft.PowerShell.Utility/Remove-Event.md @@ -75,7 +75,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -89,7 +89,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md b/reference/6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md index 997addcc3b32..6dff35dc51b2 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md +++ b/reference/6/Microsoft.PowerShell.Utility/Remove-PSBreakpoint.md @@ -118,7 +118,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -132,7 +132,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Remove-Variable.md b/reference/6/Microsoft.PowerShell.Utility/Remove-Variable.md index e9df7ceb8968..fc1b90c86701 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Remove-Variable.md +++ b/reference/6/Microsoft.PowerShell.Utility/Remove-Variable.md @@ -89,7 +89,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -103,7 +103,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Select-Object.md b/reference/6/Microsoft.PowerShell.Utility/Select-Object.md index e7cbb544fbbc..b20a15a7fcca 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Select-Object.md @@ -322,7 +322,7 @@ Accept wildcard characters: False ``` ### -SkipLast -@{Text=} + ```yaml Type: Int32 diff --git a/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md index 562b520ff850..049b264b4022 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md @@ -204,7 +204,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -218,7 +218,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Set-Alias.md b/reference/6/Microsoft.PowerShell.Utility/Set-Alias.md index 793c55a757b2..55211b0d5365 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Set-Alias.md +++ b/reference/6/Microsoft.PowerShell.Utility/Set-Alias.md @@ -127,7 +127,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -141,7 +141,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Set-Date.md b/reference/6/Microsoft.PowerShell.Utility/Set-Date.md index 09b9153765a7..95fc2e54bcb3 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Set-Date.md +++ b/reference/6/Microsoft.PowerShell.Utility/Set-Date.md @@ -139,7 +139,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -153,7 +153,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md index 524b5b745823..2b255f16c570 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -124,7 +124,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Set-Variable.md b/reference/6/Microsoft.PowerShell.Utility/Set-Variable.md index 98eaff8541fa..fbe9e0cecbc3 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Set-Variable.md +++ b/reference/6/Microsoft.PowerShell.Utility/Set-Variable.md @@ -152,7 +152,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -166,7 +166,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md index b04761e681a1..e2a718aab1d4 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md @@ -243,7 +243,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -257,7 +257,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md index 0ea2ef54218b..396b67bc49f9 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md @@ -164,7 +164,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -178,7 +178,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Unblock-File.md b/reference/6/Microsoft.PowerShell.Utility/Unblock-File.md index 52068c9c1290..0bbd4bfda216 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Unblock-File.md +++ b/reference/6/Microsoft.PowerShell.Utility/Unblock-File.md @@ -88,7 +88,7 @@ This command shows how to find and unblock Windows PowerShell scripts. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -102,7 +102,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Unregister-Event.md b/reference/6/Microsoft.PowerShell.Utility/Unregister-Event.md index 8dc0b3908145..06e7548ea122 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Unregister-Event.md +++ b/reference/6/Microsoft.PowerShell.Utility/Unregister-Event.md @@ -87,7 +87,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -101,7 +101,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md index 9ca06b65467a..da6b69eeec7e 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -178,7 +178,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -192,7 +192,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Wait-Debugger.md b/reference/6/Microsoft.PowerShell.Utility/Wait-Debugger.md index 7c248d7517f4..35efdaecc43d 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Wait-Debugger.md +++ b/reference/6/Microsoft.PowerShell.Utility/Wait-Debugger.md @@ -37,7 +37,7 @@ PS C:\> ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -51,7 +51,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Wait-Event.md b/reference/6/Microsoft.PowerShell.Utility/Wait-Event.md index 715b17ab00bd..db544ece0c39 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Wait-Event.md +++ b/reference/6/Microsoft.PowerShell.Utility/Wait-Event.md @@ -75,7 +75,7 @@ If the specified time expires, the wait ends. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -89,7 +89,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Debug.md b/reference/6/Microsoft.PowerShell.Utility/Write-Debug.md index 2ff820eb7b29..151b23559ecf 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Debug.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Debug.md @@ -82,7 +82,7 @@ For more information about $DebugPreference, see about_Preference_Variables. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -96,7 +96,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Host.md b/reference/6/Microsoft.PowerShell.Utility/Write-Host.md index ec0586e69ec0..0b5acf3c9686 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Host.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Host.md @@ -136,7 +136,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Output.md b/reference/6/Microsoft.PowerShell.Utility/Write-Output.md index 47acc45eedb8..fb2f76061d2b 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Output.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Output.md @@ -68,7 +68,7 @@ This command adds the *NoEnumerate* parameter to treat a collection or array as ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -82,7 +82,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md index 27196f5c2bb5..95c277f2d325 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -164,7 +164,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md b/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md index d2e3669fb3dd..d484fba5cdcb 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md @@ -55,7 +55,7 @@ The second command writes a verbose message. ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -69,7 +69,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Warning.md b/reference/6/Microsoft.PowerShell.Utility/Write-Warning.md index 6a37b9f9f57e..7842e516a840 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Warning.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Warning.md @@ -89,7 +89,7 @@ For more information about the *WarningAction* common parameter, see about_Commo ## PARAMETERS ### -InformationAction -@{Text=}```yaml +```yaml Type: ActionPreference Parameter Sets: (All) Aliases: infa @@ -103,7 +103,7 @@ Accept wildcard characters: False ``` ### -InformationVariable -@{Text=}```yaml +```yaml Type: String Parameter Sets: (All) Aliases: iv diff --git a/reference/6/PackageManagement/Find-Package.md b/reference/6/PackageManagement/Find-Package.md index c5485b2d4b9b..06f2f41fe868 100644 --- a/reference/6/PackageManagement/Find-Package.md +++ b/reference/6/PackageManagement/Find-Package.md @@ -494,7 +494,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -509,7 +509,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential @@ -524,7 +524,7 @@ Accept wildcard characters: False ``` ### -RoleCapability -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/PackageManagement/Find-PackageProvider.md b/reference/6/PackageManagement/Find-PackageProvider.md index 7d613e8e6a37..e881a6312f01 100644 --- a/reference/6/PackageManagement/Find-PackageProvider.md +++ b/reference/6/PackageManagement/Find-PackageProvider.md @@ -213,7 +213,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -228,7 +228,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PackageManagement/Get-Package.md b/reference/6/PackageManagement/Get-Package.md index 2f07e37bf1da..9ae9cd554410 100644 --- a/reference/6/PackageManagement/Get-Package.md +++ b/reference/6/PackageManagement/Get-Package.md @@ -326,7 +326,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -371,7 +371,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -386,7 +386,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/PackageManagement/Install-Package.md b/reference/6/PackageManagement/Install-Package.md index bee50ad7d3e6..b89d5c336565 100644 --- a/reference/6/PackageManagement/Install-Package.md +++ b/reference/6/PackageManagement/Install-Package.md @@ -571,7 +571,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -691,7 +691,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -706,7 +706,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -721,7 +721,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential @@ -736,7 +736,7 @@ Accept wildcard characters: False ``` ### -RoleCapability -@{Text=} + ```yaml Type: String[] @@ -751,7 +751,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/PackageManagement/Install-PackageProvider.md b/reference/6/PackageManagement/Install-PackageProvider.md index a56313357e5b..cfbdf744c59e 100644 --- a/reference/6/PackageManagement/Install-PackageProvider.md +++ b/reference/6/PackageManagement/Install-PackageProvider.md @@ -309,7 +309,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -324,7 +324,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PackageManagement/Register-PackageSource.md b/reference/6/PackageManagement/Register-PackageSource.md index 34dc9b16c5aa..09d104f3135c 100644 --- a/reference/6/PackageManagement/Register-PackageSource.md +++ b/reference/6/PackageManagement/Register-PackageSource.md @@ -267,7 +267,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -282,7 +282,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PackageManagement/Save-Package.md b/reference/6/PackageManagement/Save-Package.md index b234e02cbd21..4445e05d8163 100644 --- a/reference/6/PackageManagement/Save-Package.md +++ b/reference/6/PackageManagement/Save-Package.md @@ -564,7 +564,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -579,7 +579,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential @@ -594,7 +594,7 @@ Accept wildcard characters: False ``` ### -RoleCapability -@{Text=} + ```yaml Type: String[] diff --git a/reference/6/PackageManagement/Set-PackageSource.md b/reference/6/PackageManagement/Set-PackageSource.md index e4c5906221e1..86f1662552f2 100644 --- a/reference/6/PackageManagement/Set-PackageSource.md +++ b/reference/6/PackageManagement/Set-PackageSource.md @@ -337,7 +337,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -352,7 +352,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PackageManagement/Uninstall-Package.md b/reference/6/PackageManagement/Uninstall-Package.md index 6f2e58244ff0..5c60a0e9a4c2 100644 --- a/reference/6/PackageManagement/Uninstall-Package.md +++ b/reference/6/PackageManagement/Uninstall-Package.md @@ -389,7 +389,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -434,7 +434,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -449,7 +449,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/PowerShellGet/Find-Command.md b/reference/6/PowerShellGet/Find-Command.md index d8555a9a0fae..56044c57037b 100644 --- a/reference/6/PowerShellGet/Find-Command.md +++ b/reference/6/PowerShellGet/Find-Command.md @@ -131,7 +131,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version @@ -207,7 +207,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -222,7 +222,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Find-DscResource.md b/reference/6/PowerShellGet/Find-DscResource.md index 93e336bdd1c0..379115242b69 100644 --- a/reference/6/PowerShellGet/Find-DscResource.md +++ b/reference/6/PowerShellGet/Find-DscResource.md @@ -237,7 +237,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version @@ -252,7 +252,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -267,7 +267,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Find-Module.md b/reference/6/PowerShellGet/Find-Module.md index 5371fac50a6d..a6765ef852f6 100644 --- a/reference/6/PowerShellGet/Find-Module.md +++ b/reference/6/PowerShellGet/Find-Module.md @@ -323,7 +323,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -338,7 +338,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -353,7 +353,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Find-RoleCapability.md b/reference/6/PowerShellGet/Find-RoleCapability.md index 7faa43964f05..c8abaf5dee33 100644 --- a/reference/6/PowerShellGet/Find-RoleCapability.md +++ b/reference/6/PowerShellGet/Find-RoleCapability.md @@ -211,7 +211,7 @@ Accept wildcard characters: False ``` ### -MaximumVersion -@{Text=} + ```yaml Type: Version @@ -226,7 +226,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -241,7 +241,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Find-Script.md b/reference/6/PowerShellGet/Find-Script.md index 6a44288ed9ee..cc009834d5d6 100644 --- a/reference/6/PowerShellGet/Find-Script.md +++ b/reference/6/PowerShellGet/Find-Script.md @@ -74,7 +74,7 @@ Type : Script Description : Description for the Required-Script2 script Author : pattif CompanyName : Microsoft Corporation -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/14/2015 2:37:01 PM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ @@ -343,7 +343,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -358,7 +358,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -373,7 +373,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Install-Module.md b/reference/6/PowerShellGet/Install-Module.md index 17a8cad30478..3f63e45fe787 100644 --- a/reference/6/PowerShellGet/Install-Module.md +++ b/reference/6/PowerShellGet/Install-Module.md @@ -238,7 +238,7 @@ Accept wildcard characters: False ``` ### -AllowClobber -@{Text=} + ```yaml Type: SwitchParameter @@ -253,7 +253,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -283,7 +283,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -298,7 +298,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential @@ -313,7 +313,7 @@ Accept wildcard characters: False ``` ### -SkipPublisherCheck -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/PowerShellGet/Install-Script.md b/reference/6/PowerShellGet/Install-Script.md index 586d66baed73..37dfb6e050d6 100644 --- a/reference/6/PowerShellGet/Install-Script.md +++ b/reference/6/PowerShellGet/Install-Script.md @@ -57,7 +57,7 @@ Type : Script Description : Description for the Required-Script2 script Author : pattif CompanyName : -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:39 AM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ @@ -96,7 +96,7 @@ Type : Script Description : Description for the Required-Script3 script Author : pattif CompanyName : -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:45 AM LicenseUri : http://required-script3.com/license ProjectUri : http://required-script3.com/ @@ -318,7 +318,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -348,7 +348,7 @@ Accept wildcard characters: False ``` ### -NoPathUpdate -@{Text=} + ```yaml Type: SwitchParameter @@ -363,7 +363,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -378,7 +378,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Publish-Module.md b/reference/6/PowerShellGet/Publish-Module.md index d6d534e97d6b..8883eb488b51 100644 --- a/reference/6/PowerShellGet/Publish-Module.md +++ b/reference/6/PowerShellGet/Publish-Module.md @@ -79,7 +79,7 @@ Accept wildcard characters: False ``` ### -FormatVersion -@{Text=} + ```yaml Type: Version @@ -270,7 +270,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -285,7 +285,7 @@ Accept wildcard characters: False ``` ### -Force -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/PowerShellGet/Publish-Script.md b/reference/6/PowerShellGet/Publish-Script.md index b816d20f0ee0..4e73dee99fbb 100644 --- a/reference/6/PowerShellGet/Publish-Script.md +++ b/reference/6/PowerShellGet/Publish-Script.md @@ -204,7 +204,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -219,7 +219,7 @@ Accept wildcard characters: False ``` ### -Force -@{Text=} + ```yaml Type: SwitchParameter diff --git a/reference/6/PowerShellGet/Register-PSRepository.md b/reference/6/PowerShellGet/Register-PSRepository.md index 44746f3de574..b6edc64212bd 100644 --- a/reference/6/PowerShellGet/Register-PSRepository.md +++ b/reference/6/PowerShellGet/Register-PSRepository.md @@ -63,7 +63,7 @@ The second command gets registered repositories and displays the results. ## PARAMETERS ### -InstallationPolicy -@{Text=} + ```yaml Type: String @@ -79,7 +79,7 @@ Accept wildcard characters: False ``` ### -Name -@{Text=} + ```yaml Type: String @@ -94,7 +94,7 @@ Accept wildcard characters: False ``` ### -PackageManagementProvider -@{Text=} + ```yaml Type: String @@ -109,7 +109,7 @@ Accept wildcard characters: False ``` ### -PublishLocation -@{Text=} + ```yaml Type: Uri @@ -124,7 +124,7 @@ Accept wildcard characters: False ``` ### -ScriptPublishLocation -@{Text=} + ```yaml Type: Uri @@ -139,7 +139,7 @@ Accept wildcard characters: False ``` ### -ScriptSourceLocation -@{Text=} + ```yaml Type: Uri @@ -154,7 +154,7 @@ Accept wildcard characters: False ``` ### -SourceLocation -@{Text=} + ```yaml Type: Uri @@ -169,7 +169,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -184,7 +184,7 @@ Accept wildcard characters: False ``` ### -Default -@{Text=} + ```yaml Type: SwitchParameter @@ -199,7 +199,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -214,7 +214,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Save-Module.md b/reference/6/PowerShellGet/Save-Module.md index 5201ac0a60d2..b243bb0aeb0f 100644 --- a/reference/6/PowerShellGet/Save-Module.md +++ b/reference/6/PowerShellGet/Save-Module.md @@ -260,7 +260,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -290,7 +290,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -305,7 +305,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Save-Script.md b/reference/6/PowerShellGet/Save-Script.md index 9751d35b676e..fc6aaae311c8 100644 --- a/reference/6/PowerShellGet/Save-Script.md +++ b/reference/6/PowerShellGet/Save-Script.md @@ -223,7 +223,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -253,7 +253,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -268,7 +268,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Set-PSRepository.md b/reference/6/PowerShellGet/Set-PSRepository.md index 8aa03787f6a2..7444b8dea935 100644 --- a/reference/6/PowerShellGet/Set-PSRepository.md +++ b/reference/6/PowerShellGet/Set-PSRepository.md @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### -ScriptPublishLocation -@{Text=} + ```yaml Type: Uri @@ -121,7 +121,7 @@ Accept wildcard characters: False ``` ### -ScriptSourceLocation -@{Text=} + ```yaml Type: Uri @@ -152,7 +152,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -167,7 +167,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -182,7 +182,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Update-Module.md b/reference/6/PowerShellGet/Update-Module.md index 0a1100620b11..f385461bbd66 100644 --- a/reference/6/PowerShellGet/Update-Module.md +++ b/reference/6/PowerShellGet/Update-Module.md @@ -174,7 +174,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -189,7 +189,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -204,7 +204,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential diff --git a/reference/6/PowerShellGet/Update-Script.md b/reference/6/PowerShellGet/Update-Script.md index 368696986ef4..324b802ecccc 100644 --- a/reference/6/PowerShellGet/Update-Script.md +++ b/reference/6/PowerShellGet/Update-Script.md @@ -135,7 +135,7 @@ Accept wildcard characters: False ``` ### -Credential -@{Text=} + ```yaml Type: PSCredential @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### -Proxy -@{Text=} + ```yaml Type: Uri @@ -165,7 +165,7 @@ Accept wildcard characters: False ``` ### -ProxyCredential -@{Text=} + ```yaml Type: PSCredential From efba6514346594ba0867e1ae5a85dc7022f82c81 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 10:59:47 -0800 Subject: [PATCH 004/145] fixing UTF8 characters --- .../Unprotect-CmsMessage.md | 18 ++--- .../Microsoft.PowerShell.Core/Get-Module.md | 34 ++++---- .../Unprotect-CmsMessage.md | 18 ++--- reference/5.1/PowershellGet/Find-Script.md | 34 ++++---- reference/5.1/PowershellGet/Install-Script.md | 44 +++++----- .../6/Microsoft.PowerShell.Core/Get-Module.md | 34 ++++---- .../New-ModuleManifest.md | 80 +++++++++---------- reference/6/PowerShellGet/Find-Script.md | 34 ++++---- reference/6/PowerShellGet/Install-Script.md | 44 +++++----- 9 files changed, 170 insertions(+), 170 deletions(-) diff --git a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 5a56a41010e8..49135884a825 100644 --- a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -56,7 +56,7 @@ The **Unprotect-CmsMessage** cmdlet returns the decrypted content. ### Example 1: Decrypt a message ``` -PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '???????0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' +PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' Try the new Break All command ``` @@ -72,7 +72,7 @@ Specifies an encrypted string, or a variable containing an encrypted string. ```yaml Type: String Parameter Sets: ByContent -Aliases: +Aliases: Required: True Position: 0 @@ -87,7 +87,7 @@ Specifies an event log record ID that represents a CMS encryption operation. ```yaml Type: PSObject Parameter Sets: ByWinEvent -Aliases: +Aliases: Required: True Position: 0 @@ -102,7 +102,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -121,7 +121,7 @@ Single quotation marks tell Windows PowerShell not to interpret any characters a ```yaml Type: String Parameter Sets: ByLiteralPath -Aliases: +Aliases: Required: True Position: 0 @@ -136,7 +136,7 @@ Specifies the path to encrypted content that you want to decrypt. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 0 @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -To -Specifies one or more CMS message recipients, identified in any of the following formats. +Specifies one or more CMS message recipients, identified in any of the following formats. - An actual certificate (as retrieved from the certificate provider). - Path to the a file containing the certificate. @@ -157,7 +157,7 @@ Specifies one or more CMS message recipients, identified in any of the following ```yaml Type: CmsMessageRecipient[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 @@ -171,7 +171,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### +### You can pipe an object containing encrypted content to **Unprotect-CmsMessage**. ## OUTPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md index 72ecec08ab61..7be5573af794 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md @@ -102,8 +102,8 @@ This command gets all of the exported files for all available modules. ### Example 4: Get a module by its fully qualified name ``` PS C:\> Get-Module -FullyQualifiedName @{ModuleName="Microsoft.PowerShell.Management";ModuleVersion="3.1.0.0"} | Format-Table -Property Name,Version -Name Version ----- ------- +Name Version +---- ------- Microsoft.PowerShell.Management 3.1.0.0 ``` @@ -212,7 +212,7 @@ PS C:\> Get-Content $m.Path GUID="{8FA5064B-8479-4c5c-86EA-0D311FE48875}" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" -Copyright="???? Microsoft Corporation. All rights reserved." +Copyright="?Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0.0" Description="Windows Powershell File Transfer Module" PowerShellVersion="2.0" @@ -299,7 +299,7 @@ Without this parameter, **Get-Module** gets only the default module in each modu ```yaml Type: SwitchParameter Parameter Sets: Loaded, Available -Aliases: +Aliases: Required: False Position: Named @@ -319,7 +319,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: CimSession -Aliases: +Aliases: Required: False Position: Named @@ -339,7 +339,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: Uri Parameter Sets: CimSession -Aliases: +Aliases: Required: False Position: Named @@ -363,7 +363,7 @@ However, you can import only CIM-based and Cmdlet Definition XML (CDXML)-based m ```yaml Type: CimSession Parameter Sets: CimSession -Aliases: +Aliases: Required: True Position: Named @@ -375,10 +375,10 @@ Accept wildcard characters: False ### -FullyQualifiedName Specifies names of modules in the form of **ModuleSpecification** objects. These objects are described in the Remarks section of [ModuleSpecification Constructor (Hashtable)](https://msdn.microsoft.com/library/jj136290) in the MSDN library. -For example, the *FullyQualifiedName* parameter accepts a module name that is specified in the following formats: +For example, the *FullyQualifiedName* parameter accepts a module name that is specified in the following formats: @{ModuleName = "modulename"; ModuleVersion = "version_number"} -@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. +@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. **ModuleName** and **ModuleVersion** are required, but **Guid** is optional. @@ -387,7 +387,7 @@ You cannot specify the *FullyQualifiedName* parameter in the same command as a * ```yaml Type: ModuleSpecification[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -399,13 +399,13 @@ Accept wildcard characters: False ### -ListAvailable Indicates that this cmdlet gets all installed modules. **Get-Module** gets modules in paths listed in the **PSModulePath** environment variable. -Without this parameter, **Get-Module** gets only the modules that are both listed in the **PSModulePath** environment variable, and that are loaded in the current session. +Without this parameter, **Get-Module** gets only the modules that are both listed in the **PSModulePath** environment variable, and that are loaded in the current session. *ListAvailable* does not return information about modules that are not found in the **PSModulePath** environment variable, even if those modules are loaded in the current session. ```yaml Type: SwitchParameter Parameter Sets: Available -Aliases: +Aliases: Required: True Position: Named @@ -417,7 +417,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: PsSession, CimSession -Aliases: +Aliases: Required: False Position: Named @@ -438,7 +438,7 @@ To return modules by specifying a GUID, use *FullyQualifiedName* instead. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -453,7 +453,7 @@ Accept wildcard characters: False ```yaml Type: String Parameter Sets: Available, PsSession -Aliases: +Aliases: Required: False Position: Named @@ -475,7 +475,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: PSSession Parameter Sets: PsSession -Aliases: +Aliases: Required: True Position: Named @@ -498,7 +498,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: Available, PsSession, CimSession -Aliases: +Aliases: Required: False Position: Named diff --git a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 5a56a41010e8..49135884a825 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -56,7 +56,7 @@ The **Unprotect-CmsMessage** cmdlet returns the decrypted content. ### Example 1: Decrypt a message ``` -PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '???????0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' +PS C:\> C:\Users\gabyk\Documents\PowerShell_ISEUnprotect-CmsMessage -LiteralPath "C:\Users\Test\Documents\PowerShell ISE\Future_Plans.txt" -To '0f 8j b1 ab e0 ce 35 1d 67 d2 f2 6f a2 d2 00 cl 22 z9 m9 85' Try the new Break All command ``` @@ -72,7 +72,7 @@ Specifies an encrypted string, or a variable containing an encrypted string. ```yaml Type: String Parameter Sets: ByContent -Aliases: +Aliases: Required: True Position: 0 @@ -87,7 +87,7 @@ Specifies an event log record ID that represents a CMS encryption operation. ```yaml Type: PSObject Parameter Sets: ByWinEvent -Aliases: +Aliases: Required: True Position: 0 @@ -102,7 +102,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -121,7 +121,7 @@ Single quotation marks tell Windows PowerShell not to interpret any characters a ```yaml Type: String Parameter Sets: ByLiteralPath -Aliases: +Aliases: Required: True Position: 0 @@ -136,7 +136,7 @@ Specifies the path to encrypted content that you want to decrypt. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 0 @@ -146,7 +146,7 @@ Accept wildcard characters: False ``` ### -To -Specifies one or more CMS message recipients, identified in any of the following formats. +Specifies one or more CMS message recipients, identified in any of the following formats. - An actual certificate (as retrieved from the certificate provider). - Path to the a file containing the certificate. @@ -157,7 +157,7 @@ Specifies one or more CMS message recipients, identified in any of the following ```yaml Type: CmsMessageRecipient[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 @@ -171,7 +171,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### +### You can pipe an object containing encrypted content to **Unprotect-CmsMessage**. ## OUTPUTS diff --git a/reference/5.1/PowershellGet/Find-Script.md b/reference/5.1/PowershellGet/Find-Script.md index 3ad8164e86c5..a091b39c6f8c 100644 --- a/reference/5.1/PowershellGet/Find-Script.md +++ b/reference/5.1/PowershellGet/Find-Script.md @@ -74,14 +74,14 @@ Type : Script Description : Description for the Required-Script2 script Author : pattif CompanyName : Microsoft Corporation -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +Copyright : 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/14/2015 2:37:01 PM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ IconUri : http://required-script2.com/icon -Tags : {, Tag1, Tag2, Tag-Required-Script2-2.0...} +Tags : {, Tag1, Tag2, Tag-Required-Script2-2.0...} Includes : {Function, DscResource, Cmdlet, Command} -PowerShellGetFormatVersion : +PowerShellGetFormatVersion : ReleaseNotes : Required-Script2 release notes Dependencies : {} RepositorySourceLocation : C:\MyLocalRepo @@ -178,7 +178,7 @@ Indicates that this operation finds all script versions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -194,7 +194,7 @@ A command can be a function or workflow. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -209,7 +209,7 @@ Accept wildcard characters: False ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -224,7 +224,7 @@ Finds scripts based on the PackageManagement provider-specific search syntax. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -239,7 +239,7 @@ Indicates that this operation gets all scripts that are dependent upon the scrip ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -255,7 +255,7 @@ The acceptable values for this parameter are: Function, Workflow. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Function, Workflow Required: False @@ -272,7 +272,7 @@ The *MaximumVersion* and *RequiredVersion* parameters are mutually exclusive; yo ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -288,7 +288,7 @@ The *MinimumVersion* and *RequiredVersion* parameters are mutually exclusive; yo ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -303,7 +303,7 @@ Specifies an array of names of scripts to find. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -318,7 +318,7 @@ Specifies a proxy server for the request, rather than connecting directly to the ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -333,7 +333,7 @@ Specifies a user account that has permission to use the proxy server that is spe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -348,7 +348,7 @@ Specifies the friendly name of a repository that has been registered by running ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -363,7 +363,7 @@ Specifies the exact version number of the script to find. ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -378,7 +378,7 @@ Specifies an array of tags. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named diff --git a/reference/5.1/PowershellGet/Install-Script.md b/reference/5.1/PowershellGet/Install-Script.md index 7eb13f6da42a..d68a270f7cdf 100644 --- a/reference/5.1/PowershellGet/Install-Script.md +++ b/reference/5.1/PowershellGet/Install-Script.md @@ -50,21 +50,21 @@ CommandType Name Version So ExternalScript Required-Script2.ps1 2.0 C:\Users\pattif\Documents\WindowsPowerShell\Scripts\Required-Script2.ps1 PS C:\> Get-InstalledScript -Name "Required-Script2" Version Name Type Repository Description ------- ---- ---- ---------- ----------- -2.5 Required-Script2 Script local1 Description for the Required-Script2 script PS C:\> Get-InstalledScript -Name "Required-Script2" | Format-List * +2.5 Required-Script2 Script local1 Description for the Required-Script2 script PS C:\> Get-InstalledScript -Name "Required-Script2" | Format-List * Name : Required-Script2 Version : 2.5 Type : Script Description : Description for the Required-Script2 script Author : pattif -CompanyName : -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +CompanyName : +Copyright : 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:39 AM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ IconUri : http://required-script2.com/icon -Tags : {Tag1, Tag2, Tag-Required-Script2-2.5, PSScript...} +Tags : {Tag1, Tag2, Tag-Required-Script2-2.5, PSScript...} Includes : {Function, DscResource, Cmdlet, Command} -PowerShellGetFormatVersion : +PowerShellGetFormatVersion : ReleaseNotes : Required-Script2 release notes Dependencies : {} RepositorySourceLocation : http://pattif-dev:8765/api/v2/ @@ -89,21 +89,21 @@ PS C:\> Install-Script -Repository "Local1" -Name "Required-Script3" -Scope "All PS C:\> Get-InstalledScript -Name "Required-Script3" Version Name Type Repository Description ------- ---- ---- ---------- ----------- -2.5 Required-Script3 Script local1 Description for the Required-Script3 script PS C:\> Get-InstalledScript -Name "Required-Script3" | Format-List * +2.5 Required-Script3 Script local1 Description for the Required-Script3 script PS C:\> Get-InstalledScript -Name "Required-Script3" | Format-List * Name : Required-Script3 Version : 2.5 Type : Script Description : Description for the Required-Script3 script Author : pattif -CompanyName : -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +CompanyName : +Copyright : ???? 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:45 AM LicenseUri : http://required-script3.com/license ProjectUri : http://required-script3.com/ IconUri : http://required-script3.com/icon -Tags : {Tag1, Tag2, Tag-Required-Script3-2.5, PSScript...} +Tags : {Tag1, Tag2, Tag-Required-Script3-2.5, PSScript...} Includes : {Function, DscResource, Cmdlet, Command} -PowerShellGetFormatVersion : +PowerShellGetFormatVersion : ReleaseNotes : Required-Script3 release notes Dependencies : {} RepositorySourceLocation : http://pattif-dev:8765/api/v2/ @@ -192,7 +192,7 @@ Specifies a user account that has rights to install a script for a specified pac ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -207,7 +207,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -222,7 +222,7 @@ Accept wildcard characters: False ```yaml Type: PSObject[] Parameter Sets: InputObject -Aliases: +Aliases: Required: True Position: 0 @@ -239,7 +239,7 @@ This parameter accepts the wildcard character (*). ```yaml Type: Version Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -255,7 +255,7 @@ The *MinimumVersion* and *RequiredVersion* parameters are mutually exclusive; yo ```yaml Type: Version Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -270,7 +270,7 @@ Specifies an array of names of scripts to install. ```yaml Type: String[] Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: True Position: 0 @@ -285,7 +285,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -300,7 +300,7 @@ Specifies a proxy server for the request, rather than connecting directly to the ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -315,7 +315,7 @@ Specifies a user account that has permission to use the proxy server that is spe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -331,7 +331,7 @@ The default is all registered repositories. ```yaml Type: String[] Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -346,7 +346,7 @@ Specifies the exact version number of the script to install. ```yaml Type: Version Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -366,7 +366,7 @@ The CurrentUser scope specifies to install the script in $home\Documents\Windows ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: CurrentUser, AllUsers Required: False diff --git a/reference/6/Microsoft.PowerShell.Core/Get-Module.md b/reference/6/Microsoft.PowerShell.Core/Get-Module.md index 8b69589bd0a6..5427512d3467 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-Module.md @@ -102,8 +102,8 @@ This command gets all of the exported files for all available modules. ### Example 4: Get a module by its fully qualified name ``` PS C:\> Get-Module -FullyQualifiedName @{ModuleName="Microsoft.PowerShell.Management";ModuleVersion="3.1.0.0"} | Format-Table -Property Name,Version -Name Version ----- ------- +Name Version +---- ------- Microsoft.PowerShell.Management 3.1.0.0 ``` @@ -212,7 +212,7 @@ PS C:\> Get-Content $m.Path GUID="{8FA5064B-8479-4c5c-86EA-0D311FE48875}" Author="Microsoft Corporation" CompanyName="Microsoft Corporation" -Copyright="???? Microsoft Corporation. All rights reserved." +Copyright="Microsoft Corporation. All rights reserved." ModuleVersion="1.0.0.0" Description="Windows Powershell File Transfer Module" PowerShellVersion="2.0" @@ -299,7 +299,7 @@ Without this parameter, **Get-Module** gets only the default module in each modu ```yaml Type: SwitchParameter Parameter Sets: Loaded, Available -Aliases: +Aliases: Required: False Position: Named @@ -319,7 +319,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: CimSession -Aliases: +Aliases: Required: False Position: Named @@ -339,7 +339,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: Uri Parameter Sets: CimSession -Aliases: +Aliases: Required: False Position: Named @@ -363,7 +363,7 @@ However, you can import only CIM-based and Cmdlet Definition XML (CDXML)-based m ```yaml Type: CimSession Parameter Sets: CimSession -Aliases: +Aliases: Required: True Position: Named @@ -375,10 +375,10 @@ Accept wildcard characters: False ### -FullyQualifiedName Specifies names of modules in the form of **ModuleSpecification** objects. These objects are described in the Remarks section of [ModuleSpecification Constructor (Hashtable)](https://msdn.microsoft.com/library/jj136290) in the MSDN library. -For example, the *FullyQualifiedName* parameter accepts a module name that is specified in the following formats: +For example, the *FullyQualifiedName* parameter accepts a module name that is specified in the following formats: @{ModuleName = "modulename"; ModuleVersion = "version_number"} -@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. +@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}. **ModuleName** and **ModuleVersion** are required, but **Guid** is optional. @@ -387,7 +387,7 @@ You cannot specify the *FullyQualifiedName* parameter in the same command as a * ```yaml Type: ModuleSpecification[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -399,13 +399,13 @@ Accept wildcard characters: False ### -ListAvailable Indicates that this cmdlet gets all installed modules. **Get-Module** gets modules in paths listed in the **PSModulePath** environment variable. -Without this parameter, **Get-Module** gets only the modules that are both listed in the **PSModulePath** environment variable, and that are loaded in the current session. +Without this parameter, **Get-Module** gets only the modules that are both listed in the **PSModulePath** environment variable, and that are loaded in the current session. *ListAvailable* does not return information about modules that are not found in the **PSModulePath** environment variable, even if those modules are loaded in the current session. ```yaml Type: SwitchParameter Parameter Sets: Available -Aliases: +Aliases: Required: True Position: Named @@ -417,7 +417,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: PsSession, CimSession -Aliases: +Aliases: Required: False Position: Named @@ -438,7 +438,7 @@ To return modules by specifying a GUID, use *FullyQualifiedName* instead. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -460,7 +460,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: PSSession Parameter Sets: PsSession -Aliases: +Aliases: Required: True Position: Named @@ -483,7 +483,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: Available, PsSession, CimSession -Aliases: +Aliases: Required: False Position: Named @@ -498,7 +498,7 @@ Accept wildcard characters: False ```yaml Type: String Parameter Sets: Available, PsSession -Aliases: +Aliases: Required: False Position: Named diff --git a/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md b/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md index 39f47a75b26c..a5a12f94a2f7 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md +++ b/reference/6/Microsoft.PowerShell.Core/New-ModuleManifest.md @@ -151,8 +151,8 @@ For information about the HelpInfo XML file, see "Supporting Updatable Help" in ``` PS C:\> Get-Module PSScheduledJob -List | Format-List -Property * -LogPipelineExecutionDetails : -FalseName : +LogPipelineExecutionDetails : +FalseName : PSScheduledJobPath : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSScheduledJob\PSScheduledJob.psd1 Definition : Description : @@ -161,7 +161,7 @@ HelpInfoUri : http://go.microsoft.com/fwlink/?LinkID=223911 ModuleBase : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSScheduledJob PrivateData : Version : 1.0.0.0 -ModuleType : +ModuleType : BinaryAuthor : Microsoft Corporation AccessMode : ReadWrite ClrVersion : 4.0 @@ -210,7 +210,7 @@ IscsiTarget 4.0 Kds 4.0 Microsoft.PowerShell.Diagnostics 4.0 Microsoft.PowerShell.Host 4.0 -Microsoft.PowerShell.Management 4.0??????? +Microsoft.PowerShell.Management 4.0 ``` This example shows how to get the module manifest values of a module. @@ -238,7 +238,7 @@ If you omit this parameter, **New-ModuleManifest** creates an **AliasesToExport* ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -255,7 +255,7 @@ If you omit this parameter, **New-ModuleManifest** creates an **Author** key wit ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -270,7 +270,7 @@ Specifies the minimum version of the Common Language Runtime (CLR) of the Micros ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -291,7 +291,7 @@ If you omit this parameter, **New-ModuleManifest** creates a **CmdletsToExport** ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -308,7 +308,7 @@ If you omit this parameter, **New-ModuleManifest** creates a **CompanyName** key ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -341,7 +341,7 @@ All rights reserved." where \ is the current year and \ is the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -361,7 +361,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -376,7 +376,7 @@ Describes the contents of the module. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -391,7 +391,7 @@ Specifies the minimum version of the Microsoft .NET Framework that the module re ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -406,7 +406,7 @@ Accept wildcard characters: False ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -424,7 +424,7 @@ The files listed in the key are not automatically exported with the module. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -442,7 +442,7 @@ Because formatting files are not scoped, they affect all session states in the s ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -463,7 +463,7 @@ If you omit this parameter, **New-ModuleManifest** creates an **FunctionsToExpor ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -483,7 +483,7 @@ To create a new GUID in Windows PowerShell, type "\[guid\]::NewGuid()". ```yaml Type: Guid Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -506,7 +506,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -521,7 +521,7 @@ Accept wildcard characters: False ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -536,7 +536,7 @@ Accept wildcard characters: False ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -559,7 +559,7 @@ The modules that are listed in the value of this key are not automatically proce ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -577,7 +577,7 @@ If you omit this parameter, **New-ModuleManifest** creates a **ModuleVersion** k ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -606,7 +606,7 @@ To run a script in the caller's session state, list the script file name in the ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -622,7 +622,7 @@ By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -646,7 +646,7 @@ To use a variable, include the **Path** parameter in the command. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -665,7 +665,7 @@ To find the name of a host program, in the program, type `$host.name`. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -681,7 +681,7 @@ Enter a version number, such as 1.1. ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -697,7 +697,7 @@ For example, you can enter 3.0, 4.0, or 5.0 as the value of this parameter. ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -712,7 +712,7 @@ Specifies data that is passed to the module when it is imported. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -729,7 +729,7 @@ None indicates unknown or unspecified. ```yaml Type: ProcessorArchitecture Parameter Sets: (All) -Aliases: +Aliases: Accepted values: None, MSIL, X86, IA64, Amd64, Arm Required: False @@ -745,7 +745,7 @@ Accept wildcard characters: False ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -760,7 +760,7 @@ Specifies release notes. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -780,7 +780,7 @@ This includes assemblies that must be loaded to update any formatting or type fi ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -805,7 +805,7 @@ It just verifies that the required modules are in the global session state. ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -848,7 +848,7 @@ To specify scripts that run in the module's session state, use the **NestedModul ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -863,7 +863,7 @@ Accept wildcard characters: False ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -881,7 +881,7 @@ Because type files are not scoped, they affect all session states in the session ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -902,7 +902,7 @@ If you omit this parameter, **New-ModuleManifest** creates a **VariablesToExport ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -934,7 +934,7 @@ For information about PSEdition, see [Modules with compatible PowerShell Edition ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Desktop, Core Required: False diff --git a/reference/6/PowerShellGet/Find-Script.md b/reference/6/PowerShellGet/Find-Script.md index cc009834d5d6..aa62fb4473cb 100644 --- a/reference/6/PowerShellGet/Find-Script.md +++ b/reference/6/PowerShellGet/Find-Script.md @@ -74,14 +74,14 @@ Type : Script Description : Description for the Required-Script2 script Author : pattif CompanyName : Microsoft Corporation -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +Copyright : 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/14/2015 2:37:01 PM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ IconUri : http://required-script2.com/icon -Tags : {, Tag1, Tag2, Tag-Required-Script2-2.0...} +Tags : {, Tag1, Tag2, Tag-Required-Script2-2.0...} Includes : {Function, DscResource, Cmdlet, Command} -PowerShellGetFormatVersion : +PowerShellGetFormatVersion : ReleaseNotes : Required-Script2 release notes Dependencies : {} RepositorySourceLocation : C:\MyLocalRepo @@ -178,7 +178,7 @@ Indicates that this operation finds all script versions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -194,7 +194,7 @@ A command can be a function or workflow. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -209,7 +209,7 @@ Finds scripts based on the PackageManagement provider-specific search syntax. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -224,7 +224,7 @@ Indicates that this operation gets all scripts that are dependent upon the scrip ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -240,7 +240,7 @@ The acceptable values for this parameter are: Function, Workflow. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Function, Workflow Required: False @@ -257,7 +257,7 @@ The *MaximumVersion* and *RequiredVersion* parameters are mutually exclusive; yo ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -273,7 +273,7 @@ The *MinimumVersion* and *RequiredVersion* parameters are mutually exclusive; yo ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -288,7 +288,7 @@ Specifies an array of names of scripts to find. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 @@ -303,7 +303,7 @@ Specifies the friendly name of a repository that has been registered by running ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -318,7 +318,7 @@ Specifies the exact version number of the script to find. ```yaml Type: Version Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -333,7 +333,7 @@ Specifies an array of tags. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -348,7 +348,7 @@ Accept wildcard characters: False ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -363,7 +363,7 @@ Accept wildcard characters: False ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -378,7 +378,7 @@ Accept wildcard characters: False ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named diff --git a/reference/6/PowerShellGet/Install-Script.md b/reference/6/PowerShellGet/Install-Script.md index 37dfb6e050d6..919582e5b3dd 100644 --- a/reference/6/PowerShellGet/Install-Script.md +++ b/reference/6/PowerShellGet/Install-Script.md @@ -50,21 +50,21 @@ CommandType Name Version So ExternalScript Required-Script2.ps1 2.0 C:\Users\pattif\Documents\WindowsPowerShell\Scripts\Required-Script2.ps1 PS C:\> Get-InstalledScript -Name "Required-Script2" Version Name Type Repository Description ------- ---- ---- ---------- ----------- -2.5 Required-Script2 Script local1 Description for the Required-Script2 script PS C:\> Get-InstalledScript -Name "Required-Script2" | Format-List * +2.5 Required-Script2 Script local1 Description for the Required-Script2 script PS C:\> Get-InstalledScript -Name "Required-Script2" | Format-List * Name : Required-Script2 Version : 2.5 Type : Script Description : Description for the Required-Script2 script Author : pattif -CompanyName : -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +CompanyName : +Copyright : 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:39 AM LicenseUri : http://required-script2.com/license ProjectUri : http://required-script2.com/ IconUri : http://required-script2.com/icon -Tags : {Tag1, Tag2, Tag-Required-Script2-2.5, PSScript...} +Tags : {Tag1, Tag2, Tag-Required-Script2-2.5, PSScript...} Includes : {Function, DscResource, Cmdlet, Command} -PowerShellGetFormatVersion : +PowerShellGetFormatVersion : ReleaseNotes : Required-Script2 release notes Dependencies : {} RepositorySourceLocation : http://pattif-dev:8765/api/v2/ @@ -89,21 +89,21 @@ PS C:\> Install-Script -Repository "Local1" -Name "Required-Script3" -Scope "All PS C:\> Get-InstalledScript -Name "Required-Script3" Version Name Type Repository Description ------- ---- ---- ---------- ----------- -2.5 Required-Script3 Script local1 Description for the Required-Script3 script PS C:\> Get-InstalledScript -Name "Required-Script3" | Format-List * +2.5 Required-Script3 Script local1 Description for the Required-Script3 script PS C:\> Get-InstalledScript -Name "Required-Script3" | Format-List * Name : Required-Script3 Version : 2.5 Type : Script Description : Description for the Required-Script3 script Author : pattif -CompanyName : -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +CompanyName : +Copyright : 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:45 AM LicenseUri : http://required-script3.com/license ProjectUri : http://required-script3.com/ IconUri : http://required-script3.com/icon -Tags : {Tag1, Tag2, Tag-Required-Script3-2.5, PSScript...} +Tags : {Tag1, Tag2, Tag-Required-Script3-2.5, PSScript...} Includes : {Function, DscResource, Cmdlet, Command} -PowerShellGetFormatVersion : +PowerShellGetFormatVersion : ReleaseNotes : Required-Script3 release notes Dependencies : {} RepositorySourceLocation : http://pattif-dev:8765/api/v2/ @@ -177,7 +177,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -194,7 +194,7 @@ This parameter accepts the wildcard character (*). ```yaml Type: Version Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -210,7 +210,7 @@ The *MinimumVersion* and *RequiredVersion* parameters are mutually exclusive; yo ```yaml Type: Version Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -225,7 +225,7 @@ Specifies an array of names of scripts to install. ```yaml Type: String[] Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: True Position: 1 @@ -241,7 +241,7 @@ The default is all registered repositories. ```yaml Type: String[] Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -256,7 +256,7 @@ Specifies the exact version number of the script to install. ```yaml Type: Version Parameter Sets: NameParameterSet -Aliases: +Aliases: Required: False Position: Named @@ -276,7 +276,7 @@ The CurrentUser scope specifies to install the script in $home\Documents\Windows ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: CurrentUser, AllUsers Required: False @@ -323,7 +323,7 @@ Accept wildcard characters: False ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -338,7 +338,7 @@ Accept wildcard characters: False ```yaml Type: PSObject[] Parameter Sets: InputObject -Aliases: +Aliases: Required: True Position: Named @@ -353,7 +353,7 @@ Accept wildcard characters: False ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -368,7 +368,7 @@ Accept wildcard characters: False ```yaml Type: Uri Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -383,7 +383,7 @@ Accept wildcard characters: False ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named From b93a6ba9a55e0fed9608b3cfb2b20a9dbedc194c Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 13:40:15 -0800 Subject: [PATCH 005/145] removed empty H3 --- .../5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md | 1 - .../5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md | 1 - 2 files changed, 2 deletions(-) diff --git a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 49135884a825..4a3773f08351 100644 --- a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -171,7 +171,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### You can pipe an object containing encrypted content to **Unprotect-CmsMessage**. ## OUTPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 49135884a825..4a3773f08351 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -171,7 +171,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### You can pipe an object containing encrypted content to **Unprotect-CmsMessage**. ## OUTPUTS From ec505bf2bcfde03f08f93c43e5a44ee72d25be67 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 14:10:52 -0800 Subject: [PATCH 006/145] added H3 for input and output types --- .../5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md | 4 ++++ .../5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 4a3773f08351..2904dd9a3cfd 100644 --- a/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.0/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -171,10 +171,14 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS +### System.Diagnostics.Eventing.Reader.EventLogRecord or System.String You can pipe an object containing encrypted content to **Unprotect-CmsMessage**. ## OUTPUTS +### System.String +The unencrypted message. + ## NOTES ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 4a3773f08351..2904dd9a3cfd 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -171,10 +171,14 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS +### System.Diagnostics.Eventing.Reader.EventLogRecord or System.String You can pipe an object containing encrypted content to **Unprotect-CmsMessage**. ## OUTPUTS +### System.String +The unencrypted message. + ## NOTES ## RELATED LINKS From c2abb44968de990e69ebbcd2556bf3760a459588 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 19:12:37 -0800 Subject: [PATCH 007/145] removed mangled UTF8 character --- reference/5.1/PowershellGet/Install-Script.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/5.1/PowershellGet/Install-Script.md b/reference/5.1/PowershellGet/Install-Script.md index d68a270f7cdf..c5af2f49cd55 100644 --- a/reference/5.1/PowershellGet/Install-Script.md +++ b/reference/5.1/PowershellGet/Install-Script.md @@ -96,7 +96,7 @@ Type : Script Description : Description for the Required-Script3 script Author : pattif CompanyName : -Copyright : ???? 2015 Microsoft Corporation. All rights reserved. +Copyright : 2015 Microsoft Corporation. All rights reserved. PublishedDate : 8/15/2015 12:42:45 AM LicenseUri : http://required-script3.com/license ProjectUri : http://required-script3.com/ From bbffd771de9f6d1040d92bd805aa549089b2b12d Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 8 Nov 2017 16:36:46 -0800 Subject: [PATCH 008/145] updating Out-* commands with -NoNewLine per Issue 1739 --- .../Add-Content.md | 113 ++++-- .../Set-Content.md | 116 +++--- .../Microsoft.PowerShell.Utility/Out-File.md | 204 +++++++---- .../Write-Host.md | 116 ++++-- .../Add-Content.md | 255 +++++++------ .../Set-Content.md | 118 +++--- .../Microsoft.PowerShell.Utility/Out-File.md | 195 ++++++---- .../Write-Host.md | 106 ++++-- .../Add-Content.md | 143 ++++---- .../Set-Content.md | 178 +++++---- .../Microsoft.PowerShell.Utility/Out-File.md | 115 +++--- .../Write-Host.md | 72 ++-- .../Add-Content.md | 143 ++++---- .../Set-Content.md | 178 +++++---- .../Microsoft.PowerShell.Utility/Out-File.md | 121 ++++--- .../Write-Host.md | 74 ++-- .../Add-Content.md | 341 +++++++++--------- .../Set-Content.md | 178 +++++---- .../Microsoft.PowerShell.Utility/Out-File.md | 201 ++++++----- .../Write-Host.md | 79 ++-- 20 files changed, 1721 insertions(+), 1325 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md index 45f6fb17fe94..22a32c1345c0 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -9,36 +9,46 @@ title: Add-Content --- # Add-Content + ## SYNOPSIS + Adds content to the specified items, such as adding words to a file. + ## SYNTAX ### Path (Default) -``` + +```powershell Add-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` + +```powershell Add-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] ``` ## DESCRIPTION + The Add-Content cmdlet appends content to a specified item or file. You can specify the content by typing the content in the command or by specifying an object that contains the content. + ## EXAMPLES ### Example 1 -``` + +```powershell PS C:\> add-content -path *.txt -exclude help* -value "END" ``` This command adds "END" to all text files in the current directory, except for those with file names that begin with "help". + ### Example 2 + ``` PS C:\> add-content -Path file1.log, file2.log -Value (get-date) -passthru ``` @@ -47,8 +57,10 @@ This command adds the date to the end of the File1.log and File2.log files and t The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to Add-Content. The PassThru parameter passes an object representing the added content through the pipeline. Because there is no other cmdlet to receive the passed object, it is displayed at the command line. + ### Example 3 -``` + +```powershell PS C:\> add-content -path monthly.txt -value (get-content c:\rec1\weekly.txt) ``` @@ -58,8 +70,10 @@ The parentheses ensure that the Get-Content command is complete before the Add-C You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. In that case, the command would be "add-content -path monthly.txt -value $w". + ### Example 4 -``` + +```powershell PS C:\> add-content -value (get-content test.log) -path C:\tests\test134\logs\test134.log ``` @@ -74,26 +88,31 @@ The command creates the remaining directories and the Test134.log file. The Force parameter is not required for this command. Add-Content creates directories to complete a path even without the Force parameter. + ## PARAMETERS ### -Encoding + Specifies the file encoding. The default is ASCII. Valid values are: --- ASCII: Uses the encoding for the ASCII (7-bit) character set. --- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. --- Byte: Encodes a set of characters into a sequence of bytes. --- String: Uses the encoding type for a string. --- Unicode: Encodes in UTF-16 format using the little-endian byte order. --- UTF7: Encodes in UTF-7 format. --- UTF8: Encodes in UTF-8 format. --- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. +- ASCII: Uses the encoding for the ASCII (7-bit) character set. +- BigEndianUnicode: Encodes in UTF-16 format using the big-endian byte order. +- Byte: Encodes a set of characters into a sequence of bytes. +- String: Uses the encoding type for a string. +- Unicode: Encodes in UTF-16 format using the little-endian byte order. +- UTF7: Encodes in UTF-7 format. +- UTF8: Encodes in UTF-8 format. +- Unknown: The encoding type is unknown or invalid. The data can be treated as binary. + +Encoding is a dynamic parameter that the FileSystem provider adds to the Add-Content cmdlet. +This parameter works only in file system drives. -Encoding is a dynamic parameter that the FileSystem provider adds to the Add-Content cmdlet. This parameter works only in file system drives.```yaml +```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem Required: False @@ -104,12 +123,13 @@ Accept wildcard characters: False ``` ### -Force + Overrides the read-only attribute, allowing you to add content to a read-only file. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -119,14 +139,17 @@ Accept wildcard characters: False ``` ### -Stream -Adds the content to the specified alternate data stream. If the stream does not yet, exist, Add-Content creates it. Enter the stream name. Wildcards are not supported. -Stream is a dynamic parameter that the FileSystem provider adds to the Add-Content cmdlet. This parameter works only in file system drives. +Adds the content to the specified alternate data stream. If the stream does not yet, exist, Add-Content creates it. +Enter the stream name. Wildcards are not supported. +Stream is a dynamic parameter that the FileSystem provider adds to the Add-Content cmdlet. +This parameter works only in file system drives. +This parameter is introduced in PowerShell 3.0. -This parameter is introduced in Windows PowerShell 3.0.```yaml +```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -136,6 +159,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -151,6 +175,7 @@ Accept wildcard characters: False ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -167,6 +192,7 @@ Accept wildcard characters: False ``` ### -UseTransaction + Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_Transactions. @@ -184,18 +210,19 @@ Accept wildcard characters: False ``` ### -Credential + Specifies a user account that has permission to perform this action. The default is the current user. Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -205,6 +232,7 @@ Accept wildcard characters: False ``` ### -Exclude + Omits the specified items. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". @@ -213,7 +241,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -223,15 +251,16 @@ Accept wildcard characters: True ``` ### -Filter + Specifies a filter in the provider's format or language. The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -241,6 +270,7 @@ Accept wildcard characters: True ``` ### -Include + Adds only the specified items. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". @@ -249,7 +279,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -259,11 +289,12 @@ Accept wildcard characters: True ``` ### -LiteralPath + Specifies the path to the items that receive the additional content. Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -278,13 +309,14 @@ Accept wildcard characters: False ``` ### -PassThru + Returns an object representing the added content. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -301,7 +333,7 @@ If you specify multiple paths, use commas to separate the paths. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -311,6 +343,7 @@ Accept wildcard characters: True ``` ### -Value + Specifies the content to be added. Type a quoted string, such as "This data is for internal use only", or specify an object that contains content, such as the DateTime object that Get-Date generates. @@ -319,7 +352,7 @@ You cannot specify the contents of a file by typing its path, because the path i ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -329,27 +362,34 @@ Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### System.Object + You can pipe the objects to be added (the Value) to Add-Content. + ## OUTPUTS ### None or System.String + When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. + ## NOTES -* When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. The object type determines the string format, but the format might be different than the default display of the object. To control the string format, use the formatting parameters of the sending cmdlet. - You can also refer to Add-Content by its built-in alias, "ac". -For more information, see about_Aliases. +When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. +The object type determines the string format, but the format might be different than the default display of the object. +To control the string format, use the formatting parameters of the sending cmdlet. - The Add-Content cmdlet is designed to work with the data exposed by any provider. +You can also refer to Add-Content by its built-in alias, "ac". For more information, see about_Aliases. + +The Add-Content cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type "Get-PsProvider". For more information, see about_Providers. -* ## RELATED LINKS [Clear-Content](Clear-Content.md) @@ -362,4 +402,3 @@ For more information, see about_Providers. [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) - diff --git a/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md index 2219dba7cc31..ea273cba13a3 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -18,7 +18,7 @@ Writes or replaces the content in an item with new content. ### Path (Default) -``` +```powershell Set-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] @@ -26,49 +26,50 @@ Set-Content [-Value] [-PassThru] [-Path] [-Filter ### LiteralPath -``` +```powershell Set-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] ``` ## DESCRIPTION + The Set-Content cmdlet is a string-processing cmdlet that writes or replaces the content in the specified item, such as a file. Whereas the Add-Content cmdlet appends content to a file, Set-Content replaces the existing content. You can type the content in the command or send content through the pipeline to Set-Content. ## EXAMPLES -### Example 1 +### Example 1: Replace the contents of multiple files in a folder -``` -PS C:\> set-content -path C:\Test1\test*.txt -value "Hello, World" +```powershell +PS C:\> Set-Content -Path "C:\Test1\test*.txt" -Value "Hello, World" ``` -This command replaces the contents of all files in the Test1 directory that have names beginning with "test" with "Hello, World". +This command replaces the contents of all files in the Test1 folder that have names that start with "test" with "Hello, World". This example shows how to specify content by typing it in the command. -### Example 2 +### Example 2: Send content to a file -``` -PS C:\> get-date | set-content C:\Test1\date.csv +```powershell +PS C:\> Get-Date | Set-Content -Path "C:\Test1\date.csv" ``` This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. The pipeline operator passes the result to Set-Content, which creates the file and writes the content. -If the Test1 directory does not exist, the command fails, but if the file does not exist, the command will create it. +If the Test1 directory does not exist, the command fails, but if the file does not exist, the command creates it. -### Example 3 +### Example 3: Replace text in a file -``` -PS C:\> (get-content Notice.txt) | foreach-object {$_ -replace "Warning", "Caution"} | set-content Notice.txt +```powershell +PS C:\> (Get-Content -Path "Notice.txt") | ForEach-Object {$_ -Replace "Warning", "Caution"} | Set-Content -Path "Notice.txt" ``` This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. -It uses the Get-Content cmdlet to get the content of Notice.txt. +It uses Get-Content cmdlet to get the content of Notice.txt. The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. @@ -103,16 +104,16 @@ The default is the current user. Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: Current user +Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` @@ -123,13 +124,13 @@ Specifies the file encoding. The acceptable values for this parameter are: - **ASCII** Uses the encoding for the ASCII (7-bit) character set. -- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. -- **Byte** Encodes a set of characters into a sequence of bytes. -- **String** Uses the encoding type for a string. -- **Unicode** Encodes in UTF-16 format using the little-endian byte order. +- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. +- **Byte** Encodes a set of characters into a sequence of bytes. +- **String** Uses the encoding type for a string. +- **Unicode** Encodes in UTF-16 format using the little-endian byte order. - **UTF7** Encodes in UTF-7 format. -- **UTF8** Encodes in UTF-8 format. -- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. +- **UTF8** Encodes in UTF-8 format. +- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. The default value is ASCII. @@ -139,7 +140,7 @@ This parameter works only in file system drives. ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem Required: False @@ -159,7 +160,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -170,15 +171,17 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. +Specifies a filter in the format or language of the provider. The value of this parameter qualifies the Path parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +The syntax of the filter, including the use of wildcard characters, depends on the provider. +Filters are more efficient than other parameters, +because the provider applies them when it is retrieving the objects, +instead of having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -197,11 +200,11 @@ Even using the Force parameter, the cmdlet cannot override security restrictions ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -216,7 +219,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -231,7 +234,7 @@ Specifies the path to the item that will receive the content. Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -247,30 +250,30 @@ Accept wildcard characters: False ### -PassThru -Returns an object representing the content. +Returns an object that represents the content. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Path -Specifies the path to the item that will receive the content. -Wildcards are permitted. +Specifies the path of the item that receives the content. +Wildcard characters are permitted. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -280,6 +283,7 @@ Accept wildcard characters: True ``` ### -Stream + Specifies an alternative data stream for content. If the stream does not exist, this cmdlet creates it. Wildcard characters are not supported. @@ -291,12 +295,12 @@ You can use the **Set-Content** cmdlet to change the content of the Zone.Identif However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -309,9 +313,7 @@ Accept wildcard characters: False Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. -For more information, see Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -332,7 +334,7 @@ Specifies the new content for the item. ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -360,22 +362,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Parameter | --- | - --Debug | --ErrorAction | --ErrorVariable | --InformationAction | --InformationVariable | --OutBuffer | --OutVariable | --PipelineVariable | --Verbose | --WarningAction | --WarningVariable. | - -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -399,7 +389,7 @@ If you pipe non-string objects to Set-Content, it converts the object to a strin To write objects to files, use Out-File. The Set-Content cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type "Get-PsProvider". +To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. ## RELATED LINKS diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Out-File.md b/reference/3.0/Microsoft.PowerShell.Utility/Out-File.md index 6db3f3944c11..7be21e330776 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Out-File.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -9,68 +9,82 @@ title: Out-File --- # Out-File + ## SYNOPSIS + Sends output to a file. + ## SYNTAX ### ByPath (Default) -``` + +```powershell Out-File [-FilePath] [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath -``` + +```powershell Out-File -LiteralPath [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION + The Out-File cmdlet sends output to a file. You can use this cmdlet instead of the redirection operator (\>) when you need to use its parameters. + ## EXAMPLES -### Example 1 -``` -PS C:\> get-process | out-file -filepath C:\Test1\process.txt +### Example 1: Send output to a file + +```powershell +PS C:\> Get-Process | Out-File -filepath C:\Test1\process.txt ``` This command sends a list of processes on the computer to the Process.txt file. If the file does not exist, Out-File creates it. Because the name of the FilePath parameter is optional, you can omit it and submit the equivalent command "get-process | outfile C:\Test1\process.txt". -### Example 2 -``` -PS C:\> get-process | out-file C:\Test1\process.txt -noclobber + +### Example 2: Send output to a file without overwriting + +```powershell +PS C:\> Get-Process | Out-File C:\Test1\process.txt -NoClobber Out-File : File C:\Test1\process.txt already exists and NoClobber was specified. At line:1 char:23 -+ get-process | out-file <<<< process.txt -noclobber ++ Get-Process | Out-File <<<< process.txt -NoClobber ``` This command also sends a list of processes to the Process.txt file, but it uses the NoClobber parameter, which prevents an existing file from being overwritten. The output shows the error message that appears when NoClobber is used with an existing file. -### Example 3 -``` -PS C:\> $a = get-process -PS C:\> out-file -filepath C:\Test1\process.txt -inputobject $a -encoding ASCII -width 50 + +### Example 3: Send output to a file in ASCII format + +```powershell +PS C:\> $A = Get-Process +PS C:\> Out-File -FilePath C:\Test1\process.txt -InputObject $A -Encoding ASCII -Width 50 ``` These commands send a list of processes on the computer to the Process.txt file. The text is encoded in ASCII format so that it can be read by search programs like Findstr and Grep. By default, Out-File uses Unicode format. -The first command gets the list of processes and stores them in the $a variable. +The first command gets the list of processes and stores them in the $A variable. The second command uses the Out-File cmdlet to send the list to the Process.txt file. -The command uses the InputObject parameter to specify that the input is in the $a variable. +The command uses the InputObject parameter to specify that the input is in the $A variable. It uses the Encoding parameter to convert the output to ASCII format. It uses the Width parameter to limit each line in the file to 50 characters. Because the lines of output are truncated at 50 characters, the rightmost column in the process table is omitted. -### Example 4 -``` -PS C:\> set-location hklm:\software -PS C:\> get-acl mycompany\mykey | out-file -filepath c:\ps\acl.txt -PS C:\> get-acl mycompany\mykey | out-file -filepath filesystem::acl.txt + +### Example 4: Send output from outside a file system drive + +```powershell +PS C:\> Set-Location hklm:\software +PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath c:\ps\acl.txt +PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath filesystem::acl.txt ``` These commands show how to use the Out-File cmdlet when you are not in a FileSystem drive. @@ -81,29 +95,60 @@ The second and third commands have the same effect. They use the Get-Acl cmdlet to get the security descriptor of the MyKey registry subkey (HKLM\Software\MyCompany\MyKey). A pipeline operator passes the result to the Out-File cmdlet, which sends it to the Acl.txt file. -Because Out-File is not supported by the Windows PowerShell Registry provider, you must specify either the file system drive name, such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. +Because Out-File is not supported by the PowerShell Registry provider, you must specify either the file system drive name, +such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. The second and third commands demonstrate these methods. + ## PARAMETERS ### -Append + Adds the output to the end of an existing file, instead of replacing the file contents. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: Replace +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### -Encoding + Specifies the type of character encoding used in the file. -Valid values are "Unicode", "UTF7", "UTF8", "UTF32", "ASCII", "BigEndianUnicode", "Default", and "OEM". -"Unicode" is the default. +The acceptable values for this parameter are: + +- Unknown +- String +- Unicode +- BigEndianUnicode +- UTF8 +- UTF7 +- UTF32 +- ASCII +- Default +- OEM + +Unicode is the default. "Default" uses the encoding of the system's current ANSI code page. @@ -112,7 +157,8 @@ Valid values are "Unicode", "UTF7", "UTF8", "UTF32", "ASCII", "BigEndianUnicode" ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: unknown, string, unicode, bigendianunicode, utf8, utf7, utf32, ascii, default, oem Required: False Position: 2 @@ -122,12 +168,13 @@ Accept wildcard characters: False ``` ### -FilePath + Specifies the path to the output file. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 1 @@ -137,29 +184,31 @@ Accept wildcard characters: False ``` ### -Force -Allows the cmdlet to overwrite an existing read-only file. + +Indicates that the cmdlet overwrites an existing read-only file. Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject + Specifies the objects to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -168,47 +217,13 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -NoClobber -Will not overwrite (replace the contents) of an existing file. -By default, if a file exists in the specified path, Out-File overwrites the file without warning. -If both Append and NoClobber are used, the output is appended to the existing file. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: NoOverwrite - -Required: False -Position: Named -Default value: Overwrite -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Width -Specifies the number of characters in each line of output. -Any additional characters are truncated, not wrapped. -If you omit this parameter, the width is determined by the characteristics of the host. -The default for the Windows PowerShell console is 80 (characters). - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: 80 -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -LiteralPath + Specifies the path to the output file. -Unlike **FilePath**, the value of the **LiteralPath** parameter is used exactly as it is typed. +Unlike *FilePath*, the value of the *LiteralPath* parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String @@ -222,22 +237,25 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -NoClobber +Indicates that the cmdlet will not overwrite an existing file. +By default, if a file exists in the specified path, **Out-File** overwrites the file without warning. +If both *Append* and *NoClobber* are used, the output is appended to the existing file. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: NoOverwrite Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -253,28 +271,56 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Width +Specifies the number of characters in each line of output. +Any additional characters are truncated, not wrapped. +If you omit this parameter, the width is determined by the characteristics of the host. +The default for the Windows PowerShell console is 80 characters. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### System.Management.Automation.PSObject + You can pipe any object to Out-File. + ## OUTPUTS ### None + Out-File does not generate any output. + ## NOTES -* The Out cmdlets do not format objects; they just render them and send them to the specified display destination. If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - The Out cmdlets do not have parameters for names or file paths. -To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. +The Out cmdlets do not format objects; they just render them and send them to the specified display destination. +If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. + +The Out cmdlets do not have parameters for names or file paths. +To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a PowerShell command to the cmdlet. You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. For help, see the examples. - Out-File sends data, but it does not emit any output objects. +Out-File sends data, but it does not emit any output objects. If you pipe the output of Out-File to Get-Member, Get-Member reports that no objects have been specified. -* ## RELATED LINKS [Out-Default](../Microsoft.PowerShell.Core/Out-Default.md) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Write-Host.md b/reference/3.0/Microsoft.PowerShell.Utility/Write-Host.md index b7ef52a15770..f30679113e76 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Write-Host.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Write-Host.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -9,62 +9,95 @@ title: Write-Host --- # Write-Host + ## SYNOPSIS + Writes customized output to a host. + ## SYNTAX -``` +```powershell Write-Host [[-Object] ] [-NoNewline] [-Separator ] [-ForegroundColor ] [-BackgroundColor ] [] ``` ## DESCRIPTION + The Write-Host cmdlet customizes output. You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. The Separator parameter lets you specify a string to use to separate displayed objects. -The particular result depends on the program that is hosting Windows PowerShell. +The particular result depends on the program that is hosting PowerShell. + ## EXAMPLES -### Example 1 -``` -PS C:\> write-host "no newline test " -nonewline +### Example 1: Write to the console without adding a new line + +```powershell +PS C:\> Write-Host "no newline test " -NoNewline no newline test PS C:\> ``` This command displays the input to the console, but because of the NoNewline parameter, the output is followed directly by the prompt. -### Example 2 -``` -PS C:\> write-host (2,4,6,8,10,12) -Separator ", +2= " + +### Example 2: Write to the console and include a separator + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", +2= " 2, +2= 4, +2= 6, +2= 8, +2= 10, +2= 12 ``` This command displays the even numbers from 2 through 12. The Separator parameter is used to add the string , +2= (comma, space, +, 2, =, space). -### Example 3 -``` -PS C:\> write-host (2,4,6,8,10,12) -Separator ", -> " -foregroundcolor DarkGreen -backgroundcolor white + +### Example 3: Write with different text and background colors + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor White ``` This command displays the even numbers from 2 through 12. It uses the ForegroundColor parameter to output dark green text and the BackgroundColor parameter to display a white background. -### Example 4 -``` -PS C:\> write-host "Red on white text." -ForegroundColor red -BackgroundColor white + +### Example 4: Write with different text and background colors + +```powershell +PS C:\> Write-Host "Red on white text." -ForegroundColor red -BackgroundColor white Red on white text. ``` This command displays the string "Red on white text." The text is red, as defined by the ForegroundColor parameter. The background is white, as defined by the BackgroundColor parameter. + ## PARAMETERS ### -BackgroundColor + Specifies the background color. There is no default. +The acceptable values for this parameter are: + +- Black +- DarkBlue +- DarkGreen +- DarkCyan +- DarkRed +- DarkMagenta +- DarkYellow +- Gray +- DarkGray +- Blue +- Green +- Cyan +- Red +- Magenta +- Yellow +- White ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False Position: Named @@ -74,13 +107,33 @@ Accept wildcard characters: False ``` ### -ForegroundColor + Specifies the text color. There is no default. +The acceptable values for this parameter are: + +- Black +- DarkBlue +- DarkGreen +- DarkCyan +- DarkRed +- DarkMagenta +- DarkYellow +- Gray +- DarkGray +- Blue +- Green +- Cyan +- Red +- Magenta +- Yellow +- White ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False Position: Named @@ -90,12 +143,15 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -105,27 +161,28 @@ Accept wildcard characters: False ``` ### -Object -Objects to display in the console. + +Objects to display in the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -Separator -String to the output between objects displayed on the console. +Specifies a separator string to insert between objects displayed by the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -135,17 +192,26 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### System.Object + You can pipe objects to be written to the host. + ## OUTPUTS ### None + Write-Host sends the objects to the host. It does not return any objects. However, the host might display the objects that Write-Host sends to it. + ## NOTES ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Management/Add-Content.md b/reference/4.0/Microsoft.PowerShell.Management/Add-Content.md index d160e385fbcb..03cf372f15d7 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Add-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,40 +11,46 @@ title: Add-Content # Add-Content ## SYNOPSIS + Adds content to the specified items, such as adding words to a file. ## SYNTAX ### Path (Default) -``` + +```powershell Add-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` + +```powershell Add-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] ``` ## DESCRIPTION + The Add-Content cmdlet appends content to a specified item or file. You can specify the content by typing the content in the command or by specifying an object that contains the content. ## EXAMPLES -### Example 1 -``` -PS C:\> add-content -path *.txt -exclude help* -value "END" +### Example 1: Add a string to all text files with an exception + +```powershell +PS C:\> Add-Content -Path "*.txt" -Exclude "help*" -Value "END" ``` This command adds "END" to all text files in the current directory, except for those with file names that begin with "help". -### Example 2 -``` -PS C:\> add-content -Path file1.log, file2.log -Value (get-date) -passthru +### Example 2: Add a date to the end of the specified files + +```powershell +PS C:\> Add-Content -Path "file1.log", "file2.log" -Value (Get-Date) -PassThru ``` This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. @@ -52,9 +58,10 @@ The command uses the Get-Date cmdlet to get the date, and it uses the Value para The PassThru parameter passes an object representing the added content through the pipeline. Because there is no other cmdlet to receive the passed object, it is displayed at the command line. -### Example 3 -``` -PS C:\> add-content -path monthly.txt -value (get-content c:\rec1\weekly.txt) +### Example 3: Add the contents of a specified file to another file + +```powershell +PS C:\> Add-Content -Path "monthly.txt" -Value (Get-Content "c:\rec1\weekly.txt") ``` This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. @@ -64,9 +71,10 @@ The parentheses ensure that the Get-Content command is complete before the Add-C You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. In that case, the command would be "add-content -path monthly.txt -value $w". -### Example 4 -``` -PS C:\> add-content -value (get-content test.log) -path C:\tests\test134\logs\test134.log +### Example 4: Create a new directory and file and copy content + +```powershell +PS C:\> Add-Content -Value (Get-Content "test.log") -Path "C:\tests\test134\logs\test134.log" ``` This command creates a new directory and file and copies the content of an existing file to the newly created file. @@ -83,28 +91,77 @@ Add-Content creates directories to complete a path even without the Force parame ## PARAMETERS +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Credential + Specifies a user account that has permission to perform this action. The default is the current user. Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: Current user +Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -Encoding +Specifies the encoding that this cmdlet applies to the content. + +The acceptable values for this parameter are: + +- Unknown +- String +- Unicode +- Byte +- BigEndianUnicode +- UTF8 +- UTF7 +- UTF32 +- Ascii +- Default +- Oem +- BigEndianUTF32 + +```yaml +Type: FileSystemCmdletProviderEncoding +Parameter Sets: (All) +Aliases: +Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Exclude + Omits the specified items. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". @@ -113,7 +170,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -123,15 +180,16 @@ Accept wildcard characters: True ``` ### -Filter + Specifies a filter in the provider's format or language. The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -141,21 +199,22 @@ Accept wildcard characters: True ``` ### -Force -Overrides the read-only attribute, allowing you to add content to a read-only file. +Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Include + Adds only the specified items. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". @@ -164,7 +223,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -174,11 +233,12 @@ Accept wildcard characters: True ``` ### -LiteralPath + Specifies the path to the items that receive the additional content. Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -192,18 +252,38 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -NoNewline +Indicates that this cmdlet does not add a new line/carriage return to the content. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -PassThru + Returns an object representing the added content. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -216,7 +296,7 @@ If you specify multiple paths, use commas to separate the paths. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -225,51 +305,28 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True ``` -### -Value -Specifies the content to be added. -Type a quoted string, such as "This data is for internal use only", or specify an object that contains content, such as the DateTime object that Get-Date generates. - -You cannot specify the contents of a file by typing its path, because the path is just a string, but you can use a Get-Content command to get the content and pass it to the Value parameter. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Stream +Specifies an alternative data stream for content. +If the stream does not exist, this cmdlet creates it. +Wildcard characters are not supported. -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf +Stream is a dynamic parameter that the FileSystem provider adds to **Add-Content**. +This parameter works only in file system drives. -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` +You can use the **Add-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. +However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. +If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +This parameter was introduced in PowerShell 3.0. ```yaml -Type: SwitchParameter +Type: String Parameter Sets: (All) -Aliases: wi +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -293,88 +350,70 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Encoding -Specifies the encoding that this cmdlet applies to the content. +### -Value -The acceptable values for this parameter are: +Specifies the content to be added. +Type a quoted string, such as "This data is for internal use only", or specify an object that contains content, such as the DateTime object that Get-Date generates. -- Unknown -- String -- Unicode -- Byte -- BigEndianUnicode -- UTF8 -- UTF7 -- UTF32 -- Ascii -- Default -- Oem -- BigEndianUTF32 +You cannot specify the contents of a file by typing its path, because the path is just a string, but you can use a Get-Content command to get the content and pass it to the Value parameter. ```yaml -Type: FileSystemCmdletProviderEncoding +Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: -Required: False -Position: Named +Required: True +Position: 2 Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` -### -Stream -Specifies an alternative data stream for content. -If the stream does not exist, this cmdlet creates it. -Wildcard characters are not supported. - -Stream is a dynamic parameter that the FileSystem provider adds to **Add-Content**. -This parameter works only in file system drives. - -You can use the **Add-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. -However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. -If you verify that a downloaded file is safe, use the Unblock-File cmdlet. - -This parameter was introduced in Windows PowerShell 3.0. +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml -Type: String +Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: wi Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe the objects to be added (the Value) to Add-Content. + +You can pipe the objects to be added by Add-Content. ## OUTPUTS ### None or System.String + When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -* When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. The object type determines the string format, but the format might be different than the default display of the object. To control the string format, use the formatting parameters of the sending cmdlet. - You can also refer to Add-Content by its built-in alias, "ac". -For more information, see about_Aliases. +When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. +The object type determines the string format, but the format might be different than the default display of the object. +To control the string format, use the formatting parameters of the sending cmdlet. - The Add-Content cmdlet is designed to work with the data exposed by any provider. +You can also refer to Add-Content by its built-in alias, "ac". For more information, see about_Aliases. + +The Add-Content cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type "Get-PsProvider". For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Content](Clear-Content.md) diff --git a/reference/4.0/Microsoft.PowerShell.Management/Set-Content.md b/reference/4.0/Microsoft.PowerShell.Management/Set-Content.md index 35a50044bc62..16f053567773 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Set-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -18,7 +18,7 @@ Writes or replaces the content in an item with new content. ### Path (Default) -``` +```powershell Set-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] @@ -26,49 +26,50 @@ Set-Content [-Value] [-PassThru] [-Path] [-Filter ### LiteralPath -``` +```powershell Set-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-Encoding ] [-Stream ] [] ``` ## DESCRIPTION + The Set-Content cmdlet is a string-processing cmdlet that writes or replaces the content in the specified item, such as a file. Whereas the Add-Content cmdlet appends content to a file, Set-Content replaces the existing content. You can type the content in the command or send content through the pipeline to Set-Content. ## EXAMPLES -### Example 1 +### Example 1: Replace the contents of multiple files in a folder -``` -PS C:\> set-content -path C:\Test1\test*.txt -value "Hello, World" +```powershell +PS C:\> Set-Content -Path "C:\Test1\test*.txt" -Value "Hello, World" ``` -This command replaces the contents of all files in the Test1 directory that have names beginning with "test" with "Hello, World". +This command replaces the contents of all files in the Test1 folder that have names that start with "test" with "Hello, World". This example shows how to specify content by typing it in the command. -### Example 2 +### Example 2: Send content to a file -``` -PS C:\> get-date | set-content C:\Test1\date.csv +```powershell +PS C:\> Get-Date | Set-Content -Path "C:\Test1\date.csv" ``` This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. The pipeline operator passes the result to Set-Content, which creates the file and writes the content. -If the Test1 directory does not exist, the command fails, but if the file does not exist, the command will create it. +If the Test1 directory does not exist, the command fails, but if the file does not exist, the command creates it. -### Example 3 +### Example 3: Replace text in a file -``` -PS C:\> (get-content Notice.txt) | foreach-object {$_ -replace "Warning", "Caution"} | set-content Notice.txt +```powershell +PS C:\> (Get-Content -Path "Notice.txt") | ForEach-Object {$_ -Replace "Warning", "Caution"} | Set-Content -Path "Notice.txt" ``` This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. -It uses the Get-Content cmdlet to get the content of Notice.txt. +It uses Get-Content cmdlet to get the content of Notice.txt. The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. @@ -103,16 +104,16 @@ The default is the current user. Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: Current user +Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` @@ -123,13 +124,13 @@ Specifies the file encoding. The acceptable values for this parameter are: - **ASCII** Uses the encoding for the ASCII (7-bit) character set. -- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. -- **Byte** Encodes a set of characters into a sequence of bytes. -- **String** Uses the encoding type for a string. -- **Unicode** Encodes in UTF-16 format using the little-endian byte order. +- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. +- **Byte** Encodes a set of characters into a sequence of bytes. +- **String** Uses the encoding type for a string. +- **Unicode** Encodes in UTF-16 format using the little-endian byte order. - **UTF7** Encodes in UTF-7 format. -- **UTF8** Encodes in UTF-8 format. -- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. +- **UTF8** Encodes in UTF-8 format. +- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. The default value is ASCII. @@ -139,7 +140,7 @@ This parameter works only in file system drives. ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem Required: False @@ -159,7 +160,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -170,15 +171,17 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. +Specifies a filter in the format or language of the provider. The value of this parameter qualifies the Path parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +The syntax of the filter, including the use of wildcard characters, depends on the provider. +Filters are more efficient than other parameters, +because the provider applies them when it is retrieving the objects, +instead of having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -189,7 +192,7 @@ Accept wildcard characters: True ### -Force -Allows the cmdlet to set the contents of a file, even if the file is read-only. +Forces the cmdlet to set the contents of a file, even if the file is read-only. Implementation varies from provider to provider. For more information, see about_Providers. Even using the Force parameter, the cmdlet cannot override security restrictions. @@ -197,11 +200,11 @@ Even using the Force parameter, the cmdlet cannot override security restrictions ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -216,7 +219,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -231,7 +234,7 @@ Specifies the path to the item that will receive the content. Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -247,30 +250,30 @@ Accept wildcard characters: False ### -PassThru -Returns an object representing the content. +Returns an object that represents the content. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Path -Specifies the path to the item that will receive the content. -Wildcards are permitted. +Specifies the path of the item that receives the content. +Wildcard characters are permitted. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -280,6 +283,7 @@ Accept wildcard characters: True ``` ### -Stream + Specifies an alternative data stream for content. If the stream does not exist, this cmdlet creates it. Wildcard characters are not supported. @@ -291,12 +295,12 @@ You can use the **Set-Content** cmdlet to change the content of the Zone.Identif However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -309,9 +313,7 @@ Accept wildcard characters: False Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. -For more information, see Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -332,7 +334,7 @@ Specifies the new content for the item. ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -360,22 +362,10 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Parameter | --- | - --Debug | --ErrorAction | --ErrorVariable | --InformationAction | --InformationVariable | --OutBuffer | --OutVariable | --PipelineVariable | --Verbose | --WarningAction | --WarningVariable. | - -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -399,7 +389,7 @@ If you pipe non-string objects to Set-Content, it converts the object to a strin To write objects to files, use Out-File. The Set-Content cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type "Get-PsProvider". +To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Out-File.md b/reference/4.0/Microsoft.PowerShell.Utility/Out-File.md index acfd92ef95ad..dc68b22f760c 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Out-File.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,72 +11,80 @@ title: Out-File # Out-File ## SYNOPSIS + Sends output to a file. ## SYNTAX ### ByPath (Default) -``` + +```powershell Out-File [-FilePath] [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath -``` + +```powershell Out-File -LiteralPath [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION + The Out-File cmdlet sends output to a file. You can use this cmdlet instead of the redirection operator (\>) when you need to use its parameters. ## EXAMPLES -### Example 1 -``` -PS C:\> get-process | out-file -filepath C:\Test1\process.txt +### Example 1: Send output to a file + +```powershell +PS C:\> Get-Process | Out-File -filepath C:\Test1\process.txt ``` This command sends a list of processes on the computer to the Process.txt file. If the file does not exist, Out-File creates it. Because the name of the FilePath parameter is optional, you can omit it and submit the equivalent command "get-process | outfile C:\Test1\process.txt". -### Example 2 -``` -PS C:\> get-process | out-file C:\Test1\process.txt -noclobber +### Example 2: Send output to a file without overwriting + +```powershell +PS C:\> Get-Process | Out-File C:\Test1\process.txt -NoClobber Out-File : File C:\Test1\process.txt already exists and NoClobber was specified. At line:1 char:23 -+ get-process | out-file <<<< process.txt -noclobber ++ Get-Process | Out-File <<<< process.txt -NoClobber ``` This command also sends a list of processes to the Process.txt file, but it uses the NoClobber parameter, which prevents an existing file from being overwritten. The output shows the error message that appears when NoClobber is used with an existing file. -### Example 3 -``` -PS C:\> $a = get-process -PS C:\> out-file -filepath C:\Test1\process.txt -inputobject $a -encoding ASCII -width 50 +### Example 3: Send output to a file in ASCII format + +```powershell +PS C:\> $A = Get-Process +PS C:\> Out-File -FilePath C:\Test1\process.txt -InputObject $A -Encoding ASCII -Width 50 ``` These commands send a list of processes on the computer to the Process.txt file. The text is encoded in ASCII format so that it can be read by search programs like Findstr and Grep. By default, Out-File uses Unicode format. -The first command gets the list of processes and stores them in the $a variable. +The first command gets the list of processes and stores them in the $A variable. The second command uses the Out-File cmdlet to send the list to the Process.txt file. -The command uses the InputObject parameter to specify that the input is in the $a variable. +The command uses the InputObject parameter to specify that the input is in the $A variable. It uses the Encoding parameter to convert the output to ASCII format. It uses the Width parameter to limit each line in the file to 50 characters. Because the lines of output are truncated at 50 characters, the rightmost column in the process table is omitted. -### Example 4 -``` -PS C:\> set-location hklm:\software -PS C:\> get-acl mycompany\mykey | out-file -filepath c:\ps\acl.txt -PS C:\> get-acl mycompany\mykey | out-file -filepath filesystem::acl.txt +### Example 4: Send output from outside a file system drive + +```powershell +PS C:\> Set-Location hklm:\software +PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath c:\ps\acl.txt +PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath filesystem::acl.txt ``` These commands show how to use the Out-File cmdlet when you are not in a FileSystem drive. @@ -87,30 +95,60 @@ The second and third commands have the same effect. They use the Get-Acl cmdlet to get the security descriptor of the MyKey registry subkey (HKLM\Software\MyCompany\MyKey). A pipeline operator passes the result to the Out-File cmdlet, which sends it to the Acl.txt file. -Because Out-File is not supported by the Windows PowerShell Registry provider, you must specify either the file system drive name, such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. +Because Out-File is not supported by the PowerShell Registry provider, you must specify either the file system drive name, +such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. The second and third commands demonstrate these methods. ## PARAMETERS ### -Append + Adds the output to the end of an existing file, instead of replacing the file contents. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf Required: False Position: Named -Default value: Replace +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### -Encoding + Specifies the type of character encoding used in the file. -Valid values are "Unicode", "UTF7", "UTF8", "UTF32", "ASCII", "BigEndianUnicode", "Default", and "OEM". -"Unicode" is the default. +The acceptable values for this parameter are: + +- Unknown +- String +- Unicode +- BigEndianUnicode +- UTF8 +- UTF7 +- UTF32 +- ASCII +- Default +- OEM + +Unicode is the default. "Default" uses the encoding of the system's current ANSI code page. @@ -119,7 +157,8 @@ Valid values are "Unicode", "UTF7", "UTF8", "UTF32", "ASCII", "BigEndianUnicode" ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: unknown, string, unicode, bigendianunicode, utf8, utf7, utf32, ascii, default, oem Required: False Position: 2 @@ -129,12 +168,13 @@ Accept wildcard characters: False ``` ### -FilePath + Specifies the path to the output file. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 1 @@ -144,29 +184,31 @@ Accept wildcard characters: False ``` ### -Force -Allows the cmdlet to overwrite an existing read-only file. + +Indicates that the cmdlet overwrites an existing read-only file. Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject + Specifies the objects to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -175,47 +217,13 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -NoClobber -Will not overwrite (replace the contents) of an existing file. -By default, if a file exists in the specified path, Out-File overwrites the file without warning. -If both Append and NoClobber are used, the output is appended to the existing file. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: NoOverwrite - -Required: False -Position: Named -Default value: Overwrite -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Width -Specifies the number of characters in each line of output. -Any additional characters are truncated, not wrapped. -If you omit this parameter, the width is determined by the characteristics of the host. -The default for the Windows PowerShell console is 80 (characters). - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: 80 -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -LiteralPath + Specifies the path to the output file. -Unlike **FilePath**, the value of the **LiteralPath** parameter is used exactly as it is typed. +Unlike *FilePath*, the value of the *LiteralPath* parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String @@ -229,22 +237,25 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -NoClobber +Indicates that the cmdlet will not overwrite an existing file. +By default, if a file exists in the specified path, **Out-File** overwrites the file without warning. +If both *Append* and *NoClobber* are used, the output is appended to the existing file. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: NoOverwrite Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -260,32 +271,56 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Width +Specifies the number of characters in each line of output. +Any additional characters are truncated, not wrapped. +If you omit this parameter, the width is determined by the characteristics of the host. +The default for the Windows PowerShell console is 80 characters. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Management.Automation.PSObject + You can pipe any object to Out-File. ## OUTPUTS ### None + Out-File does not generate any output. ## NOTES -* The Out cmdlets do not format objects; they just render them and send them to the specified display destination. If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - The Out cmdlets do not have parameters for names or file paths. -To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. +The Out cmdlets do not format objects; they just render them and send them to the specified display destination. +If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. + +The Out cmdlets do not have parameters for names or file paths. +To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a PowerShell command to the cmdlet. You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. For help, see the examples. - Out-File sends data, but it does not emit any output objects. +Out-File sends data, but it does not emit any output objects. If you pipe the output of Out-File to Get-Member, Get-Member reports that no objects have been specified. -* - ## RELATED LINKS [Out-Default](../Microsoft.PowerShell.Core/Out-Default.md) diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Write-Host.md b/reference/4.0/Microsoft.PowerShell.Utility/Write-Host.md index bdca96854132..7d70ae62c8e3 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Write-Host.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Write-Host.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,51 +11,57 @@ title: Write-Host # Write-Host ## SYNOPSIS + Writes customized output to a host. ## SYNTAX -``` +```powershell Write-Host [[-Object] ] [-NoNewline] [-Separator ] [-ForegroundColor ] [-BackgroundColor ] [] ``` ## DESCRIPTION + The Write-Host cmdlet customizes output. You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. The Separator parameter lets you specify a string to use to separate displayed objects. -The particular result depends on the program that is hosting Windows PowerShell. +The particular result depends on the program that is hosting PowerShell. ## EXAMPLES -### Example 1 -``` -PS C:\> write-host "no newline test " -nonewline +### Example 1: Write to the console without adding a new line + +```powershell +PS C:\> Write-Host "no newline test " -NoNewline no newline test PS C:\> ``` This command displays the input to the console, but because of the NoNewline parameter, the output is followed directly by the prompt. -### Example 2 -``` -PS C:\> write-host (2,4,6,8,10,12) -Separator ", +2= " +### Example 2: Write to the console and include a separator + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", +2= " 2, +2= 4, +2= 6, +2= 8, +2= 10, +2= 12 ``` This command displays the even numbers from 2 through 12. The Separator parameter is used to add the string , +2= (comma, space, +, 2, =, space). -### Example 3 -``` -PS C:\> write-host (2,4,6,8,10,12) -Separator ", -> " -foregroundcolor DarkGreen -backgroundcolor white +### Example 3: Write with different text and background colors + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor White ``` This command displays the even numbers from 2 through 12. It uses the ForegroundColor parameter to output dark green text and the BackgroundColor parameter to display a white background. -### Example 4 -``` -PS C:\> write-host "Red on white text." -ForegroundColor red -BackgroundColor white +### Example 4: Write with different text and background colors + +```powershell +PS C:\> Write-Host "Red on white text." -ForegroundColor red -BackgroundColor white Red on white text. ``` @@ -65,13 +71,33 @@ The background is white, as defined by the BackgroundColor parameter. ## PARAMETERS ### -BackgroundColor + Specifies the background color. There is no default. +The acceptable values for this parameter are: + +- Black +- DarkBlue +- DarkGreen +- DarkCyan +- DarkRed +- DarkMagenta +- DarkYellow +- Gray +- DarkGray +- Blue +- Green +- Cyan +- Red +- Magenta +- Yellow +- White ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False Position: Named @@ -81,13 +107,33 @@ Accept wildcard characters: False ``` ### -ForegroundColor + Specifies the text color. There is no default. +The acceptable values for this parameter are: + +- Black +- DarkBlue +- DarkGreen +- DarkCyan +- DarkRed +- DarkMagenta +- DarkYellow +- Gray +- DarkGray +- Blue +- Green +- Cyan +- Red +- Magenta +- Yellow +- White ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False Position: Named @@ -97,12 +143,15 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -112,27 +161,28 @@ Accept wildcard characters: False ``` ### -Object -Objects to display in the console. + +Objects to display in the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -Separator -String to the output between objects displayed on the console. +Specifies a separator string to insert between objects displayed by the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -142,16 +192,22 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object + You can pipe objects to be written to the host. ## OUTPUTS ### None + Write-Host sends the objects to the host. It does not return any objects. However, the host might display the objects that Write-Host sends to it. diff --git a/reference/5.0/Microsoft.PowerShell.Management/Add-Content.md b/reference/5.0/Microsoft.PowerShell.Management/Add-Content.md index f30807bdd31e..7d630aa82c86 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Add-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,78 +11,88 @@ title: Add-Content # Add-Content ## SYNOPSIS + Adds content to the specified items, such as adding words to a file. ## SYNTAX ### Path (Default) -``` + +```powershell Add-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` + +```powershell Add-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] ``` ## DESCRIPTION -The **Add-Content** cmdlet appends content to a specified item or file. + +The Add-Content cmdlet appends content to a specified item or file. You can specify the content by typing the content in the command or by specifying an object that contains the content. ## EXAMPLES ### Example 1: Add a string to all text files with an exception -``` + +```powershell PS C:\> Add-Content -Path "*.txt" -Exclude "help*" -Value "END" ``` -This command adds END to all text files in the current directory, except for those with file names that begin with help. +This command adds "END" to all text files in the current directory, except for those with file names that begin with "help". ### Example 2: Add a date to the end of the specified files -``` + +```powershell PS C:\> Add-Content -Path "file1.log", "file2.log" -Value (Get-Date) -PassThru ``` This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. -The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to **Add-Content**. -The *PassThru* parameter passes an object representing the added content through the pipeline. +The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to Add-Content. +The PassThru parameter passes an object representing the added content through the pipeline. Because there is no other cmdlet to receive the passed object, it is displayed at the command line. ### Example 3: Add the contents of a specified file to another file -``` + +```powershell PS C:\> Add-Content -Path "monthly.txt" -Value (Get-Content "c:\rec1\weekly.txt") ``` This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. -The command uses the **Get-Content** cmdlet to get the contents of the Weekly.txt file, and it uses the *Value* parameter to pass the content of weekly.txt to **Add-Content**. -The parentheses ensure that the **Get-Content** command is complete before the **Add-Content** command begins. +It uses the Get-Content cmdlet to get the contents of the Weekly.txt file, and it uses the Value parameter to pass the content of weekly.txt to Add-Content. +The parentheses ensure that the Get-Content command is complete before the Add-Content command begins. -You can also copy the content of Weekly.txt to a variable, such as $String, and then use the *Value* parameter to pass the variable to **Add-Content**. +You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. +In that case, the command would be "add-content -path monthly.txt -value $w". ### Example 4: Create a new directory and file and copy content -``` + +```powershell PS C:\> Add-Content -Value (Get-Content "test.log") -Path "C:\tests\test134\logs\test134.log" ``` This command creates a new directory and file and copies the content of an existing file to the newly created file. -This command uses the **Add-Content** cmdlet to add the content. -The value of the *Value* parameter is a **Get-Content** command that gets content from an existing file, Test.log. +This command uses the Add-Content cmdlet to add the content. +The value of the Value parameter is a Get-Content command that gets content from an existing file, Test.log. -The value of the *Path* parameter is a path that does not exist when the command runs. +The value of the path parameter is a path that does not exist when the command runs. In this example, only the C:\Tests directories exist. The command creates the remaining directories and the Test134.log file. -The *Force* parameter is not required for this command. -**Add-Content** creates directories to complete a path even without the *Force* parameter. +The Force parameter is not required for this command. +Add-Content creates directories to complete a path even without the Force parameter. ## PARAMETERS ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -98,18 +108,19 @@ Accept wildcard characters: False ``` ### -Credential + Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the Get-Credential cmdlet. +Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -139,7 +150,7 @@ The acceptable values for this parameter are: ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 Required: False @@ -150,39 +161,41 @@ Accept wildcard characters: False ``` ### -Exclude -Specifies, as a string array, items that this cmdlet omits. -The value of this parameter qualifies the *Path* parameter. + +Omits the specified items. +The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Filter + Specifies a filter in the provider's format or language. -The value of this parameter qualifies the *Path* parameter. +The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Force @@ -191,7 +204,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -201,29 +214,31 @@ Accept wildcard characters: False ``` ### -Include -Specifies, as a string array, items that this cmdlet includes. -The value of this parameter qualifies the *Path* parameter. + +Adds only the specified items. +The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -LiteralPath + Specifies the path to the items that receive the additional content. -Unlike the *Path* parameter, the value of the *LiteralPath* parameter is used exactly as it is typed. +Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -240,15 +255,14 @@ Accept wildcard characters: False ### -NoNewline Indicates that this cmdlet does not add a new line/carriage return to the content. -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the **Get-Credential** cmdlet. -If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers installed with Windows PowerShell. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -258,13 +272,14 @@ Accept wildcard characters: False ``` ### -PassThru -Returns an object representing the item with which you are working. + +Returns an object representing the added content. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -281,13 +296,13 @@ If you specify multiple paths, use commas to separate the paths. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -302,12 +317,12 @@ You can use the **Add-Content** cmdlet to change the content of the Zone.Identif However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -336,6 +351,7 @@ Accept wildcard characters: False ``` ### -Value + Specifies the content to be added. Type a quoted string, such as "This data is for internal use only", or specify an object that contains content, such as the DateTime object that Get-Date generates. @@ -344,10 +360,10 @@ You cannot specify the contents of a file by typing its path, because the path i ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False @@ -370,30 +386,33 @@ Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe the objects to be added to this cmdlet. + +You can pipe the objects to be added by Add-Content. ## OUTPUTS ### None or System.String -When you use the *Passthru* parameter, **Add-Content** generates a **System.String** object representing the content. + +When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -* When you pipe an object to **Add-Content**, the object is converted to a string before it is added to the item. The object type determines the string format, but the format might be different than the default display of the object. To control the string format, use the formatting parameters of the sending cmdlet. - You can also refer to **Add-Content** by its built-in alias, "ac". -For more information, see about_Aliases. +When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. +The object type determines the string format, but the format might be different than the default display of the object. +To control the string format, use the formatting parameters of the sending cmdlet. - The **Add-Content** cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. -For more information, see about_Providers. +You can also refer to Add-Content by its built-in alias, "ac". For more information, see about_Aliases. -* +The Add-Content cmdlet is designed to work with the data exposed by any provider. +To list the providers available in your session, type "Get-PsProvider". +For more information, see about_Providers. ## RELATED LINKS @@ -405,3 +424,5 @@ For more information, see about_Providers. [Set-Content](Set-Content.md) +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) + diff --git a/reference/5.0/Microsoft.PowerShell.Management/Set-Content.md b/reference/5.0/Microsoft.PowerShell.Management/Set-Content.md index a6eced7aa434..0b5954ccf2ca 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Set-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -18,7 +18,7 @@ Writes or replaces the content in an item with new content. ### Path (Default) -``` +```powershell Set-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] @@ -26,7 +26,7 @@ Set-Content [-Value] [-PassThru] [-Path] [-Filter ### LiteralPath -``` +```powershell Set-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] @@ -34,15 +34,15 @@ Set-Content [-Value] [-PassThru] -LiteralPath [-Filter Set-Content -Path "C:\Test1\test*.txt" -Value "Hello, World" ``` @@ -51,32 +51,32 @@ This example shows how to specify content by typing it in the command. ### Example 2: Send content to a file -``` +```powershell PS C:\> Get-Date | Set-Content -Path "C:\Test1\date.csv" ``` -This command creates a comma separated variable length (csv) file that contains only the current date and time. +This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. -The pipeline operator passes the result to **Set-Content**, which creates the file and writes the content. +The pipeline operator passes the result to Set-Content, which creates the file and writes the content. If the Test1 directory does not exist, the command fails, but if the file does not exist, the command creates it. ### Example 3: Replace text in a file -``` +```powershell PS C:\> (Get-Content -Path "Notice.txt") | ForEach-Object {$_ -Replace "Warning", "Caution"} | Set-Content -Path "Notice.txt" ``` -This command replaces all instances of Warning with Caution in the Notice.txt file. +This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. -It uses **Get-Content** to get the content of Notice.txt. -The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in **Get-Content**. -The expression uses the $_ symbol to refer to the current item and the *Replace* parameter to specify the text to be replaced. +It uses Get-Content cmdlet to get the content of Notice.txt. +The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. +The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. -Another pipeline operator sends the changed content to **Set-Content** which replaces the text in Notice.txt with the new content. +Another pipeline operator sends the changed content to Set-Content which replaces the text in Notice.txt with the new content. -The parentheses around **Get-Content** make sure that the Get operation is complete before the Set operation starts. -Without them, the command fails because the two functions will be trying to access the same file. +The parentheses around the Get-Content command ensure that the Get operation is complete before the Set operation begins. +Without them, the command will fail because the two functions will be trying to access the same file. ## PARAMETERS @@ -101,15 +101,15 @@ Accept wildcard characters: False Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or enter a **PSCredential** object, such as one generated by the Get-Credential cmdlet. +Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -124,15 +124,15 @@ Specifies the file encoding. The acceptable values for this parameter are: - **ASCII** Uses the encoding for the ASCII (7-bit) character set. -- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. -- **BigEndianUTF32** Encodes in UTF-32 format using the big-endian byte order. +- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. +- **BigEndianUTF32** Encodes in UTF-32 format using the big-endian byte order. - **Default** Encodes using the default value: ASCII. -- **Byte** Encodes a set of characters into a sequence of bytes. -- **String** Uses the encoding type for a string. -- **Unicode** Encodes in UTF-16 format using the little-endian byte order. +- **Byte** Encodes a set of characters into a sequence of bytes. +- **String** Uses the encoding type for a string. +- **Unicode** Encodes in UTF-16 format using the little-endian byte order. - **UTF7** Encodes in UTF-7 format. -- **UTF8** Encodes in UTF-8 format. -- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. +- **UTF8** Encodes in UTF-8 format. +- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. The default value is ASCII. @@ -142,55 +142,54 @@ This parameter works only in file system drives. ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 Required: False Position: Named -Default value: None +Default value: ASCII Accept pipeline input: False Accept wildcard characters: False ``` ### -Exclude -Specifies items that this cmdlet omits. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcard characters are permitted. +Omits the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Filter Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcard characters, -depends on the provider. -Filters are more efficient than other parameters, -because the provider applies them when it is retrieving the objects, -instead of having Windows PowerShell filter the objects after they are retrieved. +The value of this parameter qualifies the Path parameter. +The syntax of the filter, including the use of wildcard characters, depends on the provider. +Filters are more efficient than other parameters, +because the provider applies them when it is retrieving the objects, +instead of having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Force @@ -198,12 +197,12 @@ Accept wildcard characters: False Forces the cmdlet to set the contents of a file, even if the file is read-only. Implementation varies from provider to provider. For more information, see about_Providers. -Even using the *Force* parameter, the cmdlet cannot override security restrictions. +Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -214,30 +213,30 @@ Accept wildcard characters: False ### -Include -Specifies items that this cmdlet changes. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcard characters are permitted. +Changes only the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -LiteralPath Specifies the path of the item that receives the content. -Unlike *Path*, the value of the *LiteralPath* parameter is used exactly as it is typed. -No characters are interpreted as wildcard characters. +Unlike Path, the value of LiteralPath is used exactly as it is typed. +No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -253,12 +252,14 @@ Accept wildcard characters: False ### -NoNewline -Indicates that this cmdlet uses the no newline setting. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -275,7 +276,7 @@ By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -292,13 +293,13 @@ Wildcard characters are permitted. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -307,21 +308,19 @@ Specifies an alternative data stream for content. If the stream does not exist, this cmdlet creates it. Wildcard characters are not supported. -Stream is a dynamic parameter the FileSystem provider adds to **Set-Content**. +Stream is a dynamic parameter that the FileSystem provider adds to **Set-Content**. This parameter works only in file system drives. -You can use the Set-Content cmdlet to change the content of -the Zone.Identifier alternate data stream. -However, we do not recommend this as a way to eliminate security checks -that block files that are downloaded from the Internet. +You can use the **Set-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. +However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -355,10 +354,10 @@ Specifies the new content for the item. ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False @@ -383,49 +382,33 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Parameter | --- | - --Debug | --ErrorAction | --ErrorVariable | --InformationAction | --InformationVariable | --OutBuffer | --OutVariable | --PipelineVariable | --Verbose | --WarningAction | --WarningVariable. | - -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe an object that contains the new value for the item to this cmdlet. +You can pipe an object that contains the new value for the item to Set-Content. ## OUTPUTS -### None, System.String +### None or System.String -This cmdlet generates a System.String object that represents the content, -if you specify the *Passthru* parameter. +When you use the Passthru parameter, Set-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -You can also refer to **Set-Content** by its built-in alias, **sc**. -For more information, see about_Aliases. +You can also refer to Set-Content by its built-in alias, "sc". For more information, see about_Aliases. -**Set-Content** is designed for string processing. -If you pipe non-string objects to this cmdlet, -it converts the object to a string before writing it. +Set-Content is designed for string processing. +If you pipe non-string objects to Set-Content, it converts the object to a string before writing it. To write objects to files, use Out-File. -**Set-Content** cmdlet is designed to work with the data exposed by any -provider. +The Set-Content cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. @@ -437,4 +420,5 @@ For more information, see about_Providers. [Get-Content](Get-Content.md) +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Out-File.md b/reference/5.0/Microsoft.PowerShell.Utility/Out-File.md index aff754882d7e..a437cef73327 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Out-File.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,39 +11,45 @@ title: Out-File # Out-File ## SYNOPSIS + Sends output to a file. ## SYNTAX ### ByPath (Default) -``` + +```powershell Out-File [-FilePath] [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-NoNewline] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath -``` + +```powershell Out-File -LiteralPath [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-NoNewline] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Out-File** cmdlet sends output to a file. + +The Out-File cmdlet sends output to a file. You can use this cmdlet instead of the redirection operator (\>) when you need to use its parameters. ## EXAMPLES ### Example 1: Send output to a file -``` + +```powershell PS C:\> Get-Process | Out-File -filepath C:\Test1\process.txt ``` This command sends a list of processes on the computer to the Process.txt file. -If the file does not exist, **Out-File** creates it. -Because the name of the *FilePath* parameter is optional, you can omit it and submit the equivalent command `Get-Process | Outfile C:\Test1\process.txt`. +If the file does not exist, Out-File creates it. +Because the name of the FilePath parameter is optional, you can omit it and submit the equivalent command "get-process | outfile C:\Test1\process.txt". ### Example 2: Send output to a file without overwriting -``` + +```powershell PS C:\> Get-Process | Out-File C:\Test1\process.txt -NoClobber Out-File : File C:\Test1\process.txt already exists and NoClobber was specified. @@ -51,54 +57,58 @@ At line:1 char:23 + Get-Process | Out-File <<<< process.txt -NoClobber ``` -This command sends a list of processes to the Process.txt file, but it uses the *NoClobber* parameter, which prevents an existing file from being overwritten. -The output shows the error message that appears when *NoClobber* is used with an existing file. +This command also sends a list of processes to the Process.txt file, but it uses the NoClobber parameter, which prevents an existing file from being overwritten. +The output shows the error message that appears when NoClobber is used with an existing file. ### Example 3: Send output to a file in ASCII format -``` + +```powershell PS C:\> $A = Get-Process PS C:\> Out-File -FilePath C:\Test1\process.txt -InputObject $A -Encoding ASCII -Width 50 ``` These commands send a list of processes on the computer to the Process.txt file. The text is encoded in ASCII format so that it can be read by search programs like Findstr and Grep. -By default, **Out-File** uses Unicode format. +By default, Out-File uses Unicode format. The first command gets the list of processes and stores them in the $A variable. -The second command uses the **Out-File** cmdlet to send the list to the Process.txt file. +The second command uses the Out-File cmdlet to send the list to the Process.txt file. -The command uses the *InputObject* parameter to specify that the input is in the $A variable. -It uses the *Encoding* parameter to convert the output to ASCII format. -It uses the *Width* parameter to limit each line in the file to 50 characters. +The command uses the InputObject parameter to specify that the input is in the $A variable. +It uses the Encoding parameter to convert the output to ASCII format. +It uses the Width parameter to limit each line in the file to 50 characters. Because the lines of output are truncated at 50 characters, the rightmost column in the process table is omitted. ### Example 4: Send output from outside a file system drive -``` + +```powershell PS C:\> Set-Location hklm:\software PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath c:\ps\acl.txt PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath filesystem::acl.txt ``` -These commands show how to use the **Out-File** cmdlet when you are not in a FileSystem drive. +These commands show how to use the Out-File cmdlet when you are not in a FileSystem drive. The first command sets the current location to the HKLM:\Software registry key. The second and third commands have the same effect. They use the Get-Acl cmdlet to get the security descriptor of the MyKey registry subkey (HKLM\Software\MyCompany\MyKey). -A pipeline operator passes the result to the **Out-File** cmdlet, which sends it to the Acl.txt file. +A pipeline operator passes the result to the Out-File cmdlet, which sends it to the Acl.txt file. -Because **Out-File** is not supported by the Windows PowerShell Registry provider, you must specify either the file system drive name, such as c:, or the name of the provider followed by two colons, FileSystem::, in the value of the *FilePath* parameter. +Because Out-File is not supported by the PowerShell Registry provider, you must specify either the file system drive name, +such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. The second and third commands demonstrate these methods. ## PARAMETERS ### -Append -Indicates that the cmdlet adds the output to the end of an existing file, instead of replacing the file contents. + +Adds the output to the end of an existing file, instead of replacing the file contents. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -123,6 +133,7 @@ Accept wildcard characters: False ``` ### -Encoding + Specifies the type of character encoding used in the file. The acceptable values for this parameter are: @@ -139,46 +150,48 @@ The acceptable values for this parameter are: Unicode is the default. -Default uses the encoding of the system's current ANSI code page. +"Default" uses the encoding of the system's current ANSI code page. -OEM uses the current original equipment manufacturer code page identifier for the operating system. +"OEM" uses the current original equipment manufacturer code page identifier for the operating system. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unknown, string, unicode, bigendianunicode, utf8, utf7, utf32, ascii, default, oem Required: False -Position: 1 -Default value: None +Position: 2 +Default value: Unicode Accept pipeline input: False Accept wildcard characters: False ``` ### -FilePath + Specifies the path to the output file. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Force + Indicates that the cmdlet overwrites an existing read-only file. -Even using the *Force* parameter, the cmdlet cannot override security restrictions. +Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -188,13 +201,14 @@ Accept wildcard characters: False ``` ### -InputObject + Specifies the objects to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -204,11 +218,12 @@ Accept wildcard characters: False ``` ### -LiteralPath + Specifies the path to the output file. Unlike *FilePath*, the value of the *LiteralPath* parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String @@ -240,7 +255,10 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. +Specifies that the content written to the file does not end with a newline character. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter @@ -255,6 +273,7 @@ Accept wildcard characters: False ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -289,30 +308,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Management.Automation.PSObject -You can pipe any object to this cmdlet. + +You can pipe any object to Out-File. ## OUTPUTS ### None -**Out-File** does not generate any output. + +Out-File does not generate any output. ## NOTES -* The Out cmdlets do not format objects; they just render them and send them to the specified display destination. If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - The Out cmdlets do not have parameters for names or file paths. -To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. -You can also store data in a variable and use the *InputObject* parameter to pass the data to the cmdlet. -For help, see the examples. +The Out cmdlets do not format objects; they just render them and send them to the specified display destination. +If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - **Out-File** sends data, but it does not emit any output objects. -If you pipe the output of **Out-File** to Get-Member, **Get-Member** reports that no objects have been specified. +The Out cmdlets do not have parameters for names or file paths. +To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a PowerShell command to the cmdlet. +You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. +For help, see the examples. -* +Out-File sends data, but it does not emit any output objects. +If you pipe the output of Out-File to Get-Member, Get-Member reports that no objects have been specified. ## RELATED LINKS diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Write-Host.md b/reference/5.0/Microsoft.PowerShell.Utility/Write-Host.md index 50bc061f9527..f48605ea4f86 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Write-Host.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Write-Host.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,60 +11,67 @@ title: Write-Host # Write-Host ## SYNOPSIS + Writes customized output to a host. ## SYNTAX -``` +```powershell Write-Host [[-Object] ] [-NoNewline] [-Separator ] [-ForegroundColor ] [-BackgroundColor ] [] ``` ## DESCRIPTION -The **Write-Host** cmdlet customizes output. -You can specify the color of text by using the *ForegroundColor* parameter, and you can specify the background color by using the *BackgroundColor* parameter. -The *Separator* parameter lets you specify a string to use to separate displayed objects. -The particular result depends on the program that is hosting Windows PowerShell. + +The Write-Host cmdlet customizes output. +You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. +The Separator parameter lets you specify a string to use to separate displayed objects. +The particular result depends on the program that is hosting PowerShell. ## EXAMPLES ### Example 1: Write to the console without adding a new line -``` + +```powershell PS C:\> Write-Host "no newline test " -NoNewline no newline test PS C:\> ``` -This command displays the input to the console, but because of the *NoNewline* parameter, the output is followed directly by the prompt. +This command displays the input to the console, but because of the NoNewline parameter, the output is followed directly by the prompt. ### Example 2: Write to the console and include a separator -``` + +```powershell PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", +2= " 2, +2= 4, +2= 6, +2= 8, +2= 10, +2= 12 ``` This command displays the even numbers from 2 through 12. -The *Separator* parameter is used to add the string ", +2= (comma, space, +, 2, =, space)". +The Separator parameter is used to add the string , +2= (comma, space, +, 2, =, space). ### Example 3: Write with different text and background colors -``` -PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor white + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor White ``` This command displays the even numbers from 2 through 12. -It uses the *ForegroundColor* parameter to output dark green text and the *BackgroundColor* parameter to display a white background. +It uses the ForegroundColor parameter to output dark green text and the BackgroundColor parameter to display a white background. ### Example 4: Write with different text and background colors -``` + +```powershell PS C:\> Write-Host "Red on white text." -ForegroundColor red -BackgroundColor white Red on white text. ``` -This command displays the string "Red on white text." The text is red, as defined by the *ForegroundColor* parameter. -The background is white, as defined by the *BackgroundColor* parameter. +This command displays the string "Red on white text." The text is red, as defined by the ForegroundColor parameter. +The background is white, as defined by the BackgroundColor parameter. ## PARAMETERS ### -BackgroundColor + Specifies the background color. There is no default. The acceptable values for this parameter are: @@ -89,7 +96,7 @@ The acceptable values for this parameter are: ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False @@ -100,6 +107,7 @@ Accept wildcard characters: False ``` ### -ForegroundColor + Specifies the text color. There is no default. The acceptable values for this parameter are: @@ -124,7 +132,7 @@ The acceptable values for this parameter are: ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False @@ -135,12 +143,15 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -150,12 +161,13 @@ Accept wildcard characters: False ``` ### -Object -Specifies objects to display in the console. + +Objects to display in the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -165,12 +177,12 @@ Accept wildcard characters: False ``` ### -Separator -Specifies a separator string to the output between objects displayed on the console. +Specifies a separator string to insert between objects displayed by the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -180,19 +192,25 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object + You can pipe objects to be written to the host. ## OUTPUTS ### None -**Write-Host** sends the objects to the host. + +Write-Host sends the objects to the host. It does not return any objects. -However, the host might display the objects that **Write-Host** sends to it. +However, the host might display the objects that Write-Host sends to it. ## NOTES diff --git a/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md index f30807bdd31e..7d630aa82c86 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Add-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,78 +11,88 @@ title: Add-Content # Add-Content ## SYNOPSIS + Adds content to the specified items, such as adding words to a file. ## SYNTAX ### Path (Default) -``` + +```powershell Add-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` + +```powershell Add-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] ``` ## DESCRIPTION -The **Add-Content** cmdlet appends content to a specified item or file. + +The Add-Content cmdlet appends content to a specified item or file. You can specify the content by typing the content in the command or by specifying an object that contains the content. ## EXAMPLES ### Example 1: Add a string to all text files with an exception -``` + +```powershell PS C:\> Add-Content -Path "*.txt" -Exclude "help*" -Value "END" ``` -This command adds END to all text files in the current directory, except for those with file names that begin with help. +This command adds "END" to all text files in the current directory, except for those with file names that begin with "help". ### Example 2: Add a date to the end of the specified files -``` + +```powershell PS C:\> Add-Content -Path "file1.log", "file2.log" -Value (Get-Date) -PassThru ``` This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. -The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to **Add-Content**. -The *PassThru* parameter passes an object representing the added content through the pipeline. +The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to Add-Content. +The PassThru parameter passes an object representing the added content through the pipeline. Because there is no other cmdlet to receive the passed object, it is displayed at the command line. ### Example 3: Add the contents of a specified file to another file -``` + +```powershell PS C:\> Add-Content -Path "monthly.txt" -Value (Get-Content "c:\rec1\weekly.txt") ``` This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. -The command uses the **Get-Content** cmdlet to get the contents of the Weekly.txt file, and it uses the *Value* parameter to pass the content of weekly.txt to **Add-Content**. -The parentheses ensure that the **Get-Content** command is complete before the **Add-Content** command begins. +It uses the Get-Content cmdlet to get the contents of the Weekly.txt file, and it uses the Value parameter to pass the content of weekly.txt to Add-Content. +The parentheses ensure that the Get-Content command is complete before the Add-Content command begins. -You can also copy the content of Weekly.txt to a variable, such as $String, and then use the *Value* parameter to pass the variable to **Add-Content**. +You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. +In that case, the command would be "add-content -path monthly.txt -value $w". ### Example 4: Create a new directory and file and copy content -``` + +```powershell PS C:\> Add-Content -Value (Get-Content "test.log") -Path "C:\tests\test134\logs\test134.log" ``` This command creates a new directory and file and copies the content of an existing file to the newly created file. -This command uses the **Add-Content** cmdlet to add the content. -The value of the *Value* parameter is a **Get-Content** command that gets content from an existing file, Test.log. +This command uses the Add-Content cmdlet to add the content. +The value of the Value parameter is a Get-Content command that gets content from an existing file, Test.log. -The value of the *Path* parameter is a path that does not exist when the command runs. +The value of the path parameter is a path that does not exist when the command runs. In this example, only the C:\Tests directories exist. The command creates the remaining directories and the Test134.log file. -The *Force* parameter is not required for this command. -**Add-Content** creates directories to complete a path even without the *Force* parameter. +The Force parameter is not required for this command. +Add-Content creates directories to complete a path even without the Force parameter. ## PARAMETERS ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -98,18 +108,19 @@ Accept wildcard characters: False ``` ### -Credential + Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the Get-Credential cmdlet. +Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -139,7 +150,7 @@ The acceptable values for this parameter are: ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 Required: False @@ -150,39 +161,41 @@ Accept wildcard characters: False ``` ### -Exclude -Specifies, as a string array, items that this cmdlet omits. -The value of this parameter qualifies the *Path* parameter. + +Omits the specified items. +The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Filter + Specifies a filter in the provider's format or language. -The value of this parameter qualifies the *Path* parameter. +The value of this parameter qualifies the Path parameter. The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Force @@ -191,7 +204,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -201,29 +214,31 @@ Accept wildcard characters: False ``` ### -Include -Specifies, as a string array, items that this cmdlet includes. -The value of this parameter qualifies the *Path* parameter. + +Adds only the specified items. +The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as "*.txt". Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -LiteralPath + Specifies the path to the items that receive the additional content. -Unlike the *Path* parameter, the value of the *LiteralPath* parameter is used exactly as it is typed. +Unlike Path, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -240,15 +255,14 @@ Accept wildcard characters: False ### -NoNewline Indicates that this cmdlet does not add a new line/carriage return to the content. -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the **Get-Credential** cmdlet. -If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers installed with Windows PowerShell. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -258,13 +272,14 @@ Accept wildcard characters: False ``` ### -PassThru -Returns an object representing the item with which you are working. + +Returns an object representing the added content. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -281,13 +296,13 @@ If you specify multiple paths, use commas to separate the paths. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -302,12 +317,12 @@ You can use the **Add-Content** cmdlet to change the content of the Zone.Identif However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -336,6 +351,7 @@ Accept wildcard characters: False ``` ### -Value + Specifies the content to be added. Type a quoted string, such as "This data is for internal use only", or specify an object that contains content, such as the DateTime object that Get-Date generates. @@ -344,10 +360,10 @@ You cannot specify the contents of a file by typing its path, because the path i ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False @@ -370,30 +386,33 @@ Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe the objects to be added to this cmdlet. + +You can pipe the objects to be added by Add-Content. ## OUTPUTS ### None or System.String -When you use the *Passthru* parameter, **Add-Content** generates a **System.String** object representing the content. + +When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -* When you pipe an object to **Add-Content**, the object is converted to a string before it is added to the item. The object type determines the string format, but the format might be different than the default display of the object. To control the string format, use the formatting parameters of the sending cmdlet. - You can also refer to **Add-Content** by its built-in alias, "ac". -For more information, see about_Aliases. +When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. +The object type determines the string format, but the format might be different than the default display of the object. +To control the string format, use the formatting parameters of the sending cmdlet. - The **Add-Content** cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. -For more information, see about_Providers. +You can also refer to Add-Content by its built-in alias, "ac". For more information, see about_Aliases. -* +The Add-Content cmdlet is designed to work with the data exposed by any provider. +To list the providers available in your session, type "Get-PsProvider". +For more information, see about_Providers. ## RELATED LINKS @@ -405,3 +424,5 @@ For more information, see about_Providers. [Set-Content](Set-Content.md) +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) + diff --git a/reference/5.1/Microsoft.PowerShell.Management/Set-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Set-Content.md index a6eced7aa434..0b5954ccf2ca 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Set-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -18,7 +18,7 @@ Writes or replaces the content in an item with new content. ### Path (Default) -``` +```powershell Set-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] @@ -26,7 +26,7 @@ Set-Content [-Value] [-PassThru] [-Path] [-Filter ### LiteralPath -``` +```powershell Set-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] @@ -34,15 +34,15 @@ Set-Content [-Value] [-PassThru] -LiteralPath [-Filter Set-Content -Path "C:\Test1\test*.txt" -Value "Hello, World" ``` @@ -51,32 +51,32 @@ This example shows how to specify content by typing it in the command. ### Example 2: Send content to a file -``` +```powershell PS C:\> Get-Date | Set-Content -Path "C:\Test1\date.csv" ``` -This command creates a comma separated variable length (csv) file that contains only the current date and time. +This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. -The pipeline operator passes the result to **Set-Content**, which creates the file and writes the content. +The pipeline operator passes the result to Set-Content, which creates the file and writes the content. If the Test1 directory does not exist, the command fails, but if the file does not exist, the command creates it. ### Example 3: Replace text in a file -``` +```powershell PS C:\> (Get-Content -Path "Notice.txt") | ForEach-Object {$_ -Replace "Warning", "Caution"} | Set-Content -Path "Notice.txt" ``` -This command replaces all instances of Warning with Caution in the Notice.txt file. +This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. -It uses **Get-Content** to get the content of Notice.txt. -The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in **Get-Content**. -The expression uses the $_ symbol to refer to the current item and the *Replace* parameter to specify the text to be replaced. +It uses Get-Content cmdlet to get the content of Notice.txt. +The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. +The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. -Another pipeline operator sends the changed content to **Set-Content** which replaces the text in Notice.txt with the new content. +Another pipeline operator sends the changed content to Set-Content which replaces the text in Notice.txt with the new content. -The parentheses around **Get-Content** make sure that the Get operation is complete before the Set operation starts. -Without them, the command fails because the two functions will be trying to access the same file. +The parentheses around the Get-Content command ensure that the Get operation is complete before the Set operation begins. +Without them, the command will fail because the two functions will be trying to access the same file. ## PARAMETERS @@ -101,15 +101,15 @@ Accept wildcard characters: False Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or enter a **PSCredential** object, such as one generated by the Get-Credential cmdlet. +Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -124,15 +124,15 @@ Specifies the file encoding. The acceptable values for this parameter are: - **ASCII** Uses the encoding for the ASCII (7-bit) character set. -- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. -- **BigEndianUTF32** Encodes in UTF-32 format using the big-endian byte order. +- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. +- **BigEndianUTF32** Encodes in UTF-32 format using the big-endian byte order. - **Default** Encodes using the default value: ASCII. -- **Byte** Encodes a set of characters into a sequence of bytes. -- **String** Uses the encoding type for a string. -- **Unicode** Encodes in UTF-16 format using the little-endian byte order. +- **Byte** Encodes a set of characters into a sequence of bytes. +- **String** Uses the encoding type for a string. +- **Unicode** Encodes in UTF-16 format using the little-endian byte order. - **UTF7** Encodes in UTF-7 format. -- **UTF8** Encodes in UTF-8 format. -- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. +- **UTF8** Encodes in UTF-8 format. +- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. The default value is ASCII. @@ -142,55 +142,54 @@ This parameter works only in file system drives. ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 Required: False Position: Named -Default value: None +Default value: ASCII Accept pipeline input: False Accept wildcard characters: False ``` ### -Exclude -Specifies items that this cmdlet omits. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcard characters are permitted. +Omits the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Filter Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcard characters, -depends on the provider. -Filters are more efficient than other parameters, -because the provider applies them when it is retrieving the objects, -instead of having Windows PowerShell filter the objects after they are retrieved. +The value of this parameter qualifies the Path parameter. +The syntax of the filter, including the use of wildcard characters, depends on the provider. +Filters are more efficient than other parameters, +because the provider applies them when it is retrieving the objects, +instead of having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Force @@ -198,12 +197,12 @@ Accept wildcard characters: False Forces the cmdlet to set the contents of a file, even if the file is read-only. Implementation varies from provider to provider. For more information, see about_Providers. -Even using the *Force* parameter, the cmdlet cannot override security restrictions. +Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -214,30 +213,30 @@ Accept wildcard characters: False ### -Include -Specifies items that this cmdlet changes. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcard characters are permitted. +Changes only the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -LiteralPath Specifies the path of the item that receives the content. -Unlike *Path*, the value of the *LiteralPath* parameter is used exactly as it is typed. -No characters are interpreted as wildcard characters. +Unlike Path, the value of LiteralPath is used exactly as it is typed. +No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -253,12 +252,14 @@ Accept wildcard characters: False ### -NoNewline -Indicates that this cmdlet uses the no newline setting. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -275,7 +276,7 @@ By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -292,13 +293,13 @@ Wildcard characters are permitted. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -307,21 +308,19 @@ Specifies an alternative data stream for content. If the stream does not exist, this cmdlet creates it. Wildcard characters are not supported. -Stream is a dynamic parameter the FileSystem provider adds to **Set-Content**. +Stream is a dynamic parameter that the FileSystem provider adds to **Set-Content**. This parameter works only in file system drives. -You can use the Set-Content cmdlet to change the content of -the Zone.Identifier alternate data stream. -However, we do not recommend this as a way to eliminate security checks -that block files that are downloaded from the Internet. +You can use the **Set-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. +However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -355,10 +354,10 @@ Specifies the new content for the item. ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False @@ -383,49 +382,33 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Parameter | --- | - --Debug | --ErrorAction | --ErrorVariable | --InformationAction | --InformationVariable | --OutBuffer | --OutVariable | --PipelineVariable | --Verbose | --WarningAction | --WarningVariable. | - -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe an object that contains the new value for the item to this cmdlet. +You can pipe an object that contains the new value for the item to Set-Content. ## OUTPUTS -### None, System.String +### None or System.String -This cmdlet generates a System.String object that represents the content, -if you specify the *Passthru* parameter. +When you use the Passthru parameter, Set-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -You can also refer to **Set-Content** by its built-in alias, **sc**. -For more information, see about_Aliases. +You can also refer to Set-Content by its built-in alias, "sc". For more information, see about_Aliases. -**Set-Content** is designed for string processing. -If you pipe non-string objects to this cmdlet, -it converts the object to a string before writing it. +Set-Content is designed for string processing. +If you pipe non-string objects to Set-Content, it converts the object to a string before writing it. To write objects to files, use Out-File. -**Set-Content** cmdlet is designed to work with the data exposed by any -provider. +The Set-Content cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. @@ -437,4 +420,5 @@ For more information, see about_Providers. [Get-Content](Get-Content.md) +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md b/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md index 9dbfb752cac4..a437cef73327 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Out-File.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,39 +11,45 @@ title: Out-File # Out-File ## SYNOPSIS + Sends output to a file. ## SYNTAX ### ByPath (Default) -``` + +```powershell Out-File [-FilePath] [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-NoNewline] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath -``` + +```powershell Out-File -LiteralPath [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-NoNewline] [-InputObject ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Out-File** cmdlet sends output to a file. + +The Out-File cmdlet sends output to a file. You can use this cmdlet instead of the redirection operator (\>) when you need to use its parameters. ## EXAMPLES ### Example 1: Send output to a file -``` + +```powershell PS C:\> Get-Process | Out-File -filepath C:\Test1\process.txt ``` This command sends a list of processes on the computer to the Process.txt file. -If the file does not exist, **Out-File** creates it. -Because the name of the *FilePath* parameter is optional, you can omit it and submit the equivalent command `Get-Process | Outfile C:\Test1\process.txt`. +If the file does not exist, Out-File creates it. +Because the name of the FilePath parameter is optional, you can omit it and submit the equivalent command "get-process | outfile C:\Test1\process.txt". ### Example 2: Send output to a file without overwriting -``` + +```powershell PS C:\> Get-Process | Out-File C:\Test1\process.txt -NoClobber Out-File : File C:\Test1\process.txt already exists and NoClobber was specified. @@ -51,54 +57,58 @@ At line:1 char:23 + Get-Process | Out-File <<<< process.txt -NoClobber ``` -This command sends a list of processes to the Process.txt file, but it uses the *NoClobber* parameter, which prevents an existing file from being overwritten. -The output shows the error message that appears when *NoClobber* is used with an existing file. +This command also sends a list of processes to the Process.txt file, but it uses the NoClobber parameter, which prevents an existing file from being overwritten. +The output shows the error message that appears when NoClobber is used with an existing file. ### Example 3: Send output to a file in ASCII format -``` + +```powershell PS C:\> $A = Get-Process PS C:\> Out-File -FilePath C:\Test1\process.txt -InputObject $A -Encoding ASCII -Width 50 ``` These commands send a list of processes on the computer to the Process.txt file. The text is encoded in ASCII format so that it can be read by search programs like Findstr and Grep. -By default, **Out-File** uses Unicode format. +By default, Out-File uses Unicode format. The first command gets the list of processes and stores them in the $A variable. -The second command uses the **Out-File** cmdlet to send the list to the Process.txt file. +The second command uses the Out-File cmdlet to send the list to the Process.txt file. -The command uses the *InputObject* parameter to specify that the input is in the $A variable. -It uses the *Encoding* parameter to convert the output to ASCII format. -It uses the *Width* parameter to limit each line in the file to 50 characters. +The command uses the InputObject parameter to specify that the input is in the $A variable. +It uses the Encoding parameter to convert the output to ASCII format. +It uses the Width parameter to limit each line in the file to 50 characters. Because the lines of output are truncated at 50 characters, the rightmost column in the process table is omitted. ### Example 4: Send output from outside a file system drive -``` + +```powershell PS C:\> Set-Location hklm:\software PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath c:\ps\acl.txt PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath filesystem::acl.txt ``` -These commands show how to use the **Out-File** cmdlet when you are not in a FileSystem drive. +These commands show how to use the Out-File cmdlet when you are not in a FileSystem drive. The first command sets the current location to the HKLM:\Software registry key. The second and third commands have the same effect. They use the Get-Acl cmdlet to get the security descriptor of the MyKey registry subkey (HKLM\Software\MyCompany\MyKey). -A pipeline operator passes the result to the **Out-File** cmdlet, which sends it to the Acl.txt file. +A pipeline operator passes the result to the Out-File cmdlet, which sends it to the Acl.txt file. -Because **Out-File** is not supported by the Windows PowerShell Registry provider, you must specify either the file system drive name, such as c:, or the name of the provider followed by two colons, FileSystem::, in the value of the *FilePath* parameter. +Because Out-File is not supported by the PowerShell Registry provider, you must specify either the file system drive name, +such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. The second and third commands demonstrate these methods. ## PARAMETERS ### -Append -Indicates that the cmdlet adds the output to the end of an existing file, instead of replacing the file contents. + +Adds the output to the end of an existing file, instead of replacing the file contents. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -123,6 +133,7 @@ Accept wildcard characters: False ``` ### -Encoding + Specifies the type of character encoding used in the file. The acceptable values for this parameter are: @@ -139,46 +150,48 @@ The acceptable values for this parameter are: Unicode is the default. -Default uses the encoding of the system's current ANSI code page. +"Default" uses the encoding of the system's current ANSI code page. -OEM uses the current original equipment manufacturer code page identifier for the operating system. +"OEM" uses the current original equipment manufacturer code page identifier for the operating system. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unknown, string, unicode, bigendianunicode, utf8, utf7, utf32, ascii, default, oem Required: False -Position: 1 -Default value: None +Position: 2 +Default value: Unicode Accept pipeline input: False Accept wildcard characters: False ``` ### -FilePath + Specifies the path to the output file. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Force + Indicates that the cmdlet overwrites an existing read-only file. -Even using the *Force* parameter, the cmdlet cannot override security restrictions. +Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -188,13 +201,14 @@ Accept wildcard characters: False ``` ### -InputObject + Specifies the objects to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -204,11 +218,12 @@ Accept wildcard characters: False ``` ### -LiteralPath + Specifies the path to the output file. Unlike *FilePath*, the value of the *LiteralPath* parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String @@ -240,7 +255,10 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. +Specifies that the content written to the file does not end with a newline character. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter @@ -255,6 +273,7 @@ Accept wildcard characters: False ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -289,35 +308,47 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Management.Automation.PSObject -You can pipe any object to this cmdlet. + +You can pipe any object to Out-File. ## OUTPUTS ### None -**Out-File** does not generate any output. + +Out-File does not generate any output. ## NOTES -* The Out cmdlets do not format objects; they just render them and send them to the specified display destination. If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - The Out cmdlets do not have parameters for names or file paths. -To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. -You can also store data in a variable and use the *InputObject* parameter to pass the data to the cmdlet. -For help, see the examples. +The Out cmdlets do not format objects; they just render them and send them to the specified display destination. +If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - **Out-File** sends data, but it does not emit any output objects. -If you pipe the output of **Out-File** to Get-Member, **Get-Member** reports that no objects have been specified. +The Out cmdlets do not have parameters for names or file paths. +To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a PowerShell command to the cmdlet. +You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. +For help, see the examples. -* +Out-File sends data, but it does not emit any output objects. +If you pipe the output of Out-File to Get-Member, Get-Member reports that no objects have been specified. ## RELATED LINKS +[Out-Default](../Microsoft.PowerShell.Core/Out-Default.md) + [Out-GridView](Out-GridView.md) +[Out-Host](../Microsoft.PowerShell.Core/Out-Host.md) + +[Out-Null](../Microsoft.PowerShell.Core/Out-Null.md) + [Out-Printer](Out-Printer.md) [Out-String](Out-String.md) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Write-Host.md b/reference/5.1/Microsoft.PowerShell.Utility/Write-Host.md index c0dd5cbb4858..f48605ea4f86 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Write-Host.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Write-Host.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,60 +11,67 @@ title: Write-Host # Write-Host ## SYNOPSIS + Writes customized output to a host. ## SYNTAX -``` +```powershell Write-Host [[-Object] ] [-NoNewline] [-Separator ] [-ForegroundColor ] [-BackgroundColor ] [] ``` ## DESCRIPTION -The **Write-Host** cmdlet customizes output. -You can specify the color of text by using the *ForegroundColor* parameter, and you can specify the background color by using the *BackgroundColor* parameter. -The *Separator* parameter lets you specify a string to use to separate displayed objects. -The particular result depends on the program that is hosting Windows PowerShell. + +The Write-Host cmdlet customizes output. +You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. +The Separator parameter lets you specify a string to use to separate displayed objects. +The particular result depends on the program that is hosting PowerShell. ## EXAMPLES ### Example 1: Write to the console without adding a new line -``` + +```powershell PS C:\> Write-Host "no newline test " -NoNewline no newline test PS C:\> ``` -This command displays the input to the console, but because of the *NoNewline* parameter, the output is followed directly by the prompt. +This command displays the input to the console, but because of the NoNewline parameter, the output is followed directly by the prompt. ### Example 2: Write to the console and include a separator -``` + +```powershell PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", +2= " 2, +2= 4, +2= 6, +2= 8, +2= 10, +2= 12 ``` This command displays the even numbers from 2 through 12. -The *Separator* parameter is used to add the string ", +2= (comma, space, +, 2, =, space)". +The Separator parameter is used to add the string , +2= (comma, space, +, 2, =, space). ### Example 3: Write with different text and background colors -``` -PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor white + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor White ``` This command displays the even numbers from 2 through 12. -It uses the *ForegroundColor* parameter to output dark green text and the *BackgroundColor* parameter to display a white background. +It uses the ForegroundColor parameter to output dark green text and the BackgroundColor parameter to display a white background. ### Example 4: Write with different text and background colors -``` + +```powershell PS C:\> Write-Host "Red on white text." -ForegroundColor red -BackgroundColor white Red on white text. ``` -This command displays the string "Red on white text." The text is red, as defined by the *ForegroundColor* parameter. -The background is white, as defined by the *BackgroundColor* parameter. +This command displays the string "Red on white text." The text is red, as defined by the ForegroundColor parameter. +The background is white, as defined by the BackgroundColor parameter. ## PARAMETERS ### -BackgroundColor + Specifies the background color. There is no default. The acceptable values for this parameter are: @@ -89,7 +96,7 @@ The acceptable values for this parameter are: ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False @@ -100,6 +107,7 @@ Accept wildcard characters: False ``` ### -ForegroundColor + Specifies the text color. There is no default. The acceptable values for this parameter are: @@ -124,7 +132,7 @@ The acceptable values for this parameter are: ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False @@ -135,12 +143,15 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -150,12 +161,13 @@ Accept wildcard characters: False ``` ### -Object -Specifies objects to display in the console. + +Objects to display in the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -165,12 +177,12 @@ Accept wildcard characters: False ``` ### -Separator -Specifies a separator string to the output between objects displayed on the console. +Specifies a separator string to insert between objects displayed by the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -180,19 +192,25 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object + You can pipe objects to be written to the host. ## OUTPUTS ### None -**Write-Host** sends the objects to the host. + +Write-Host sends the objects to the host. It does not return any objects. -However, the host might display the objects that **Write-Host** sends to it. +However, the host might display the objects that Write-Host sends to it. ## NOTES @@ -200,6 +218,8 @@ However, the host might display the objects that **Write-Host** sends to it. [Clear-Host](../Microsoft.PowerShell.Core/Functions/Clear-Host.md) +[Out-Host](../Microsoft.PowerShell.Core/Out-Host.md) + [Write-Debug](Write-Debug.md) [Write-Error](Write-Error.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Add-Content.md b/reference/6/Microsoft.PowerShell.Management/Add-Content.md index 3ff5ad6b5714..eb1328014646 100644 --- a/reference/6/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Add-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,12 +11,14 @@ title: Add-Content # Add-Content ## SYNOPSIS + Adds content to the specified items, such as adding words to a file. ## SYNTAX ### Path (Default) -``` + +```powershell Add-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] @@ -24,7 +26,8 @@ Add-Content [-Value] [-PassThru] [-Path] [-Filter ``` ### LiteralPath -``` + +```powershell Add-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] @@ -32,58 +35,102 @@ Add-Content [-Value] [-PassThru] -LiteralPath [-Filter Add-Content -Path "*.txt" -Exclude "help*" -Value "END" ``` -This command adds END to all text files in the current directory, except for those with file names that begin with help. +This command adds "END" to all text files in the current directory, except for those with file names that begin with "help". ### Example 2: Add a date to the end of the specified files -``` + +```powershell PS C:\> Add-Content -Path "file1.log", "file2.log" -Value (Get-Date) -PassThru ``` This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. -The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to **Add-Content**. -The *PassThru* parameter passes an object representing the added content through the pipeline. +The command uses the Get-Date cmdlet to get the date, and it uses the Value parameter to pass the date to Add-Content. +The PassThru parameter passes an object representing the added content through the pipeline. Because there is no other cmdlet to receive the passed object, it is displayed at the command line. ### Example 3: Add the contents of a specified file to another file -``` + +```powershell PS C:\> Add-Content -Path "monthly.txt" -Value (Get-Content "c:\rec1\weekly.txt") ``` This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. -The command uses the **Get-Content** cmdlet to get the contents of the Weekly.txt file, and it uses the *Value* parameter to pass the content of weekly.txt to **Add-Content**. -The parentheses ensure that the **Get-Content** command is complete before the **Add-Content** command begins. +It uses the Get-Content cmdlet to get the contents of the Weekly.txt file, and it uses the Value parameter to pass the content of weekly.txt to Add-Content. +The parentheses ensure that the Get-Content command is complete before the Add-Content command begins. -You can also copy the content of Weekly.txt to a variable, such as $String, and then use the *Value* parameter to pass the variable to **Add-Content**. +You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. +In that case, the command would be "add-content -path monthly.txt -value $w". ### Example 4: Create a new directory and file and copy content -``` + +```powershell PS C:\> Add-Content -Value (Get-Content "test.log") -Path "C:\tests\test134\logs\test134.log" ``` This command creates a new directory and file and copies the content of an existing file to the newly created file. -This command uses the **Add-Content** cmdlet to add the content. -The value of the *Value* parameter is a **Get-Content** command that gets content from an existing file, Test.log. +This command uses the Add-Content cmdlet to add the content. +The value of the Value parameter is a Get-Content command that gets content from an existing file, Test.log. -The value of the *Path* parameter is a path that does not exist when the command runs. +The value of the path parameter is a path that does not exist when the command runs. In this example, only the C:\Tests directories exist. The command creates the remaining directories and the Test134.log file. -The *Force* parameter is not required for this command. -**Add-Content** creates directories to complete a path even without the *Force* parameter. +The Force parameter is not required for this command. +Add-Content creates directories to complete a path even without the Force parameter. ## PARAMETERS +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Credential + +Specifies a user account that has permission to perform this action. +The default is the current user. + +Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. +If you type a user name, you will be prompted for a password. + +This parameter is not supported by any providers installed with PowerShell. + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Encoding Specifies the encoding that this cmdlet applies to the content. @@ -102,15 +149,10 @@ The acceptable values for this parameter are: - Oem - BigEndianUTF32 -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the **Get-Credential** cmdlet. -If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers installed with Windows PowerShell. - ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 Required: False @@ -120,120 +162,109 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Force -Forces the command to run without asking for user confirmation. +### -Exclude + +Omits the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml -Type: SwitchParameter +Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` -### -Stream -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the **Get-Credential** cmdlet. -If you type a user name, you will be prompted for a password. +### -Filter -This parameter is not supported by any providers installed with Windows PowerShell. +Specifies a filter in the provider's format or language. +The value of this parameter qualifies the Path parameter. +The syntax of the filter, including the use of wildcards, depends on the provider. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Force +Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` +### -Include -### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see +Adds only the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml -Type: SwitchParameter +Type: String[] Parameter Sets: (All) -Aliases: usetx +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` -### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the Get-Credential cmdlet. -If you type a user name, you will be prompted for a password. +### -LiteralPath -This parameter is not supported by any providers installed with Windows PowerShell. +Specifies the path to the items that receive the additional content. +Unlike Path, the value of LiteralPath is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml -Type: PSCredential -Parameter Sets: (All) -Aliases: +Type: String[] +Parameter Sets: LiteralPath +Aliases: PSPath -Required: False +Required: True Position: Named Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Exclude -Specifies, as a string array, items that this cmdlet omits. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -NoNewline +Indicates that this cmdlet does not add a new line/carriage return to the content. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml -Type: String[] +Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -242,16 +273,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +### -PassThru + +Returns an object representing the added content. +By default, this cmdlet does not generate any output. ```yaml -Type: String +Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -260,47 +290,41 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Include -Specifies, as a string array, items that this cmdlet includes. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". +### -Path +Specifies the path to the items that receive the additional content. Wildcards are permitted. +If you specify multiple paths, use commas to separate the paths. ```yaml Type: String[] -Parameter Sets: (All) -Aliases: +Parameter Sets: Path +Aliases: -Required: False -Position: Named +Required: True +Position: 1 Default value: None -Accept pipeline input: False -Accept wildcard characters: False +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True ``` -### -InformationAction -Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. +### -Stream +Specifies an alternative data stream for content. +If the stream does not exist, this cmdlet creates it. +Wildcard characters are not supported. -This parameter is not supported by any providers installed with Windows PowerShell.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend +Stream is a dynamic parameter that the FileSystem provider adds to **Add-Content**. +This parameter works only in file system drives. -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` +You can use the **Add-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. +However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. +If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -### -InformationVariable -Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. +This parameter was introduced in PowerShell 3.0. -This parameter is not supported by any providers installed with Windows PowerShell.```yaml +```yaml Type: String Parameter Sets: (All) -Aliases: iv +Aliases: Required: False Position: Named @@ -309,58 +333,25 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -LiteralPath -Specifies the path to the items that receive the additional content. -Unlike the *Path* parameter, the value of the *LiteralPath* parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. - -```yaml -Type: String[] -Parameter Sets: LiteralPath -Aliases: PSPath - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -PassThru -Returns an object representing the item with which you are working. -By default, this cmdlet does not generate any output. +### -UseTransaction +Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: usetx Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -Path -Specifies the path to the items that receive the additional content. -Wildcards are permitted. -If you specify multiple paths, use commas to separate the paths. - -```yaml -Type: String[] -Parameter Sets: Path -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -Value Specifies the content to be added. Type a quoted string, such as "This data is for internal use only", or specify an object that contains content, such as the DateTime object that Get-Date generates. @@ -370,7 +361,7 @@ You cannot specify the contents of a file by typing its path, because the path i ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -379,46 +370,50 @@ Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` -### -NoNewline -Indicates that this cmdlet does not add a new line/carriage return to the content. +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: wi Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe the objects to be added to this cmdlet. + +You can pipe the objects to be added by Add-Content. ## OUTPUTS ### None or System.String -When you use the *Passthru* parameter, **Add-Content** generates a **System.String** object representing the content. + +When you use the Passthru parameter, Add-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -* When you pipe an object to **Add-Content**, the object is converted to a string before it is added to the item. The object type determines the string format, but the format might be different than the default display of the object. To control the string format, use the formatting parameters of the sending cmdlet. - You can also refer to **Add-Content** by its built-in alias, "ac". -For more information, see about_Aliases. +When you pipe an object to Add-Content, the object is converted to a string before it is added to the item. +The object type determines the string format, but the format might be different than the default display of the object. +To control the string format, use the formatting parameters of the sending cmdlet. - The **Add-Content** cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. -For more information, see about_Providers. +You can also refer to Add-Content by its built-in alias, "ac". For more information, see about_Aliases. -* +The Add-Content cmdlet is designed to work with the data exposed by any provider. +To list the providers available in your session, type "Get-PsProvider". +For more information, see about_Providers. ## RELATED LINKS @@ -430,3 +425,5 @@ For more information, see about_Providers. [Set-Content](Set-Content.md) +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) + diff --git a/reference/6/Microsoft.PowerShell.Management/Set-Content.md b/reference/6/Microsoft.PowerShell.Management/Set-Content.md index 57ee77bff7fe..d94a653440f6 100644 --- a/reference/6/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Set-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -18,7 +18,7 @@ Writes or replaces the content in an item with new content. ### Path (Default) -``` +```powershell Set-Content [-Value] [-PassThru] [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] @@ -26,7 +26,7 @@ Set-Content [-Value] [-PassThru] [-Path] [-Filter ### LiteralPath -``` +```powershell Set-Content [-Value] [-PassThru] -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-WhatIf] [-Confirm] [-UseTransaction] [-NoNewline] [-Encoding ] [-Stream ] [] @@ -34,15 +34,15 @@ Set-Content [-Value] [-PassThru] -LiteralPath [-Filter Set-Content -Path "C:\Test1\test*.txt" -Value "Hello, World" ``` @@ -51,32 +51,32 @@ This example shows how to specify content by typing it in the command. ### Example 2: Send content to a file -``` +```powershell PS C:\> Get-Date | Set-Content -Path "C:\Test1\date.csv" ``` -This command creates a comma separated variable length (csv) file that contains only the current date and time. +This command creates a comma-separated variable-length (csv) file that contains only the current date and time. It uses the Get-Date cmdlet to get the current system date and time. -The pipeline operator passes the result to **Set-Content**, which creates the file and writes the content. +The pipeline operator passes the result to Set-Content, which creates the file and writes the content. If the Test1 directory does not exist, the command fails, but if the file does not exist, the command creates it. ### Example 3: Replace text in a file -``` +```powershell PS C:\> (Get-Content -Path "Notice.txt") | ForEach-Object {$_ -Replace "Warning", "Caution"} | Set-Content -Path "Notice.txt" ``` -This command replaces all instances of Warning with Caution in the Notice.txt file. +This command replaces all instances of "Warning" with "Caution" in the Notice.txt file. -It uses **Get-Content** to get the content of Notice.txt. -The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in **Get-Content**. -The expression uses the $_ symbol to refer to the current item and the *Replace* parameter to specify the text to be replaced. +It uses Get-Content cmdlet to get the content of Notice.txt. +The pipeline operator sends the results to the ForEach-Object cmdlet, which applies the expression to each line of content in Get-Content. +The expression uses the "$_" symbol to refer to the current item and the Replace parameter to specify the text to be replaced. -Another pipeline operator sends the changed content to **Set-Content** which replaces the text in Notice.txt with the new content. +Another pipeline operator sends the changed content to Set-Content which replaces the text in Notice.txt with the new content. -The parentheses around **Get-Content** make sure that the Get operation is complete before the Set operation starts. -Without them, the command fails because the two functions will be trying to access the same file. +The parentheses around the Get-Content command ensure that the Get operation is complete before the Set operation begins. +Without them, the command will fail because the two functions will be trying to access the same file. ## PARAMETERS @@ -101,15 +101,15 @@ Accept wildcard characters: False Specifies a user account that has permission to perform this action. The default is the current user. -Type a user name, such as User01 or Domain01\User01, or enter a **PSCredential** object, such as one generated by the Get-Credential cmdlet. +Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. -This parameter is not supported by any providers installed with Windows PowerShell. +This parameter is not supported by any providers installed with PowerShell. ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -124,15 +124,15 @@ Specifies the file encoding. The acceptable values for this parameter are: - **ASCII** Uses the encoding for the ASCII (7-bit) character set. -- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. -- **BigEndianUTF32** Encodes in UTF-32 format using the big-endian byte order. +- **BigEndianUnicode** Encodes in UTF-16 format using the big-endian byte order. +- **BigEndianUTF32** Encodes in UTF-32 format using the big-endian byte order. - **Default** Encodes using the default value: ASCII. -- **Byte** Encodes a set of characters into a sequence of bytes. -- **String** Uses the encoding type for a string. -- **Unicode** Encodes in UTF-16 format using the little-endian byte order. +- **Byte** Encodes a set of characters into a sequence of bytes. +- **String** Uses the encoding type for a string. +- **Unicode** Encodes in UTF-16 format using the little-endian byte order. - **UTF7** Encodes in UTF-7 format. -- **UTF8** Encodes in UTF-8 format. -- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. +- **UTF8** Encodes in UTF-8 format. +- **Unknown** The encoding type is unknown or invalid; the data can be treated as binary. The default value is ASCII. @@ -142,55 +142,54 @@ This parameter works only in file system drives. ```yaml Type: FileSystemCmdletProviderEncoding Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32 Required: False Position: Named -Default value: None +Default value: ASCII Accept pipeline input: False Accept wildcard characters: False ``` ### -Exclude -Specifies items that this cmdlet omits. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcard characters are permitted. +Omits the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Filter Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcard characters, -depends on the provider. -Filters are more efficient than other parameters, -because the provider applies them when it is retrieving the objects, -instead of having Windows PowerShell filter the objects after they are retrieved. +The value of this parameter qualifies the Path parameter. +The syntax of the filter, including the use of wildcard characters, depends on the provider. +Filters are more efficient than other parameters, +because the provider applies them when it is retrieving the objects, +instead of having PowerShell filter the objects after they are retrieved. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Force @@ -198,12 +197,12 @@ Accept wildcard characters: False Forces the cmdlet to set the contents of a file, even if the file is read-only. Implementation varies from provider to provider. For more information, see about_Providers. -Even using the *Force* parameter, the cmdlet cannot override security restrictions. +Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -214,30 +213,30 @@ Accept wildcard characters: False ### -Include -Specifies items that this cmdlet changes. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcard characters are permitted. +Changes only the specified items. +The value of this parameter qualifies the Path parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -LiteralPath Specifies the path of the item that receives the content. -Unlike *Path*, the value of the *LiteralPath* parameter is used exactly as it is typed. -No characters are interpreted as wildcard characters. +Unlike Path, the value of LiteralPath is used exactly as it is typed. +No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml Type: String[] @@ -253,12 +252,14 @@ Accept wildcard characters: False ### -NoNewline -Indicates that this cmdlet uses the no newline setting. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -275,7 +276,7 @@ By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -292,13 +293,13 @@ Wildcard characters are permitted. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -307,21 +308,19 @@ Specifies an alternative data stream for content. If the stream does not exist, this cmdlet creates it. Wildcard characters are not supported. -Stream is a dynamic parameter the FileSystem provider adds to **Set-Content**. +Stream is a dynamic parameter that the FileSystem provider adds to **Set-Content**. This parameter works only in file system drives. -You can use the Set-Content cmdlet to change the content of -the Zone.Identifier alternate data stream. -However, we do not recommend this as a way to eliminate security checks -that block files that are downloaded from the Internet. +You can use the **Set-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. +However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. -This parameter was introduced in Windows PowerShell 3.0. +This parameter was introduced in PowerShell 3.0. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -355,10 +354,10 @@ Specifies the new content for the item. ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False @@ -383,49 +382,33 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Parameter | --- | - --Debug | --ErrorAction | --ErrorVariable | --InformationAction | --InformationVariable | --OutBuffer | --OutVariable | --PipelineVariable | --Verbose | --WarningAction | --WarningVariable. | - -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object -You can pipe an object that contains the new value for the item to this cmdlet. +You can pipe an object that contains the new value for the item to Set-Content. ## OUTPUTS -### None, System.String +### None or System.String -This cmdlet generates a System.String object that represents the content, -if you specify the *Passthru* parameter. +When you use the Passthru parameter, Set-Content generates a System.String object representing the content. Otherwise, this cmdlet does not generate any output. ## NOTES -You can also refer to **Set-Content** by its built-in alias, **sc**. -For more information, see about_Aliases. +You can also refer to Set-Content by its built-in alias, "sc". For more information, see about_Aliases. -**Set-Content** is designed for string processing. -If you pipe non-string objects to this cmdlet, -it converts the object to a string before writing it. +Set-Content is designed for string processing. +If you pipe non-string objects to Set-Content, it converts the object to a string before writing it. To write objects to files, use Out-File. -**Set-Content** cmdlet is designed to work with the data exposed by any -provider. +The Set-Content cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. @@ -437,4 +420,5 @@ For more information, see about_Providers. [Get-Content](Get-Content.md) +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Utility/Out-File.md b/reference/6/Microsoft.PowerShell.Utility/Out-File.md index 5b7cc06f3a6d..3b03012d81d5 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Out-File.md +++ b/reference/6/Microsoft.PowerShell.Utility/Out-File.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -11,41 +11,47 @@ title: Out-File # Out-File ## SYNOPSIS + Sends output to a file. ## SYNTAX ### ByPath (Default) -``` + +```powershell Out-File [-FilePath] [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-NoNewline] [-InputObject ] [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath -``` + +```powershell Out-File -LiteralPath [[-Encoding] ] [-Append] [-Force] [-NoClobber] [-Width ] [-NoNewline] [-InputObject ] [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The **Out-File** cmdlet sends output to a file. + +The Out-File cmdlet sends output to a file. You can use this cmdlet instead of the redirection operator (\>) when you need to use its parameters. ## EXAMPLES ### Example 1: Send output to a file -``` + +```powershell PS C:\> Get-Process | Out-File -filepath C:\Test1\process.txt ``` This command sends a list of processes on the computer to the Process.txt file. -If the file does not exist, **Out-File** creates it. -Because the name of the *FilePath* parameter is optional, you can omit it and submit the equivalent command `Get-Process | Outfile C:\Test1\process.txt`. +If the file does not exist, Out-File creates it. +Because the name of the FilePath parameter is optional, you can omit it and submit the equivalent command "get-process | outfile C:\Test1\process.txt". ### Example 2: Send output to a file without overwriting -``` + +```powershell PS C:\> Get-Process | Out-File C:\Test1\process.txt -NoClobber Out-File : File C:\Test1\process.txt already exists and NoClobber was specified. @@ -53,54 +59,58 @@ At line:1 char:23 + Get-Process | Out-File <<<< process.txt -NoClobber ``` -This command sends a list of processes to the Process.txt file, but it uses the *NoClobber* parameter, which prevents an existing file from being overwritten. -The output shows the error message that appears when *NoClobber* is used with an existing file. +This command also sends a list of processes to the Process.txt file, but it uses the NoClobber parameter, which prevents an existing file from being overwritten. +The output shows the error message that appears when NoClobber is used with an existing file. ### Example 3: Send output to a file in ASCII format -``` + +```powershell PS C:\> $A = Get-Process PS C:\> Out-File -FilePath C:\Test1\process.txt -InputObject $A -Encoding ASCII -Width 50 ``` These commands send a list of processes on the computer to the Process.txt file. The text is encoded in ASCII format so that it can be read by search programs like Findstr and Grep. -By default, **Out-File** uses Unicode format. +By default, Out-File uses Unicode format. The first command gets the list of processes and stores them in the $A variable. -The second command uses the **Out-File** cmdlet to send the list to the Process.txt file. +The second command uses the Out-File cmdlet to send the list to the Process.txt file. -The command uses the *InputObject* parameter to specify that the input is in the $A variable. -It uses the *Encoding* parameter to convert the output to ASCII format. -It uses the *Width* parameter to limit each line in the file to 50 characters. +The command uses the InputObject parameter to specify that the input is in the $A variable. +It uses the Encoding parameter to convert the output to ASCII format. +It uses the Width parameter to limit each line in the file to 50 characters. Because the lines of output are truncated at 50 characters, the rightmost column in the process table is omitted. ### Example 4: Send output from outside a file system drive -``` + +```powershell PS C:\> Set-Location hklm:\software PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath c:\ps\acl.txt PS C:\> Get-Acl mycompany\mykey | Out-File -FilePath filesystem::acl.txt ``` -These commands show how to use the **Out-File** cmdlet when you are not in a FileSystem drive. +These commands show how to use the Out-File cmdlet when you are not in a FileSystem drive. The first command sets the current location to the HKLM:\Software registry key. The second and third commands have the same effect. They use the Get-Acl cmdlet to get the security descriptor of the MyKey registry subkey (HKLM\Software\MyCompany\MyKey). -A pipeline operator passes the result to the **Out-File** cmdlet, which sends it to the Acl.txt file. +A pipeline operator passes the result to the Out-File cmdlet, which sends it to the Acl.txt file. -Because **Out-File** is not supported by the Windows PowerShell Registry provider, you must specify either the file system drive name, such as c:, or the name of the provider followed by two colons, FileSystem::, in the value of the *FilePath* parameter. +Because Out-File is not supported by the PowerShell Registry provider, you must specify either the file system drive name, +such as "c:", or the name of the provider followed by two colons, "FileSystem::", in the value of the FilePath parameter. The second and third commands demonstrate these methods. ## PARAMETERS ### -Append -Indicates that the cmdlet adds the output to the end of an existing file, instead of replacing the file contents. + +Adds the output to the end of an existing file, instead of replacing the file contents. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -109,7 +119,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Encoding + Specifies the type of character encoding used in the file. The acceptable values for this parameter are: @@ -126,30 +152,31 @@ The acceptable values for this parameter are: Unicode is the default. -Default uses the encoding of the system's current ANSI code page. +"Default" uses the encoding of the system's current ANSI code page. -OEM uses the current original equipment manufacturer code page identifier for the operating system. +"OEM" uses the current original equipment manufacturer code page identifier for the operating system. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unknown, string, unicode, bigendianunicode, utf8, utf7, utf32, ascii, default, oem Required: False Position: 2 -Default value: None +Default value: Unicode Accept pipeline input: False Accept wildcard characters: False ``` ### -FilePath + Specifies the path to the output file. ```yaml Type: String Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 1 @@ -159,13 +186,14 @@ Accept wildcard characters: False ``` ### -Force + Indicates that the cmdlet overwrites an existing read-only file. -Even using the *Force* parameter, the cmdlet cannot override security restrictions. +Even using the Force parameter, the cmdlet cannot override security restrictions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -202,13 +230,14 @@ Accept wildcard characters: False ``` ### -InputObject + Specifies the objects to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -217,33 +246,35 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -NoClobber -Indicates that the cmdlet will not overwrite an existing file. -By default, if a file exists in the specified path, **Out-File** overwrites the file without warning. -If both *Append* and *NoClobber* are used, the output is appended to the existing file. +### -LiteralPath + +Specifies the path to the output file. +Unlike *FilePath*, the value of the *LiteralPath* parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell PowerShell not to interpret any characters as escape sequences. ```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: NoOverwrite +Type: String +Parameter Sets: ByLiteralPath +Aliases: PSPath -Required: False +Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Width -Specifies the number of characters in each line of output. -Any additional characters are truncated, not wrapped. -If you omit this parameter, the width is determined by the characteristics of the host. -The default for the Windows PowerShell console is 80 characters. +### -NoClobber +Indicates that the cmdlet will not overwrite an existing file. +By default, if a file exists in the specified path, **Out-File** overwrites the file without warning. +If both *Append* and *NoClobber* are used, the output is appended to the existing file. ```yaml -Type: Int32 +Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: NoOverwrite Required: False Position: Named @@ -252,41 +283,26 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -LiteralPath -Specifies the path to the output file. -Unlike *FilePath*, the value of the *LiteralPath* parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. - -```yaml -Type: String -Parameter Sets: ByLiteralPath -Aliases: PSPath - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -NoNewline +Specifies that the content written to the file does not end with a newline character. +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -WhatIf + Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -302,11 +318,14 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -NoNewline - +### -Width +Specifies the number of characters in each line of output. +Any additional characters are truncated, not wrapped. +If you omit this parameter, the width is determined by the characteristics of the host. +The default for the Windows PowerShell console is 80 characters. ```yaml -Type: SwitchParameter +Type: Int32 Parameter Sets: (All) Aliases: @@ -318,36 +337,48 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Management.Automation.PSObject -You can pipe any object to this cmdlet. + +You can pipe any object to Out-File. ## OUTPUTS ### None -**Out-File** does not generate any output. + +Out-File does not generate any output. ## NOTES -* The Out cmdlets do not format objects; they just render them and send them to the specified display destination. If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - The Out cmdlets do not have parameters for names or file paths. -To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a Windows PowerShell command to the cmdlet. -You can also store data in a variable and use the *InputObject* parameter to pass the data to the cmdlet. -For help, see the examples. +The Out cmdlets do not format objects; they just render them and send them to the specified display destination. +If you send an unformatted object to an Out cmdlet, the cmdlet sends it to a formatting cmdlet before rendering it. - **Out-File** sends data, but it does not emit any output objects. -If you pipe the output of **Out-File** to Get-Member, **Get-Member** reports that no objects have been specified. +The Out cmdlets do not have parameters for names or file paths. +To send data to a cmdlet that contains the Out verb (an Out cmdlet), use a pipeline operator (|) to send the output of a PowerShell command to the cmdlet. +You can also store data in a variable and use the InputObject parameter to pass the data to the cmdlet. +For help, see the examples. -* +Out-File sends data, but it does not emit any output objects. +If you pipe the output of Out-File to Get-Member, Get-Member reports that no objects have been specified. ## RELATED LINKS -[Out-GridView](https://msdn.microsoft.com/en-us/powershell/reference/5.1/Microsoft.PowerShell.Utility/Out-GridView) +[Out-Default](../Microsoft.PowerShell.Core/Out-Default.md) + +[Out-GridView](Out-GridView.md) + +[Out-Host](../Microsoft.PowerShell.Core/Out-Host.md) + +[Out-Null](../Microsoft.PowerShell.Core/Out-Null.md) -[Out-Printer](https://msdn.microsoft.com/en-us/powershell/reference/5.1/Microsoft.PowerShell.Utility/Out-Printer) +[Out-Printer](Out-Printer.md) [Out-String](Out-String.md) diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Host.md b/reference/6/Microsoft.PowerShell.Utility/Write-Host.md index 0b5acf3c9686..a522488a6f68 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Host.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Host.md @@ -1,9 +1,8 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-09 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=821876 external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml title: Write-Host --- @@ -11,61 +10,68 @@ title: Write-Host # Write-Host ## SYNOPSIS + Writes customized output to a host. ## SYNTAX -``` +```powershell Write-Host [[-Object] ] [-NoNewline] [-Separator ] [-ForegroundColor ] [-BackgroundColor ] [-InformationAction ] [-InformationVariable ] [] ``` ## DESCRIPTION -The **Write-Host** cmdlet customizes output. -You can specify the color of text by using the *ForegroundColor* parameter, and you can specify the background color by using the *BackgroundColor* parameter. -The *Separator* parameter lets you specify a string to use to separate displayed objects. -The particular result depends on the program that is hosting Windows PowerShell. + +The Write-Host cmdlet customizes output. +You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. +The Separator parameter lets you specify a string to use to separate displayed objects. +The particular result depends on the program that is hosting PowerShell. ## EXAMPLES ### Example 1: Write to the console without adding a new line -``` + +```powershell PS C:\> Write-Host "no newline test " -NoNewline no newline test PS C:\> ``` -This command displays the input to the console, but because of the *NoNewline* parameter, the output is followed directly by the prompt. +This command displays the input to the console, but because of the NoNewline parameter, the output is followed directly by the prompt. ### Example 2: Write to the console and include a separator -``` + +```powershell PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", +2= " 2, +2= 4, +2= 6, +2= 8, +2= 10, +2= 12 ``` This command displays the even numbers from 2 through 12. -The *Separator* parameter is used to add the string ", +2= (comma, space, +, 2, =, space)". +The Separator parameter is used to add the string , +2= (comma, space, +, 2, =, space). ### Example 3: Write with different text and background colors -``` -PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor white + +```powershell +PS C:\> Write-Host (2,4,6,8,10,12) -Separator ", -> " -ForegroundColor DarkGreen -BackgroundColor White ``` This command displays the even numbers from 2 through 12. -It uses the *ForegroundColor* parameter to output dark green text and the *BackgroundColor* parameter to display a white background. +It uses the ForegroundColor parameter to output dark green text and the BackgroundColor parameter to display a white background. ### Example 4: Write with different text and background colors -``` + +```powershell PS C:\> Write-Host "Red on white text." -ForegroundColor red -BackgroundColor white Red on white text. ``` -This command displays the string "Red on white text." The text is red, as defined by the *ForegroundColor* parameter. -The background is white, as defined by the *BackgroundColor* parameter. +This command displays the string "Red on white text." The text is red, as defined by the ForegroundColor parameter. +The background is white, as defined by the BackgroundColor parameter. ## PARAMETERS ### -BackgroundColor + Specifies the background color. There is no default. The acceptable values for this parameter are: @@ -90,7 +96,7 @@ The acceptable values for this parameter are: ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False @@ -101,6 +107,7 @@ Accept wildcard characters: False ``` ### -ForegroundColor + Specifies the text color. There is no default. The acceptable values for this parameter are: @@ -125,7 +132,7 @@ The acceptable values for this parameter are: ```yaml Type: ConsoleColor Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White Required: False @@ -163,12 +170,15 @@ Accept wildcard characters: False ``` ### -NoNewline -Specifies that the content displayed in the console does not end with a newline character. + +The string representations of the input objects are concatenated to form the output. +No spaces or newlines are inserted between the output strings. +No newline is added after the last output string. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -178,27 +188,28 @@ Accept wildcard characters: False ``` ### -Object -Specifies objects to display in the console. + +Objects to display in the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ### -Separator -Specifies a separator string to the output between objects displayed on the console. +Specifies a separator string to insert between objects displayed by the host. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -208,25 +219,33 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Object + You can pipe objects to be written to the host. ## OUTPUTS ### None -**Write-Host** sends the objects to the host. + +Write-Host sends the objects to the host. It does not return any objects. -However, the host might display the objects that **Write-Host** sends to it. +However, the host might display the objects that Write-Host sends to it. ## NOTES ## RELATED LINKS -[Clear-Host](../microsoft.powershell.core/clear-host.md) +[Clear-Host](../Microsoft.PowerShell.Core/Functions/Clear-Host.md) + +[Out-Host](../Microsoft.PowerShell.Core/Out-Host.md) [Write-Debug](Write-Debug.md) From 2bdb9e6d4a99628983c73f68e8db7340be532398 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 10 Nov 2017 03:28:08 +0900 Subject: [PATCH 009/145] Fix the example of `Format-Table -DisplayError` (#1848) The example is a `-DisplayError` parameter example. But it uses `-ShowError` parameter. --- .../3.0/Microsoft.PowerShell.Utility/Format-Table.md | 11 +++++++---- .../4.0/Microsoft.PowerShell.Utility/Format-Table.md | 11 +++++++---- .../5.0/Microsoft.PowerShell.Utility/Format-Table.md | 9 ++++++--- .../5.1/Microsoft.PowerShell.Utility/Format-Table.md | 9 ++++++--- .../6/Microsoft.PowerShell.Utility/Format-Table.md | 9 ++++++--- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md b/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md index c9542ce4b85f..7bdc4cfc66ef 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md @@ -132,14 +132,17 @@ Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Table command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +Indicates that the cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Table` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Table DayOfWeek, { $_ / $null } -DisplayError -PS \> Get-Date | Format-Table DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Format-Table.md b/reference/4.0/Microsoft.PowerShell.Utility/Format-Table.md index 1c0b53dafa5b..e8d22e7cd77a 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Format-Table.md @@ -141,14 +141,17 @@ Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Table command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +Indicates that the cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Table` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Table DayOfWeek, { $_ / $null } -DisplayError -PS \> Get-Date | Format-Table DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Format-Table.md b/reference/5.0/Microsoft.PowerShell.Utility/Format-Table.md index 539afbcb6d08..1965eb28091c 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Format-Table.md @@ -142,13 +142,16 @@ Accept wildcard characters: False ### -DisplayError Indicates that the cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Table** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Table` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Table DayOfWeek, { $_ / $null } -DisplayError -PS \> Get-Date | Format-Table DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Table.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Table.md index 9f9cd1d532db..fad250d7ec9e 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Table.md @@ -142,13 +142,16 @@ Accept wildcard characters: False ### -DisplayError Indicates that the cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Table** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Table` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Table DayOfWeek, { $_ / $null } -DisplayError -PS \> Get-Date | Format-Table DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Table.md b/reference/6/Microsoft.PowerShell.Utility/Format-Table.md index c49e5a3c9694..cd46af1d30c1 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Table.md @@ -142,13 +142,16 @@ Accept wildcard characters: False ### -DisplayError Indicates that the cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Table** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Table` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Table DayOfWeek, { $_ / $null } -DisplayError -PS \> Get-Date | Format-Table DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter From 61cb77d74678067ae1fbd95ca78e2831bb8d5db6 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 11 Nov 2017 01:10:30 +0900 Subject: [PATCH 010/145] Fix the example of `Format-Wide -DisplayError` (#1850) --- .../Microsoft.PowerShell.Utility/Format-Wide.md | 16 +++++++++------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 16 +++++++++------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 16 +++++++++------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 14 ++++++++------ .../Microsoft.PowerShell.Utility/Format-Wide.md | 14 ++++++++------ 5 files changed, 43 insertions(+), 33 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md index 74fd9557c740..74b467467e59 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -78,14 +78,16 @@ Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Wide command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +Indicates that this cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -DisplayError + + +#ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md index 8783140f7341..54b29b78d57f 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -83,14 +83,16 @@ Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Wide command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +Indicates that this cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -DisplayError + + +#ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md index adc0734866ce..5b4d2a6b5c50 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -83,14 +83,16 @@ Accept wildcard characters: False ``` ### -DisplayError -Indicates that the cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Wide** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *DisplayError* parameter with an expression. +Indicates that this cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -DisplayError + + +#ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md index bdb999fc6ee7..0b9181c73b5f 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md @@ -84,13 +84,15 @@ Accept wildcard characters: False ### -DisplayError Indicates that this cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Wide** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *DisplayError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -DisplayError + + +#ERR +``` ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md index 2ecf27f13eac..0dcc7b2a5816 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md @@ -85,13 +85,15 @@ Accept wildcard characters: False ### -DisplayError Indicates that this cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Wide** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *DisplayError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -DisplayError + + +#ERR +``` ```yaml Type: SwitchParameter From 882b0e8a582f2854e23c4422c35efad2f37c46e5 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 11 Nov 2017 01:11:29 +0900 Subject: [PATCH 011/145] Fix the example of `Format-Custom -DisplayError` (#1849) The example is a -DisplayError parameter example. But it uses -ShowError parameter. --- .../Format-Custom.md | 21 ++++++++++++------- .../Format-Custom.md | 21 ++++++++++++------- .../Format-Custom.md | 16 ++++++++------ .../Format-Custom.md | 16 ++++++++------ .../Format-Custom.md | 16 ++++++++------ 5 files changed, 56 insertions(+), 34 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md index 02dd4734a64e..a53370370c35 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md @@ -56,14 +56,19 @@ Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Custom command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. - -PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +Indicates that this cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError + +class DateTime +{ + DayOfWeek = Wednesday + $_ / $null = #ERR +} +``` ```yaml Type: SwitchParameter diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/4.0/Microsoft.PowerShell.Utility/Format-Custom.md index 479e88483c75..7740ff8de399 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Format-Custom.md @@ -61,14 +61,19 @@ Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Custom command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. - -PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday #ERR +Indicates that this cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError + +class DateTime +{ + DayOfWeek = Wednesday + $_ / $null = #ERR +} +``` ```yaml Type: SwitchParameter diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/5.0/Microsoft.PowerShell.Utility/Format-Custom.md index b98818c4ba00..5efba0338d12 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Format-Custom.md @@ -62,14 +62,18 @@ Accept wildcard characters: False ### -DisplayError Indicates that this cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Custom** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *DisplayError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -`PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError` +```powershell +PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError -`DayOfWeek $_ / $null` -`--------- ------------` -`Wednesday #ERR` +class DateTime +{ + DayOfWeek = Wednesday + $_ / $null = #ERR +} +``` ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md index 4459468606ea..3c6f9f1e5c1c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md @@ -62,14 +62,18 @@ Accept wildcard characters: False ### -DisplayError Indicates that this cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Custom** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *DisplayError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -`PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError` +```powershell +PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError -`DayOfWeek $_ / $null` -`--------- ------------` -`Wednesday #ERR` +class DateTime +{ + DayOfWeek = Wednesday + $_ / $null = #ERR +} +``` ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md index 332b3f7cda9b..7ed2ab5b3d93 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Custom.md @@ -63,14 +63,18 @@ Accept wildcard characters: False ### -DisplayError Indicates that this cmdlet displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Custom** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *DisplayError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Custom` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. -`PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError` +```powershell +PS C:\> Get-Date | Format-Custom DayOfWeek, { $_ / $null } -DisplayError -`DayOfWeek $_ / $null` -`--------- ------------` -`Wednesday #ERR` +class DateTime +{ + DayOfWeek = Wednesday + $_ / $null = #ERR +} +``` ```yaml Type: SwitchParameter From 67db02a8cbf09d33f4ba8c8ef59cc154b1ca62b5 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 15:47:05 -0800 Subject: [PATCH 012/145] updating set-acl docs per PR#901 --- .../Microsoft.PowerShell.Security/Set-Acl.md | 221 +++++++----- .../Microsoft.PowerShell.Security/Set-Acl.md | 213 ++++++----- .../Microsoft.PowerShell.Security/Set-Acl.md | 339 +++++++++-------- .../Microsoft.PowerShell.Security/Set-Acl.md | 339 +++++++++-------- .../Microsoft.PowerShell.Security/Set-Acl.md | 340 ++++++++++-------- 5 files changed, 838 insertions(+), 614 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md index a4e0470c14df..26afdbe3b464 100644 --- a/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-07 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -9,11 +9,16 @@ title: Set-Acl --- # Set-Acl + ## SYNOPSIS -Changes the security descriptor of a specified item, such as a file or a registry key. + +Changes the security descriptor of a specified item. The ability to manage a security descriptor +can be extended to additional providers that support Powershell Objects. + ## SYNTAX ### ByPath (Default) + ``` Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] @@ -21,12 +26,14 @@ Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] [-AclObject] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ### ByLiteralPath + ``` Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] @@ -34,76 +41,97 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. -When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security +descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt +and Cat.txt files are identical. + +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The +assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. -The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in +$DogACL. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. +The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** +parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. -The value of the **Path** parameter is the path to the Cat.txt file. -The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 + ``` PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a +pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the +**Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. + ### Example 3 + ``` PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the +C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and +uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. -The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the +C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. -(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use +"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** +cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in +the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. -In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". -This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can +affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl +-AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. + ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. -**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. +Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by +the **Path** or **InputObject** parameter to match the values in the specified security object. + +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter +to pass the variable, or type a Get-Acl command. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -113,15 +141,15 @@ Accept wildcard characters: False ``` ### -Exclude -Omits the specified items. -The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. + +Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a +path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may +support this parameter. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -131,15 +159,17 @@ Accept wildcard characters: True ``` ### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the **Path** parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. + +Specifies a filter in the provider's format or language. The value of this parameter qualifies the +**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the +provider. Filters are more efficient than other parameters, because the provider applies them when +retrieving the objects, rather than having Windows PowerShell filter the objects after they are +retrieved. Note: Not all providers may support this parameter. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -149,15 +179,15 @@ Accept wildcard characters: True ``` ### -Include -Changes only the specified items. -The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. + +Changes only the specified items. The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers +may support this parameter. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -167,13 +197,14 @@ Accept wildcard characters: True ``` ### -Passthru -Returns an object that represents the security descriptor that was changed. -By default, this cmdlet does not generate any output. + +Returns an object that represents the security descriptor that was changed. By default, this cmdlet +does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -183,16 +214,19 @@ Accept wildcard characters: False ``` ### -Path -Changes the security descriptor of the specified item. -Enter the path to an item, such as a path to a file or registry key. -Wildcards are permitted. -If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the security object. +Changes the security descriptor of the specified item. Enter the path to an item, such as a path to +a file or registry key. Wildcards are permitted. + +If you pass a security object to **Set-Acl** (either by using the **AclObject** or +**SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and +you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the +security object. ```yaml Type: String[] Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 1 @@ -202,18 +236,20 @@ Accept wildcard characters: True ``` ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. -Enter the CAP ID or friendly name of a central access policy on the computer. -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of +a central access policy on the computer. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see [Dynamic Access Control: +Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: Required: False Position: 3 @@ -223,17 +259,19 @@ Accept wildcard characters: False ``` ### -ClearCentralAccessPolicy + Removes the central access policy from the specified item. -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see +[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: Required: False Position: Named @@ -243,18 +281,19 @@ Accept wildcard characters: False ``` ### -InputObject -Changes the security descriptor of the specified object. -Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. -Instead, use the **InputObject** parameter explicitly in the command. +Changes the security descriptor of the specified object. Enter a variable that contains the object +or a command that gets the object. + +You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter +explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: PSObject Parameter Sets: ByInputObject -Aliases: +Aliases: Required: True Position: 1 @@ -264,11 +303,11 @@ Accept wildcard characters: False ``` ### -LiteralPath -Changes the security descriptor of the specified item. -Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. + +Changes the security descriptor of the specified item. Unlike **Path**, the value of the +**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as +wildcards. If the path includes escape characters, enclose it in single quotation marks. Single +quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -285,6 +324,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -300,8 +340,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter @@ -316,9 +356,9 @@ Accept wildcard characters: False ``` ### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see about_Transactions. + +Includes the command in the active transaction. This parameter is valid only when a transaction is +in progress. For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -333,23 +373,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### System.Security.AccessControl.ObjectSecurity, System.Security.AccessControl.CommonSecurityDescriptor + You can pipe an ACL object or a security descriptor to **Set-Acl**. + ## OUTPUTS ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. -However, if you use the **Passthru** parameter, it generates a security object. -The type of the security object depends on the type of the item. + +By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** +parameter, it generates a security object. The type of the security object depends on the type of +the item. + ## NOTES -* The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. -* -## RELATED LINKS +- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. + As such, you can use it to change the security descriptors of files, directories, and registry + keys. -[Get-Acl](Get-Acl.md) +- There may be additional providers that also support this interface, or extend it. For example, + the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the + security descriptor extensions used by Active Directory. +## RELATED LINKS +[Get-Acl](Get-Acl.md) diff --git a/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md index e65fda487d2f..26afdbe3b464 100644 --- a/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -1,9 +1,9 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-07 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/p/?linkid=293939 +online version: http://go.microsoft.com/fwlink/?LinkID=113389 external help file: Microsoft.PowerShell.Security.dll-Help.xml title: Set-Acl --- @@ -11,11 +11,14 @@ title: Set-Acl # Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item, such as a file or a registry key. + +Changes the security descriptor of a specified item. The ability to manage a security descriptor +can be extended to additional providers that support Powershell Objects. ## SYNTAX ### ByPath (Default) + ``` Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] @@ -23,12 +26,14 @@ Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] [-AclObject] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ### ByLiteralPath + ``` Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] @@ -36,80 +41,97 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. -When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security +descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt +and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. -The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The +assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in +$DogACL. -The value of the **Path** parameter is the path to the Cat.txt file. -The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** +parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 + ``` PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a +pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the +**Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. ### Example 3 + ``` PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the +C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and +uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. -The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the +C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. -(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use +"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** +cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in +the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. -In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". -This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can +affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl +-AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. -**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. +Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by +the **Path** or **InputObject** parameter to match the values in the specified security object. + +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter +to pass the variable, or type a Get-Acl command. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -119,15 +141,15 @@ Accept wildcard characters: False ``` ### -Exclude -Omits the specified items. -The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. + +Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a +path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may +support this parameter. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -137,15 +159,17 @@ Accept wildcard characters: True ``` ### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the **Path** parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. + +Specifies a filter in the provider's format or language. The value of this parameter qualifies the +**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the +provider. Filters are more efficient than other parameters, because the provider applies them when +retrieving the objects, rather than having Windows PowerShell filter the objects after they are +retrieved. Note: Not all providers may support this parameter. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -155,15 +179,15 @@ Accept wildcard characters: True ``` ### -Include -Changes only the specified items. -The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. + +Changes only the specified items. The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers +may support this parameter. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -173,13 +197,14 @@ Accept wildcard characters: True ``` ### -Passthru -Returns an object that represents the security descriptor that was changed. -By default, this cmdlet does not generate any output. + +Returns an object that represents the security descriptor that was changed. By default, this cmdlet +does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -189,16 +214,19 @@ Accept wildcard characters: False ``` ### -Path -Changes the security descriptor of the specified item. -Enter the path to an item, such as a path to a file or registry key. -Wildcards are permitted. -If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the security object. +Changes the security descriptor of the specified item. Enter the path to an item, such as a path to +a file or registry key. Wildcards are permitted. + +If you pass a security object to **Set-Acl** (either by using the **AclObject** or +**SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and +you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the +security object. ```yaml Type: String[] Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 1 @@ -208,18 +236,20 @@ Accept wildcard characters: True ``` ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. -Enter the CAP ID or friendly name of a central access policy on the computer. -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of +a central access policy on the computer. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see [Dynamic Access Control: +Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: Required: False Position: 3 @@ -229,17 +259,19 @@ Accept wildcard characters: False ``` ### -ClearCentralAccessPolicy + Removes the central access policy from the specified item. -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see +[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: Required: False Position: Named @@ -249,18 +281,19 @@ Accept wildcard characters: False ``` ### -InputObject -Changes the security descriptor of the specified object. -Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. -Instead, use the **InputObject** parameter explicitly in the command. +Changes the security descriptor of the specified object. Enter a variable that contains the object +or a command that gets the object. + +You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter +explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: PSObject Parameter Sets: ByInputObject -Aliases: +Aliases: Required: True Position: 1 @@ -270,11 +303,11 @@ Accept wildcard characters: False ``` ### -LiteralPath -Changes the security descriptor of the specified item. -Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. + +Changes the security descriptor of the specified item. Unlike **Path**, the value of the +**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as +wildcards. If the path includes escape characters, enclose it in single quotation marks. Single +quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -291,6 +324,7 @@ Accept wildcard characters: False ``` ### -Confirm + Prompts you for confirmation before running the cmdlet. ```yaml @@ -306,8 +340,8 @@ Accept wildcard characters: False ``` ### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. + +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter @@ -322,9 +356,9 @@ Accept wildcard characters: False ``` ### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see about_Transactions. + +Includes the command in the active transaction. This parameter is valid only when a transaction is +in progress. For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -339,27 +373,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Security.AccessControl.ObjectSecurity, System.Security.AccessControl.CommonSecurityDescriptor + You can pipe an ACL object or a security descriptor to **Set-Acl**. ## OUTPUTS ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. -However, if you use the **Passthru** parameter, it generates a security object. -The type of the security object depends on the type of the item. + +By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** +parameter, it generates a security object. The type of the security object depends on the type of +the item. ## NOTES -* The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. -* +- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. + As such, you can use it to change the security descriptors of files, directories, and registry + keys. + +- There may be additional providers that also support this interface, or extend it. For example, + the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the + security descriptor extensions used by Active Directory. ## RELATED LINKS [Get-Acl](Get-Acl.md) - - diff --git a/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md index 2d434ebbcde3..26afdbe3b464 100644 --- a/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -1,9 +1,9 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-07 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=821717 +online version: http://go.microsoft.com/fwlink/?LinkID=113389 external help file: Microsoft.PowerShell.Security.dll-Help.xml title: Set-Acl --- @@ -11,11 +11,14 @@ title: Set-Acl # Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item, such as a file or a registry key. + +Changes the security descriptor of a specified item. The ability to manage a security descriptor +can be extended to additional providers that support Powershell Objects. ## SYNTAX ### ByPath (Default) + ``` Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] @@ -23,12 +26,14 @@ Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] [-AclObject] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ### ByLiteralPath + ``` Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] @@ -36,136 +41,170 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl -Path "C:\Dog.txt" -PS C:\> Set-Acl -Path "C:\Cat.txt" -AclObject $DogACL +PS C:\> $DogACL = Get-Acl C:\Dog.txt +PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. -When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security +descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt +and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. -The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The +assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in +$DogACL. -The value of the *Path* parameter is the path to the Cat.txt file. -The value of the *AclObject* parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** +parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. + +### Example 2 -### Example 2: Use the pipeline operator to pass a descriptor ``` -PS C:\> Get-Acl -Path "C:\Dog.txt" | Set-Acl -Path "C:\Cat.txt" +PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a +pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the +**Set-Acl** cmdlet. -The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. +The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. -### Example 3: Apply a security descriptor to multiple files +### Example 3 + ``` PS C:\> $NewAcl = Get-Acl File0.txt -PS C:\> Get-ChildItem -Path "C:\temp" -Recurse -Include "*.txt" -Force | Set-Acl -AclObject $NewAcl +PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the +C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and +uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. -The *Recurse* parameter extends the command to all subdirectories of C:\temp. -The *Include* parameter limits the files retrieved to those with the ".txt" file name extension. -The *Force* parameter gets hidden files, which would otherwise be excluded. -(You cannot use "c:\temp\*.txt", because the *Recurse* parameter works on directories, not on files.) +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the +C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. +The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use +"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the *AclObject* parameter to all of the files in the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** +cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in +the pipeline. -In practice, it is best to use the *WhatIf* parameter with all **Set-Acl** commands that can affect more than one item. -In this case, the second command in the pipeline would be `Set-Acl -AclObject $NewAcl -WhatIf`. -This command lists the files that would be affected by the command. -After reviewing the result, you can run the command again without the *WhatIf* parameter. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can +affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl +-AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. -**Set-Acl** changes the ACL of item specified by the *Path* or *InputObject* parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the *AclObject* parameter to pass the variable, or type a Get-Acl command. +Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by +the **Path** or **InputObject** parameter to match the values in the specified security object. + +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter +to pass the variable, or type a Get-Acl command. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -CentralAccessPolicy -Establishes or changes the central access policy of the item. -Enter the CAP ID or friendly name of a central access policy on the computer. +### -Exclude + +Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a +path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may +support this parameter. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: True +``` -This parameter was introduced in Windows PowerShell 3.0. +### -Filter + +Specifies a filter in the provider's format or language. The value of this parameter qualifies the +**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the +provider. Filters are more efficient than other parameters, because the provider applies them when +retrieving the objects, rather than having Windows PowerShell filter the objects after they are +retrieved. Note: Not all providers may support this parameter. ```yaml Type: String -Parameter Sets: ByPath, ByLiteralPath -Aliases: +Parameter Sets: (All) +Aliases: Required: False -Position: 2 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept pipeline input: False +Accept wildcard characters: True ``` -### -ClearCentralAccessPolicy -Removes the central access policy from the specified item. - -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +### -Include -This parameter was introduced in Windows PowerShell 3.0. +Changes only the specified items. The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers +may support this parameter. ```yaml -Type: SwitchParameter -Parameter Sets: ByPath, ByLiteralPath -Aliases: +Type: String[] +Parameter Sets: (All) +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Passthru + +Returns an object that represents the security descriptor that was changed. By default, this cmdlet +does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: Required: False Position: Named @@ -174,89 +213,103 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Exclude -Omits the specified items. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -Path + +Changes the security descriptor of the specified item. Enter the path to an item, such as a path to +a file or registry key. Wildcards are permitted. + +If you pass a security object to **Set-Acl** (either by using the **AclObject** or +**SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and +you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the +security object. ```yaml Type: String[] -Parameter Sets: (All) -Aliases: +Parameter Sets: ByPath +Aliases: -Required: False -Position: Named +Required: True +Position: 1 Default value: None -Accept pipeline input: False -Accept wildcard characters: False +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True ``` -### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +### -CentralAccessPolicy + +Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of +a central access policy on the computer. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see [Dynamic Access Control: +Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String -Parameter Sets: (All) -Aliases: +Parameter Sets: ByPath, ByLiteralPath +Aliases: Required: False -Position: Named +Position: 3 Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Include -Changes only the specified items. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -ClearCentralAccessPolicy + +Removes the central access policy from the specified item. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see +[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). + +This parameter is introduced in Windows PowerShell 3.0. ```yaml -Type: String[] -Parameter Sets: (All) -Aliases: +Type: SwitchParameter +Parameter Sets: ByPath, ByLiteralPath +Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject -Changes the security descriptor of the specified object. -Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. -Instead, use the *InputObject* parameter explicitly in the command. +Changes the security descriptor of the specified object. Enter a variable that contains the object +or a command that gets the object. + +You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter +explicitly in the command. -This parameter was introduced in Windows PowerShell 3.0. +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: PSObject Parameter Sets: ByInputObject -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` ### -LiteralPath -Changes the security descriptor of the specified item. -Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. -This parameter was introduced in Windows PowerShell 3.0. +Changes the security descriptor of the specified item. Unlike **Path**, the value of the +**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as +wildcards. If the path includes escape characters, enclose it in single quotation marks. Single +quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String[] @@ -270,14 +323,14 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Passthru -Returns an object that represents the security descriptor that was changed. -By default, this cmdlet does not generate any output. +### -Confirm + +Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: cf Required: False Position: Named @@ -286,34 +339,14 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Path -Changes the security descriptor of the specified item. -Enter the path to an item, such as a path to a file or registry key. -Wildcards are permitted. +### -WhatIf -If you pass a security object to **Set-Acl** (either by using the *AclObject* or *SecurityDescriptor* parameter, or by passing a security object from Get-Acl to **Set-Acl**), and you omit the *Path* parameter (name and value), **Set-Acl** uses the path that is included in the security object. - -```yaml -Type: String[] -Parameter Sets: ByPath -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see about_Transactions. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: usetx +Aliases: wi Required: False Position: Named @@ -322,14 +355,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +### -UseTransaction + +Includes the command in the active transaction. This parameter is valid only when a transaction is +in progress. For more information, see about_Transactions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: wi +Aliases: usetx Required: False Position: Named @@ -339,27 +373,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Security.AccessControl.ObjectSecurity, System.Security.AccessControl.CommonSecurityDescriptor + You can pipe an ACL object or a security descriptor to **Set-Acl**. ## OUTPUTS ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. -However, if you use the *Passthru* parameter, it generates a security object. -The type of the security object depends on the type of the item. + +By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** +parameter, it generates a security object. The type of the security object depends on the type of +the item. ## NOTES -* The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. -* +- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. + As such, you can use it to change the security descriptors of files, directories, and registry + keys. + +- There may be additional providers that also support this interface, or extend it. For example, + the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the + security descriptor extensions used by Active Directory. ## RELATED LINKS [Get-Acl](Get-Acl.md) - - diff --git a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md index e617de4ce14e..26afdbe3b464 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md @@ -1,9 +1,9 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-07 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=821717 +online version: http://go.microsoft.com/fwlink/?LinkID=113389 external help file: Microsoft.PowerShell.Security.dll-Help.xml title: Set-Acl --- @@ -11,11 +11,14 @@ title: Set-Acl # Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item, such as a file or a registry key. + +Changes the security descriptor of a specified item. The ability to manage a security descriptor +can be extended to additional providers that support Powershell Objects. ## SYNTAX ### ByPath (Default) + ``` Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] @@ -23,12 +26,14 @@ Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] [-AclObject] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ### ByLiteralPath + ``` Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] @@ -36,136 +41,170 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl -Path "C:\Dog.txt" -PS C:\> Set-Acl -Path "C:\Cat.txt" -AclObject $DogACL +PS C:\> $DogACL = Get-Acl C:\Dog.txt +PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. -When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security +descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt +and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. -The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The +assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in +$DogACL. -The value of the *Path* parameter is the path to the Cat.txt file. -The value of the *AclObject* parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** +parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. + +### Example 2 -### Example 2: Use the pipeline operator to pass a descriptor ``` -PS C:\> Get-Acl -Path "C:\Dog.txt" | Set-Acl -Path "C:\Cat.txt" +PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a +pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the +**Set-Acl** cmdlet. -The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. +The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. -### Example 3: Apply a security descriptor to multiple files +### Example 3 + ``` PS C:\> $NewAcl = Get-Acl File0.txt -PS C:\> Get-ChildItem -Path "C:\temp" -Recurse -Include "*.txt" -Force | Set-Acl -AclObject $NewAcl +PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the +C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and +uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. -The *Recurse* parameter extends the command to all subdirectories of C:\temp. -The *Include* parameter limits the files retrieved to those with the ".txt" file name extension. -The *Force* parameter gets hidden files, which would otherwise be excluded. -(You cannot use "c:\temp\*.txt", because the *Recurse* parameter works on directories, not on files.) +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the +C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. +The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use +"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the *AclObject* parameter to all of the files in the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** +cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in +the pipeline. -In practice, it is best to use the *WhatIf* parameter with all **Set-Acl** commands that can affect more than one item. -In this case, the second command in the pipeline would be `Set-Acl -AclObject $NewAcl -WhatIf`. -This command lists the files that would be affected by the command. -After reviewing the result, you can run the command again without the *WhatIf* parameter. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can +affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl +-AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. -**Set-Acl** changes the ACL of item specified by the *Path* or *InputObject* parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the *AclObject* parameter to pass the variable, or type a Get-Acl command. +Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by +the **Path** or **InputObject** parameter to match the values in the specified security object. + +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter +to pass the variable, or type a Get-Acl command. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -CentralAccessPolicy -Establishes or changes the central access policy of the item. -Enter the CAP ID or friendly name of a central access policy on the computer. +### -Exclude + +Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a +path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may +support this parameter. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: True +``` -This parameter was introduced in Windows PowerShell 3.0. +### -Filter + +Specifies a filter in the provider's format or language. The value of this parameter qualifies the +**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the +provider. Filters are more efficient than other parameters, because the provider applies them when +retrieving the objects, rather than having Windows PowerShell filter the objects after they are +retrieved. Note: Not all providers may support this parameter. ```yaml Type: String -Parameter Sets: ByPath, ByLiteralPath -Aliases: +Parameter Sets: (All) +Aliases: Required: False -Position: 2 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept pipeline input: False +Accept wildcard characters: True ``` -### -ClearCentralAccessPolicy -Removes the central access policy from the specified item. - -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +### -Include -This parameter was introduced in Windows PowerShell 3.0. +Changes only the specified items. The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers +may support this parameter. ```yaml -Type: SwitchParameter -Parameter Sets: ByPath, ByLiteralPath -Aliases: +Type: String[] +Parameter Sets: (All) +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Passthru + +Returns an object that represents the security descriptor that was changed. By default, this cmdlet +does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: Required: False Position: Named @@ -174,89 +213,103 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Exclude -Omits the specified items. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -Path + +Changes the security descriptor of the specified item. Enter the path to an item, such as a path to +a file or registry key. Wildcards are permitted. + +If you pass a security object to **Set-Acl** (either by using the **AclObject** or +**SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and +you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the +security object. ```yaml Type: String[] -Parameter Sets: (All) -Aliases: +Parameter Sets: ByPath +Aliases: -Required: False -Position: Named +Required: True +Position: 1 Default value: None -Accept pipeline input: False -Accept wildcard characters: False +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True ``` -### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +### -CentralAccessPolicy + +Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of +a central access policy on the computer. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see [Dynamic Access Control: +Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String -Parameter Sets: (All) -Aliases: +Parameter Sets: ByPath, ByLiteralPath +Aliases: Required: False -Position: Named +Position: 3 Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Include -Changes only the specified items. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -ClearCentralAccessPolicy + +Removes the central access policy from the specified item. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see +[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). + +This parameter is introduced in Windows PowerShell 3.0. ```yaml -Type: String[] -Parameter Sets: (All) -Aliases: +Type: SwitchParameter +Parameter Sets: ByPath, ByLiteralPath +Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject -Changes the security descriptor of the specified object. -Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. -Instead, use the *InputObject* parameter explicitly in the command. +Changes the security descriptor of the specified object. Enter a variable that contains the object +or a command that gets the object. + +You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter +explicitly in the command. -This parameter was introduced in Windows PowerShell 3.0. +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: PSObject Parameter Sets: ByInputObject -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` ### -LiteralPath -Changes the security descriptor of the specified item. -Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. -This parameter was introduced in Windows PowerShell 3.0. +Changes the security descriptor of the specified item. Unlike **Path**, the value of the +**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as +wildcards. If the path includes escape characters, enclose it in single quotation marks. Single +quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String[] @@ -270,50 +323,30 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Passthru -Returns an object that represents the security descriptor that was changed. -By default, this cmdlet does not generate any output. +### -Confirm + +Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: cf Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -Path -Changes the security descriptor of the specified item. -Enter the path to an item, such as a path to a file or registry key. -Wildcards are permitted. +### -WhatIf -If you pass a security object to **Set-Acl** (either by using the *AclObject* or *SecurityDescriptor* parameter, or by passing a security object from Get-Acl to **Set-Acl**), and you omit the *Path* parameter (name and value), **Set-Acl** uses the path that is included in the security object. - -```yaml -Type: String[] -Parameter Sets: ByPath -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see about_Transactions. +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: usetx +Aliases: wi Required: False Position: Named @@ -322,14 +355,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +### -UseTransaction + +Includes the command in the active transaction. This parameter is valid only when a transaction is +in progress. For more information, see about_Transactions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: wi +Aliases: usetx Required: False Position: Named @@ -339,27 +373,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Security.AccessControl.ObjectSecurity, System.Security.AccessControl.CommonSecurityDescriptor + You can pipe an ACL object or a security descriptor to **Set-Acl**. ## OUTPUTS ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. -However, if you use the *Passthru* parameter, it generates a security object. -The type of the security object depends on the type of the item. + +By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** +parameter, it generates a security object. The type of the security object depends on the type of +the item. ## NOTES -* The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. -* +- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. + As such, you can use it to change the security descriptors of files, directories, and registry + keys. + +- There may be additional providers that also support this interface, or extend it. For example, + the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the + security descriptor extensions used by Active Directory. ## RELATED LINKS [Get-Acl](Get-Acl.md) - - diff --git a/reference/6/Microsoft.PowerShell.Security/Set-Acl.md b/reference/6/Microsoft.PowerShell.Security/Set-Acl.md index a795f5ee3088..751c008f40b6 100644 --- a/reference/6/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/6/Microsoft.PowerShell.Security/Set-Acl.md @@ -1,9 +1,9 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-11-07 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=821717 +online version: http://go.microsoft.com/fwlink/?LinkID=113389 external help file: Microsoft.PowerShell.Security.dll-Help.xml title: Set-Acl --- @@ -11,11 +11,14 @@ title: Set-Acl # Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item, such as a file or a registry key. + +Changes the security descriptor of a specified item. The ability to manage a security descriptor +can be extended to additional providers that support Powershell Objects. ## SYNTAX ### ByPath (Default) + ``` Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] @@ -23,12 +26,14 @@ Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] [-AclObject] [-Passthru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ### ByLiteralPath + ``` Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] [-Passthru] [-Filter ] [-Include ] [-Exclude ] @@ -36,136 +41,170 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl -Path "C:\Dog.txt" -PS C:\> Set-Acl -Path "C:\Cat.txt" -AclObject $DogACL +PS C:\> $DogACL = Get-Acl C:\Dog.txt +PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. -When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security +descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt +and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. -The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The +assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in +$DogACL. -The value of the *Path* parameter is the path to the Cat.txt file. -The value of the *AclObject* parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** +parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. + +### Example 2 -### Example 2: Use the pipeline operator to pass a descriptor ``` -PS C:\> Get-Acl -Path "C:\Dog.txt" | Set-Acl -Path "C:\Cat.txt" +PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a +pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the +**Set-Acl** cmdlet. -The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. +The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. -### Example 3: Apply a security descriptor to multiple files +### Example 3 + ``` PS C:\> $NewAcl = Get-Acl File0.txt -PS C:\> Get-ChildItem -Path "C:\temp" -Recurse -Include "*.txt" -Force | Set-Acl -AclObject $NewAcl +PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the +C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and +uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. -The *Recurse* parameter extends the command to all subdirectories of C:\temp. -The *Include* parameter limits the files retrieved to those with the ".txt" file name extension. -The *Force* parameter gets hidden files, which would otherwise be excluded. -(You cannot use "c:\temp\*.txt", because the *Recurse* parameter works on directories, not on files.) +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the +C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. +The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use +"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the *AclObject* parameter to all of the files in the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** +cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in +the pipeline. -In practice, it is best to use the *WhatIf* parameter with all **Set-Acl** commands that can affect more than one item. -In this case, the second command in the pipeline would be `Set-Acl -AclObject $NewAcl -WhatIf`. -This command lists the files that would be affected by the command. -After reviewing the result, you can run the command again without the *WhatIf* parameter. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can +affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl +-AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. -**Set-Acl** changes the ACL of item specified by the *Path* or *InputObject* parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the *AclObject* parameter to pass the variable, or type a Get-Acl command. +Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by +the **Path** or **InputObject** parameter to match the values in the specified security object. + +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter +to pass the variable, or type a Get-Acl command. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: True -Position: 1 +Position: 2 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -CentralAccessPolicy -Establishes or changes the central access policy of the item. -Enter the CAP ID or friendly name of a central access policy on the computer. +### -Exclude + +Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a +path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may +support this parameter. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: True +``` -This parameter was introduced in Windows PowerShell 3.0. +### -Filter + +Specifies a filter in the provider's format or language. The value of this parameter qualifies the +**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the +provider. Filters are more efficient than other parameters, because the provider applies them when +retrieving the objects, rather than having Windows PowerShell filter the objects after they are +retrieved. Note: Not all providers may support this parameter. ```yaml Type: String -Parameter Sets: ByPath, ByLiteralPath -Aliases: +Parameter Sets: (All) +Aliases: Required: False -Position: 2 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False +Accept pipeline input: False +Accept wildcard characters: True ``` -### -ClearCentralAccessPolicy -Removes the central access policy from the specified item. - -Beginning in Windows Server® 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. -For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +### -Include -This parameter was introduced in Windows PowerShell 3.0. +Changes only the specified items. The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers +may support this parameter. ```yaml -Type: SwitchParameter -Parameter Sets: ByPath, ByLiteralPath -Aliases: +Type: String[] +Parameter Sets: (All) +Aliases: Required: False Position: Named Default value: None Accept pipeline input: False -Accept wildcard characters: False +Accept wildcard characters: True ``` -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Passthru + +Returns an object that represents the security descriptor that was changed. By default, this cmdlet +does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf +Aliases: Required: False Position: Named @@ -174,89 +213,103 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Exclude -Omits the specified items. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -Path + +Changes the security descriptor of the specified item. Enter the path to an item, such as a path to +a file or registry key. Wildcards are permitted. + +If you pass a security object to **Set-Acl** (either by using the **AclObject** or +**SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and +you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the +security object. ```yaml Type: String[] -Parameter Sets: (All) -Aliases: +Parameter Sets: ByPath +Aliases: -Required: False -Position: Named +Required: True +Position: 1 Default value: None -Accept pipeline input: False -Accept wildcard characters: False +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True ``` -### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the *Path* parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +### -CentralAccessPolicy + +Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of +a central access policy on the computer. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see [Dynamic Access Control: +Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String -Parameter Sets: (All) -Aliases: +Parameter Sets: ByPath, ByLiteralPath +Aliases: Required: False -Position: Named +Position: 3 Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Include -Changes only the specified items. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +### -ClearCentralAccessPolicy + +Removes the central access policy from the specified item. + +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set +central access policies for users and groups. For more information, see +[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). + +This parameter is introduced in Windows PowerShell 3.0. ```yaml -Type: String[] -Parameter Sets: (All) -Aliases: +Type: SwitchParameter +Parameter Sets: ByPath, ByLiteralPath +Aliases: Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject -Changes the security descriptor of the specified object. -Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. -Instead, use the *InputObject* parameter explicitly in the command. +Changes the security descriptor of the specified object. Enter a variable that contains the object +or a command that gets the object. -This parameter was introduced in Windows PowerShell 3.0. +You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter +explicitly in the command. + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: PSObject Parameter Sets: ByInputObject -Aliases: +Aliases: Required: True -Position: 0 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` ### -LiteralPath -Changes the security descriptor of the specified item. -Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. -This parameter was introduced in Windows PowerShell 3.0. +Changes the security descriptor of the specified item. Unlike **Path**, the value of the +**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as +wildcards. If the path includes escape characters, enclose it in single quotation marks. Single +quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. + +This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String[] @@ -270,52 +323,30 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Passthru -Returns an object that represents the security descriptor that was changed. -By default, this cmdlet does not generate any output. +### -Confirm + +Prompts you for confirmation before running the cmdlet. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: cf Required: False Position: Named -Default value: None +Default value: False Accept pipeline input: False Accept wildcard characters: False ``` -### -Path -Changes the security descriptor of the specified item. -Enter the path to an item, such as a path to a file or registry key. -Wildcards are permitted. - -If you pass a security object to **Set-Acl** (either by using the *AclObject* or *SecurityDescriptor* parameter, or by passing a security object from Get-Acl to **Set-Acl**), and you omit the *Path* parameter (name and value), **Set-Acl** uses the path that is included in the security object. - -```yaml -Type: String[] -Parameter Sets: ByPath -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` +### -WhatIf -### -UseTransaction -Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see Includes the command in the active transaction. -This parameter is valid only when a transaction is in progress. -For more information, see +Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: usetx +Aliases: wi Required: False Position: Named @@ -324,14 +355,15 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. +### -UseTransaction + +Includes the command in the active transaction. This parameter is valid only when a transaction is +in progress. For more information, see about_Transactions. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: wi +Aliases: usetx Required: False Position: Named @@ -341,26 +373,36 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see about_CommonParameters +(http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS ### System.Security.AccessControl.ObjectSecurity, System.Security.AccessControl.CommonSecurityDescriptor + You can pipe an ACL object or a security descriptor to **Set-Acl**. ## OUTPUTS ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. -However, if you use the *Passthru* parameter, it generates a security object. -The type of the security object depends on the type of the item. + +By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** +parameter, it generates a security object. The type of the security object depends on the type of +the item. ## NOTES -* The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. -* +- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. + As such, you can use it to change the security descriptors of files, directories, and registry + keys. + +- There may be additional providers that also support this interface, or extend it. For example, + the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the + security descriptor extensions used by Active Directory. ## RELATED LINKS [Get-Acl](Get-Acl.md) - From 9799c2b11ba6d89e9ccc7892b222ac391014b1f8 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Fri, 10 Nov 2017 11:11:12 -0800 Subject: [PATCH 013/145] using semantic link breaks --- .../Microsoft.PowerShell.Security/Set-Acl.md | 165 +++++++++--------- .../Microsoft.PowerShell.Security/Set-Acl.md | 165 +++++++++--------- .../Microsoft.PowerShell.Security/Set-Acl.md | 165 +++++++++--------- .../Microsoft.PowerShell.Security/Set-Acl.md | 165 +++++++++--------- .../Microsoft.PowerShell.Security/Set-Acl.md | 165 +++++++++--------- 5 files changed, 390 insertions(+), 435 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md index 26afdbe3b464..27ca1b9e3071 100644 --- a/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -12,8 +12,8 @@ title: Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item. The ability to manage a security descriptor -can be extended to additional providers that support Powershell Objects. +Changes the security descriptor of a specified item. +The ability to manage a security descriptor can be extended to additional providers that support Powershell Objects. ## SYNTAX @@ -42,15 +42,12 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security -descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt -and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. +When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The -assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. +The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in -$DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. -The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** -parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. +The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 @@ -80,12 +75,10 @@ parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $Do PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a -pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the -**Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. @@ -97,36 +90,31 @@ PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the -C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and -uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the -C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. +The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use -"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. +(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** -cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in -the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can -affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl --AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. +In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". +This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by -the **Path** or **InputObject** parameter to match the values in the specified security object. +Specifies an ACL with the desired property values. +**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter -to pass the variable, or type a Get-Acl command. +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. ```yaml Type: Object @@ -142,9 +130,11 @@ Accept wildcard characters: False ### -Exclude -Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a -path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may -support this parameter. +Omits the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -160,11 +150,11 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. Filters are more efficient than other parameters, because the provider applies them when -retrieving the objects, rather than having Windows PowerShell filter the objects after they are -retrieved. Note: Not all providers may support this parameter. +Specifies a filter in the provider's format or language. +The value of this parameter qualifies the **Path** parameter. +The syntax of the filter, including the use of wildcards, depends on the provider. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Note: Not all providers may support this parameter. ```yaml Type: String @@ -180,9 +170,11 @@ Accept wildcard characters: True ### -Include -Changes only the specified items. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers -may support this parameter. +Changes only the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -198,8 +190,8 @@ Accept wildcard characters: True ### -Passthru -Returns an object that represents the security descriptor that was changed. By default, this cmdlet -does not generate any output. +Returns an object that represents the security descriptor that was changed. +By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter @@ -215,8 +207,9 @@ Accept wildcard characters: False ### -Path -Changes the security descriptor of the specified item. Enter the path to an item, such as a path to -a file or registry key. Wildcards are permitted. +Changes the security descriptor of the specified item. +Enter the path to an item, such as a path to a file or registry key. +Wildcards are permitted. If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and @@ -237,12 +230,12 @@ Accept wildcard characters: True ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of -a central access policy on the computer. +Establishes or changes the central access policy of the item. +Enter the CAP ID or friendly name of a central access policy on the computer. Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see [Dynamic Access Control: -Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -262,9 +255,8 @@ Accept wildcard characters: False Removes the central access policy from the specified item. -Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see -[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -282,11 +274,11 @@ Accept wildcard characters: False ### -InputObject -Changes the security descriptor of the specified object. Enter a variable that contains the object -or a command that gets the object. +Changes the security descriptor of the specified object. +Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter -explicitly in the command. +You cannot pipe the object to be changed to **Set-Acl**. +Instead, use the **InputObject** parameter explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. @@ -304,10 +296,11 @@ Accept wildcard characters: False ### -LiteralPath -Changes the security descriptor of the specified item. Unlike **Path**, the value of the -**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as -wildcards. If the path includes escape characters, enclose it in single quotation marks. Single -quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Changes the security descriptor of the specified item. +Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -341,7 +334,8 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: SwitchParameter @@ -357,8 +351,9 @@ Accept wildcard characters: False ### -UseTransaction -Includes the command in the active transaction. This parameter is valid only when a transaction is -in progress. For more information, see about_Transactions. +Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -374,10 +369,8 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, --InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see about_CommonParameters -(http://go.microsoft.com/fwlink/?LinkID=113216). +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). ## INPUTS @@ -389,19 +382,17 @@ You can pipe an ACL object or a security descriptor to **Set-Acl**. ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** -parameter, it generates a security object. The type of the security object depends on the type of -the item. +By default, **Set-Acl** does not generate any output. +However, if you use the **Passthru** parameter, it generates a security object. +The type of the security object depends on the type of the item. ## NOTES -- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. - As such, you can use it to change the security descriptors of files, directories, and registry - keys. +The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. +As such, you can use it to change the security descriptors of files, directories, and registry keys. -- There may be additional providers that also support this interface, or extend it. For example, - the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the - security descriptor extensions used by Active Directory. +There may be additional providers that also support this interface, or extend it. +For example, the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the security descriptor extensions used by Active Directory. ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md index 26afdbe3b464..27ca1b9e3071 100644 --- a/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/4.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -12,8 +12,8 @@ title: Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item. The ability to manage a security descriptor -can be extended to additional providers that support Powershell Objects. +Changes the security descriptor of a specified item. +The ability to manage a security descriptor can be extended to additional providers that support Powershell Objects. ## SYNTAX @@ -42,15 +42,12 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security -descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt -and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. +When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The -assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. +The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in -$DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. -The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** -parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. +The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 @@ -80,12 +75,10 @@ parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $Do PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a -pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the -**Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. @@ -97,36 +90,31 @@ PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the -C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and -uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the -C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. +The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use -"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. +(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** -cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in -the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can -affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl --AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. +In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". +This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by -the **Path** or **InputObject** parameter to match the values in the specified security object. +Specifies an ACL with the desired property values. +**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter -to pass the variable, or type a Get-Acl command. +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. ```yaml Type: Object @@ -142,9 +130,11 @@ Accept wildcard characters: False ### -Exclude -Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a -path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may -support this parameter. +Omits the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -160,11 +150,11 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. Filters are more efficient than other parameters, because the provider applies them when -retrieving the objects, rather than having Windows PowerShell filter the objects after they are -retrieved. Note: Not all providers may support this parameter. +Specifies a filter in the provider's format or language. +The value of this parameter qualifies the **Path** parameter. +The syntax of the filter, including the use of wildcards, depends on the provider. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Note: Not all providers may support this parameter. ```yaml Type: String @@ -180,9 +170,11 @@ Accept wildcard characters: True ### -Include -Changes only the specified items. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers -may support this parameter. +Changes only the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -198,8 +190,8 @@ Accept wildcard characters: True ### -Passthru -Returns an object that represents the security descriptor that was changed. By default, this cmdlet -does not generate any output. +Returns an object that represents the security descriptor that was changed. +By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter @@ -215,8 +207,9 @@ Accept wildcard characters: False ### -Path -Changes the security descriptor of the specified item. Enter the path to an item, such as a path to -a file or registry key. Wildcards are permitted. +Changes the security descriptor of the specified item. +Enter the path to an item, such as a path to a file or registry key. +Wildcards are permitted. If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and @@ -237,12 +230,12 @@ Accept wildcard characters: True ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of -a central access policy on the computer. +Establishes or changes the central access policy of the item. +Enter the CAP ID or friendly name of a central access policy on the computer. Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see [Dynamic Access Control: -Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -262,9 +255,8 @@ Accept wildcard characters: False Removes the central access policy from the specified item. -Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see -[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -282,11 +274,11 @@ Accept wildcard characters: False ### -InputObject -Changes the security descriptor of the specified object. Enter a variable that contains the object -or a command that gets the object. +Changes the security descriptor of the specified object. +Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter -explicitly in the command. +You cannot pipe the object to be changed to **Set-Acl**. +Instead, use the **InputObject** parameter explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. @@ -304,10 +296,11 @@ Accept wildcard characters: False ### -LiteralPath -Changes the security descriptor of the specified item. Unlike **Path**, the value of the -**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as -wildcards. If the path includes escape characters, enclose it in single quotation marks. Single -quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Changes the security descriptor of the specified item. +Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -341,7 +334,8 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: SwitchParameter @@ -357,8 +351,9 @@ Accept wildcard characters: False ### -UseTransaction -Includes the command in the active transaction. This parameter is valid only when a transaction is -in progress. For more information, see about_Transactions. +Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -374,10 +369,8 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, --InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see about_CommonParameters -(http://go.microsoft.com/fwlink/?LinkID=113216). +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). ## INPUTS @@ -389,19 +382,17 @@ You can pipe an ACL object or a security descriptor to **Set-Acl**. ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** -parameter, it generates a security object. The type of the security object depends on the type of -the item. +By default, **Set-Acl** does not generate any output. +However, if you use the **Passthru** parameter, it generates a security object. +The type of the security object depends on the type of the item. ## NOTES -- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. - As such, you can use it to change the security descriptors of files, directories, and registry - keys. +The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. +As such, you can use it to change the security descriptors of files, directories, and registry keys. -- There may be additional providers that also support this interface, or extend it. For example, - the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the - security descriptor extensions used by Active Directory. +There may be additional providers that also support this interface, or extend it. +For example, the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the security descriptor extensions used by Active Directory. ## RELATED LINKS diff --git a/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md index 26afdbe3b464..27ca1b9e3071 100644 --- a/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -12,8 +12,8 @@ title: Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item. The ability to manage a security descriptor -can be extended to additional providers that support Powershell Objects. +Changes the security descriptor of a specified item. +The ability to manage a security descriptor can be extended to additional providers that support Powershell Objects. ## SYNTAX @@ -42,15 +42,12 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security -descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt -and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. +When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The -assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. +The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in -$DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. -The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** -parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. +The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 @@ -80,12 +75,10 @@ parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $Do PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a -pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the -**Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. @@ -97,36 +90,31 @@ PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the -C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and -uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the -C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. +The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use -"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. +(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** -cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in -the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can -affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl --AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. +In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". +This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by -the **Path** or **InputObject** parameter to match the values in the specified security object. +Specifies an ACL with the desired property values. +**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter -to pass the variable, or type a Get-Acl command. +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. ```yaml Type: Object @@ -142,9 +130,11 @@ Accept wildcard characters: False ### -Exclude -Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a -path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may -support this parameter. +Omits the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -160,11 +150,11 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. Filters are more efficient than other parameters, because the provider applies them when -retrieving the objects, rather than having Windows PowerShell filter the objects after they are -retrieved. Note: Not all providers may support this parameter. +Specifies a filter in the provider's format or language. +The value of this parameter qualifies the **Path** parameter. +The syntax of the filter, including the use of wildcards, depends on the provider. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Note: Not all providers may support this parameter. ```yaml Type: String @@ -180,9 +170,11 @@ Accept wildcard characters: True ### -Include -Changes only the specified items. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers -may support this parameter. +Changes only the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -198,8 +190,8 @@ Accept wildcard characters: True ### -Passthru -Returns an object that represents the security descriptor that was changed. By default, this cmdlet -does not generate any output. +Returns an object that represents the security descriptor that was changed. +By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter @@ -215,8 +207,9 @@ Accept wildcard characters: False ### -Path -Changes the security descriptor of the specified item. Enter the path to an item, such as a path to -a file or registry key. Wildcards are permitted. +Changes the security descriptor of the specified item. +Enter the path to an item, such as a path to a file or registry key. +Wildcards are permitted. If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and @@ -237,12 +230,12 @@ Accept wildcard characters: True ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of -a central access policy on the computer. +Establishes or changes the central access policy of the item. +Enter the CAP ID or friendly name of a central access policy on the computer. Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see [Dynamic Access Control: -Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -262,9 +255,8 @@ Accept wildcard characters: False Removes the central access policy from the specified item. -Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see -[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -282,11 +274,11 @@ Accept wildcard characters: False ### -InputObject -Changes the security descriptor of the specified object. Enter a variable that contains the object -or a command that gets the object. +Changes the security descriptor of the specified object. +Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter -explicitly in the command. +You cannot pipe the object to be changed to **Set-Acl**. +Instead, use the **InputObject** parameter explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. @@ -304,10 +296,11 @@ Accept wildcard characters: False ### -LiteralPath -Changes the security descriptor of the specified item. Unlike **Path**, the value of the -**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as -wildcards. If the path includes escape characters, enclose it in single quotation marks. Single -quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Changes the security descriptor of the specified item. +Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -341,7 +334,8 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: SwitchParameter @@ -357,8 +351,9 @@ Accept wildcard characters: False ### -UseTransaction -Includes the command in the active transaction. This parameter is valid only when a transaction is -in progress. For more information, see about_Transactions. +Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -374,10 +369,8 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, --InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see about_CommonParameters -(http://go.microsoft.com/fwlink/?LinkID=113216). +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). ## INPUTS @@ -389,19 +382,17 @@ You can pipe an ACL object or a security descriptor to **Set-Acl**. ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** -parameter, it generates a security object. The type of the security object depends on the type of -the item. +By default, **Set-Acl** does not generate any output. +However, if you use the **Passthru** parameter, it generates a security object. +The type of the security object depends on the type of the item. ## NOTES -- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. - As such, you can use it to change the security descriptors of files, directories, and registry - keys. +The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. +As such, you can use it to change the security descriptors of files, directories, and registry keys. -- There may be additional providers that also support this interface, or extend it. For example, - the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the - security descriptor extensions used by Active Directory. +There may be additional providers that also support this interface, or extend it. +For example, the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the security descriptor extensions used by Active Directory. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md index 26afdbe3b464..27ca1b9e3071 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md @@ -12,8 +12,8 @@ title: Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item. The ability to manage a security descriptor -can be extended to additional providers that support Powershell Objects. +Changes the security descriptor of a specified item. +The ability to manage a security descriptor can be extended to additional providers that support Powershell Objects. ## SYNTAX @@ -42,15 +42,12 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security -descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt -and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. +When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The -assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. +The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in -$DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. -The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** -parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. +The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 @@ -80,12 +75,10 @@ parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $Do PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a -pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the -**Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. @@ -97,36 +90,31 @@ PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the -C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and -uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the -C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. +The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use -"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. +(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** -cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in -the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can -affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl --AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. +In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". +This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by -the **Path** or **InputObject** parameter to match the values in the specified security object. +Specifies an ACL with the desired property values. +**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter -to pass the variable, or type a Get-Acl command. +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. ```yaml Type: Object @@ -142,9 +130,11 @@ Accept wildcard characters: False ### -Exclude -Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a -path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may -support this parameter. +Omits the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -160,11 +150,11 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. Filters are more efficient than other parameters, because the provider applies them when -retrieving the objects, rather than having Windows PowerShell filter the objects after they are -retrieved. Note: Not all providers may support this parameter. +Specifies a filter in the provider's format or language. +The value of this parameter qualifies the **Path** parameter. +The syntax of the filter, including the use of wildcards, depends on the provider. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Note: Not all providers may support this parameter. ```yaml Type: String @@ -180,9 +170,11 @@ Accept wildcard characters: True ### -Include -Changes only the specified items. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers -may support this parameter. +Changes only the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -198,8 +190,8 @@ Accept wildcard characters: True ### -Passthru -Returns an object that represents the security descriptor that was changed. By default, this cmdlet -does not generate any output. +Returns an object that represents the security descriptor that was changed. +By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter @@ -215,8 +207,9 @@ Accept wildcard characters: False ### -Path -Changes the security descriptor of the specified item. Enter the path to an item, such as a path to -a file or registry key. Wildcards are permitted. +Changes the security descriptor of the specified item. +Enter the path to an item, such as a path to a file or registry key. +Wildcards are permitted. If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and @@ -237,12 +230,12 @@ Accept wildcard characters: True ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of -a central access policy on the computer. +Establishes or changes the central access policy of the item. +Enter the CAP ID or friendly name of a central access policy on the computer. Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see [Dynamic Access Control: -Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -262,9 +255,8 @@ Accept wildcard characters: False Removes the central access policy from the specified item. -Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see -[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -282,11 +274,11 @@ Accept wildcard characters: False ### -InputObject -Changes the security descriptor of the specified object. Enter a variable that contains the object -or a command that gets the object. +Changes the security descriptor of the specified object. +Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter -explicitly in the command. +You cannot pipe the object to be changed to **Set-Acl**. +Instead, use the **InputObject** parameter explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. @@ -304,10 +296,11 @@ Accept wildcard characters: False ### -LiteralPath -Changes the security descriptor of the specified item. Unlike **Path**, the value of the -**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as -wildcards. If the path includes escape characters, enclose it in single quotation marks. Single -quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Changes the security descriptor of the specified item. +Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -341,7 +334,8 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: SwitchParameter @@ -357,8 +351,9 @@ Accept wildcard characters: False ### -UseTransaction -Includes the command in the active transaction. This parameter is valid only when a transaction is -in progress. For more information, see about_Transactions. +Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -374,10 +369,8 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, --InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see about_CommonParameters -(http://go.microsoft.com/fwlink/?LinkID=113216). +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). ## INPUTS @@ -389,19 +382,17 @@ You can pipe an ACL object or a security descriptor to **Set-Acl**. ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** -parameter, it generates a security object. The type of the security object depends on the type of -the item. +By default, **Set-Acl** does not generate any output. +However, if you use the **Passthru** parameter, it generates a security object. +The type of the security object depends on the type of the item. ## NOTES -- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. - As such, you can use it to change the security descriptors of files, directories, and registry - keys. +The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. +As such, you can use it to change the security descriptors of files, directories, and registry keys. -- There may be additional providers that also support this interface, or extend it. For example, - the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the - security descriptor extensions used by Active Directory. +There may be additional providers that also support this interface, or extend it. +For example, the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the security descriptor extensions used by Active Directory. ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Security/Set-Acl.md b/reference/6/Microsoft.PowerShell.Security/Set-Acl.md index 751c008f40b6..609150b9dfe5 100644 --- a/reference/6/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/6/Microsoft.PowerShell.Security/Set-Acl.md @@ -12,8 +12,8 @@ title: Set-Acl ## SYNOPSIS -Changes the security descriptor of a specified item. The ability to manage a security descriptor -can be extended to additional providers that support Powershell Objects. +Changes the security descriptor of a specified item. +The ability to manage a security descriptor can be extended to additional providers that support Powershell Objects. ## SYNTAX @@ -42,15 +42,12 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL ``` -These commands copy the values from the security descriptor of the Dog.txt file to the security -descriptor of the Cat.txt file. When the commands complete, the security descriptors of the Dog.txt -and Cat.txt files are identical. +These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. +When the commands complete, the security descriptors of the Dog.txt and Cat.txt files are identical. -The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The -assignment operator (=) stores the security descriptor in the value of the $DogACL variable. +The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. +The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in -$DogACL. +The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. -The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** -parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. +The value of the **Path** parameter is the path to the Cat.txt file. +The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. ### Example 2 @@ -80,12 +75,10 @@ parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $Do PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt ``` -This command is almost the same as the command in the previous example, except that it uses a -pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the -**Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. @@ -97,36 +90,31 @@ PS C:\> $NewAcl = Get-Acl File0.txt PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl ``` -These commands apply the security descriptors in the File0.txt file to all text files in the -C:\Temp directory and all of its subdirectories. +These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. -The first command gets the security descriptor of the File0.txt file in the current directory and -uses the assignment operator (=) to store it in the $NewACL variable. +The first command gets the security descriptor of the File0.txt file in the current directory and uses the assignment operator (=) to store it in the $NewACL variable. -The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the -C:\Temp directory. The **Recurse** parameter extends the command to all subdirectories of C:\temp. +The first command in the pipeline uses the Get-ChildItem cmdlet to get all of the text files in the C:\Temp directory. +The **Recurse** parameter extends the command to all subdirectories of C:\temp. The **Include** parameter limits the files retrieved to those with the ".txt" file name extension. -The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use -"c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) +The **Force** parameter gets hidden files, which would otherwise be excluded. +(You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** -cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in -the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can -affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl --AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. +In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. +In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". +This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. ## PARAMETERS ### -AclObject -Specifies an ACL with the desired property values. **Set-Acl** changes the ACL of item specified by -the **Path** or **InputObject** parameter to match the values in the specified security object. +Specifies an ACL with the desired property values. +**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. -You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter -to pass the variable, or type a Get-Acl command. +You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. ```yaml Type: Object @@ -142,9 +130,11 @@ Accept wildcard characters: False ### -Exclude -Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a -path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers may -support this parameter. +Omits the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -160,11 +150,11 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. Filters are more efficient than other parameters, because the provider applies them when -retrieving the objects, rather than having Windows PowerShell filter the objects after they are -retrieved. Note: Not all providers may support this parameter. +Specifies a filter in the provider's format or language. +The value of this parameter qualifies the **Path** parameter. +The syntax of the filter, including the use of wildcards, depends on the provider. +Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having Windows PowerShell filter the objects after they are retrieved. +Note: Not all providers may support this parameter. ```yaml Type: String @@ -180,9 +170,11 @@ Accept wildcard characters: True ### -Include -Changes only the specified items. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". Wildcards are permitted. Note: Not all providers -may support this parameter. +Changes only the specified items. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as "*.txt". +Wildcards are permitted. +Note: Not all providers may support this parameter. ```yaml Type: String[] @@ -198,8 +190,8 @@ Accept wildcard characters: True ### -Passthru -Returns an object that represents the security descriptor that was changed. By default, this cmdlet -does not generate any output. +Returns an object that represents the security descriptor that was changed. +By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter @@ -215,8 +207,9 @@ Accept wildcard characters: False ### -Path -Changes the security descriptor of the specified item. Enter the path to an item, such as a path to -a file or registry key. Wildcards are permitted. +Changes the security descriptor of the specified item. +Enter the path to an item, such as a path to a file or registry key. +Wildcards are permitted. If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and @@ -237,12 +230,12 @@ Accept wildcard characters: True ### -CentralAccessPolicy -Establishes or changes the central access policy of the item. Enter the CAP ID or friendly name of -a central access policy on the computer. +Establishes or changes the central access policy of the item. +Enter the CAP ID or friendly name of a central access policy on the computer. Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see [Dynamic Access Control: -Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -262,9 +255,8 @@ Accept wildcard characters: False Removes the central access policy from the specified item. -Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set -central access policies for users and groups. For more information, see -[Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). +Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups. +For more information, see [Dynamic Access Control: Scenario Overview](http://go.microsoft.com/fwlink/?LinkId=238408). This parameter is introduced in Windows PowerShell 3.0. @@ -282,11 +274,11 @@ Accept wildcard characters: False ### -InputObject -Changes the security descriptor of the specified object. Enter a variable that contains the object -or a command that gets the object. +Changes the security descriptor of the specified object. +Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. Instead, use the **InputObject** parameter -explicitly in the command. +You cannot pipe the object to be changed to **Set-Acl**. +Instead, use the **InputObject** parameter explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. @@ -304,10 +296,11 @@ Accept wildcard characters: False ### -LiteralPath -Changes the security descriptor of the specified item. Unlike **Path**, the value of the -**LiteralPath** parameter is used exactly as it is typed. No characters are interpreted as -wildcards. If the path includes escape characters, enclose it in single quotation marks. Single -quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. +Changes the security descriptor of the specified item. +Unlike **Path**, the value of the **LiteralPath** parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. This parameter is introduced in Windows PowerShell 3.0. @@ -341,7 +334,8 @@ Accept wildcard characters: False ### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. +Shows what would happen if the cmdlet runs. +The cmdlet is not run. ```yaml Type: SwitchParameter @@ -357,8 +351,9 @@ Accept wildcard characters: False ### -UseTransaction -Includes the command in the active transaction. This parameter is valid only when a transaction is -in progress. For more information, see about_Transactions. +Includes the command in the active transaction. +This parameter is valid only when a transaction is in progress. +For more information, see about_Transactions. ```yaml Type: SwitchParameter @@ -374,10 +369,8 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, --InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see about_CommonParameters -(http://go.microsoft.com/fwlink/?LinkID=113216). +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). ## INPUTS @@ -389,19 +382,17 @@ You can pipe an ACL object or a security descriptor to **Set-Acl**. ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. However, if you use the **Passthru** -parameter, it generates a security object. The type of the security object depends on the type of -the item. +By default, **Set-Acl** does not generate any output. +However, if you use the **Passthru** parameter, it generates a security object. +The type of the security object depends on the type of the item. ## NOTES -- The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. - As such, you can use it to change the security descriptors of files, directories, and registry - keys. +The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. +As such, you can use it to change the security descriptors of files, directories, and registry keys. -- There may be additional providers that also support this interface, or extend it. For example, - the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the - security descriptor extensions used by Active Directory. +There may be additional providers that also support this interface, or extend it. +For example, the Active Directory Provider defines a new ActiveDirectoryAccessRule class to implement the security descriptor extensions used by Active Directory. ## RELATED LINKS From a5f21c5808fcff6d283a01a4d5f3793bd31eb92b Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Tue, 14 Nov 2017 01:25:59 +0900 Subject: [PATCH 014/145] Fix the example of `Format-Wide -ShowError` (#1851) --- .../Microsoft.PowerShell.Utility/Format-Wide.md | 16 ++++++++-------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 16 ++++++++-------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 14 +++++++------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 14 +++++++------- .../Microsoft.PowerShell.Utility/Format-Wide.md | 14 +++++++------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md index 74b467467e59..9952a8efcdc1 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -208,18 +208,18 @@ Accept wildcard characters: True ``` ### -ShowError -Sends errors through the pipeline. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Wide command, and the expressions do not appear to be working. -The following shows an example of the results of adding the ShowError parameter with an expression. +Indicates that the cmdlet sends errors through the pipeline. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **ShowError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -ShowError -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday Failed to evaluate expression " $_ / $null ". - + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) \[\], RuntimeException + + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) [], RuntimeException + FullyQualifiedErrorId : mshExpressionError +``` ```yaml Type: SwitchParameter diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md index 54b29b78d57f..9c8e33a81766 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -213,18 +213,18 @@ Accept wildcard characters: True ``` ### -ShowError -Sends errors through the pipeline. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Wide command, and the expressions do not appear to be working. -The following shows an example of the results of adding the ShowError parameter with an expression. +Indicates that the cmdlet sends errors through the pipeline. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **ShowError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -ShowError -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday Failed to evaluate expression " $_ / $null ". - + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) \[\], RuntimeException + + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) [], RuntimeException + FullyQualifiedErrorId : mshExpressionError +``` ```yaml Type: SwitchParameter diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md index 5b4d2a6b5c50..ec9b0eba9f2b 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Format-Wide.md @@ -217,17 +217,17 @@ Accept wildcard characters: False ### -ShowError Indicates that the cmdlet sends errors through the pipeline. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Wide** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *ShowError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **ShowError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -ShowError -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday Failed to evaluate expression " $_ / $null ". - + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) \[\], RuntimeException + + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) [], RuntimeException + FullyQualifiedErrorId : mshExpressionError +``` ```yaml Type: SwitchParameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md index 0b9181c73b5f..a0930b259b7a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md @@ -217,17 +217,17 @@ Accept wildcard characters: False ### -ShowError Indicates that the cmdlet sends errors through the pipeline. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Wide** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *ShowError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **ShowError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -ShowError -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday Failed to evaluate expression " $_ / $null ". - + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) \[\], RuntimeException + + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) [], RuntimeException + FullyQualifiedErrorId : mshExpressionError +``` ```yaml Type: SwitchParameter diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md index 0dcc7b2a5816..d57313b8dc33 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Wide.md @@ -245,17 +245,17 @@ Accept wildcard characters: False ### -ShowError Indicates that the cmdlet sends errors through the pipeline. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a **Format-Wide** command, and the expressions do not appear to be working. -The following shows an example of the results of adding the *ShowError* parameter with an expression. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Wide` command, and the expressions do not appear to be working. +The following shows an example of the results of adding the **ShowError** parameter with an expression. + +```powershell +PS C:\> Get-Date | Format-Wide { $_ / $null } -ShowError -PS \> Get-Date | Format-Wide DayOfWeek,{ $_ / $null } -ShowError -DayOfWeek $_ / $null ---------- ------------ -Wednesday Failed to evaluate expression " $_ / $null ". - + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) \[\], RuntimeException + + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) [], RuntimeException + FullyQualifiedErrorId : mshExpressionError +``` ```yaml Type: SwitchParameter From 9467262f96e7d07deeb06747c0bed9b57494ec0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alan=20P=C5=82=C3=B3cieniak?= Date: Mon, 13 Nov 2017 17:27:49 +0100 Subject: [PATCH 015/145] Fixed Test-ScriptFileInfo example (#1852) --- reference/5.1/PowershellGet/Test-ScriptFileInfo.md | 14 +++++++------- reference/6/PowerShellGet/Test-ScriptFileInfo.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reference/5.1/PowershellGet/Test-ScriptFileInfo.md b/reference/5.1/PowershellGet/Test-ScriptFileInfo.md index a9d8c04f5312..22d1673e4c94 100644 --- a/reference/5.1/PowershellGet/Test-ScriptFileInfo.md +++ b/reference/5.1/PowershellGet/Test-ScriptFileInfo.md @@ -44,16 +44,16 @@ The script file includes valid metadata. ### Example 2: Test a script file that has values for all metadata properties ``` -PS C:\> Test-ScriptFileInfo -Path "D:\code\Test-Runbook.ps1 | Format-List * +PS C:\> Test-ScriptFileInfo -Path "D:\code\Test-Runbook.ps1" | Format-List * Name : Test-Runbook Path : D:\code\Test-Runbook.ps1 ScriptBase : D:\code -ReleaseNotes : {contoso script now supports following features, Feature 1, Feature 2, Feature 3...} +ReleaseNotes : {contoso script now supports following features, Feature 1, Feature 2, Feature 3...} Version : 1.0 Guid : eb246b19-17da-4392-8c89-7c280f69ad0e Author : pattif CompanyName : Microsoft Corporation -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : © 2015 Microsoft Corporation. All rights reserved. Tags : {Tag1, Tag2, Tag3} LicenseUri : https://contoso.com/License ProjectUri : https://contoso.com/ @@ -63,7 +63,7 @@ RequiredScripts : {Start-WFContosoServer, Stop-ContosoServerScript} ExternalScriptDependencies : Stop-ContosoServerScript Description : Contoso Script example RequiredModules : {RequiredModule1, @{ ModuleName = 'RequiredModule2'; ModuleVersion = '1.0' }, @{ ModuleName = 'RequiredModule3'; RequiredVersion = '2.0' }, ExternalModule1} -ExportedCommands : {Test-WebUri, ValidateAndAdd-PSScriptInfoEntry, Get-PSScriptInfo, My-Workflow...} +ExportedCommands : {Test-WebUri, ValidateAndAdd-PSScriptInfoEntry, Get-PSScriptInfo, My-Workflow...} ExportedFunctions : {Test-WebUri, ValidateAndAdd-PSScriptInfoEntry, Get-PSScriptInfo, My-AdvPSCmdlet} ExportedWorkflows : My-Workflow ``` @@ -74,7 +74,7 @@ This command tests the script file Test-Runbook.ps1 and uses the pipeline operat ``` PS C:\> Test-ScriptFileInfo -Path "D:\code\Hello-World.ps1" Test-ScriptFileInfo : Script 'D:\code\Hello-World.ps1' is missing required metadata properties. Verify that the script file has Version, Description -and Author properties. You can use the Update-ScriptFileInfo or New-ScriptFileInfo cmdlet to add or update the PSScriptInfo to the script file. +and Author properties. You can use the Update-ScriptFileInfo or New-ScriptFileInfo cmdlet to add or update the PSScriptInfo to the script file. At line:1 char:1 + Test-ScriptFileInfo D:\code\Hello-World.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -97,7 +97,7 @@ Single quotation marks tell Windows PowerShell not to interpret any characters a ```yaml Type: String Parameter Sets: LiteralPathParameterSet -Aliases: +Aliases: Required: True Position: Named @@ -114,7 +114,7 @@ The default location is the current directory (.). ```yaml Type: String Parameter Sets: PathParameterSet -Aliases: +Aliases: Required: True Position: 0 diff --git a/reference/6/PowerShellGet/Test-ScriptFileInfo.md b/reference/6/PowerShellGet/Test-ScriptFileInfo.md index b589bd989d08..639c8b7c2cda 100644 --- a/reference/6/PowerShellGet/Test-ScriptFileInfo.md +++ b/reference/6/PowerShellGet/Test-ScriptFileInfo.md @@ -44,16 +44,16 @@ The script file includes valid metadata. ### Example 2: Test a script file that has values for all metadata properties ``` -PS C:\> Test-ScriptFileInfo -Path "D:\code\Test-Runbook.ps1 | Format-List * +PS C:\> Test-ScriptFileInfo -Path "D:\code\Test-Runbook.ps1" | Format-List * Name : Test-Runbook Path : D:\code\Test-Runbook.ps1 ScriptBase : D:\code -ReleaseNotes : {contoso script now supports following features, Feature 1, Feature 2, Feature 3...} +ReleaseNotes : {contoso script now supports following features, Feature 1, Feature 2, Feature 3...} Version : 1.0 Guid : eb246b19-17da-4392-8c89-7c280f69ad0e Author : pattif CompanyName : Microsoft Corporation -Copyright : © 2015 Microsoft Corporation. All rights reserved. +Copyright : © 2015 Microsoft Corporation. All rights reserved. Tags : {Tag1, Tag2, Tag3} LicenseUri : https://contoso.com/License ProjectUri : https://contoso.com/ @@ -63,7 +63,7 @@ RequiredScripts : {Start-WFContosoServer, Stop-ContosoServerScript} ExternalScriptDependencies : Stop-ContosoServerScript Description : Contoso Script example RequiredModules : {RequiredModule1, @{ ModuleName = 'RequiredModule2'; ModuleVersion = '1.0' }, @{ ModuleName = 'RequiredModule3'; RequiredVersion = '2.0' }, ExternalModule1} -ExportedCommands : {Test-WebUri, ValidateAndAdd-PSScriptInfoEntry, Get-PSScriptInfo, My-Workflow...} +ExportedCommands : {Test-WebUri, ValidateAndAdd-PSScriptInfoEntry, Get-PSScriptInfo, My-Workflow...} ExportedFunctions : {Test-WebUri, ValidateAndAdd-PSScriptInfoEntry, Get-PSScriptInfo, My-AdvPSCmdlet} ExportedWorkflows : My-Workflow ``` @@ -74,7 +74,7 @@ This command tests the script file Test-Runbook.ps1 and uses the pipeline operat ``` PS C:\> Test-ScriptFileInfo -Path "D:\code\Hello-World.ps1" Test-ScriptFileInfo : Script 'D:\code\Hello-World.ps1' is missing required metadata properties. Verify that the script file has Version, Description -and Author properties. You can use the Update-ScriptFileInfo or New-ScriptFileInfo cmdlet to add or update the PSScriptInfo to the script file. +and Author properties. You can use the Update-ScriptFileInfo or New-ScriptFileInfo cmdlet to add or update the PSScriptInfo to the script file. At line:1 char:1 + Test-ScriptFileInfo D:\code\Hello-World.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -97,7 +97,7 @@ Single quotation marks tell Windows PowerShell not to interpret any characters a ```yaml Type: String Parameter Sets: LiteralPathParameterSet -Aliases: +Aliases: Required: True Position: Named @@ -114,7 +114,7 @@ The default location is the current directory (.). ```yaml Type: String Parameter Sets: PathParameterSet -Aliases: +Aliases: Required: True Position: 1 From b5d12a3476fb1b7cbf72f61795c468c83351085e Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 7 Nov 2017 14:18:25 -0800 Subject: [PATCH 016/145] fixing issue 1768 --- .../Write-Progress.md | 26 +++++++++---------- .../Write-Progress.md | 26 +++++++++---------- .../Write-Progress.md | 24 ++++++++--------- .../Write-Progress.md | 22 ++++++++-------- .../Write-Progress.md | 24 ++++++++--------- 5 files changed, 61 insertions(+), 61 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/3.0/Microsoft.PowerShell.Utility/Write-Progress.md index 25eb91d0afbc..8209bbb0b9ac 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Write-Progress.md @@ -27,7 +27,7 @@ You can select the indicators that the bar reflects and the text that appears ab ### Example 1 ``` PS C:\> for ($i = 1; $i -le 100; $i++ ) -{write-progress -activity "Search in Progress" -status "$i% Complete:" -percentcomplete $i;} +{write-progress -activity "Search in Progress" -status "$i% Complete:" -PercentComplete $i;} ``` This command displays the progress of a For loop that counts from 1 to 100. @@ -35,9 +35,9 @@ The Write-Progress command includes a status bar heading ("activity"), a status ### Example 2 ``` PS C:\> for($i = 1; $i -lt 101; $i++ ) -{write-progress -activity Updating -status 'Progress->' -percentcomplete $i -currentOperation OuterLoop; ` +{write-progress -activity Updating -status 'Progress->' -PercentComplete $i -currentOperation OuterLoop; ` for($j = 1; $j -lt 101; $j++ ) -{write-progress -id 1 -activity Updating -status 'Progress' -percentcomplete $j -currentOperation InnerLoop} } +{write-progress -id 1 -activity Updating -status 'Progress' -PercentComplete $j -currentOperation InnerLoop} } Updating Progress -> @@ -58,7 +58,7 @@ Without the Id parameter, the progress bars would be superimposed on each other PS C:\> $events = get-eventlog -logname system PS C:\> $events | foreach-object -begin {clear-host;$i=0;$out=""} ` -process {if($_.message -like "*bios*") {$out=$out + $_.Message}; $i = $i+1; -write-progress -activity "Searching Events" -status "Progress:" -percentcomplete ($i/$events.count*100)} ` +write-progress -activity "Searching Events" -status "Progress:" -PercentComplete ($i/$events.count*100)} ` -end {$out} ``` @@ -86,7 +86,7 @@ This text describes the activity whose progress is being reported. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -102,7 +102,7 @@ If this parameter is omitted, Write-Progress displays progress information. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -118,7 +118,7 @@ This text describes the operation that is currently taking place. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -135,7 +135,7 @@ If the progress bars do not have different IDs, they are superimposed instead of ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 3 @@ -151,7 +151,7 @@ Use the value -1 if the current activity has no parent activity. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -167,7 +167,7 @@ Use the value -1 if the percentage complete is unknown or not applicable. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -183,7 +183,7 @@ Use the value -1 if the number of seconds remaining is unknown or not applicable ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -198,7 +198,7 @@ Identifies the source of the record. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -214,7 +214,7 @@ This text describes current state of the activity. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 2 diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/4.0/Microsoft.PowerShell.Utility/Write-Progress.md index 67667aec29ad..24503f7aff94 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Write-Progress.md @@ -30,7 +30,7 @@ You can select the indicators that the bar reflects and the text that appears ab ### Example 1 ``` PS C:\> for ($i = 1; $i -le 100; $i++ ) -{write-progress -activity "Search in Progress" -status "$i% Complete:" -percentcomplete $i;} +{write-progress -activity "Search in Progress" -status "$i% Complete:" -PercentComplete $i;} ``` This command displays the progress of a For loop that counts from 1 to 100. @@ -39,9 +39,9 @@ The Write-Progress command includes a status bar heading ("activity"), a status ### Example 2 ``` PS C:\> for($i = 1; $i -lt 101; $i++ ) -{write-progress -activity Updating -status 'Progress->' -percentcomplete $i -currentOperation OuterLoop; ` +{write-progress -activity Updating -status 'Progress->' -PercentComplete $i -currentOperation OuterLoop; ` for($j = 1; $j -lt 101; $j++ ) -{write-progress -id 1 -activity Updating -status 'Progress' -percentcomplete $j -currentOperation InnerLoop} } +{write-progress -id 1 -activity Updating -status 'Progress' -PercentComplete $j -currentOperation InnerLoop} } Updating Progress -> @@ -63,7 +63,7 @@ Without the Id parameter, the progress bars would be superimposed on each other PS C:\> $events = get-eventlog -logname system PS C:\> $events | foreach-object -begin {clear-host;$i=0;$out=""} ` -process {if($_.message -like "*bios*") {$out=$out + $_.Message}; $i = $i+1; -write-progress -activity "Searching Events" -status "Progress:" -percentcomplete ($i/$events.count*100)} ` +write-progress -activity "Searching Events" -status "Progress:" -PercentComplete ($i/$events.count*100)} ` -end {$out} ``` @@ -92,7 +92,7 @@ This text describes the activity whose progress is being reported. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -108,7 +108,7 @@ If this parameter is omitted, Write-Progress displays progress information. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -124,7 +124,7 @@ This text describes the operation that is currently taking place. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -141,7 +141,7 @@ If the progress bars do not have different IDs, they are superimposed instead of ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 3 @@ -157,7 +157,7 @@ Use the value -1 if the current activity has no parent activity. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -173,7 +173,7 @@ Use the value -1 if the percentage complete is unknown or not applicable. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -189,7 +189,7 @@ Use the value -1 if the number of seconds remaining is unknown or not applicable ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -204,7 +204,7 @@ Identifies the source of the record. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -220,7 +220,7 @@ This text describes current state of the activity. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 2 diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/5.0/Microsoft.PowerShell.Utility/Write-Progress.md index 9817cf3c8f1b..19c02b36752e 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Write-Progress.md @@ -41,14 +41,14 @@ The **Write-Progress** command includes a status bar heading ("activity"), a sta PS C:\> for($I = 1; $I -lt 101; $I++ ) {Write-Progress -Activity Updating -Status 'Progress->' -PercentComplete $I -CurrentOperation OuterLoop; ` PS C:\> for($j = 1; $j -lt 101; $j++ ) -{Write-Progress -Id 1 -Activity Updating -Status 'Progress' - PercentComplete $j -CurrentOperation InnerLoop} } +{Write-Progress -Id 1 -Activity Updating -Status 'Progress' -PercentComplete $j -CurrentOperation InnerLoop} } Updating Progress -> - [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] + [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] OutsideLoop Updating Progress - [oooooooooooooooooo ] + [oooooooooooooooooo ] InnerLoop ``` @@ -91,7 +91,7 @@ This text describes the activity whose progress is being reported. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -107,7 +107,7 @@ If this parameter is omitted, **Write-Progress** displays progress information. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -123,7 +123,7 @@ This text describes the operation that is currently taking place. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -140,7 +140,7 @@ If the progress bars do not have different IDs, they are superimposed instead of ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 2 @@ -156,7 +156,7 @@ Use the value -1 if the current activity has no parent activity. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -172,7 +172,7 @@ Use the value -1 if the percentage complete is unknown or not applicable. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -188,7 +188,7 @@ Use the value -1 if the number of seconds remaining is unknown or not applicable ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -203,7 +203,7 @@ Specifies the source of the record. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -219,7 +219,7 @@ This text describes current state of the activity. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/5.1/Microsoft.PowerShell.Utility/Write-Progress.md index 0591cc71b089..2d2fd97ef740 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Write-Progress.md @@ -44,11 +44,11 @@ PS C:\> for($j = 1; $j -lt 101; $j++ ) {Write-Progress -Id 1 -Activity Updating -Status 'Progress' -PercentComplete $j -CurrentOperation InnerLoop} } Updating Progress -> - [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] + [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] OutsideLoop Updating Progress - [oooooooooooooooooo ] + [oooooooooooooooooo ] InnerLoop ``` @@ -91,7 +91,7 @@ This text describes the activity whose progress is being reported. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -107,7 +107,7 @@ If this parameter is omitted, Write-Progress displays progress information. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -123,7 +123,7 @@ This text describes the operation that is currently taking place. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -140,7 +140,7 @@ If the progress bars do not have different IDs, they are superimposed instead of ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 2 @@ -156,7 +156,7 @@ Use the value -1 if the current activity has no parent activity. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -172,7 +172,7 @@ Use the value -1 if the percentage complete is unknown or not applicable. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -188,7 +188,7 @@ Use the value -1 if the number of seconds remaining is unknown or not applicable ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -203,7 +203,7 @@ Specifies the source of the record. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -219,7 +219,7 @@ This text describes current state of the activity. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md b/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md index 95c277f2d325..d42ee3bfe042 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Progress.md @@ -41,14 +41,14 @@ The **Write-Progress** command includes a status bar heading ("activity"), a sta PS C:\> for($I = 1; $I -lt 101; $I++ ) {Write-Progress -Activity Updating -Status 'Progress->' -PercentComplete $I -CurrentOperation OuterLoop; ` PS C:\> for($j = 1; $j -lt 101; $j++ ) -{Write-Progress -Id 1 -Activity Updating -Status 'Progress' - PercentComplete $j -CurrentOperation InnerLoop} } +{Write-Progress -Id 1 -Activity Updating -Status 'Progress' -PercentComplete $j -CurrentOperation InnerLoop} } Updating Progress -> - [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] + [ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo] OutsideLoop Updating Progress - [oooooooooooooooooo ] + [oooooooooooooooooo ] InnerLoop ``` @@ -91,7 +91,7 @@ This text describes the activity whose progress is being reported. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -107,7 +107,7 @@ If this parameter is omitted, Write-Progress displays progress information. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -123,7 +123,7 @@ This text describes the operation that is currently taking place. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -140,7 +140,7 @@ If the progress bars do not have different IDs, they are superimposed instead of ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 3 @@ -183,7 +183,7 @@ Use the value -1 if the current activity has no parent activity. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -199,7 +199,7 @@ Use the value -1 if the percentage complete is unknown or not applicable. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -215,7 +215,7 @@ Use the value -1 if the number of seconds remaining is unknown or not applicable ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -230,7 +230,7 @@ Specifies the source of the record. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -246,7 +246,7 @@ This text describes current state of the activity. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 2 From b04197f509e8a44a97455bd6d450c1bec14f1772 Mon Sep 17 00:00:00 2001 From: Ebru Cucen Date: Mon, 13 Nov 2017 17:13:25 +0000 Subject: [PATCH 017/145] Formatting, example fix for Body parameter (#1847) 1. Replaced variable names with PascalCase convention and for consistency 2. Removed directory information [c:\] in the examples 3. Put powershell keyword for formatting examples 4. Replaced Invoke-RestMethod with Invoke-WebRequest in the Body example, added method Post 5. Removed InformationAction and InformationVariable parameters, which were mistakenly a copy of Body, included already in CommonVariables part --- .../Invoke-WebRequest.md | 158 ++++++------------ 1 file changed, 50 insertions(+), 108 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md index 2eb0ca48e765..3035e1d0ac8e 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md +++ b/reference/6/Microsoft.PowerShell.Utility/Invoke-WebRequest.md @@ -35,9 +35,9 @@ This cmdlet was introduced in Windows PowerShell 3.0. ## EXAMPLES ### Example 1: Send a web request -``` -PS C:\> $R = Invoke-WebRequest -URI http://www.bing.com?q=how+many+feet+in+a+mile -PS C:\> $R.AllElements | where {$_.innerhtml -like "*=*"} | Sort { $_.InnerHtml.Length } | Select InnerText -First 5 +```powershell +$Response = Invoke-WebRequest -URI http://www.bing.com?q=how+many+feet+in+a+mile +$Response.AllElements | where {$_.innerhtml -like "*=*"} | Sort { $_.InnerHtml.Length } | Select InnerText -First 5 innerText---------1 =5280 feet1 mile ``` @@ -49,41 +49,41 @@ The second command gets the InnerHtml property when it includes an equal sign, s Sorting by the shortest HTML value often helps you find the most specific element that matches that text. ### Example 2: Use a stateful web service -``` -# The first command uses the **Invoke-WebRequest** cmdlet to send a sign-in request. The command specifies a value of "FB" for the value of the *SessionVariable* parameter, and saves the result in the $R variable.When the command completes, the $R variable contains an **HtmlWebResponseObject** and the $FB variable contains a **WebRequestSession** object. -PS C:\> $R=Invoke-WebRequest http://www.facebook.com/login.php -SessionVariable fb +```powershell +# The first command uses the **Invoke-WebRequest** cmdlet to send a sign-in request. The command specifies a value of "FB" for the value of the *SessionVariable* parameter, and saves the result in the $Response variable.When the command completes, the $Response variable contains an **HtmlWebResponseObject** and the $FB variable contains a **WebRequestSession** object. +$Response=Invoke-WebRequest http://www.facebook.com/login.php -SessionVariable FB # The second command shows the **WebRequestSession** object in the $FB variable. -PS C:\> $FB +$FB -# The third command gets the first form in the **Forms** property of the HTTP response object in the $R variable, and saves it in the $Form variable. -PS C:\> $Form = $R.Forms[0] +# The third command gets the first form in the **Forms** property of the HTTP response object in the $Response variable, and saves it in the $Form variable. +$Form = $Response.Forms[0] # The fourth command pipes the properties of the form in the $Form variable into a list by using the Format-List cmdlet. -PS C:\> $Form | Format-List +$Form | Format-List # The fifth command displays the keys and values in the hash table (dictionary) object in the Fields property of the form. -PS C:\> $Form.fields +$Form.fields # The sixth and seventh commands populate the values of the email and pass keys of the hash table in the **Fields** property of the form. You can replace the email and password with values that you want to use. -PS C:\> $Form.Fields["email"]="User01@Fabrikam.com" +$Form.Fields["email"]="User01@Fabrikam.com" $Form.Fields["pass"]="P@ssw0rd" -# The eighth command uses the **Invoke-WebRequest** cmdlet to sign into the Facebook web service.The value of the *Uri* parameter is the value of the **Action** property of the form. The **WebRequestSession** object in the $FB variable (the session variable specified in the first command) is now the value of the *WebSession* parameter. The value of the *Body* parameter is the hash table in the Fields property of the form and the value of the *Method* parameter is POST. The command saves the output in the $R variable. -PS C:\> $R=Invoke-WebRequest -Uri ("https://www.facebook.com" + $Form.Action) -WebSession $FB -Method POST -Body $Form.Fields +# The eighth command uses the **Invoke-WebRequest** cmdlet to sign into the Facebook web service.The value of the *Uri* parameter is the value of the **Action** property of the form. The **WebRequestSession** object in the $FB variable (the session variable specified in the first command) is now the value of the *WebSession* parameter. The value of the *Body* parameter is the hash table in the Fields property of the form and the value of the *Method* parameter is POST. The command saves the output in the $Response variable. +$Response=Invoke-WebRequest -Uri ("https://www.facebook.com" + $Form.Action) -WebSession $FB -Method POST -Body $Form.Fields # The full script, then, is as follows. -# Sends a sign-in request by running the Invoke-WebRequest cmdlet. The command specifies a value of "fb" for the SessionVariable parameter, and saves the results in the $R variable. +# Sends a sign-in request by running the Invoke-WebRequest cmdlet. The command specifies a value of "FB" for the SessionVariable parameter, and saves the results in the $Response variable. -PS C:\> $R=Invoke-WebRequest http://www.facebook.com/login.php -SessionVariable fb +$Response=Invoke-WebRequest http://www.facebook.com/login.php -SessionVariable FB # Use the session variable that you created in Example 1. Output displays values for Headers, Cookies, Credentials, etc. $FB -# Gets the first form in the Forms property of the HTTP response object in the $R variable, and saves it in the $Form variable. +# Gets the first form in the Forms property of the HTTP response object in the $Response variable, and saves it in the $Form variable. -$Form = $R.Forms[0] +$Form = $Response.Forms[0] # Pipes the form properties that are stored in the $Forms variable into the Format-List cmdlet, to display those properties in a list. @@ -100,17 +100,17 @@ $Form.Fields["pass"] = "P@ssw0rd" # The final command uses the Invoke-WebRequest cmdlet to sign in to the Facebook web service. -$R=Invoke-WebRequest -Uri ("https://www.facebook.com" + $Form.Action) -WebSession $FB -Method POST -Body $Form.Fields +$Response=Invoke-WebRequest -Uri ("https://www.facebook.com" + $Form.Action) -WebSession $FB -Method POST -Body $Form.Fields -# When the command finishes, the **StatusDescription** property of the web response object in the $R variable indicates that the user is signed in successfully. -$R.StatusDescription +# When the command finishes, the **StatusDescription** property of the web response object in the $Response variable indicates that the user is signed in successfully. +$Response.StatusDescription ``` This example shows how to use the **Invoke-WebRequest** cmdlet with a stateful web service, such as Facebook. ### Example 3: Get links from a web page -``` -PS C:\> (Invoke-WebRequest -Uri "http://msdn.microsoft.com/en-us/library/aa973757(v=vs.85).aspx").Links.Href +```powershell +(Invoke-WebRequest -Uri "http://msdn.microsoft.com/en-us/library/aa973757(v=vs.85).aspx").Links.Href ``` This command gets the links in a web page. @@ -118,10 +118,10 @@ It uses the **Invoke-WebRequest** cmdlet to get the web page content. Then it users the **Links** property of the **HtmlWebResponseObject** that **Invoke-WebRequest** returns, and the Href property of each link. ### Example 4: Writes the response content to a file using the encoding defined in the requested page. -``` -PS C:\> $response = Invoke-WebRequest -Uri "http://msdn.microsoft.com/en-us/library/aa973757(v=vs.85).aspx" -PS C:\> $stream = [System.IO.StreamWriter]::new('.\msdnpage.html', $false, $response.Encoding) -PS C:\> try {$stream.Write($response.Content)} finally {$stream.Dispose()} +```powershell +$Response = Invoke-WebRequest -Uri "http://msdn.microsoft.com/en-us/library/aa973757(v=vs.85).aspx" +$Stream = [System.IO.StreamWriter]::new('.\msdnpage.html', $false, $Response.Encoding) +try {$Stream.Write($response.Content)} finally {$Stream.Dispose()} ``` This command uses the **Invoke-WebRequest** cmdlet to retrieve the web page content of an msdn page. @@ -136,22 +136,22 @@ Note that the Encoding property will be null if the web request does not return ### Example 4: Submit a multipart/form-data file ```powershell -$filePath = 'c:\document.txt' -$fieldName = 'document' -$contentType = 'text/plain' +$FilePath = 'c:\document.txt' +$FieldName = 'document' +$ContentType = 'text/plain' -$fileStream = [System.IO.FileStream]::new($filePath, [System.IO.FileMode]::Open) -$fileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new('form-data') -$fileHeader.Name = $fieldName -$fileHeader.FileName = Split-Path -leaf $filePath -$fileContent = [System.Net.Http.StreamContent]::new($fileStream) -$fileContent.Headers.ContentDisposition = $fileHeader -$fileContent.Headers.ContentType = [System.Net.Http.Headers.MediaTypeHeaderValue]::Parse($contentType) +$FileStream = [System.IO.FileStream]::new($filePath, [System.IO.FileMode]::Open) +$FileHeader = [System.Net.Http.Headers.ContentDispositionHeaderValue]::new('form-data') +$FileHeader.Name = $FieldName +$FileHeader.FileName = Split-Path -leaf $FilePath +$FileContent = [System.Net.Http.StreamContent]::new($FileStream) +$FileContent.Headers.ContentDisposition = $FileHeader +$FileContent.Headers.ContentType = [System.Net.Http.Headers.MediaTypeHeaderValue]::Parse($ContentType) -$multipartContent = [System.Net.Http.MultipartFormDataContent]::new() -$multipartContent.Add($fileContent) +$MultipartContent = [System.Net.Http.MultipartFormDataContent]::new() +$MultipartContent.Add($FileContent) -$response = Invoke-WebRequest -Body $multipartContent -Method 'POST' -uri 'https://api.contoso.com/upload' +$Response = Invoke-WebRequest -Body $MultipartContent -Method 'POST' -Uri 'https://api.contoso.com/upload' ``` This example uses the **Invoke-WebRequest** cmdlet upload a file as a `multipart/form-data` submission. The file `c:\document.txt` will be submitted as the form field `document` with the `Content-Type` of `text/plain`. @@ -218,16 +218,17 @@ For example: ```powershell -$R = Invoke-WebRequest http://website.com/login.aspx -$R.Forms[0].Name = "MyName" -$R.Forms[0].Password = "MyPassword" -Invoke-RestMethod http://website.com/service.aspx -Body $R +$Response = Invoke-WebRequest -Uri http://website.com/login.aspx +$Response.Forms[0].Name = "MyName" +$Response.Forms[0].Password = "MyPassword" ``` +```powershell +Invoke-WebRequest -Uri http://website.com/service.aspx -Body $Response -Method POST +``` or - ```powershell -Invoke-RestMethod http://website.com/service.aspx -Body $R.Forms[0] +Invoke-WebRequest -Uri http://website.com/service.aspx -Body $Response.Forms[0] -Method POST ``` The *Body* parameter may also accept a `System.Net.Http.MultipartFormDataContent` object. This will facilitate `multipart/form-data` requests. When a `MultipartFormDataContent` object is supplied for *Body*, any Content related headers supplied to the *ContentType*, *Headers*, or *WebSession* parameters will be overridden by the Content headers of the `MultipartFormDataContent` object. @@ -413,66 +414,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -The Body parameter can be used to specify a list of query parameters or specify the content of the response. - -When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - -When the body is a form, or it is the output of an Invoke-WebRequest call, Windows PowerShell sets the request content to the form fields. - -For example: - -$r = Invoke-WebRequest http://website.com/login.aspx -$r.Forms[0].Name = "MyName" -$r.Forms[0].Password = "MyPassword" -Invoke-RestMethod http://website.com/service.aspx -Body $r - -- or - - -Invoke-RestMethod http://website.com/service.aspx -Body $r.Forms[0] - -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -The Body parameter can be used to specify a list of query parameters or specify the content of the response. - -When the input is a GET request and the body is an IDictionary (typically, a hash table), the body is added to the URI as query parameters. For other GET requests, the body is set as the value of the request body in the standard name=value format. - -When the body is a form, or it is the output of an Invoke-WebRequest call, Windows PowerShell sets the request content to the form fields. - -For example: - -$r = Invoke-WebRequest http://website.com/login.aspx -$r.Forms[0].Name = "MyName" -$r.Forms[0].Password = "MyPassword" -Invoke-RestMethod http://website.com/service.aspx -Body $r - -- or - - -Invoke-RestMethod http://website.com/service.aspx -Body $r.Forms[0] - -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` ### -MaximumRedirection Specifies how many times Windows PowerShell redirects a connection to an alternate Uniform Resource Identifier (URI) before the connection fails. @@ -817,8 +758,9 @@ To test a website with the standard user agent string that is used by most Inter For example, the following command uses the user agent string for Internet Explorer - -PS C:\> Invoke-WebRequest -Uri http://website.com/ -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer) +```powershell +Invoke-WebRequest -Uri http://website.com/ -UserAgent ([Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer) +``` ```yaml Type: String From b6b156a4585aeb216791576d1b0c7294a77ef166 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 13 Nov 2017 11:53:10 -0800 Subject: [PATCH 018/145] fixing style consistency across articles --- .../Add-Content.md | 31 +-- .../Set-Content.md | 12 +- .../Microsoft.PowerShell.Security/Set-Acl.md | 75 +++---- .../Format-Custom.md | 74 ++++--- .../Format-Table.md | 197 ++++++++++-------- .../Format-Wide.md | 129 +++++++----- .../Microsoft.PowerShell.Utility/Out-File.md | 31 ++- .../Write-Host.md | 6 +- .../Write-Progress.md | 104 ++++----- .../Add-Content.md | 2 +- .../Set-Content.md | 12 +- .../Microsoft.PowerShell.Security/Set-Acl.md | 67 +++--- .../Format-Custom.md | 89 ++++---- .../Format-Table.md | 184 ++++++++-------- .../Format-Wide.md | 122 ++++++----- .../Microsoft.PowerShell.Utility/Out-File.md | 31 ++- .../Write-Host.md | 6 +- .../Write-Progress.md | 97 ++++----- .../Add-Content.md | 2 +- .../Set-Content.md | 10 +- .../Microsoft.PowerShell.Security/Set-Acl.md | 67 +++--- .../Format-Custom.md | 114 +++++----- .../Format-Table.md | 132 ++++++------ .../Format-Wide.md | 120 +++++------ .../Microsoft.PowerShell.Utility/Out-File.md | 34 +-- .../Write-Host.md | 6 +- .../Write-Progress.md | 64 +++--- .../Add-Content.md | 2 +- .../Set-Content.md | 10 +- .../Microsoft.PowerShell.Security/Set-Acl.md | 65 +++--- .../Format-Custom.md | 116 ++++++----- .../Format-Table.md | 134 ++++++------ .../Format-Wide.md | 120 +++++------ .../Microsoft.PowerShell.Utility/Out-File.md | 28 +-- .../Write-Host.md | 6 +- .../Write-Progress.md | 68 +++--- .../Add-Content.md | 13 +- .../Set-Content.md | 10 +- .../Microsoft.PowerShell.Security/Set-Acl.md | 66 +++--- .../Format-Custom.md | 146 ++++++------- .../Format-Table.md | 165 +++++++-------- .../Format-Wide.md | 148 ++++++------- .../Microsoft.PowerShell.Utility/Out-File.md | 61 ++---- .../Write-Host.md | 36 +--- .../Write-Progress.md | 89 +++----- 45 files changed, 1531 insertions(+), 1570 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md index 22a32c1345c0..ed1b89be2772 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Add-Content.md @@ -39,18 +39,18 @@ You can specify the content by typing the content in the command or by specifyin ## EXAMPLES -### Example 1 +### Example 1: Add a string to all text files with an exception ```powershell -PS C:\> add-content -path *.txt -exclude help* -value "END" +PS C:\> Add-Content -Path "*.txt" -Exclude "help*" -Value "END" ``` This command adds "END" to all text files in the current directory, except for those with file names that begin with "help". -### Example 2 +### Example 2: Add a date to the end of the specified files -``` -PS C:\> add-content -Path file1.log, file2.log -Value (get-date) -passthru +```powershell +PS C:\> Add-Content -Path "file1.log", "file2.log" -Value (Get-Date) -PassThru ``` This command adds the date to the end of the File1.log and File2.log files and then displays the date at the command line. @@ -58,10 +58,10 @@ The command uses the Get-Date cmdlet to get the date, and it uses the Value para The PassThru parameter passes an object representing the added content through the pipeline. Because there is no other cmdlet to receive the passed object, it is displayed at the command line. -### Example 3 +### Example 3: Add the contents of a specified file to another file ```powershell -PS C:\> add-content -path monthly.txt -value (get-content c:\rec1\weekly.txt) +PS C:\> Add-Content -Path "monthly.txt" -Value (Get-Content "c:\rec1\weekly.txt") ``` This command adds the contents of the Weekly.txt file to the end of the Monthly.txt file. @@ -69,12 +69,12 @@ It uses the Get-Content cmdlet to get the contents of the Weekly.txt file, and i The parentheses ensure that the Get-Content command is complete before the Add-Content command begins. You can also copy the content of Weekly.txt to a variable, such as $w, and then use the Value parameter to pass the variable to Add-Content. -In that case, the command would be "add-content -path monthly.txt -value $w". +In that case, the command would be "Add-Content -Path monthly.txt -Value $w". -### Example 4 +### Example 4: Create a new directory and file and copy content ```powershell -PS C:\> add-content -value (get-content test.log) -path C:\tests\test134\logs\test134.log +PS C:\> Add-Content -Value (Get-Content "test.log") -Path "C:\tests\test134\logs\test134.log" ``` This command creates a new directory and file and copies the content of an existing file to the newly created file. @@ -140,8 +140,11 @@ Accept wildcard characters: False ### -Stream -Adds the content to the specified alternate data stream. If the stream does not yet, exist, Add-Content creates it. -Enter the stream name. Wildcards are not supported. +Adds the content to the specified alternate data stream. +If the stream does not yet, exist, Add-Content creates it. +Enter the stream name. +Wildcards are not supported. + Stream is a dynamic parameter that the FileSystem provider adds to the Add-Content cmdlet. This parameter works only in file system drives. This parameter is introduced in PowerShell 3.0. @@ -320,7 +323,7 @@ Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -369,7 +372,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### System.Object -You can pipe the objects to be added (the Value) to Add-Content. +You can pipe the objects to be added by Add-Content. ## OUTPUTS diff --git a/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md index ea273cba13a3..f0d83c19e88b 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Set-Content.md @@ -192,10 +192,10 @@ Accept wildcard characters: True ### -Force -Allows the cmdlet to set the contents of a file, even if the file is read-only. +Forces the cmdlet to set the contents of a file, even if the file is read-only. Implementation varies from provider to provider. For more information, see about_Providers. -Even using the Force parameter, the cmdlet cannot override security restrictions. +Using the Force parameter does not override security restrictions. ```yaml Type: SwitchParameter @@ -288,10 +288,10 @@ Specifies an alternative data stream for content. If the stream does not exist, this cmdlet creates it. Wildcard characters are not supported. -Stream is a dynamic parameter that the FileSystem provider adds to **Set-Content**. +Stream is a dynamic parameter that the FileSystem provider adds to `Set-Content`. This parameter works only in file system drives. -You can use the **Set-Content** cmdlet to change the content of the Zone.Identifier alternate data stream. +You can use the `Set-Content` cmdlet to change the content of the Zone.Identifier alternate data stream. However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the Unblock-File cmdlet. @@ -365,7 +365,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](http://go.microsoft.com/fwlink/?LinkID=113216). +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters). ## INPUTS @@ -382,7 +382,7 @@ Otherwise, this cmdlet does not generate any output. ## NOTES -You can also refer to Set-Content by its built-in alias, "sc". For more information, see about_Aliases. +You can also refer to Set-Content by its built-in alias, "sc". For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). Set-Content is designed for string processing. If you pipe non-string objects to Set-Content, it converts the object to a string before writing it. diff --git a/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md b/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md index a4e0470c14df..d5135545bee2 100644 --- a/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/3.0/Microsoft.PowerShell.Security/Set-Acl.md @@ -34,18 +34,19 @@ Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] $DogACL = Get-Acl C:\Dog.txt -PS C:\> Set-Acl -Path C:\Cat.txt -AclObject $DogACL +PS C:\> $DogACL = Get-Acl -Path "C:\Dog.txt" +PS C:\> Set-Acl -Path "C:\Cat.txt" -AclObject $DogACL ``` These commands copy the values from the security descriptor of the Dog.txt file to the security descriptor of the Cat.txt file. @@ -54,26 +55,28 @@ When the commands complete, the security descriptors of the Dog.txt and Cat.txt The first command uses the Get-Acl cmdlet to get the security descriptor of the Dog.txt file. The assignment operator (=) stores the security descriptor in the value of the $DogACL variable. -The second command uses **Set-Acl** to change the values in the ACL of Cat.txt to the values in $DogACL. +The second command uses `Set-Acl` to change the values in the ACL of Cat.txt to the values in $DogACL. The value of the **Path** parameter is the path to the Cat.txt file. The value of the **AclObject** parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the $DogACL variable. -### Example 2 + +### Example 2: Use the pipeline operator to pass a descriptor ``` -PS C:\> Get-Acl C:\Dog.txt | Set-Acl -Path C:\Cat.txt +PS C:\> Get-Acl -Path "C:\Dog.txt" | Set-Acl -Path "C:\Cat.txt" ``` -This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a **Set-Acl** command. +This command is almost the same as the command in the previous example, except that it uses a pipeline operator to send the security descriptor from a Get-Aclcommand to a `Set-Acl` command. The first command uses the **Get-Acl** cmdlet to get the security descriptor of the Dog.txt file. -The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the **Set-Acl** cmdlet. +The pipeline operator (|) passes an object that represents the Dog.txt security descriptor to the `Set-Acl` cmdlet. -The second command uses **Set-Acl** to apply the security descriptor of Dog.txt to Cat.txt. +The second command uses `Set-Acl` to apply the security descriptor of Dog.txt to Cat.txt. When the command completes, the ACLs of the Dog.txt and Cat.txt files are identical. -### Example 3 + +### Example 3: Apply a security descriptor to multiple files ``` PS C:\> $NewAcl = Get-Acl File0.txt -PS C:\> Get-ChildItem c:\temp -Recurse -Include *.txt -Force | Set-Acl -AclObject $NewAcl +PS C:\> Get-ChildItem -Path "C:\temp" -Recurse -Include "*.txt" -Force | Set-Acl -AclObject $NewAcl ``` These commands apply the security descriptors in the File0.txt file to all text files in the C:\Temp directory and all of its subdirectories. @@ -86,24 +89,25 @@ The **Include** parameter limits the files retrieved to those with the ".txt" fi The **Force** parameter gets hidden files, which would otherwise be excluded. (You cannot use "c:\temp\*.txt", because the **Recurse** parameter works on directories, not on files.) -The pipeline operator (|) sends the objects representing the retrieved files to the **Set-Acl** cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. +The pipeline operator (|) sends the objects representing the retrieved files to the `Set-Acl` cmdlet, which applies the security descriptor in the **AclObject** parameter to all of the files in the pipeline. -In practice, it is best to use the **Whatif** parameter with all **Set-Acl** commands that can affect more than one item. +In practice, it is best to use the **Whatif** parameter with all `Set-Acl` commands that can affect more than one item. In this case, the second command in the pipeline would be "`Set-Acl -AclObject $NewAcl -WhatIf`". This command lists the files that would be affected by the command. After reviewing the result, you can run the command again without the **Whatif** parameter. + ## PARAMETERS ### -AclObject Specifies an ACL with the desired property values. -**Set-Acl** changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. +`Set-Acl` changes the ACL of item specified by the **Path** or **InputObject** parameter to match the values in the specified security object. You can save the output of a Get-Acl command in a variable and then use the **AclObject** parameter to pass the variable, or type a Get-Acl command. ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 2 @@ -121,7 +125,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -139,7 +143,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -157,7 +161,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -167,13 +171,13 @@ Accept wildcard characters: True ``` ### -Passthru -Returns an object that represents the security descriptor that was changed. +Returns an object that represents the security descriptor that was changed. By default, this cmdlet does not generate any output. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -187,12 +191,12 @@ Changes the security descriptor of the specified item. Enter the path to an item, such as a path to a file or registry key. Wildcards are permitted. -If you pass a security object to **Set-Acl** (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to **Set-Acl**), and you omit the **Path** parameter (name and value), **Set-Acl** uses the path that is included in the security object. +If you pass a security object to `Set-Acl` (either by using the **AclObject** or **SecurityDescriptor** parameters or by passing a security object from Get-Acl to `Set-Acl`), and you omit the **Path** parameter (name and value), `Set-Acl` uses the path that is included in the security object. ```yaml Type: String[] Parameter Sets: ByPath -Aliases: +Aliases: Required: True Position: 1 @@ -213,7 +217,7 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: Required: False Position: 3 @@ -233,7 +237,7 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: Required: False Position: Named @@ -246,7 +250,7 @@ Accept wildcard characters: False Changes the security descriptor of the specified object. Enter a variable that contains the object or a command that gets the object. -You cannot pipe the object to be changed to **Set-Acl**. +You cannot pipe the object to be changed to `Set-Acl`. Instead, use the **InputObject** parameter explicitly in the command. This parameter is introduced in Windows PowerShell 3.0. @@ -254,7 +258,7 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: PSObject Parameter Sets: ByInputObject -Aliases: +Aliases: Required: True Position: 1 @@ -334,22 +338,23 @@ Accept wildcard characters: False ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### System.Security.AccessControl.ObjectSecurity, System.Security.AccessControl.CommonSecurityDescriptor -You can pipe an ACL object or a security descriptor to **Set-Acl**. +You can pipe an ACL object or a security descriptor to `Set-Acl`. + ## OUTPUTS ### System.Security.AccessControl.FileSecurity -By default, **Set-Acl** does not generate any output. +By default, `Set-Acl` does not generate any output. However, if you use the **Passthru** parameter, it generates a security object. The type of the security object depends on the type of the item. + ## NOTES -* The **Set-Acl** cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. -* + The `Set-Acl` cmdlet is supported by the Windows PowerShell file system and registry providers. As such, you can use it to change the security descriptors of files, directories, and registry keys. + ## RELATED LINKS [Get-Acl](Get-Acl.md) - - diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md index 02dd4734a64e..34356d29d590 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Format-Custom.md @@ -9,8 +9,10 @@ title: Format-Custom --- # Format-Custom + ## SYNOPSIS Uses a customized view to format the output. + ## SYNTAX ``` @@ -19,25 +21,28 @@ Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] [-Vi ``` ## DESCRIPTION -The Format-Custom cmdlet formats the output of a command as defined in an alternate view. -Format-Custom is designed to display views that are not just tables or just lists. +The `Format-Custom` cmdlet formats the output of a command as defined in an alternate view. +`Format-Custom` is designed to display views that are not just tables or just lists. You can use the views defined in the *format.PS1XML files in the Windows PowerShell directory, or you can create your own views in new PS1XML files and use the Update-FormatData cmdlet to add them to Windows PowerShell. + ## EXAMPLES ### Example 1 -``` -PS C:\> get-command start-transcript | format-custom -view MyView +```powershell +PS C:\> Get-Command Start-Transcript | Format-Custom -View MyView ``` -This command formats information about the Start-Transcript cmdlet in the format defined by the MyView view, a custom view created by the user. +This command formats information about the `Start-Transcript` cmdlet in the format defined by the MyView view, a custom view created by the user. To run this command successfully, you must first create a new PS1XML file, define the MyView view, and then use the Update-FormatData command to add the PS1XML file to Windows PowerShell. + ### Example 2 -``` -PS C:\> get-process Winlogon | format-custom +```powershell +PS C:\> Get-Process Winlogon | Format-Custom ``` This command formats information about the Winlogon process in an alternate customized view. -Because the command does not use the View parameter, Format-Custom uses a default custom view to format the data. +Because the command does not use the **View** parameter, `Format-Custom` uses a default custom view to format the data. + ## PARAMETERS ### -Depth @@ -46,7 +51,7 @@ Specifies the number of columns in the display. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -58,17 +63,20 @@ Accept wildcard characters: False ### -DisplayError Displays errors at the command line. This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Custom command, and the expressions do not appear to be working. -The following shows an example of the results of adding the DisplayError parameter with an expression. +The following shows an example of the results of adding the **DisplayError** parameter with an expression. + +```powershell +PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -DisplayError -PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -80,7 +88,7 @@ Accept wildcard characters: False ### -Expand Formats the collection object, as well as the objects in the collection. This parameter is designed to format objects that support the ICollection (System.Collections) interface. -The default value is EnumOnly. +The default value is **EnumOnly**. Valid values are: @@ -91,7 +99,7 @@ Valid values are: ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -108,7 +116,7 @@ By default, when an error object is written to the error or display streams, onl ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -132,7 +140,7 @@ Valid keys are: ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -148,7 +156,7 @@ Enter a variable that contains the objects or type a command or expression that ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -175,7 +183,7 @@ Valid keys are: ```yaml Type: Object[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 1 @@ -187,8 +195,9 @@ Accept wildcard characters: False ### -ShowError Sends errors through the pipeline. This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Custom command, and the expressions do not appear to be working. -The following shows an example of the results of adding the ShowError parameter with an expression. +The following shows an example of the results of adding the **ShowError** parameter with an expression. +```powershell PS \> Get-Date | Format-Custom DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ @@ -197,11 +206,12 @@ Wednesday Failed to evaluate expression " $_ / $null ". + CategoryInfo : InvalidArgument: (10/30/2013 2:28:07 PM:PSObject) \[\], RuntimeException + FullyQualifiedErrorId : mshExpressionError +``` ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -211,13 +221,13 @@ Accept wildcard characters: False ``` ### -View -Specifies the name of an alternate format or "view." If you omit this parameter, Format-Custom uses a default custom view. +Specifies the name of an alternate format or "view." If you omit this parameter, `Format-Custom` uses a default custom view. You cannot use the Property and View parameters in the same command. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -227,24 +237,30 @@ Accept wildcard characters: False ``` ### CommonParameters + This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS ### System.Management.Automation.PSObject -You can pipe any object to Format-Custom + +You can pipe any object to Format-Custom. + ## OUTPUTS ### Microsoft.PowerShell.Commands.Internal.Format + Format-Custom returns the format objects that represent the display. + ## NOTES -* Format-Custom is designed to display views that are not just tables or just lists. To display an alternate table view, use Format-Table. To display an alternate list view, use Format-List. - You can also refer to Format-Custom by its built-in alias, "fc". -For more information, see about_Aliases. +Format-Custom is designed to display views that are not just tables or just lists. To display an alternate table view, use Format-Table. To display an alternate list view, use Format-List. + +You can also refer to `Format-Custom` by its built-in alias, "fc". +For more information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - The GroupBy parameter assumes that the objects are sorted. -Before using Format-Custom to group the objects, use Sort-Object to sort them. +The **GroupBy** parameter assumes that the objects are sorted. +Before using `Format-Custom` to group the objects, use `Sort-Object` to sort them. -* ## RELATED LINKS diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md b/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md index c9542ce4b85f..90e3c095f97a 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Format-Table.md @@ -9,38 +9,42 @@ title: Format-Table --- # Format-Table + ## SYNOPSIS Formats the output as a table. + ## SYNTAX -``` +```powershell Format-Table [-AutoSize] [-HideTableHeaders] [-Wrap] [[-Property] ] [-GroupBy ] [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] [] ``` ## DESCRIPTION -The Format-Table cmdlet formats the output of a command as a table with the selected properties of the object in each column. -The object type determines the default layout and properties that are displayed in each column, but you can use the Property parameter to select the properties that you want to see. +The `Format-Table` cmdlet formats the output of a command as a table with the selected properties of the object in each column. +The object type determines the default layout and properties that are displayed in each column, but you can use the **Property** parameter to select the properties that you want to see. You can also use a hash table to add calculated properties to an object before displaying it and to specify the column headings in the table. -To add a calculated property, use the Property or GroupBy parameters. +To add a calculated property, use the **Property** or **GroupBy** parameter. + ## EXAMPLES -### Example 1 -``` -PS C:\> get-pssnapin | format-table -auto +### Example 1: Format PowerShell snap-ins +```powershell +PS C:\> Get-PSSnapin | Format-Table -Auto ``` This command formats information about Windows PowerShell snap-ins in a table. By default, they are formatted in a list. The Get-PSSnapin cmdlet gets objects representing the snap-ins. -The pipeline operator (|) passes the object to the Format-Table command. -Format-Table formats the objects in a table. -The Autosize parameter adjusts the column widths to minimize truncation. -### Example 2 -``` -PS C:\> get-process | sort-object -property basepriority | format-table -groupby basepriority -wrap +The pipeline operator (|) passes the object to the `Format-Table` command. +`Format-Table` formats the objects in a table. +The **Autosize** parameter adjusts the column widths to minimize truncation. + +### Example 2: Format processes by BasePriority +```powershell +PS C:\> Get-Process | Sort-Object -Property basepriority | Format-Table -GroupBy basepriority -Wrap ``` This command displays the processes on the computer in groups with the same base priority. @@ -48,117 +52,123 @@ This command displays the processes on the computer in groups with the same base The Get-Process cmdlet gets objects representing each process on the computer. The pipeline operator (|) passes the object to the Sort-Object cmdlet, which sorts the objects in order of their base priority. -Another pipeline operator passes the results to the Format-Table cmdlet. -The GroupBy parameter arranges the data about the processes into groups based on the value of their BasePriority property. -The Wrap parameter ensures that data is not truncated. -### Example 3 -``` -PS C:\> get-process | sort-object starttime | format-table -view starttime +Another pipeline operator passes the results to the `Format-Table` cmdlet. +The **GroupBy** parameter arranges the data about the processes into groups based on the value of their BasePriority property. +The **Wrap** parameter ensures that data is not truncated. + +### Example 3: Format processes by start date +```powershell +PS C:\> Get-Process | Sort-Object starttime | Format-Table -View starttime ``` This command displays information about the processes on the computer in group based on the start date of the process. It uses the Get-Process cmdlet to get objects representing the processes on the computer. The pipeline operator (|) sends the output of Get-Process to the Sort-Object cmdlet, which sorts it based on the StartTime property. -Another pipeline operator sends the sorted results to Format-Table. +Another pipeline operator sends the sorted results to `Format-Table`. -The View parameter is used to select the StartTime view that is defined in the DotNetTypes.format.ps1xml formatting file for System.Diagnostics.Process objects, such as those returned by Get-Process. +The **View** parameter is used to select the StartTime view that is defined in the DotNetTypes.format.ps1xml formatting file for **System.Diagnostics.Process** objects, such as those returned by `Get-Process`. This view converts the StartTime of the process to a short date and then groups the processes by start date. The DotNetTypes.format.ps1xml formatting file also contains a Priority view for processes, and you can create your own format.ps1xml files with customized views. -### Example 4 -``` -PS C:\> get-service | format-table -property Name, DependentServices + +### Example 4: Format services +```powershell +PS C:\> Get-Service | Format-Table -Property Name, DependentServices ``` This command displays all of the services on the computer in a table with two columns, Name and DependentServices. The command uses the Get-Service cmdlet to get all of the services on the computer. -The pipeline operator (|) sends the results to the Format-Table cmdlet, which formats the output in a table. -The Property parameter specifies the properties that appear in the table as columns. -The name of the Property parameter is optional, so you can omit it ("format-table name, dependentservices"). +The pipeline operator (|) sends the results to the `Format-Table` cmdlet, which formats the output in a table. +The **Property** parameter specifies the properties that appear in the table as columns. +The name of the **Property** parameter is optional, so you can omit it, for example `format-table name, dependentservices`. -Property and DependentServices are just two of the properties of service objects. -To view all of the properties, type "get-service | get-member". -### Example 5 -``` -PS C:\> get-process notepad | format-table ProcessName, @{Label="TotalRunningTime"; Expression={(get-date) - $_.StartTime}} +Name and DependentServices are just two of the properties of service objects. +To view all of the properties, type `get-service | get-member`. + +### Example 5: Format a process and calculate its running time +```powershell +PS C:\> Get-Process Notepad | Format-Table ProcessName, @{Label="TotalRunningTime"; Expression={(Get-Date) - $_.StartTime}} ``` This command shows how to use a calculated property in a table. The command displays a table with the process name and total running time of all Notepad processes on the local computer. The total running time is calculated by subtracting the start time of each process from the current time. -The command uses the Get-Process cmdlet to get all processes named "Notepad" on the local computer. -The pipeline operator (|) sends the results to Format-Table, which displays a table with two columns: ProcessName, a standard property of processes, and TotalRunningTime, a calculated property. +The command uses the Get-Process cmdlet to get all processes named Notepad on the local computer. +The pipeline operator (|) sends the results to `Format-Table`, which displays a table with two columns: ProcessName, a standard property of processes, and TotalRunningTime, a calculated property. The TotalRunningTime property is specified by a hash table with two keys, Label and Expression. The name of the property is assigned to the Label key. The calculation is assigned to the Expression key. -The expression gets the StartTime property of each process object and subtracts it from the result of a Get-Date command, which gets the current date (and time). -### Example 6 -``` -PS C:\> $processes = get-wmiobject -ComputerName Server01 win32_process -filter "name='notepad.exe'" -PS C:\> $processes | format-table ProcessName, @{ Label = "Total Running Time"; Expression={(get-date) - $_.ConvertToDateTime($_.CreationDate)}} +The expression gets the StartTime property of each process object and subtracts it from the result of a `Get-Date` command, which gets the current date and time. + +### Example 6: Format Notepad processes +```powershell +PS C:\> $Processes = Get-WmiObject -ComputerName "Server01" -Class win32_process -Filter "name='notepad.exe'" +PS C:\> $Processes | Format-Table ProcessName, @{ Label = "Total Running Time"; Expression={(Get-Date) - $_.ConvertToDateTime($_.CreationDate)}} ``` These commands are similar to the previous command, except that these commands use the Get-WmiObject cmdlet and the Win32_Process class to display information about Notepad processes on a remote computer. -The first command uses the Get-WmiObject cmdlet to get instances of the Windows Management Instrumentation (WMI) Win32_Process class that describes all of the processes on the Server01 computer that are named Notepad.exe. -The command stores the process information in the $processes variable. +The first command uses the `Get-WmiObject` cmdlet to get instances of the Windows Management Instrumentation (WMI) Win32_Process class that describes all of the processes on the Server01 computer that are named Notepad.exe. +The command stores the process information in the $Processes variable. -The second command uses a pipeline operator (|) to send the process information in the $processes variable to the Format-Table cmdlet, which displays the ProcessName of each process along with a new calculated property. +The second command uses a pipeline operator (|) to send the process information in the $Processes variable to the `Format-Table` cmdlet, which displays the ProcessName of each process along with a new calculated property. The command assigns the name of the new calculated property, Total Running Time, to the Label key. The script block that is assigned to the Expression key calculates how long the process has been running by subtracting the creation date of the process from the current date. The Get-Date cmdlet gets the current date. -The ConvertToDateTime method converts the CreationDate property of the Win32_Process object from a WMI CIM_DATETIME object to a Microsoft .NET Framework DateTime object that can be compared with the output of Get-Date. +The ConvertToDateTime method converts the CreationDate property of the Win32_Process object from a WMI CIM_DATETIME object to a Microsoft .NET Framework **DateTime** object that can be compared with the output of `Get-Date`. Then, the converted creation date is subtracted from the current date. The result is the value of Total Running Time. + ## PARAMETERS ### -AutoSize -Adjusts the column size and number of columns based on the width of the data. +Indicates that the cmdlet adjusts the column size and number of columns based on the width of the data. By default, the column size and number are determined by the view. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -DisplayError -Displays errors at the command line. -This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a Format-Table command, and the expressions do not appear to be working. +Indicates that the cmdlet displays errors at the command line. +This parameter is rarely used, but can be used as a debugging aid when you are formatting expressions in a `Format-Table` command, and the expressions do not appear to be working. The following shows an example of the results of adding the DisplayError parameter with an expression. +```powershell PS \> Get-Date | Format-Table DayOfWeek,{ $_ / $null } -ShowError DayOfWeek $_ / $null --------- ------------ Wednesday #ERR +``` ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Expand -Formats the collection object, as well as the objects in the collection. +Specifies the format of the collection object, as well as the objects in the collection. This parameter is designed to format objects that support the ICollection (System.Collections) interface. The default value is EnumOnly. - -Valid values are: +The acceptable values for this parameter are: - EnumOnly: Displays the properties of the objects in the collection. - CoreOnly: Displays the properties of the collection object. @@ -167,40 +177,41 @@ Valid values are: ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: CoreOnly, EnumOnly, Both Required: False Position: Named -Default value: EnumOnly +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Force -Directs the cmdlet to display all of the error information. -Use with the DisplayError or ShowError parameters. +Indicates that the cmdlet directs the cmdlet to display all of the error information. +Use with the **DisplayError** or **ShowError** parameter. By default, when an error object is written to the error or display streams, only some of the error information is displayed. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -GroupBy -Arranges sorted output in separate tables based on a property value. -For example, you can use GroupBy to list services in separate tables based on their status. +Specifies sorted output in separate tables based on a property value. +For example, you can use **GroupBy** to list services in separate tables based on their status. Enter an expression or a property of the output. -The output must be sorted before you send it to Format-Table. +The output must be sorted before you send it to `Format-Table`. -The value of the GroupBy parameter can be a new calculated property. +The value of the **GroupBy** parameter can be a new calculated property. To create a calculated, property, use a hash table. Valid keys are: @@ -211,7 +222,7 @@ Valid keys are: ```yaml Type: Object Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -226,23 +237,23 @@ Omits the column headings from the table. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -InputObject -Specifies the objects to be formatted. +Specifies the objects to format. Enter a variable that contains the objects, or type a command or expression that gets the objects. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -257,36 +268,37 @@ Type one or more property names (separated by commas), or use a hash table to di Wildcards are permitted. If you omit this parameter, the properties that appear in the display depend on the object being displayed. -The parameter name ("Property") is optional. -You cannot use the Property and View parameters in the same command. +The parameter name (**Property**) is optional. +You cannot use the **Property** and **View** parameters in the same command. -The value of the Property parameter can be a new calculated property. -To create a calculated, property, use a hash table. +The value of the **Property** parameter can be a new calculated property. +To create a calculated property, use a hash table. Valid keys are: - Name (or Label) \ - Expression \ or \ - - - ConvertFromDateTime - - - + System.Management.ManagementObject + + + ConvertToDateTime + + + + ConvertFromDateTime + + + ``` @@ -542,7 +547,7 @@ property of the `GetVersionInfo` static method of VersionInfo - [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) + [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) @@ -553,12 +558,12 @@ For more information, see the [Windows PowerShell Software Development Kit (SDK) in the MSDN (Microsoft Developer Network) library](http://go.microsoft.com/fwlink/?LinkId=144538). -## Update-TypeData +## `Update-TypeData` To load your Types.ps1xml files into a Windows PowerShell session, run the `Update-TypeData` cmdlet. If you want the types in your file to take precedence over types in the built-in Types.ps1xml file, add the -`PrependData` parameter of `Update-TypeData`. `Update-TypeData` affects only +PrependData parameter of `Update-TypeData`. `Update-TypeData` affects only the current session. To make the change to all future sessions, export the session, or add the `Update-TypeData` command to your Windows PowerShell profile. @@ -580,8 +585,9 @@ use method syntax. ## Signing a Types.ps1xml File -To protect users of your Types.ps1xml file, you can sign the file using -a digital signature. For more information, see `about_Signing`. +To protect users of your Types.ps1xml file, you can sign the file using a +digital signature. For more information, see +[about_Signing](about_Signing.md). # SEE ALSO @@ -598,4 +604,3 @@ a digital signature. For more information, see `about_Signing`. [Remove-TypeData](../../Microsoft.PowerShell.Utility/Remove-TypeData.md) [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md) - diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md index b2ddd2ffb955..08ee68185fcb 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,86 +7,90 @@ title: about_WMI_Cmdlets --- # About WMI Cmdlets -## about_WMI_Cmdlets - ## SHORT DESCRIPTION -Provides background information about Windows Management Instrumentation (WMI) and Windows PowerShell®. +Provides background information about Windows Management Instrumentation (WMI) +and Windows PowerShell. ## LONG DESCRIPTION -This topic provides information about WMI technology, the WMI cmdlets for Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI troubleshooting. This topic also provides links to more information about WMI. +This topic provides information about WMI technology, the WMI cmdlets for +Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI +troubleshooting. This topic also provides links to more information about WMI. ### ABOUT WMI -Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF). You can use WMI to manage both local and remote computers. For example, you can use WMI to do the following: - --- Start a process on a remote computer. - --- Restart a computer remotely. - --- Get a list of the applications that are installed on a local or remote computer. - --- Query the Windows event logs on a local or remote computer. +Windows Management Instrumentation (WMI) is the Microsoft implementation of +Web-Based Enterprise Management (WBEM), which is an industry initiative to +develop a standard technology for accessing management information in an +enterprise environment. WMI uses the Common Information Model (CIM) industry +standard to represent systems, applications, networks, devices, and other +managed components. CIM is developed and maintained by the Distributed +Management Task Force (DMTF). You can use WMI to manage both local and remote +computers. For example, you can use WMI to do the following: + +- Start a process on a remote computer. +- Restart a computer remotely. +- Get a list of the applications that are installed on a local or remote + computer. +- Query the Windows event logs on a local or remote computer. ### THE WMI CMDLETS FOR WINDOWS POWERSHELL -Windows PowerShell implements WMI functionality through a set of cmdlets that are available in Windows PowerShell by default. You can use these cmdlets to complete the end-to-end tasks necessary to manage local and remote computers. - -The following WMI cmdlets are included. +Windows PowerShell implements WMI functionality through a set of cmdlets that +are available in Windows PowerShell by default. You can use these cmdlets to +complete the end-to-end tasks necessary to manage local and remote computers. -``` -Cmdlet Description ------------------- ---------------------------------------------- -Get-WmiObject Gets instances of WMI classes or information - about the available classes. - -Invoke-WmiMethod Calls WMI methods. - -Register-WmiEvent Subscribes to a WMI event. - -Remove-WmiObject Deletes WMI classes and instances. - -Set-WmiInstance Creates or modifies instances of WMI classes. -``` - +The following WMI cmdlets are included. +|Cmdlet |Description | +|-----------------|----------------------------------------------| +|Get-WmiObject |Gets instances of WMI classes or information | +| |about the available classes. | +|Invoke-WmiMethod |Calls WMI methods. | +|Register-WmiEvent|Subscribes to a WMI event. | +|Remove-WmiObject |Deletes WMI classes and instances. | +|Set-WmiInstance |Creates or modifies instances of WMI classes. | ### SAMPLE COMMANDS The following command displays the BIOS information for the local computer. - -``` +```powershell C:\PS> get-wmiobject win32_bios | format-list * ``` +The following command displays information about the WinRM service for three +remote computers. -The following command displays information about the WinRM service for three remote computers. - - -``` -C:\PS> get-wmiobject -query "select * from win32_service where name='WinRM'" -computername server01, server01, server03 +```powershell +$wql = "select * from win32_service where name='WinRM'" +get-wmiobject -query $wql -computername server01, server01, server03 ``` - The following more complex command exits all instances of a program. - -``` -C:\PS> notepad.exe -C:\PS> $np = get-wmiobject -query "select * from win32_process where name='notepad.exe'" +```powershell +C:\PS> notepad.exe +C:\PS> $wql = "select * from win32_process where name='notepad.exe'" +C:\PS> $np = get-wmiobject -query $wql C:\PS> $np | remove-wmiobject ``` - - ### WMI-BASED REMOTING -While the ability to manage a local system through WMI is useful, it is the remoting capabilities that make WMI a powerful administrative tool. WMI uses Microsoft's Distributed Component Object Model (DCOM) to connect to and manage systems. You might have to configure some systems to allow DCOM connections. Firewall settings and locked-down DCOM permissions can block WMI's ability to remotely manage systems. +While the ability to manage a local system through WMI is useful, it is the +remoting capabilities that make WMI a powerful administrative tool. WMI uses +Microsoft's Distributed Component Object Model (DCOM) to connect to and manage +systems. You might have to configure some systems to allow DCOM connections. +Firewall settings and locked-down DCOM permissions can block WMI's ability to +remotely manage systems. ### WMI TYPE ACCELERATORS -Windows PowerShell includes WMI type accelerators. These WMI type accelerators (shortcuts) allow more direct access to a WMI objects than a non-type accelerator approach would allow. + +Windows PowerShell includes WMI type accelerators. These WMI type accelerators +(shortcuts) allow more direct access to a WMI objects than a non-type +accelerator approach would allow. The following type accelerators are supported with WMI: @@ -96,125 +100,117 @@ The following type accelerators are supported with WMI: [WMI] - A shortcut for getting a single instance of a class. -[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can take a string constructor to create a searcher that you can then do a GET() on. +[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can +take a string constructor to create a searcher that you can then do a GET() +on. For example: +```powershell +PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' +PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto +count __PATH name +----- ------ ---- +1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... +1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe +1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe +1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE +1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe +2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe ``` -PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' -PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto - -handlecount __PATH name ------------ ------ ---- -1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... -1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe -1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe -1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE -1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe -2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe -``` - -[WMICLASS] is a type accelerator for ManagementClass. This has a string constructor that takes a local or absolute WMI path to a WMI class and returns an object that is bound to that class. +[WMICLASS] is a type accelerator for ManagementClass. This has a string +constructor that takes a local or absolute WMI path to a WMI class and returns +an object that is bound to that class. For example: - -``` -PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" -PS> $c |fl * -Name : Win32_Process -__GENUS : 1 -__CLASS : Win32_Process -__SUPERCLASS : CIM_Process -__DYNASTY : CIM_ManagedSystemElement -__RELPATH : Win32_Process -__PROPERTY_COUNT : 45 -__DERIVATION : {CIM_Process, CIM_LogicalElement, CIM_ManagedSystemElement} -__SERVER : SERVER01 -__NAMESPACE : ROOT\cimv2 +```powershell +PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" +PS> $c |fl * +Name : Win32_Process +__GENUS : 1 +__CLASS : Win32_Process +__SUPERCLASS : CIM_Process +__DYNASTY : CIM_ManagedSystemElement +__RELPATH : Win32_Process +__PROPERTY_COUNT : 45 +__DERIVATION : {CIM_Process, CIM_LogicalElement, + CIM_ManagedSystemElement} +__SERVER : SERVER01 +__NAMESPACE : ROOT\cimv2 __PATH : \\SERVER01\ROOT\cimv2:Win32_Process ``` - -[WMI] is a type accelerator for ManagementObject. This has a string constructor that takes a local or absolute WMI path to a WMI instance and returns an object that is bound to that instance. +[WMI] is a type accelerator for ManagementObject. This has a string +constructor that takes a local or absolute WMI path to a WMI instance and +returns an object that is bound to that instance. For example: - -``` -PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' -PS> $p.Name +```powershell +PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' +PS> $p.Name OUTLOOK.EXE ``` - - ### WMI TROUBLESHOOTING -The following problems are the most common problems that might occur when you try to connect to a remote computer. -Problem 1: The remote computer is not online. - -If a computer is offline, you will not be able to connect to it by using WMI. You may receive the following error message: +The following problems are the most common problems that might occur when you +try to connect to a remote computer. +Problem 1: The remote computer is not online. -``` -"Remote server machine does not exist or is unavailable" -``` +If a computer is offline, you will not be able to connect to it by using WMI. +You may receive the following error message: + Remote server machine does not exist or is unavailable -If you receive this error message, verify that the computer is online. Try to ping the remote computer. +If you receive this error message, verify that the computer is online. Try to +ping the remote computer. Problem 2: You do not have local administrator rights on the remote computer. -To use WMI remotely, you must have local administrator rights on the remote computer. If you do not, access to that computer will be denied. +To use WMI remotely, you must have local administrator rights on the remote +computer. If you do not, access to that computer will be denied. To verify namespace security: -- a. Click Start, right-click My Computer, and then click Manage. - -- b. In Computer Management, expand Services and Applications, right-click WMI Control, and then click Properties. - -- c. In the WMI Control Properties dialog box, click the Security tab. +1. Click Start, right-click My Computer, and then click Manage. +2. In Computer Management, expand Services and Applications, right-click WMI + Control, and then click Properties. +3. In the WMI Control Properties dialog box, click the Security tab. Problem 3: A firewall is blocking access to the remote computer. -WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols to traverse the network. By default, many firewalls block DCOM and RPC traffic. If your firewall is blocking these protocols, your connection will fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is configured to automatically block all unsolicited network traffic, including DCOM and WMI. In its default configuration, Windows Firewall rejects an incoming WMI request, and you receive the following error message: - - -``` -"Remote server machine does not exist or is unavailable" -``` - +WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols +to traverse the network. By default, many firewalls block DCOM and RPC +traffic. If your firewall is blocking these protocols, your connection will +fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is +configured to automatically block all unsolicited network traffic, including +DCOM and WMI. In its default configuration, Windows Firewall rejects an +incoming WMI request, and you receive the following error message: + Remote server machine does not exist or is unavailable ### MORE INFORMATION ABOUT WMI -For more information about WMI, see the following topics in the MSDN (Microsoft Developer Network) library: - -``` -"About WMI: -http://go.microsoft.com/fwlink/?LinkId=142212 - -"WMI Troubleshooting" -http://go.microsoft.com/fwlink/?LinkId=142213 -``` +For more information about WMI, see the following topics in the MSDN +(Microsoft Developer Network) library: +About WMI: http://go.microsoft.com/fwlink/?LinkId=142212 -And, see "Secrets of Windows Management Instrumentation - Troubleshooting and Tips" in the Microsoft TechNet Script Center: +WMI Troubleshooting: http://go.microsoft.com/fwlink/?LinkId=142213 +And, see "Secrets of Windows Management Instrumentation - Troubleshooting and +Tips" in the Microsoft TechNet Script Center: -``` http://go.microsoft.com/fwlink/?LinkId=142214 -``` - ## SEE ALSO -Online version: http:\/\/go.microsoft.com\/fwlink\/?LinkId\=142219 - Get-WmiObject Invoke-WmiMethod diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Splatting.md index 0d9fbe39f89d..10b1d7bc00db 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -74,20 +74,24 @@ are included. Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf ``` -The second example uses hash table splatting. The first command creates -a hash table of parameter-name and parameter-value pairs and stores it -in the $HashArguments variable. The second command uses the `$HashArguments` -variable in a command with splatting. The At symbol (`@HashArguments`) -replaces the dollar sign (`$HashArguments`) in the command. +The second example uses hash table splatting. The first command creates a hash +table of parameter-name and parameter-value pairs and stores it in the +\$HashArguments variable. The second command uses the `$HashArguments` variable +in a command with splatting. The At symbol (`@HashArguments`) replaces the +dollar sign (`$HashArguments`) in the command. To provide a value for the WhatIf switch parameter, use $True or $False. ```powershell -$HashArguments = @{ Path = "test.txt"; Destination = "test2.txt"; WhatIf = $true } +$HashArguments = @{ + Path = "test.txt" + Destination = "test2.txt" + WhatIf = $true +} Copy-Item @HashArguments ``` -*Note: In the first command, the At symbol (@) indicates a hash table, not +Note: In the first command, the At symbol (@) indicates a hash table, not a splatted value. The syntax for hash tables in Windows PowerShell is: @{\=\; \=\; …}* @@ -106,11 +110,12 @@ omitted. The parameter values appear in position order in the command. Copy-Item "test.txt" "test2.txt" -WhatIf ``` -The second example uses array splatting. The first command creates an array -of the parameter values and stores it in the `$ArrayArguments` variable. The +The second example uses array splatting. The first command creates an array of +the parameter values and stores it in the `$ArrayArguments` variable. The values are in position order in the array. The second command uses the `$ArrayArguments` variable in a command in splatting. The At symbol -(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the command. +(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the +command. ```powershell $ArrayArguments = "test.txt", "test2.txt" @@ -120,10 +125,10 @@ Copy-Item @ArrayArguments -WhatIf # EXAMPLES -This example shows how to re-use splatted values in different commands. -The commands in this example use the Write-Host cmdlet to write messages -to the host program console. It uses splatting to specify the foreground -and background colors. +This example shows how to re-use splatted values in different commands. The +commands in this example use the Write-Host cmdlet to write messages to the +host program console. It uses splatting to specify the foreground and +background colors. To change the colors of all commands, just change the value of the `$Colors` variable. @@ -143,7 +148,8 @@ Write-Host command. To use the `$Colors variable`, replace the dollar sign #Write a message with the colors in $Colors Write-Host "This is a test." @Colors -#Write second message with same colors. The position of splatted hash table does not matter. +#Write second message with same colors. The position of splatted +#hash table does not matter. Write-Host @Colors "This is another test." ``` @@ -193,22 +199,19 @@ Test2 -a 1 -b 2 -c 3 # SPLATTING COMMAND PARAMETERS -You can use splatting to represent the parameters of -a command. This technique is useful when you are creating -a proxy function, that is, a function that calls another -command. This feature is introduced in Windows PowerShell 3.0. +You can use splatting to represent the parameters of a command. This technique +is useful when you are creating a proxy function, that is, a function that +calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent -the command parameters. This technique is easier than -enumerating command parameters and it works without revision -even if the parameters of the called command change. +To splat the parameters of a command, use `@Args` to represent the command +parameters. This technique is easier than enumerating command parameters and +it works without revision even if the parameters of the called command change. The feature uses the `$Args` automatic variable, which contains all unassigned parameter values. -For example, the following function calls the Get-Process -cmdlet. In this function, `@Args` represents all of the parameters -of the Get-Process cmdlet. +For example, the following function calls the Get-Process cmdlet. In this +function, `@Args` represents all of the parameters of the Get-Process cmdlet. ```powershell function Get-MyProcess { Get-Process @Args } @@ -223,20 +226,18 @@ Get-MyProcess -Name PowerShell Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -463 46 225484 237196 719 15.86 3228 powershell + 463 46 225484 237196 719 15.86 3228 powershell Get-MyProcess -Name PowerShell_Ise -FileVersionInfo ProductVersion FileVersion FileName -------------- ----------- -------- -6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe +6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly -declared parameters. You can use it more than once in -a function, but all parameters that you enter are passed -to all instances of `@Args`, as shown in the following -example. +You can use `@Args` in a function that has explicitly declared parameters. You +can use it more than once in a function, but all parameters that you enter are +passed to all instances of `@Args`, as shown in the following example. ```powershell function Get-MyCommand @@ -252,9 +253,9 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 408 28 75568 83176 620 1.33 1692 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -265,10 +266,11 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell + \v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616) + FileVersion: 10.0.14393.0 (rs1_release.160715-1616 FileDescription: Windows PowerShell Product: Microsoft® Windows® Operating System ProductVersion: 10.0.14393.0 @@ -289,4 +291,3 @@ FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1. [about_Hash_Tables](about_Hash_Tables.md) [about_Parameters](about_Parameters.md) - diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md index 9154bed7ea49..98b97dd2dab7 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -19,22 +19,21 @@ The Split operator splits one or more strings into substrings. You can change the following elements of the Split operation: * Delimiter. The default is whitespace, but you can specify characters, -strings, patterns, or script blocks that specify the delimiter. The Split -operator in Windows PowerShell uses a regular expression in the delimiter, -rather than a simple character. + strings, patterns, or script blocks that specify the delimiter. The Split + operator in Windows PowerShell uses a regular expression in the delimiter, + rather than a simple character. * Maximum number of substrings. The default is to return all substrings. If -you specify a number less than the number of substrings, the remaining -substrings are concatenated in the last substring. + you specify a number less than the number of substrings, the remaining + substrings are concatenated in the last substring. * Options that specify the conditions under which the delimiter is matched, -such as SimpleMatch and Multiline. + such as SimpleMatch and Multiline. ## SYNTAX The following diagram shows the syntax for the -split operator. -The parameter names do not appear in the command. Include only the -parameter values. The values must appear in the order specified in the -syntax diagram. +The parameter names do not appear in the command. Include only the parameter +values. The values must appear in the order specified in the syntax diagram. ```powershell -Split @@ -45,17 +44,17 @@ syntax diagram. ``` You can substitute `-iSplit` or `-cSplit` for `-split` in any binary Split -statement (a Split statement that includes a delimiter or script block). -The `-iSplit` and `-split` operators are case-insensitive. The `-cSplit` -operator is case-sensitive, meaning that case is considered when the -delimiter rules are applied. +statement (a Split statement that includes a delimiter or script block). The +`-iSplit` and `-split` operators are case-insensitive. The `-cSplit` operator +is case-sensitive, meaning that case is considered when the delimiter rules +are applied. ## PARAMETERS ### \ -Specifies one or more strings to be split. If you submit multiple -strings, all the strings are split using the same delimiter rules. +Specifies one or more strings to be split. If you submit multiple strings, all +the strings are split using the same delimiter rules. Example: @@ -69,10 +68,10 @@ green ### \ -The characters that identify the end of a substring. The default delimiter -is whitespace, including spaces and non-printable characters, such as -newline (\`n) and tab (\`t). When the strings are split, the delimiter is -omitted from all the substrings. Example: +The characters that identify the end of a substring. The default delimiter is +whitespace, including spaces and non-printable characters, such as newline +(\`n) and tab (\`t). When the strings are split, the delimiter is omitted from +all the substrings. Example: ```powershell "Lastname:FirstName:Address" -split ":" @@ -81,13 +80,13 @@ FirstName Address ``` -By default, the delimiter is omitted from the results. To preserve all or -part of the delimiter, enclose in parentheses the part that you want to -preserve. If the \ parameter is added, this takes -precedence when your command splits up the collection. If you opt to -include a delimiter as part of the output, the command returns the -delimiter as part of the output; however, splitting the string to return -the delimiter as part of output does not count as a split. +By default, the delimiter is omitted from the results. To preserve all or part +of the delimiter, enclose in parentheses the part that you want to preserve. +If the \ parameter is added, this takes precedence when your +command splits up the collection. If you opt to include a delimiter as part of +the output, the command returns the delimiter as part of the output; however, +splitting the string to return the delimiter as part of output does not count +as a split. Examples: @@ -124,17 +123,16 @@ Strawberry-Blueberry ### \ -Specifies the maximum number of times that a string is split. The default -is all the substrings split by the delimiter. If there are more substrings, -they are concatenated to the final substring. If there are fewer -substrings, all the substrings are returned. A value of 0 and negative -values return all the substrings. +Specifies the maximum number of times that a string is split. The default is +all the substrings split by the delimiter. If there are more substrings, they +are concatenated to the final substring. If there are fewer substrings, all +the substrings are returned. A value of 0 and negative values return all the +substrings. Max-substrings does not specify the maximum number of objects that are -returned; its value equals the maximum number of times that a string is -split. If you submit more than one string (an array of strings) to the -Split operator , the Max-substrings limit is applied to each string -separately. +returned; its value equals the maximum number of times that a string is split. +If you submit more than one string (an array of strings) to the Split operator +, the Max-substrings limit is applied to each string separately. Example: @@ -150,9 +148,8 @@ Jupiter,Saturn,Uranus,Neptune ### \ -An expression that specifies rules for applying the delimiter. The -expression must evaluate to $true or $false. Enclose the script block in -braces. +An expression that specifies rules for applying the delimiter. The expression +must evaluate to $true or $false. Enclose the script block in braces. Example: @@ -187,63 +184,62 @@ The syntax for the Options parameter is: The SimpleMatch options are: * **SimpleMatch**: Use simple string comparison when evaluating the -delimiter. Cannot be used with RegexMatch. + delimiter. Cannot be used with RegexMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. The RegexMatch options are: * **RegexMatch**: Use regular expression matching to evaluate the -delimiter. This is the default behavior. Cannot be used with -SimpleMatch. + delimiter. This is the default behavior. Cannot be used with + SimpleMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. * **CultureInvariant**: Ignores cultural differences in language -when evaluting the delimiter. Valid only with RegexMatch. + when evaluting the delimiter. Valid only with RegexMatch. * IgnorePatternWhitespace: Ignores unescaped whitespace and -comments marked with the number sign (#). Valid only with -RegexMatch. + comments marked with the number sign (#). Valid only with + RegexMatch. * **Multiline**: Multiline mode recognizes the start and end of lines -and strings. Valid only with RegexMatch. Singleline is the default. + and strings. Valid only with RegexMatch. Singleline is the default. * **Singleline**: Singleline mode recognizes only the start and end of -strings. Valid only with RegexMatch. Singleline is the default. + strings. Valid only with RegexMatch. Singleline is the default. * **ExplicitCapture**: Ignores non-named match groups so that only -explicit capture groups are returned in the result list. Valid -only with RegexMatch. + explicit capture groups are returned in the result list. Valid + only with RegexMatch. ## UNARY and BINARY SPLIT OPERATORS The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the -unary split operator, only the first string (before the first comma) is -split. +unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( --split ). Enclose all the strings in parentheses, or store the -strings in a variable, and then submit the variable to the split operator. +To split more than one string, use the binary split operator ( -split +). Enclose all the strings in parentheses, or store the strings in +a variable, and then submit the variable to the split operator. Consider the following example: ```powershell -PS C:\> -split "1 2", "a b" +PS > -split "1 2", "a b" 1 2 a b -PS C:\> "1 2", "a b" -split " " +PS > "1 2", "a b" -split " " 1 2 a b -PS C:\> -split ("1 2", "a b") +PS > -split ("1 2", "a b") 1 2 a b -PS C:\> $a = "1 2", "a b" -PS C:\> -split $a +PS > $a = "1 2", "a b" +PS > -split $a 1 2 a @@ -255,7 +251,7 @@ b The following statement splits the string at whitespace. ```powershell -PS C:\> -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" Windows PowerShell 2.0 @@ -268,7 +264,7 @@ remoting The following statement splits the string at any comma. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' Mercury Venus Earth @@ -282,17 +278,16 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune ``` -The following statement performs a case-sensitive split at the -letter "N". +The following statement performs a case-sensitive split at the letter "N". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -300,7 +295,7 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' M rcury,V nus, @@ -317,7 +312,8 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` + -split '[er]', 6 M cu @@ -329,7 +325,7 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS C:\> "a,b,c,d,e,f,g,h" -split ",", 3 +PS > "a,b,c,d,e,f,g,h" -split ",", 3 a b c,d,e,f,g,h @@ -339,7 +335,7 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS C:\> "a,b,c,d", "e,f,g,h" -split ",", 3 +PS > "a,b,c,d", "e,f,g,h" -split ",", 3 a b c,d @@ -352,18 +348,18 @@ The following statement splits each line in the here-string at the first digit. It uses the Multiline option to recognize the beginning of each line and string. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as Multiline, only when the Max-substrings value -is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as Multiline, only when the Max-substrings value is +specified. ```powershell -PS C:\> $a = @' +PS > $a = @' 1The first line. 2The second line. 3The third of three lines. '@ -PS C:\> $a -split "^\d", 0, "multiline" +PS > $a -split "^\d", 0, "multiline" The first line. @@ -380,12 +376,12 @@ interpreted to match any character except for a newline character. As a result, the Split statement returns a blank line for every character except newline. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as SimpleMatch, only when the Max-substrings -value is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as SimpleMatch, only when the Max-substrings value is +specified. ```powershell -PS C:\> "This.is.a.test" -split ".", 0, "simplematch" +PS > "This.is.a.test" -split ".", 0, "simplematch" This is @@ -393,13 +389,13 @@ a test ``` -The following statement splits the string at one of two delimiters, -depending on the value of a variable. +The following statement splits the string at one of two delimiters, depending +on the value of a variable. ```powershell -PS C:\> $i = 1 -PS C:\> $c = "LastName, FirstName; Address, City, State, Zip" -PS C:\> $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +PS > $i = 1 +PS > $c = "LastName, FirstName; Address, City, State, Zip" +PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} LastName, FirstName Address, City, State, Zip @@ -407,7 +403,7 @@ Address, City, State, Zip ## SEE ALSO -Split-Path +[Split-Path](../../Microsoft.PowerShell.Management/Split-Path.md) [about_Operators](about_Operators.md) diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Switch.md index 90658fd83ff1..1bfafbe78470 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -148,13 +148,25 @@ Default clause is permitted in each Switch statement. Switch has the following parameters: -|Parameter|Description| -|---|---| -| Wildcard | Indicates that the condition is a wildcard string. If you use Wildcard, Regex and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| Exact | Indicates that the match clause, if it is a string, must match exactly. If you use Exact, Regex and Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| CaseSensitive | Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. | -| File | Takes input from a file rather than a value statement. If multiple File parameters are included, only the last one is used. Each line of the file is read and evaluated by the Switch statement. | -| Regex | Performs regular expression matching of the value to the condition. If you use Regex, Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | +|Parameter |Description | +|-------------|-----------------------------------------------------------| +|Wildcard |Indicates that the condition is a wildcard string. If you | +| |you use Wildcard, Regex and Exact are ignored. Also, if | +| |the match clause is not a string, the parameter is ignored.| +|Exact |Indicates that the match clause, if it is a string, must | +| |match exactly. Regex and Wildcard and Exact are ignored. | +| |Also, if the match clause is not a string, this parameter | +| |is ignored. | +|CaseSensitive|Performs a case-sensitive match. If the match clause is not| +| |a string, this parameter is ignored. | +|File |Takes input from a file rather than a value statement. If | +| |multiple File parameters are included, only the last one is| +| |used. Each line of the file is read and evaluated by the | +| |Switch statement. | +|Regex |Performs regular expression matching of the value to the | +| |condition. Wildcard and Exact are ignored. Also, if the | +| |match clause is not a string, this parameter is ignored. | + ```powershell Example: diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Throw.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Throw.md index 2deea43ade1b..08fe2f6e5c7e 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Throw.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Throw.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -14,16 +14,16 @@ Describes the Throw keyword, which generates a terminating error. ## LONG DESCRIPTION -The Throw keyword causes a terminating error. You can use the Throw keyword -to stop the processing of a command, function, or script. +The Throw keyword causes a terminating error. You can use the Throw keyword to +stop the processing of a command, function, or script. For example, you can use the Throw keyword in the script block of an If statement to respond to a condition or in the Catch block of a -Try-Catch-Finally statement. You can also use the Throw keyword in a -parameter declaration to make a function parameter mandatory. +Try-Catch-Finally statement. You can also use the Throw keyword in a parameter +declaration to make a function parameter mandatory. -The Throw keyword can throw any object, such as a user message string or -the object that caused the error. +The Throw keyword can throw any object, such as a user message string or the +object that caused the error. ## SYNTAX @@ -33,8 +33,8 @@ The syntax of the Throw keyword is as follows: throw [] ``` -The expression in the Throw syntax is optional. When the Throw statement -does not appear in a Catch block, and it does not include an expression, it +The expression in the Throw syntax is optional. When the Throw statement does +not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error. ```powershell @@ -47,13 +47,14 @@ At line:1 char:6 + FullyQualifiedErrorId : ScriptHalted ``` -If the Throw keyword is used in a Catch block without an expression, it -throws the current RuntimeException again. For more information, see +If the Throw keyword is used in a Catch block without an expression, it throws +the current RuntimeException again. For more information, see about_Try_Catch_Finally. ## THROWING A STRING -The optional expression in a Throw statement can be a string, as shown in -the following example: + +The optional expression in a Throw statement can be a string, as shown in the +following example: ```powershell C:\PS> throw "This is an error." @@ -61,7 +62,8 @@ C:\PS> throw "This is an error." This is an error. At line:1 char:6 + throw <<<< "This is an error." -+ CategoryInfo : OperationStopped: (This is an error.:String) [], RuntimeException ++ CategoryInfo : OperationStopped: (This is an error.:String) [], R +untimeException + FullyQualifiedErrorId : This is an error. ``` @@ -76,7 +78,8 @@ C:\PS> throw (get-process PowerShell) System.Diagnostics.Process (PowerShell) At line:1 char:6 + throw <<<< (get-process PowerShell) -+ CategoryInfo : OperationStopped: (System.Diagnostics.Process (PowerShell):Process) [], ++ CategoryInfo : OperationStopped: (System.Diagnostics.Process (Pow +erShell):Process) [], RuntimeException + FullyQualifiedErrorId : System.Diagnostics.Process (PowerShell) ``` @@ -105,15 +108,16 @@ One of the identified items was in an invalid format. At line:1 char:6 + throw <<<< $formatError + CategoryInfo : OperationStopped: (:) [], FormatException -+ FullyQualifiedErrorId : One of the identified items was in an invalid format. ++ FullyQualifiedErrorId : One of the identified items was in an invalid +format. ``` ## RESULTING ERROR -The Throw keyword can generate an ErrorRecord object. The Exception -property of the ErrorRecord object contains a RuntimeException object. The -remainder of the ErrorRecord object and the RuntimeException object vary -with the object that the Throw keyword throws. +The Throw keyword can generate an ErrorRecord object. The Exception property +of the ErrorRecord object contains a RuntimeException object. The remainder of +the ErrorRecord object and the RuntimeException object vary with the object +that the Throw keyword throws. The RunTimeException object is wrapped in an ErrorRecord object, and the ErrorRecord object is automatically saved in the $Error automatic variable. @@ -139,7 +143,9 @@ optional. function Get-XMLFiles { param ($path = $(throw "The Path parameter is required.")) - dir -path $path\*.xml -recurse | sort lastwritetime | ft lastwritetime, attributes, name -auto + dir -path $path\*.xml -recurse | + sort lastwritetime | + ft lastwritetime, attributes, name -auto } ``` @@ -154,4 +160,3 @@ function Get-XMLFiles [about_Trap](about_Trap.md) [about_Try_Catch_Finally](about_Try_Catch_Finally.md) - diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Trap.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Trap.md index 338030fa058b..bc042324bc4b 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Trap.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Trap.md @@ -130,7 +130,9 @@ statement that specifies the CommandNotFoundException type. ```powershell trap {"Other terminating error trapped" } -trap [System.Management.Automation.CommandNotFoundException] {"Command error trapped"} +trap [System.Management.Automation.CommandNotFoundException] { + "Command error trapped" +} nonsenseString ``` diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md index a94e962d87b3..531eb8a2f9da 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-091 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -26,11 +26,16 @@ fails, it returns nothing. It does not return an error. The following table lists the type operators in Windows PowerShell. -|Operator|Description|Example| -|---|---|---| -|`-is`|Returns TRUE when the input is an instance of the specified.NET Framework type.|`C:\PS> (get-date) -is [DateTime]`
`True`| -|`-isNot`|Returns TRUE when the input is not an instance of the specified.NET Framework type.|`C:\PS> (get-date) -isNot [DateTime]`
`False`| -|`-as`|Converts the input to the specified.NET Framework type.|`C:\PS> 12/31/07 -as [DateTime]`
`Monday, December 31, 2007 12:00:00 AM`| +|Operator|Description |Example | +|--------|---------------------------|---------------------------------| +|`-is` |Returns TRUE when the input|`(get-date) -is [DateTime]` | +| |is an instance of the |`True` | +| |specified .NET type. | | +|`-isNot`|Returns TRUE when the input|`(get-date) -isNot [DateTime]` | +| |not an instance of the |`False` | +| |specified.NET type. | | +|`-as` |Converts the input to the |`"5/7/07" -as [DateTime]` | +| |specified .NET type. |`Monday, May 7, 2007 12:00:00 AM`| The syntax of the type operators is as follows: @@ -64,7 +69,7 @@ property of this method. For example, the following statement gets the type of the return value of a Get-Culture command: ```powershell -C:\PS> (get-culture).gettype().fullname +PS> (get-culture).gettype().fullname System.Globalization.CultureInfo ``` @@ -72,25 +77,25 @@ System.Globalization.CultureInfo The following examples show some uses of the Type operators: ```powershell -C:\PS> 32 -is [Float] +PS> 32 -is [Float] False -C:\PS> 32 -is "int" +PS> 32 -is "int" True -C:\PS> (get-date) -is [DateTime] +PS> (get-date) -is [DateTime] True -C:\PS> "12/31/2007" -is [DateTime] +PS> "12/31/2007" -is [DateTime] False -C:\PS> "12/31/2007" -is [String] +PS> "12/31/2007" -is [String] True -C:\PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] +PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] True -C:\PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] +PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] True ``` @@ -103,53 +108,55 @@ return System.Globalization.CultureInfo objects, a collection of these objects is a System.Object array. ```powershell -C:\PS> (get-culture) -is [System.Globalization.CultureInfo] +PS> (get-culture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-uiculture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] False -C:\PS> (get-culture), (get-uiculture) -is [Array] +PS> (get-culture), (get-uiculture) -is [Array] True -C:\PS> (get-culture), (get-uiculture) | foreach {$_ -is [System.Globalization.CultureInfo]) +PS> (get-culture), (get-uiculture) | foreach { + $_ -is [System.Globalization.CultureInfo]) +} True True -C:\PS> (get-culture), (get-uiculture) -is [Object] +PS> (get-culture), (get-uiculture) -is [Object] True ``` The following examples show how to use the -as operator. ```powershell -C:\PS> "12/31/07" -is [DateTime] +PS> "12/31/07" -is [DateTime] False -C:\PS> "12/31/07" -as [DateTime] +PS> "12/31/07" -as [DateTime] Monday, December 31, 2007 12:00:00 AM -C:\PS> $date = "12/31/07" -as [DateTime] +PS> $date = "12/31/07" -as [DateTime] C:\PS>$a -is [DateTime] True -C:\PS> 1031 -as [System.Globalization.CultureInfo] +PS> 1031 -as [System.Globalization.CultureInfo] -LCID Name DisplayName ----- ---- ----------- -1031 de-DE German (Germany) +LCID Name DisplayName +---- ---- ----------- +1031 de-DE German (Germany) ``` The following example shows that when the -as operator cannot convert the input object to the .NET Framework type, it returns nothing. ```powershell -C:\PS> 1031 -as [System.Diagnostic.Process] -C:\PS> +PS> 1031 -as [System.Diagnostic.Process] +PS> ``` ## SEE ALSO diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md index 4720a9de93dc..3888516c6096 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,9 +7,6 @@ title: about_Types.ps1xml --- # About Types.ps1xml -## about_Types.ps1xml - - # SHORT DESCRIPTION @@ -27,16 +24,16 @@ extended type data to a Windows PowerShell session. extended data for types in the current session. This topic describes Types.ps1xml files. For more information about using the -`Update-TypeData` cmdlet to add dynamic extended type data to the current session -see [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). +`Update-TypeData` cmdlet to add dynamic extended type data to the current +session see +[Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). ## About Extended Type Data -Extended type data defines additional properties and methods ("members") -of object types in Windows PowerShell. You can extend any type that is -supported by Windows PowerShell and use the added properties and methods -in the same way that you use the properties that are defined on the object -types. +Extended type data defines additional properties and methods ("members") of +object types in Windows PowerShell. You can extend any type that is supported +by Windows PowerShell and use the added properties and methods in the same way +that you use the properties that are defined on the object types. For example, Windows PowerShell adds a `DateTime` property to all `System.DateTime` objects, such as the ones that the `Get-Date` cmdlet @@ -47,27 +44,27 @@ PS C:> (Get-Date).DateTime Sunday, January 29, 2012 9:43:57 AM ``` -You won't find the DateTime property in the description of the [`System.DateTime` -structure](http://msdn.microsoft.com/library/system.datetime.aspx), -because Windows PowerShell adds the property and it is visible only in -Windows PowerShell. +You won't find the `DateTime` property in the description of the +[`System.DateTime` structure](http://msdn.microsoft.com/library/system.datetime.aspx), +because Windows PowerShell adds the property and it is visible only in Windows +PowerShell. -To add the DateTime property to all Windows PowerShell sessions, Windows PowerShell -defines the DateTime property in the Types.ps1xml file in the Windows PowerShell -installation directory (`$PSHOME`). +To add the `DateTime` property to all Windows PowerShell sessions, Windows +PowerShell defines the `DateTime` property in the Types.ps1xml file in the +Windows PowerShell installation directory (`$PSHOME`). ## Adding Extended Type Data to Windows PowerShell. There are three sources of extended type data in Windows PowerShell sessions. -- The Types.ps1xml files in the Windows PowerShell installation directory -are loaded automatically into every Windows PowerShell session. +- The Types.ps1xml files in the Windows PowerShell installation directory + are loaded automatically into every Windows PowerShell session. -- The Types.ps1xml files that modules export are loaded when the module -is imported into the current session. +- The Types.ps1xml files that modules export are loaded when the module + is imported into the current session. -- Extended type data that is defined by using the `Update-TypeData` cmdlet -is added only to the current session. It is not saved in a file. +- Extended type data that is defined by using the `Update-TypeData` cmdlet + is added only to the current session. It is not saved in a file. In the session, the extended type data from the three sources is applied to objects in the same way and is available on all objects of the specified @@ -78,14 +75,12 @@ types. The following TypeData cmdlets are included in the Microsoft.PowerShell.Utility module in Windows PowerShell 3.0 and later versions of Windows PowerShell. -| | | -| --------------- | --------------------------------------------------- | -| Get-TypeData | Gets extended type data in the current session. | -| Update-TypeData | Reloads Types.ps1xml files. Adds extended type data to the current session. | -| Remove-TypeData | Removes extended type data from the current session. | +- `Get-TypeData`: Gets extended type data in the current session. +- `Update-TypeData`: Reloads Types.ps1xml files. Adds extended type data to the + current session. +- `Remove-TypeData`: Removes extended type data from the current session. -For more information about these cmdlets, see the help topic for each -cmdlet. +For more information about these cmdlets, see the help topic for each cmdlet. ## Built-in Types.ps1xml Files @@ -103,7 +98,7 @@ For example, by default, array objects (`System.Array`) have a `Length` property that lists the number of objects in the array. However, because the name "Length" does not clearly describe the property, Windows PowerShell adds an alias property named "Count" that displays the same -value. The following XML adds the `Count` property to the `System.Array` type. +value. The following XML adds the Count property to the `System.Array` type. ```xml @@ -119,8 +114,8 @@ value. The following XML adds the `Count` property to the `System.Array` type. ``` -To get the new `AliasProperty`, use a `Get-Member` command on any array, as shown -in the following example. +To get the new `AliasProperty`, use a `Get-Member` command on any array, as +shown in the following example. ```powershell Get-Member -InputObject (1,2,3,4) @@ -128,29 +123,28 @@ Get-Member -InputObject (1,2,3,4) The command returns the following results. -```powershell -Name MemberType Definition ----- ---------- ---------- -Count AliasProperty Count = Length -Address Method System.Object& Address(Int32) -Clone Method System.Object Clone() -CopyTo Method System.Void CopyTo(Array array, Int32 index): -Equals Method System.Boolean Equals(Object obj) -Get Method System.Object Get(Int32) +```output +Name MemberType Definition +---- ---------- ---------- +Count AliasProperty Count = Length +Address Method System.Object& Address(Int32) +Clone Method System.Object Clone() +CopyTo Method System.Void CopyTo(Array array, Int32 index): +Equals Method System.Boolean Equals(Object obj) +Get Method System.Object Get(Int32) # ... ``` - -As a result, you can use either the `Count` property or the `Length` property +As a result, you can use either the Count property or the Length property of arrays in Windows PowerShell. For example: ```powershell -C:\PS> (1, 2, 3, 4).Count +C:\PS> (1, 2, 3, 4).count # 4 ``` ```powershell -C:\PS> (1, 2, 3, 4).Length +C:\PS> (1, 2, 3, 4).length # 4 ``` @@ -172,12 +166,12 @@ installation directory. When you have saved the new file, use the `Update-TypeData` cmdlet to add the new file to your Windows PowerShell session. If you want your types to take precedence over the types that are defined in the built-in file, -use the `PrependData` parameter of the `Update-TypeData` cmdlet. +use the PrependData parameter of the `Update-TypeData` cmdlet. `Update-TypeData` affects only the current session. To make the change to all future sessions, export the console, or add the `Update-TypeData` command to your Windows PowerShell profile. -## Types.ps1xml and `Add-Member` +## Types.ps1xml and Add-Member The Types.ps1xml files add properties and methods to all the instances of the objects of the specified .NET Framework type in the affected @@ -188,7 +182,7 @@ For more information, see [Add-Member](../../Microsoft.PowerShell.Utility/Add-Me ## Example: Adding an `Age` Member to `FileInfo` Objects -This example shows how to add an Age property to file objects +This example shows how to add an `Age` property to file objects (`System.IO.FileInfo`). The age of a file is the difference between its creation time and the current time in days. @@ -201,7 +195,7 @@ Copy-Item Types.ps1xml MyTypes.ps1xml ``` Next, open the Types.ps1xml file in any XML or text editor, such -as Notepad. Because the Age property is calculated by using a script +as Notepad. Because the `Age` property is calculated by using a script block, find a `` tag to use as a model for the new `Age` property. @@ -257,7 +251,7 @@ information about `Update-TypeData`, see [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md).) ```powershell -Update-TypeData -PrependPath $PSHOME\MyTypes.ps1xml +Update-Typedata -PrependPath $PSHOME\MyTypes.ps1xml ``` To test the change, run a `Get-ChildItem` command to get the @@ -285,11 +279,11 @@ You can also display the `Age` property of the file by using the following command. ```powershell -(Get-GhildItem $PSHOME\PowerShell.exe).Age +(Get-ChildItem $PSHOME\PowerShell.exe).Age # 16 ``` -The XML in Types.ps1xml Files +## The XML in Types.ps1xml Files The `` tag encloses all of the types that are defined in the file. There should be only one pair of `` tags. @@ -335,7 +329,7 @@ The `` tag must have a pair of `` tags that specify the name of the new method and a pair of `` tags that specify the code in which the method is defined. -For example, the Mode property of directories (System.IO.DirectoryInfo +For example, the Mode property of directories (`System.IO.DirectoryInfo` objects) is a code property defined in the Windows PowerShell FileSystem provider. @@ -346,7 +340,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -371,7 +367,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -439,7 +437,7 @@ The `` tag must have a pair of `` tags that specify the name of the new property and a pair of `` tags that specify the value of the property. -For example, the following XML creates a `Status` property for +For example, the following XML creates a Status property for directories (`System.IO.DirectoryInfo` objects). The value of the `Status` property is always "Success". @@ -474,7 +472,7 @@ properties for the default display of an object. You can identify the default displays by the value "PsStandardMembers" in the `` tag of a `` tag. -For example, the following XML creates a `Status` property for +For example, the following XML creates a Status property for directories (`System.IO.DirectoryInfo` objects). The value of the `Status` property is always "Success". @@ -496,7 +494,7 @@ property is always "Success". - + ``` ``: Defines a method whose value is the output of a script. @@ -512,21 +510,21 @@ methods of the `System.Management.ManagementDateTimeConverter` class. ```xml - System.Management.ManagementObject - - - ConvertToDateTime - - - - ConvertFromDateTime - - - + System.Management.ManagementObject + + + ConvertToDateTime + + + + ConvertFromDateTime + + + ``` @@ -549,7 +547,7 @@ property of the `GetVersionInfo` static method of VersionInfo - [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) + [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) @@ -565,7 +563,7 @@ library](http://go.microsoft.com/fwlink/?LinkId=144538). To load your Types.ps1xml files into a Windows PowerShell session, run the `Update-TypeData` cmdlet. If you want the types in your file to take precedence over types in the built-in Types.ps1xml file, add the -`PrependData` parameter of `Update-TypeData`. `Update-TypeData` affects only +PrependData parameter of `Update-TypeData`. `Update-TypeData` affects only the current session. To make the change to all future sessions, export the session, or add the `Update-TypeData` command to your Windows PowerShell profile. @@ -576,8 +574,8 @@ suppress exceptions that would occur in many common types during formatting and outputting. If you are getting .NET Framework properties, you can work around the suppression of exceptions by using method syntax instead, as shown in the following example: - - ```powershell + +```powershell "hello".get_Length() ``` @@ -587,8 +585,9 @@ use method syntax. ## Signing a Types.ps1xml File -To protect users of your Types.ps1xml file, you can sign the file using -a digital signature. For more information, see [about_Signing](about_Signing.md). +To protect users of your Types.ps1xml file, you can sign the file using a +digital signature. For more information, see +[about_Signing](about_Signing.md). # SEE ALSO @@ -605,4 +604,3 @@ a digital signature. For more information, see [about_Signing](about_Signing.md) [Remove-TypeData](../../Microsoft.PowerShell.Utility/Remove-TypeData.md) [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md) - diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md index b2ddd2ffb955..08ee68185fcb 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,86 +7,90 @@ title: about_WMI_Cmdlets --- # About WMI Cmdlets -## about_WMI_Cmdlets - ## SHORT DESCRIPTION -Provides background information about Windows Management Instrumentation (WMI) and Windows PowerShell®. +Provides background information about Windows Management Instrumentation (WMI) +and Windows PowerShell. ## LONG DESCRIPTION -This topic provides information about WMI technology, the WMI cmdlets for Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI troubleshooting. This topic also provides links to more information about WMI. +This topic provides information about WMI technology, the WMI cmdlets for +Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI +troubleshooting. This topic also provides links to more information about WMI. ### ABOUT WMI -Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF). You can use WMI to manage both local and remote computers. For example, you can use WMI to do the following: - --- Start a process on a remote computer. - --- Restart a computer remotely. - --- Get a list of the applications that are installed on a local or remote computer. - --- Query the Windows event logs on a local or remote computer. +Windows Management Instrumentation (WMI) is the Microsoft implementation of +Web-Based Enterprise Management (WBEM), which is an industry initiative to +develop a standard technology for accessing management information in an +enterprise environment. WMI uses the Common Information Model (CIM) industry +standard to represent systems, applications, networks, devices, and other +managed components. CIM is developed and maintained by the Distributed +Management Task Force (DMTF). You can use WMI to manage both local and remote +computers. For example, you can use WMI to do the following: + +- Start a process on a remote computer. +- Restart a computer remotely. +- Get a list of the applications that are installed on a local or remote + computer. +- Query the Windows event logs on a local or remote computer. ### THE WMI CMDLETS FOR WINDOWS POWERSHELL -Windows PowerShell implements WMI functionality through a set of cmdlets that are available in Windows PowerShell by default. You can use these cmdlets to complete the end-to-end tasks necessary to manage local and remote computers. - -The following WMI cmdlets are included. +Windows PowerShell implements WMI functionality through a set of cmdlets that +are available in Windows PowerShell by default. You can use these cmdlets to +complete the end-to-end tasks necessary to manage local and remote computers. -``` -Cmdlet Description ------------------- ---------------------------------------------- -Get-WmiObject Gets instances of WMI classes or information - about the available classes. - -Invoke-WmiMethod Calls WMI methods. - -Register-WmiEvent Subscribes to a WMI event. - -Remove-WmiObject Deletes WMI classes and instances. - -Set-WmiInstance Creates or modifies instances of WMI classes. -``` - +The following WMI cmdlets are included. +|Cmdlet |Description | +|-----------------|----------------------------------------------| +|Get-WmiObject |Gets instances of WMI classes or information | +| |about the available classes. | +|Invoke-WmiMethod |Calls WMI methods. | +|Register-WmiEvent|Subscribes to a WMI event. | +|Remove-WmiObject |Deletes WMI classes and instances. | +|Set-WmiInstance |Creates or modifies instances of WMI classes. | ### SAMPLE COMMANDS The following command displays the BIOS information for the local computer. - -``` +```powershell C:\PS> get-wmiobject win32_bios | format-list * ``` +The following command displays information about the WinRM service for three +remote computers. -The following command displays information about the WinRM service for three remote computers. - - -``` -C:\PS> get-wmiobject -query "select * from win32_service where name='WinRM'" -computername server01, server01, server03 +```powershell +$wql = "select * from win32_service where name='WinRM'" +get-wmiobject -query $wql -computername server01, server01, server03 ``` - The following more complex command exits all instances of a program. - -``` -C:\PS> notepad.exe -C:\PS> $np = get-wmiobject -query "select * from win32_process where name='notepad.exe'" +```powershell +C:\PS> notepad.exe +C:\PS> $wql = "select * from win32_process where name='notepad.exe'" +C:\PS> $np = get-wmiobject -query $wql C:\PS> $np | remove-wmiobject ``` - - ### WMI-BASED REMOTING -While the ability to manage a local system through WMI is useful, it is the remoting capabilities that make WMI a powerful administrative tool. WMI uses Microsoft's Distributed Component Object Model (DCOM) to connect to and manage systems. You might have to configure some systems to allow DCOM connections. Firewall settings and locked-down DCOM permissions can block WMI's ability to remotely manage systems. +While the ability to manage a local system through WMI is useful, it is the +remoting capabilities that make WMI a powerful administrative tool. WMI uses +Microsoft's Distributed Component Object Model (DCOM) to connect to and manage +systems. You might have to configure some systems to allow DCOM connections. +Firewall settings and locked-down DCOM permissions can block WMI's ability to +remotely manage systems. ### WMI TYPE ACCELERATORS -Windows PowerShell includes WMI type accelerators. These WMI type accelerators (shortcuts) allow more direct access to a WMI objects than a non-type accelerator approach would allow. + +Windows PowerShell includes WMI type accelerators. These WMI type accelerators +(shortcuts) allow more direct access to a WMI objects than a non-type +accelerator approach would allow. The following type accelerators are supported with WMI: @@ -96,125 +100,117 @@ The following type accelerators are supported with WMI: [WMI] - A shortcut for getting a single instance of a class. -[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can take a string constructor to create a searcher that you can then do a GET() on. +[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can +take a string constructor to create a searcher that you can then do a GET() +on. For example: +```powershell +PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' +PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto +count __PATH name +----- ------ ---- +1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... +1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe +1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe +1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE +1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe +2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe ``` -PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' -PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto - -handlecount __PATH name ------------ ------ ---- -1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... -1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe -1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe -1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE -1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe -2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe -``` - -[WMICLASS] is a type accelerator for ManagementClass. This has a string constructor that takes a local or absolute WMI path to a WMI class and returns an object that is bound to that class. +[WMICLASS] is a type accelerator for ManagementClass. This has a string +constructor that takes a local or absolute WMI path to a WMI class and returns +an object that is bound to that class. For example: - -``` -PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" -PS> $c |fl * -Name : Win32_Process -__GENUS : 1 -__CLASS : Win32_Process -__SUPERCLASS : CIM_Process -__DYNASTY : CIM_ManagedSystemElement -__RELPATH : Win32_Process -__PROPERTY_COUNT : 45 -__DERIVATION : {CIM_Process, CIM_LogicalElement, CIM_ManagedSystemElement} -__SERVER : SERVER01 -__NAMESPACE : ROOT\cimv2 +```powershell +PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" +PS> $c |fl * +Name : Win32_Process +__GENUS : 1 +__CLASS : Win32_Process +__SUPERCLASS : CIM_Process +__DYNASTY : CIM_ManagedSystemElement +__RELPATH : Win32_Process +__PROPERTY_COUNT : 45 +__DERIVATION : {CIM_Process, CIM_LogicalElement, + CIM_ManagedSystemElement} +__SERVER : SERVER01 +__NAMESPACE : ROOT\cimv2 __PATH : \\SERVER01\ROOT\cimv2:Win32_Process ``` - -[WMI] is a type accelerator for ManagementObject. This has a string constructor that takes a local or absolute WMI path to a WMI instance and returns an object that is bound to that instance. +[WMI] is a type accelerator for ManagementObject. This has a string +constructor that takes a local or absolute WMI path to a WMI instance and +returns an object that is bound to that instance. For example: - -``` -PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' -PS> $p.Name +```powershell +PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' +PS> $p.Name OUTLOOK.EXE ``` - - ### WMI TROUBLESHOOTING -The following problems are the most common problems that might occur when you try to connect to a remote computer. -Problem 1: The remote computer is not online. - -If a computer is offline, you will not be able to connect to it by using WMI. You may receive the following error message: +The following problems are the most common problems that might occur when you +try to connect to a remote computer. +Problem 1: The remote computer is not online. -``` -"Remote server machine does not exist or is unavailable" -``` +If a computer is offline, you will not be able to connect to it by using WMI. +You may receive the following error message: + Remote server machine does not exist or is unavailable -If you receive this error message, verify that the computer is online. Try to ping the remote computer. +If you receive this error message, verify that the computer is online. Try to +ping the remote computer. Problem 2: You do not have local administrator rights on the remote computer. -To use WMI remotely, you must have local administrator rights on the remote computer. If you do not, access to that computer will be denied. +To use WMI remotely, you must have local administrator rights on the remote +computer. If you do not, access to that computer will be denied. To verify namespace security: -- a. Click Start, right-click My Computer, and then click Manage. - -- b. In Computer Management, expand Services and Applications, right-click WMI Control, and then click Properties. - -- c. In the WMI Control Properties dialog box, click the Security tab. +1. Click Start, right-click My Computer, and then click Manage. +2. In Computer Management, expand Services and Applications, right-click WMI + Control, and then click Properties. +3. In the WMI Control Properties dialog box, click the Security tab. Problem 3: A firewall is blocking access to the remote computer. -WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols to traverse the network. By default, many firewalls block DCOM and RPC traffic. If your firewall is blocking these protocols, your connection will fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is configured to automatically block all unsolicited network traffic, including DCOM and WMI. In its default configuration, Windows Firewall rejects an incoming WMI request, and you receive the following error message: - - -``` -"Remote server machine does not exist or is unavailable" -``` - +WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols +to traverse the network. By default, many firewalls block DCOM and RPC +traffic. If your firewall is blocking these protocols, your connection will +fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is +configured to automatically block all unsolicited network traffic, including +DCOM and WMI. In its default configuration, Windows Firewall rejects an +incoming WMI request, and you receive the following error message: + Remote server machine does not exist or is unavailable ### MORE INFORMATION ABOUT WMI -For more information about WMI, see the following topics in the MSDN (Microsoft Developer Network) library: - -``` -"About WMI: -http://go.microsoft.com/fwlink/?LinkId=142212 - -"WMI Troubleshooting" -http://go.microsoft.com/fwlink/?LinkId=142213 -``` +For more information about WMI, see the following topics in the MSDN +(Microsoft Developer Network) library: +About WMI: http://go.microsoft.com/fwlink/?LinkId=142212 -And, see "Secrets of Windows Management Instrumentation - Troubleshooting and Tips" in the Microsoft TechNet Script Center: +WMI Troubleshooting: http://go.microsoft.com/fwlink/?LinkId=142213 +And, see "Secrets of Windows Management Instrumentation - Troubleshooting and +Tips" in the Microsoft TechNet Script Center: -``` http://go.microsoft.com/fwlink/?LinkId=142214 -``` - ## SEE ALSO -Online version: http:\/\/go.microsoft.com\/fwlink\/?LinkId\=142219 - Get-WmiObject Invoke-WmiMethod diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/About_Using.md b/reference/5.0/Microsoft.PowerShell.Core/About/About_Using.md index b6abbe721641..4fbccbdc21cf 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/About_Using.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/About_Using.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,7 +7,6 @@ title: about_Using --- # About Using -## about_Using # SHORT DESCRIPTION @@ -15,47 +14,49 @@ Allows to indicate which namespaces are used in the session. # LONG DESCRIPTION - -The `using` statement allows to indicate which namespaces are used in the session. -Making easier to mention classes and members, as it requires less typing to mention them; -also, classes from modules can be referenced too. +The `using` statement allows to indicate which namespaces are used in the +session. Making easier to mention classes and members, as it requires less +typing to mention them; also, classes from modules can be referenced too. The `using` statement needs to be the first statement in the script. Syntax #1, to reference .Net Framework namespaces: + ``` using namespace <.Net-framework-namespace> ``` Syntax #2, to reference PowerShell modules: + ``` using module ``` -> **Note** The `using` statetement, for modules, is intended to surface the classes in the module. -> If the module isn't loaded, the `using` fails. +**Note**: The `using` statetement, for modules, is intended to surface the +classes in the module. If the module isn't loaded, the `using` fails. ## Example 1 The following script gets the cryptographic hash for the "Hello World" string. -Note how the `using namespace System.Text` and `using namespace System.IO` simplify -the references to `[UnicodeEncoding]` in *System.Text*; and, to `[Stream]` -and to `[MemoryStream]` in *System.IO*. - +Note how the `using namespace System.Text` and `using namespace System.IO` +simplify the references to `[UnicodeEncoding]` in *System.Text*; and, to +`[Stream]` and to `[MemoryStream]` in *System.IO*. ```powershell - using namespace System.Text - using namespace System.IO +using namespace System.Text +using namespace System.IO - [string]$string = "Hello World" - [string]$algorithm = "SHA256" ## Valid values are "SHA1", "SHA256", "SHA384", "SHA512", "MACTripleDES", "MD5", "RIPEMD160" +[string]$string = "Hello World" +## Valid values are "SHA1", "SHA256", "SHA384", "SHA512", "MD5" +[string]$algorithm = "SHA256" - [byte[]]$stringbytes = [UnicodeEncoding]::Unicode.GetBytes($string) +[byte[]]$stringbytes = [UnicodeEncoding]::Unicode.GetBytes($string) - [Stream]$memorystream = [MemoryStream]::new($stringbytes) - $hashfromstream = Get-FileHash -InputStream $memorystream -Algorithm $algorithm - $hashfromstream.Hash.ToString() +[Stream]$memorystream = [MemoryStream]::new($stringbytes) +$hashfromstream = Get-FileHash -InputStream $memorystream ` + -Algorithm $algorithm +$hashfromstream.Hash.ToString() ``` ## Example 2 @@ -77,4 +78,3 @@ $deck.Shuffle() [Card[]]$hand2 = $deck.Deal(5) [Card[]]$hand3 = $deck.Deal(5) ``` - diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Splatting.md index 0d9fbe39f89d..10b1d7bc00db 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -74,20 +74,24 @@ are included. Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf ``` -The second example uses hash table splatting. The first command creates -a hash table of parameter-name and parameter-value pairs and stores it -in the $HashArguments variable. The second command uses the `$HashArguments` -variable in a command with splatting. The At symbol (`@HashArguments`) -replaces the dollar sign (`$HashArguments`) in the command. +The second example uses hash table splatting. The first command creates a hash +table of parameter-name and parameter-value pairs and stores it in the +\$HashArguments variable. The second command uses the `$HashArguments` variable +in a command with splatting. The At symbol (`@HashArguments`) replaces the +dollar sign (`$HashArguments`) in the command. To provide a value for the WhatIf switch parameter, use $True or $False. ```powershell -$HashArguments = @{ Path = "test.txt"; Destination = "test2.txt"; WhatIf = $true } +$HashArguments = @{ + Path = "test.txt" + Destination = "test2.txt" + WhatIf = $true +} Copy-Item @HashArguments ``` -*Note: In the first command, the At symbol (@) indicates a hash table, not +Note: In the first command, the At symbol (@) indicates a hash table, not a splatted value. The syntax for hash tables in Windows PowerShell is: @{\=\; \=\; …}* @@ -106,11 +110,12 @@ omitted. The parameter values appear in position order in the command. Copy-Item "test.txt" "test2.txt" -WhatIf ``` -The second example uses array splatting. The first command creates an array -of the parameter values and stores it in the `$ArrayArguments` variable. The +The second example uses array splatting. The first command creates an array of +the parameter values and stores it in the `$ArrayArguments` variable. The values are in position order in the array. The second command uses the `$ArrayArguments` variable in a command in splatting. The At symbol -(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the command. +(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the +command. ```powershell $ArrayArguments = "test.txt", "test2.txt" @@ -120,10 +125,10 @@ Copy-Item @ArrayArguments -WhatIf # EXAMPLES -This example shows how to re-use splatted values in different commands. -The commands in this example use the Write-Host cmdlet to write messages -to the host program console. It uses splatting to specify the foreground -and background colors. +This example shows how to re-use splatted values in different commands. The +commands in this example use the Write-Host cmdlet to write messages to the +host program console. It uses splatting to specify the foreground and +background colors. To change the colors of all commands, just change the value of the `$Colors` variable. @@ -143,7 +148,8 @@ Write-Host command. To use the `$Colors variable`, replace the dollar sign #Write a message with the colors in $Colors Write-Host "This is a test." @Colors -#Write second message with same colors. The position of splatted hash table does not matter. +#Write second message with same colors. The position of splatted +#hash table does not matter. Write-Host @Colors "This is another test." ``` @@ -193,22 +199,19 @@ Test2 -a 1 -b 2 -c 3 # SPLATTING COMMAND PARAMETERS -You can use splatting to represent the parameters of -a command. This technique is useful when you are creating -a proxy function, that is, a function that calls another -command. This feature is introduced in Windows PowerShell 3.0. +You can use splatting to represent the parameters of a command. This technique +is useful when you are creating a proxy function, that is, a function that +calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent -the command parameters. This technique is easier than -enumerating command parameters and it works without revision -even if the parameters of the called command change. +To splat the parameters of a command, use `@Args` to represent the command +parameters. This technique is easier than enumerating command parameters and +it works without revision even if the parameters of the called command change. The feature uses the `$Args` automatic variable, which contains all unassigned parameter values. -For example, the following function calls the Get-Process -cmdlet. In this function, `@Args` represents all of the parameters -of the Get-Process cmdlet. +For example, the following function calls the Get-Process cmdlet. In this +function, `@Args` represents all of the parameters of the Get-Process cmdlet. ```powershell function Get-MyProcess { Get-Process @Args } @@ -223,20 +226,18 @@ Get-MyProcess -Name PowerShell Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -463 46 225484 237196 719 15.86 3228 powershell + 463 46 225484 237196 719 15.86 3228 powershell Get-MyProcess -Name PowerShell_Ise -FileVersionInfo ProductVersion FileVersion FileName -------------- ----------- -------- -6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe +6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly -declared parameters. You can use it more than once in -a function, but all parameters that you enter are passed -to all instances of `@Args`, as shown in the following -example. +You can use `@Args` in a function that has explicitly declared parameters. You +can use it more than once in a function, but all parameters that you enter are +passed to all instances of `@Args`, as shown in the following example. ```powershell function Get-MyCommand @@ -252,9 +253,9 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 408 28 75568 83176 620 1.33 1692 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -265,10 +266,11 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell + \v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616) + FileVersion: 10.0.14393.0 (rs1_release.160715-1616 FileDescription: Windows PowerShell Product: Microsoft® Windows® Operating System ProductVersion: 10.0.14393.0 @@ -289,4 +291,3 @@ FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1. [about_Hash_Tables](about_Hash_Tables.md) [about_Parameters](about_Parameters.md) - diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md index 9154bed7ea49..98b97dd2dab7 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -19,22 +19,21 @@ The Split operator splits one or more strings into substrings. You can change the following elements of the Split operation: * Delimiter. The default is whitespace, but you can specify characters, -strings, patterns, or script blocks that specify the delimiter. The Split -operator in Windows PowerShell uses a regular expression in the delimiter, -rather than a simple character. + strings, patterns, or script blocks that specify the delimiter. The Split + operator in Windows PowerShell uses a regular expression in the delimiter, + rather than a simple character. * Maximum number of substrings. The default is to return all substrings. If -you specify a number less than the number of substrings, the remaining -substrings are concatenated in the last substring. + you specify a number less than the number of substrings, the remaining + substrings are concatenated in the last substring. * Options that specify the conditions under which the delimiter is matched, -such as SimpleMatch and Multiline. + such as SimpleMatch and Multiline. ## SYNTAX The following diagram shows the syntax for the -split operator. -The parameter names do not appear in the command. Include only the -parameter values. The values must appear in the order specified in the -syntax diagram. +The parameter names do not appear in the command. Include only the parameter +values. The values must appear in the order specified in the syntax diagram. ```powershell -Split @@ -45,17 +44,17 @@ syntax diagram. ``` You can substitute `-iSplit` or `-cSplit` for `-split` in any binary Split -statement (a Split statement that includes a delimiter or script block). -The `-iSplit` and `-split` operators are case-insensitive. The `-cSplit` -operator is case-sensitive, meaning that case is considered when the -delimiter rules are applied. +statement (a Split statement that includes a delimiter or script block). The +`-iSplit` and `-split` operators are case-insensitive. The `-cSplit` operator +is case-sensitive, meaning that case is considered when the delimiter rules +are applied. ## PARAMETERS ### \ -Specifies one or more strings to be split. If you submit multiple -strings, all the strings are split using the same delimiter rules. +Specifies one or more strings to be split. If you submit multiple strings, all +the strings are split using the same delimiter rules. Example: @@ -69,10 +68,10 @@ green ### \ -The characters that identify the end of a substring. The default delimiter -is whitespace, including spaces and non-printable characters, such as -newline (\`n) and tab (\`t). When the strings are split, the delimiter is -omitted from all the substrings. Example: +The characters that identify the end of a substring. The default delimiter is +whitespace, including spaces and non-printable characters, such as newline +(\`n) and tab (\`t). When the strings are split, the delimiter is omitted from +all the substrings. Example: ```powershell "Lastname:FirstName:Address" -split ":" @@ -81,13 +80,13 @@ FirstName Address ``` -By default, the delimiter is omitted from the results. To preserve all or -part of the delimiter, enclose in parentheses the part that you want to -preserve. If the \ parameter is added, this takes -precedence when your command splits up the collection. If you opt to -include a delimiter as part of the output, the command returns the -delimiter as part of the output; however, splitting the string to return -the delimiter as part of output does not count as a split. +By default, the delimiter is omitted from the results. To preserve all or part +of the delimiter, enclose in parentheses the part that you want to preserve. +If the \ parameter is added, this takes precedence when your +command splits up the collection. If you opt to include a delimiter as part of +the output, the command returns the delimiter as part of the output; however, +splitting the string to return the delimiter as part of output does not count +as a split. Examples: @@ -124,17 +123,16 @@ Strawberry-Blueberry ### \ -Specifies the maximum number of times that a string is split. The default -is all the substrings split by the delimiter. If there are more substrings, -they are concatenated to the final substring. If there are fewer -substrings, all the substrings are returned. A value of 0 and negative -values return all the substrings. +Specifies the maximum number of times that a string is split. The default is +all the substrings split by the delimiter. If there are more substrings, they +are concatenated to the final substring. If there are fewer substrings, all +the substrings are returned. A value of 0 and negative values return all the +substrings. Max-substrings does not specify the maximum number of objects that are -returned; its value equals the maximum number of times that a string is -split. If you submit more than one string (an array of strings) to the -Split operator , the Max-substrings limit is applied to each string -separately. +returned; its value equals the maximum number of times that a string is split. +If you submit more than one string (an array of strings) to the Split operator +, the Max-substrings limit is applied to each string separately. Example: @@ -150,9 +148,8 @@ Jupiter,Saturn,Uranus,Neptune ### \ -An expression that specifies rules for applying the delimiter. The -expression must evaluate to $true or $false. Enclose the script block in -braces. +An expression that specifies rules for applying the delimiter. The expression +must evaluate to $true or $false. Enclose the script block in braces. Example: @@ -187,63 +184,62 @@ The syntax for the Options parameter is: The SimpleMatch options are: * **SimpleMatch**: Use simple string comparison when evaluating the -delimiter. Cannot be used with RegexMatch. + delimiter. Cannot be used with RegexMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. The RegexMatch options are: * **RegexMatch**: Use regular expression matching to evaluate the -delimiter. This is the default behavior. Cannot be used with -SimpleMatch. + delimiter. This is the default behavior. Cannot be used with + SimpleMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. * **CultureInvariant**: Ignores cultural differences in language -when evaluting the delimiter. Valid only with RegexMatch. + when evaluting the delimiter. Valid only with RegexMatch. * IgnorePatternWhitespace: Ignores unescaped whitespace and -comments marked with the number sign (#). Valid only with -RegexMatch. + comments marked with the number sign (#). Valid only with + RegexMatch. * **Multiline**: Multiline mode recognizes the start and end of lines -and strings. Valid only with RegexMatch. Singleline is the default. + and strings. Valid only with RegexMatch. Singleline is the default. * **Singleline**: Singleline mode recognizes only the start and end of -strings. Valid only with RegexMatch. Singleline is the default. + strings. Valid only with RegexMatch. Singleline is the default. * **ExplicitCapture**: Ignores non-named match groups so that only -explicit capture groups are returned in the result list. Valid -only with RegexMatch. + explicit capture groups are returned in the result list. Valid + only with RegexMatch. ## UNARY and BINARY SPLIT OPERATORS The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the -unary split operator, only the first string (before the first comma) is -split. +unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( --split ). Enclose all the strings in parentheses, or store the -strings in a variable, and then submit the variable to the split operator. +To split more than one string, use the binary split operator ( -split +). Enclose all the strings in parentheses, or store the strings in +a variable, and then submit the variable to the split operator. Consider the following example: ```powershell -PS C:\> -split "1 2", "a b" +PS > -split "1 2", "a b" 1 2 a b -PS C:\> "1 2", "a b" -split " " +PS > "1 2", "a b" -split " " 1 2 a b -PS C:\> -split ("1 2", "a b") +PS > -split ("1 2", "a b") 1 2 a b -PS C:\> $a = "1 2", "a b" -PS C:\> -split $a +PS > $a = "1 2", "a b" +PS > -split $a 1 2 a @@ -255,7 +251,7 @@ b The following statement splits the string at whitespace. ```powershell -PS C:\> -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" Windows PowerShell 2.0 @@ -268,7 +264,7 @@ remoting The following statement splits the string at any comma. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' Mercury Venus Earth @@ -282,17 +278,16 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune ``` -The following statement performs a case-sensitive split at the -letter "N". +The following statement performs a case-sensitive split at the letter "N". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -300,7 +295,7 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' M rcury,V nus, @@ -317,7 +312,8 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` + -split '[er]', 6 M cu @@ -329,7 +325,7 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS C:\> "a,b,c,d,e,f,g,h" -split ",", 3 +PS > "a,b,c,d,e,f,g,h" -split ",", 3 a b c,d,e,f,g,h @@ -339,7 +335,7 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS C:\> "a,b,c,d", "e,f,g,h" -split ",", 3 +PS > "a,b,c,d", "e,f,g,h" -split ",", 3 a b c,d @@ -352,18 +348,18 @@ The following statement splits each line in the here-string at the first digit. It uses the Multiline option to recognize the beginning of each line and string. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as Multiline, only when the Max-substrings value -is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as Multiline, only when the Max-substrings value is +specified. ```powershell -PS C:\> $a = @' +PS > $a = @' 1The first line. 2The second line. 3The third of three lines. '@ -PS C:\> $a -split "^\d", 0, "multiline" +PS > $a -split "^\d", 0, "multiline" The first line. @@ -380,12 +376,12 @@ interpreted to match any character except for a newline character. As a result, the Split statement returns a blank line for every character except newline. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as SimpleMatch, only when the Max-substrings -value is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as SimpleMatch, only when the Max-substrings value is +specified. ```powershell -PS C:\> "This.is.a.test" -split ".", 0, "simplematch" +PS > "This.is.a.test" -split ".", 0, "simplematch" This is @@ -393,13 +389,13 @@ a test ``` -The following statement splits the string at one of two delimiters, -depending on the value of a variable. +The following statement splits the string at one of two delimiters, depending +on the value of a variable. ```powershell -PS C:\> $i = 1 -PS C:\> $c = "LastName, FirstName; Address, City, State, Zip" -PS C:\> $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +PS > $i = 1 +PS > $c = "LastName, FirstName; Address, City, State, Zip" +PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} LastName, FirstName Address, City, State, Zip @@ -407,7 +403,7 @@ Address, City, State, Zip ## SEE ALSO -Split-Path +[Split-Path](../../Microsoft.PowerShell.Management/Split-Path.md) [about_Operators](about_Operators.md) diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Switch.md index 90658fd83ff1..1bfafbe78470 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -148,13 +148,25 @@ Default clause is permitted in each Switch statement. Switch has the following parameters: -|Parameter|Description| -|---|---| -| Wildcard | Indicates that the condition is a wildcard string. If you use Wildcard, Regex and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| Exact | Indicates that the match clause, if it is a string, must match exactly. If you use Exact, Regex and Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| CaseSensitive | Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. | -| File | Takes input from a file rather than a value statement. If multiple File parameters are included, only the last one is used. Each line of the file is read and evaluated by the Switch statement. | -| Regex | Performs regular expression matching of the value to the condition. If you use Regex, Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | +|Parameter |Description | +|-------------|-----------------------------------------------------------| +|Wildcard |Indicates that the condition is a wildcard string. If you | +| |you use Wildcard, Regex and Exact are ignored. Also, if | +| |the match clause is not a string, the parameter is ignored.| +|Exact |Indicates that the match clause, if it is a string, must | +| |match exactly. Regex and Wildcard and Exact are ignored. | +| |Also, if the match clause is not a string, this parameter | +| |is ignored. | +|CaseSensitive|Performs a case-sensitive match. If the match clause is not| +| |a string, this parameter is ignored. | +|File |Takes input from a file rather than a value statement. If | +| |multiple File parameters are included, only the last one is| +| |used. Each line of the file is read and evaluated by the | +| |Switch statement. | +|Regex |Performs regular expression matching of the value to the | +| |condition. Wildcard and Exact are ignored. Also, if the | +| |match clause is not a string, this parameter is ignored. | + ```powershell Example: diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Throw.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Throw.md index 2deea43ade1b..08fe2f6e5c7e 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Throw.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Throw.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -14,16 +14,16 @@ Describes the Throw keyword, which generates a terminating error. ## LONG DESCRIPTION -The Throw keyword causes a terminating error. You can use the Throw keyword -to stop the processing of a command, function, or script. +The Throw keyword causes a terminating error. You can use the Throw keyword to +stop the processing of a command, function, or script. For example, you can use the Throw keyword in the script block of an If statement to respond to a condition or in the Catch block of a -Try-Catch-Finally statement. You can also use the Throw keyword in a -parameter declaration to make a function parameter mandatory. +Try-Catch-Finally statement. You can also use the Throw keyword in a parameter +declaration to make a function parameter mandatory. -The Throw keyword can throw any object, such as a user message string or -the object that caused the error. +The Throw keyword can throw any object, such as a user message string or the +object that caused the error. ## SYNTAX @@ -33,8 +33,8 @@ The syntax of the Throw keyword is as follows: throw [] ``` -The expression in the Throw syntax is optional. When the Throw statement -does not appear in a Catch block, and it does not include an expression, it +The expression in the Throw syntax is optional. When the Throw statement does +not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error. ```powershell @@ -47,13 +47,14 @@ At line:1 char:6 + FullyQualifiedErrorId : ScriptHalted ``` -If the Throw keyword is used in a Catch block without an expression, it -throws the current RuntimeException again. For more information, see +If the Throw keyword is used in a Catch block without an expression, it throws +the current RuntimeException again. For more information, see about_Try_Catch_Finally. ## THROWING A STRING -The optional expression in a Throw statement can be a string, as shown in -the following example: + +The optional expression in a Throw statement can be a string, as shown in the +following example: ```powershell C:\PS> throw "This is an error." @@ -61,7 +62,8 @@ C:\PS> throw "This is an error." This is an error. At line:1 char:6 + throw <<<< "This is an error." -+ CategoryInfo : OperationStopped: (This is an error.:String) [], RuntimeException ++ CategoryInfo : OperationStopped: (This is an error.:String) [], R +untimeException + FullyQualifiedErrorId : This is an error. ``` @@ -76,7 +78,8 @@ C:\PS> throw (get-process PowerShell) System.Diagnostics.Process (PowerShell) At line:1 char:6 + throw <<<< (get-process PowerShell) -+ CategoryInfo : OperationStopped: (System.Diagnostics.Process (PowerShell):Process) [], ++ CategoryInfo : OperationStopped: (System.Diagnostics.Process (Pow +erShell):Process) [], RuntimeException + FullyQualifiedErrorId : System.Diagnostics.Process (PowerShell) ``` @@ -105,15 +108,16 @@ One of the identified items was in an invalid format. At line:1 char:6 + throw <<<< $formatError + CategoryInfo : OperationStopped: (:) [], FormatException -+ FullyQualifiedErrorId : One of the identified items was in an invalid format. ++ FullyQualifiedErrorId : One of the identified items was in an invalid +format. ``` ## RESULTING ERROR -The Throw keyword can generate an ErrorRecord object. The Exception -property of the ErrorRecord object contains a RuntimeException object. The -remainder of the ErrorRecord object and the RuntimeException object vary -with the object that the Throw keyword throws. +The Throw keyword can generate an ErrorRecord object. The Exception property +of the ErrorRecord object contains a RuntimeException object. The remainder of +the ErrorRecord object and the RuntimeException object vary with the object +that the Throw keyword throws. The RunTimeException object is wrapped in an ErrorRecord object, and the ErrorRecord object is automatically saved in the $Error automatic variable. @@ -139,7 +143,9 @@ optional. function Get-XMLFiles { param ($path = $(throw "The Path parameter is required.")) - dir -path $path\*.xml -recurse | sort lastwritetime | ft lastwritetime, attributes, name -auto + dir -path $path\*.xml -recurse | + sort lastwritetime | + ft lastwritetime, attributes, name -auto } ``` @@ -154,4 +160,3 @@ function Get-XMLFiles [about_Trap](about_Trap.md) [about_Try_Catch_Finally](about_Try_Catch_Finally.md) - diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Trap.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Trap.md index 338030fa058b..bc042324bc4b 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Trap.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Trap.md @@ -130,7 +130,9 @@ statement that specifies the CommandNotFoundException type. ```powershell trap {"Other terminating error trapped" } -trap [System.Management.Automation.CommandNotFoundException] {"Command error trapped"} +trap [System.Management.Automation.CommandNotFoundException] { + "Command error trapped" +} nonsenseString ``` diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md index a94e962d87b3..531eb8a2f9da 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-091 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -26,11 +26,16 @@ fails, it returns nothing. It does not return an error. The following table lists the type operators in Windows PowerShell. -|Operator|Description|Example| -|---|---|---| -|`-is`|Returns TRUE when the input is an instance of the specified.NET Framework type.|`C:\PS> (get-date) -is [DateTime]`
`True`| -|`-isNot`|Returns TRUE when the input is not an instance of the specified.NET Framework type.|`C:\PS> (get-date) -isNot [DateTime]`
`False`| -|`-as`|Converts the input to the specified.NET Framework type.|`C:\PS> 12/31/07 -as [DateTime]`
`Monday, December 31, 2007 12:00:00 AM`| +|Operator|Description |Example | +|--------|---------------------------|---------------------------------| +|`-is` |Returns TRUE when the input|`(get-date) -is [DateTime]` | +| |is an instance of the |`True` | +| |specified .NET type. | | +|`-isNot`|Returns TRUE when the input|`(get-date) -isNot [DateTime]` | +| |not an instance of the |`False` | +| |specified.NET type. | | +|`-as` |Converts the input to the |`"5/7/07" -as [DateTime]` | +| |specified .NET type. |`Monday, May 7, 2007 12:00:00 AM`| The syntax of the type operators is as follows: @@ -64,7 +69,7 @@ property of this method. For example, the following statement gets the type of the return value of a Get-Culture command: ```powershell -C:\PS> (get-culture).gettype().fullname +PS> (get-culture).gettype().fullname System.Globalization.CultureInfo ``` @@ -72,25 +77,25 @@ System.Globalization.CultureInfo The following examples show some uses of the Type operators: ```powershell -C:\PS> 32 -is [Float] +PS> 32 -is [Float] False -C:\PS> 32 -is "int" +PS> 32 -is "int" True -C:\PS> (get-date) -is [DateTime] +PS> (get-date) -is [DateTime] True -C:\PS> "12/31/2007" -is [DateTime] +PS> "12/31/2007" -is [DateTime] False -C:\PS> "12/31/2007" -is [String] +PS> "12/31/2007" -is [String] True -C:\PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] +PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] True -C:\PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] +PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] True ``` @@ -103,53 +108,55 @@ return System.Globalization.CultureInfo objects, a collection of these objects is a System.Object array. ```powershell -C:\PS> (get-culture) -is [System.Globalization.CultureInfo] +PS> (get-culture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-uiculture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] False -C:\PS> (get-culture), (get-uiculture) -is [Array] +PS> (get-culture), (get-uiculture) -is [Array] True -C:\PS> (get-culture), (get-uiculture) | foreach {$_ -is [System.Globalization.CultureInfo]) +PS> (get-culture), (get-uiculture) | foreach { + $_ -is [System.Globalization.CultureInfo]) +} True True -C:\PS> (get-culture), (get-uiculture) -is [Object] +PS> (get-culture), (get-uiculture) -is [Object] True ``` The following examples show how to use the -as operator. ```powershell -C:\PS> "12/31/07" -is [DateTime] +PS> "12/31/07" -is [DateTime] False -C:\PS> "12/31/07" -as [DateTime] +PS> "12/31/07" -as [DateTime] Monday, December 31, 2007 12:00:00 AM -C:\PS> $date = "12/31/07" -as [DateTime] +PS> $date = "12/31/07" -as [DateTime] C:\PS>$a -is [DateTime] True -C:\PS> 1031 -as [System.Globalization.CultureInfo] +PS> 1031 -as [System.Globalization.CultureInfo] -LCID Name DisplayName ----- ---- ----------- -1031 de-DE German (Germany) +LCID Name DisplayName +---- ---- ----------- +1031 de-DE German (Germany) ``` The following example shows that when the -as operator cannot convert the input object to the .NET Framework type, it returns nothing. ```powershell -C:\PS> 1031 -as [System.Diagnostic.Process] -C:\PS> +PS> 1031 -as [System.Diagnostic.Process] +PS> ``` ## SEE ALSO diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md index ea2b5a898093..3888516c6096 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,9 +7,6 @@ title: about_Types.ps1xml --- # About Types.ps1xml -## about_Types.ps1xml - - # SHORT DESCRIPTION @@ -27,16 +24,16 @@ extended type data to a Windows PowerShell session. extended data for types in the current session. This topic describes Types.ps1xml files. For more information about using the -`Update-TypeData` cmdlet to add dynamic extended type data to the current session -see [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). +`Update-TypeData` cmdlet to add dynamic extended type data to the current +session see +[Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). ## About Extended Type Data -Extended type data defines additional properties and methods ("members") -of object types in Windows PowerShell. You can extend any type that is -supported by Windows PowerShell and use the added properties and methods -in the same way that you use the properties that are defined on the object -types. +Extended type data defines additional properties and methods ("members") of +object types in Windows PowerShell. You can extend any type that is supported +by Windows PowerShell and use the added properties and methods in the same way +that you use the properties that are defined on the object types. For example, Windows PowerShell adds a `DateTime` property to all `System.DateTime` objects, such as the ones that the `Get-Date` cmdlet @@ -47,27 +44,27 @@ PS C:> (Get-Date).DateTime Sunday, January 29, 2012 9:43:57 AM ``` -You won't find the `DateTime` property in the description of the [`System.DateTime` -structure](http://msdn.microsoft.com/library/system.datetime.aspx), -because Windows PowerShell adds the property and it is visible only in -Windows PowerShell. +You won't find the `DateTime` property in the description of the +[`System.DateTime` structure](http://msdn.microsoft.com/library/system.datetime.aspx), +because Windows PowerShell adds the property and it is visible only in Windows +PowerShell. -To add the `DateTime` property to all Windows PowerShell sessions, Windows PowerShell -defines the `DateTime` property in the Types.ps1xml file in the Windows PowerShell -installation directory (`$PSHOME`). +To add the `DateTime` property to all Windows PowerShell sessions, Windows +PowerShell defines the `DateTime` property in the Types.ps1xml file in the +Windows PowerShell installation directory (`$PSHOME`). ## Adding Extended Type Data to Windows PowerShell. There are three sources of extended type data in Windows PowerShell sessions. - The Types.ps1xml files in the Windows PowerShell installation directory -are loaded automatically into every Windows PowerShell session. + are loaded automatically into every Windows PowerShell session. - The Types.ps1xml files that modules export are loaded when the module -is imported into the current session. + is imported into the current session. - Extended type data that is defined by using the `Update-TypeData` cmdlet -is added only to the current session. It is not saved in a file. + is added only to the current session. It is not saved in a file. In the session, the extended type data from the three sources is applied to objects in the same way and is available on all objects of the specified @@ -78,18 +75,16 @@ types. The following TypeData cmdlets are included in the Microsoft.PowerShell.Utility module in Windows PowerShell 3.0 and later versions of Windows PowerShell. -| | | -| --------------- | ----------------------------------------------------- | -| Get-TypeData | Gets extended type data in the current session. | -| Update-TypeData | Reloads Types.ps1xml files. Adds extended type data to the current session. | -| Remove-TypeData | Removes extended type data from the current session. | +- `Get-TypeData`: Gets extended type data in the current session. +- `Update-TypeData`: Reloads Types.ps1xml files. Adds extended type data to the + current session. +- `Remove-TypeData`: Removes extended type data from the current session. -For more information about these cmdlets, see the help topic for each -cmdlet. +For more information about these cmdlets, see the help topic for each cmdlet. ## Built-in Types.ps1xml Files -The Types.ps1xml files in the $PSHOME directory are added automatically to +The Types.ps1xml files in the `$PSHOME` directory are added automatically to every session. The Types.ps1xml file in the Windows PowerShell installation directory @@ -103,7 +98,7 @@ For example, by default, array objects (`System.Array`) have a `Length` property that lists the number of objects in the array. However, because the name "Length" does not clearly describe the property, Windows PowerShell adds an alias property named "Count" that displays the same -value. The following XML adds the `Count` property to the `System.Array` type. +value. The following XML adds the Count property to the `System.Array` type. ```xml @@ -119,28 +114,28 @@ value. The following XML adds the `Count` property to the `System.Array` type. ``` -To get the new `AliasProperty`, use a `Get-Member` command on any array, as shown -in the following example. +To get the new `AliasProperty`, use a `Get-Member` command on any array, as +shown in the following example. ```powershell -Get-Member -inputobject (1,2,3,4) +Get-Member -InputObject (1,2,3,4) ``` The command returns the following results. -```powershell -Name MemberType Definition ----- ---------- ---------- -Count AliasProperty Count = Length -Address Method System.Object& Address(Int32) -Clone Method System.Object Clone() -CopyTo Method System.Void CopyTo(Array array, Int32 index): -Equals Method System.Boolean Equals(Object obj) -Get Method System.Object Get(Int32) +```output +Name MemberType Definition +---- ---------- ---------- +Count AliasProperty Count = Length +Address Method System.Object& Address(Int32) +Clone Method System.Object Clone() +CopyTo Method System.Void CopyTo(Array array, Int32 index): +Equals Method System.Boolean Equals(Object obj) +Get Method System.Object Get(Int32) # ... ``` -As a result, you can use either the `Count` property or the `Length` property +As a result, you can use either the Count property or the Length property of arrays in Windows PowerShell. For example: ```powershell @@ -171,17 +166,17 @@ installation directory. When you have saved the new file, use the `Update-TypeData` cmdlet to add the new file to your Windows PowerShell session. If you want your types to take precedence over the types that are defined in the built-in file, -use the `PrependData` parameter of the `Update-TypeData` cmdlet. +use the PrependData parameter of the `Update-TypeData` cmdlet. `Update-TypeData` affects only the current session. To make the change to all future sessions, export the console, or add the `Update-TypeData` command to your Windows PowerShell profile. -## Types.ps1xml and `Add-Member` +## Types.ps1xml and Add-Member The Types.ps1xml files add properties and methods to all the instances of the objects of the specified .NET Framework type in the affected Windows PowerShell session. However, if you need to add properties or -methods only to one instance of an object, use the Add-Member cmdlet. +methods only to one instance of an object, use the `Add-Member` cmdlet. For more information, see [Add-Member](../../Microsoft.PowerShell.Utility/Add-Member.md). @@ -193,7 +188,7 @@ its creation time and the current time in days. It is easiest to use the original Types.ps1xml file as a template for the new file. The following command copies the original file to -a file called MyTypes.ps1xml in the $PSHOME directory. +a file called MyTypes.ps1xml in the `$PSHOME` directory. ```powershell Copy-Item Types.ps1xml MyTypes.ps1xml @@ -256,13 +251,13 @@ information about `Update-TypeData`, see [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md).) ```powershell -Update-TypeData -PrependPath $PSHOME\MyTypes.ps1xml +Update-Typedata -PrependPath $PSHOME\MyTypes.ps1xml ``` To test the change, run a `Get-ChildItem` command to get the PowerShell.exe file in the `$PSHOME` directory, and then pipe the file to the `Format-List` cmdlet to list all of the properties of the file. As a -result of the change, the Age property appears in the list. +result of the change, the `Age` property appears in the list. ```powershell Get-ChildItem $PSHOME\PowerShell.exe | Format-List -Property * @@ -334,7 +329,7 @@ The `` tag must have a pair of `` tags that specify the name of the new method and a pair of `` tags that specify the code in which the method is defined. -For example, the `Mode` property of directories (`System.IO.DirectoryInfo` +For example, the Mode property of directories (`System.IO.DirectoryInfo` objects) is a code property defined in the Windows PowerShell FileSystem provider. @@ -345,7 +340,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -370,7 +367,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -391,7 +390,7 @@ In Types.ps1xml files, the `` tag is used to define the default views of the .NET Framework objects in Windows PowerShell. In this case, the name of the member set (the value within the `` tags) is always "PsStandardMembers", and the names of the properties -(the value of the tag) are one of the following: +(the value of the `` tag) are one of the following: - `DefaultDisplayProperty`: A single property of an object. @@ -438,7 +437,7 @@ The `` tag must have a pair of `` tags that specify the name of the new property and a pair of `` tags that specify the value of the property. -For example, the following XML creates a `Status` property for +For example, the following XML creates a Status property for directories (`System.IO.DirectoryInfo` objects). The value of the `Status` property is always "Success". @@ -473,7 +472,7 @@ properties for the default display of an object. You can identify the default displays by the value "PsStandardMembers" in the `` tag of a `` tag. -For example, the following XML creates a `Status` property for +For example, the following XML creates a Status property for directories (`System.IO.DirectoryInfo` objects). The value of the `Status` property is always "Success". @@ -495,7 +494,7 @@ property is always "Success". - + ``` ``: Defines a method whose value is the output of a script. @@ -511,21 +510,21 @@ methods of the `System.Management.ManagementDateTimeConverter` class. ```xml - System.Management.ManagementObject - - - ConvertToDateTime - - - - ConvertFromDateTime - - - + System.Management.ManagementObject + + + ConvertToDateTime + + + + ConvertFromDateTime + + + ``` @@ -548,7 +547,7 @@ property of the `GetVersionInfo` static method of VersionInfo - [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) + [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) @@ -586,8 +585,9 @@ use method syntax. ## Signing a Types.ps1xml File -To protect users of your Types.ps1xml file, you can sign the file using -a digital signature. For more information, see [about_Signing](about_Signing.md). +To protect users of your Types.ps1xml file, you can sign the file using a +digital signature. For more information, see +[about_Signing](about_Signing.md). # SEE ALSO @@ -595,7 +595,7 @@ a digital signature. For more information, see [about_Signing](about_Signing.md) [Copy-Item](../../Microsoft.PowerShell.Management/Copy-Item.md) -[Copy-ItemProperty](../../Microsoft.PowerShell.Management/Copy-Item.md) +[Copy-ItemProperty](../../Microsoft.PowerShell.Management/Copy-ItemProperty.md) [Get-Member](../../Microsoft.PowerShell.Utility/Get-Member.md) @@ -604,4 +604,3 @@ a digital signature. For more information, see [about_Signing](about_Signing.md) [Remove-TypeData](../../Microsoft.PowerShell.Utility/Remove-TypeData.md) [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md) - diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md index 85125adac7b3..08ee68185fcb 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,86 +7,90 @@ title: about_WMI_Cmdlets --- # About WMI Cmdlets -## about_WMI_Cmdlets - ## SHORT DESCRIPTION -Provides background information about Windows Management Instrumentation (WMI) and Windows PowerShell? +Provides background information about Windows Management Instrumentation (WMI) +and Windows PowerShell. ## LONG DESCRIPTION -This topic provides information about WMI technology, the WMI cmdlets for Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI troubleshooting. This topic also provides links to more information about WMI. +This topic provides information about WMI technology, the WMI cmdlets for +Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI +troubleshooting. This topic also provides links to more information about WMI. ### ABOUT WMI -Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF). You can use WMI to manage both local and remote computers. For example, you can use WMI to do the following: - --- Start a process on a remote computer. - --- Restart a computer remotely. - --- Get a list of the applications that are installed on a local or remote computer. - --- Query the Windows event logs on a local or remote computer. +Windows Management Instrumentation (WMI) is the Microsoft implementation of +Web-Based Enterprise Management (WBEM), which is an industry initiative to +develop a standard technology for accessing management information in an +enterprise environment. WMI uses the Common Information Model (CIM) industry +standard to represent systems, applications, networks, devices, and other +managed components. CIM is developed and maintained by the Distributed +Management Task Force (DMTF). You can use WMI to manage both local and remote +computers. For example, you can use WMI to do the following: + +- Start a process on a remote computer. +- Restart a computer remotely. +- Get a list of the applications that are installed on a local or remote + computer. +- Query the Windows event logs on a local or remote computer. ### THE WMI CMDLETS FOR WINDOWS POWERSHELL -Windows PowerShell implements WMI functionality through a set of cmdlets that are available in Windows PowerShell by default. You can use these cmdlets to complete the end-to-end tasks necessary to manage local and remote computers. - -The following WMI cmdlets are included. +Windows PowerShell implements WMI functionality through a set of cmdlets that +are available in Windows PowerShell by default. You can use these cmdlets to +complete the end-to-end tasks necessary to manage local and remote computers. -``` -Cmdlet Description ------------------- ---------------------------------------------- -Get-WmiObject Gets instances of WMI classes or information - about the available classes. - -Invoke-WmiMethod Calls WMI methods. - -Register-WmiEvent Subscribes to a WMI event. - -Remove-WmiObject Deletes WMI classes and instances. - -Set-WmiInstance Creates or modifies instances of WMI classes. -``` - +The following WMI cmdlets are included. +|Cmdlet |Description | +|-----------------|----------------------------------------------| +|Get-WmiObject |Gets instances of WMI classes or information | +| |about the available classes. | +|Invoke-WmiMethod |Calls WMI methods. | +|Register-WmiEvent|Subscribes to a WMI event. | +|Remove-WmiObject |Deletes WMI classes and instances. | +|Set-WmiInstance |Creates or modifies instances of WMI classes. | ### SAMPLE COMMANDS The following command displays the BIOS information for the local computer. - -``` +```powershell C:\PS> get-wmiobject win32_bios | format-list * ``` +The following command displays information about the WinRM service for three +remote computers. -The following command displays information about the WinRM service for three remote computers. - - -``` -C:\PS> get-wmiobject -query "select * from win32_service where name='WinRM'" -computername server01, server01, server03 +```powershell +$wql = "select * from win32_service where name='WinRM'" +get-wmiobject -query $wql -computername server01, server01, server03 ``` - The following more complex command exits all instances of a program. - -``` -C:\PS> notepad.exe -C:\PS> $np = get-wmiobject -query "select * from win32_process where name='notepad.exe'" +```powershell +C:\PS> notepad.exe +C:\PS> $wql = "select * from win32_process where name='notepad.exe'" +C:\PS> $np = get-wmiobject -query $wql C:\PS> $np | remove-wmiobject ``` - - ### WMI-BASED REMOTING -While the ability to manage a local system through WMI is useful, it is the remoting capabilities that make WMI a powerful administrative tool. WMI uses Microsoft's Distributed Component Object Model (DCOM) to connect to and manage systems. You might have to configure some systems to allow DCOM connections. Firewall settings and locked-down DCOM permissions can block WMI's ability to remotely manage systems. +While the ability to manage a local system through WMI is useful, it is the +remoting capabilities that make WMI a powerful administrative tool. WMI uses +Microsoft's Distributed Component Object Model (DCOM) to connect to and manage +systems. You might have to configure some systems to allow DCOM connections. +Firewall settings and locked-down DCOM permissions can block WMI's ability to +remotely manage systems. ### WMI TYPE ACCELERATORS -Windows PowerShell includes WMI type accelerators. These WMI type accelerators (shortcuts) allow more direct access to a WMI objects than a non-type accelerator approach would allow. + +Windows PowerShell includes WMI type accelerators. These WMI type accelerators +(shortcuts) allow more direct access to a WMI objects than a non-type +accelerator approach would allow. The following type accelerators are supported with WMI: @@ -96,125 +100,117 @@ The following type accelerators are supported with WMI: [WMI] - A shortcut for getting a single instance of a class. -[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can take a string constructor to create a searcher that you can then do a GET() on. +[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can +take a string constructor to create a searcher that you can then do a GET() +on. For example: +```powershell +PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' +PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto +count __PATH name +----- ------ ---- +1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... +1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe +1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe +1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE +1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe +2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe ``` -PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' -PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto - -handlecount __PATH name ------------ ------ ---- -1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... -1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe -1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe -1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE -1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe -2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe -``` - -[WMICLASS] is a type accelerator for ManagementClass. This has a string constructor that takes a local or absolute WMI path to a WMI class and returns an object that is bound to that class. +[WMICLASS] is a type accelerator for ManagementClass. This has a string +constructor that takes a local or absolute WMI path to a WMI class and returns +an object that is bound to that class. For example: - -``` -PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" -PS> $c |fl * -Name : Win32_Process -__GENUS : 1 -__CLASS : Win32_Process -__SUPERCLASS : CIM_Process -__DYNASTY : CIM_ManagedSystemElement -__RELPATH : Win32_Process -__PROPERTY_COUNT : 45 -__DERIVATION : {CIM_Process, CIM_LogicalElement, CIM_ManagedSystemElement} -__SERVER : SERVER01 -__NAMESPACE : ROOT\cimv2 +```powershell +PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" +PS> $c |fl * +Name : Win32_Process +__GENUS : 1 +__CLASS : Win32_Process +__SUPERCLASS : CIM_Process +__DYNASTY : CIM_ManagedSystemElement +__RELPATH : Win32_Process +__PROPERTY_COUNT : 45 +__DERIVATION : {CIM_Process, CIM_LogicalElement, + CIM_ManagedSystemElement} +__SERVER : SERVER01 +__NAMESPACE : ROOT\cimv2 __PATH : \\SERVER01\ROOT\cimv2:Win32_Process ``` - -[WMI] is a type accelerator for ManagementObject. This has a string constructor that takes a local or absolute WMI path to a WMI instance and returns an object that is bound to that instance. +[WMI] is a type accelerator for ManagementObject. This has a string +constructor that takes a local or absolute WMI path to a WMI instance and +returns an object that is bound to that instance. For example: - -``` -PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' -PS> $p.Name +```powershell +PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' +PS> $p.Name OUTLOOK.EXE ``` - - ### WMI TROUBLESHOOTING -The following problems are the most common problems that might occur when you try to connect to a remote computer. -Problem 1: The remote computer is not online. - -If a computer is offline, you will not be able to connect to it by using WMI. You may receive the following error message: +The following problems are the most common problems that might occur when you +try to connect to a remote computer. +Problem 1: The remote computer is not online. -``` -"Remote server machine does not exist or is unavailable" -``` +If a computer is offline, you will not be able to connect to it by using WMI. +You may receive the following error message: + Remote server machine does not exist or is unavailable -If you receive this error message, verify that the computer is online. Try to ping the remote computer. +If you receive this error message, verify that the computer is online. Try to +ping the remote computer. Problem 2: You do not have local administrator rights on the remote computer. -To use WMI remotely, you must have local administrator rights on the remote computer. If you do not, access to that computer will be denied. +To use WMI remotely, you must have local administrator rights on the remote +computer. If you do not, access to that computer will be denied. To verify namespace security: -- a. Click Start, right-click My Computer, and then click Manage. - -- b. In Computer Management, expand Services and Applications, right-click WMI Control, and then click Properties. - -- c. In the WMI Control Properties dialog box, click the Security tab. +1. Click Start, right-click My Computer, and then click Manage. +2. In Computer Management, expand Services and Applications, right-click WMI + Control, and then click Properties. +3. In the WMI Control Properties dialog box, click the Security tab. Problem 3: A firewall is blocking access to the remote computer. -WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols to traverse the network. By default, many firewalls block DCOM and RPC traffic. If your firewall is blocking these protocols, your connection will fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is configured to automatically block all unsolicited network traffic, including DCOM and WMI. In its default configuration, Windows Firewall rejects an incoming WMI request, and you receive the following error message: - - -``` -"Remote server machine does not exist or is unavailable" -``` - +WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols +to traverse the network. By default, many firewalls block DCOM and RPC +traffic. If your firewall is blocking these protocols, your connection will +fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is +configured to automatically block all unsolicited network traffic, including +DCOM and WMI. In its default configuration, Windows Firewall rejects an +incoming WMI request, and you receive the following error message: + Remote server machine does not exist or is unavailable ### MORE INFORMATION ABOUT WMI -For more information about WMI, see the following topics in the MSDN (Microsoft Developer Network) library: - -``` -"About WMI: -http://go.microsoft.com/fwlink/?LinkId=142212 - -"WMI Troubleshooting" -http://go.microsoft.com/fwlink/?LinkId=142213 -``` +For more information about WMI, see the following topics in the MSDN +(Microsoft Developer Network) library: +About WMI: http://go.microsoft.com/fwlink/?LinkId=142212 -And, see "Secrets of Windows Management Instrumentation - Troubleshooting and Tips" in the Microsoft TechNet Script Center: +WMI Troubleshooting: http://go.microsoft.com/fwlink/?LinkId=142213 +And, see "Secrets of Windows Management Instrumentation - Troubleshooting and +Tips" in the Microsoft TechNet Script Center: -``` http://go.microsoft.com/fwlink/?LinkId=142214 -``` - ## SEE ALSO -Online version: http://go.microsoft.com/fwlink/?LinkId=142219 - Get-WmiObject Invoke-WmiMethod diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/About_Using.md b/reference/5.1/Microsoft.PowerShell.Core/About/About_Using.md index b6abbe721641..4fbccbdc21cf 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/About_Using.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/About_Using.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,7 +7,6 @@ title: about_Using --- # About Using -## about_Using # SHORT DESCRIPTION @@ -15,47 +14,49 @@ Allows to indicate which namespaces are used in the session. # LONG DESCRIPTION - -The `using` statement allows to indicate which namespaces are used in the session. -Making easier to mention classes and members, as it requires less typing to mention them; -also, classes from modules can be referenced too. +The `using` statement allows to indicate which namespaces are used in the +session. Making easier to mention classes and members, as it requires less +typing to mention them; also, classes from modules can be referenced too. The `using` statement needs to be the first statement in the script. Syntax #1, to reference .Net Framework namespaces: + ``` using namespace <.Net-framework-namespace> ``` Syntax #2, to reference PowerShell modules: + ``` using module ``` -> **Note** The `using` statetement, for modules, is intended to surface the classes in the module. -> If the module isn't loaded, the `using` fails. +**Note**: The `using` statetement, for modules, is intended to surface the +classes in the module. If the module isn't loaded, the `using` fails. ## Example 1 The following script gets the cryptographic hash for the "Hello World" string. -Note how the `using namespace System.Text` and `using namespace System.IO` simplify -the references to `[UnicodeEncoding]` in *System.Text*; and, to `[Stream]` -and to `[MemoryStream]` in *System.IO*. - +Note how the `using namespace System.Text` and `using namespace System.IO` +simplify the references to `[UnicodeEncoding]` in *System.Text*; and, to +`[Stream]` and to `[MemoryStream]` in *System.IO*. ```powershell - using namespace System.Text - using namespace System.IO +using namespace System.Text +using namespace System.IO - [string]$string = "Hello World" - [string]$algorithm = "SHA256" ## Valid values are "SHA1", "SHA256", "SHA384", "SHA512", "MACTripleDES", "MD5", "RIPEMD160" +[string]$string = "Hello World" +## Valid values are "SHA1", "SHA256", "SHA384", "SHA512", "MD5" +[string]$algorithm = "SHA256" - [byte[]]$stringbytes = [UnicodeEncoding]::Unicode.GetBytes($string) +[byte[]]$stringbytes = [UnicodeEncoding]::Unicode.GetBytes($string) - [Stream]$memorystream = [MemoryStream]::new($stringbytes) - $hashfromstream = Get-FileHash -InputStream $memorystream -Algorithm $algorithm - $hashfromstream.Hash.ToString() +[Stream]$memorystream = [MemoryStream]::new($stringbytes) +$hashfromstream = Get-FileHash -InputStream $memorystream ` + -Algorithm $algorithm +$hashfromstream.Hash.ToString() ``` ## Example 2 @@ -77,4 +78,3 @@ $deck.Shuffle() [Card[]]$hand2 = $deck.Deal(5) [Card[]]$hand3 = $deck.Deal(5) ``` - diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md index 0d9fbe39f89d..10b1d7bc00db 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -74,20 +74,24 @@ are included. Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf ``` -The second example uses hash table splatting. The first command creates -a hash table of parameter-name and parameter-value pairs and stores it -in the $HashArguments variable. The second command uses the `$HashArguments` -variable in a command with splatting. The At symbol (`@HashArguments`) -replaces the dollar sign (`$HashArguments`) in the command. +The second example uses hash table splatting. The first command creates a hash +table of parameter-name and parameter-value pairs and stores it in the +\$HashArguments variable. The second command uses the `$HashArguments` variable +in a command with splatting. The At symbol (`@HashArguments`) replaces the +dollar sign (`$HashArguments`) in the command. To provide a value for the WhatIf switch parameter, use $True or $False. ```powershell -$HashArguments = @{ Path = "test.txt"; Destination = "test2.txt"; WhatIf = $true } +$HashArguments = @{ + Path = "test.txt" + Destination = "test2.txt" + WhatIf = $true +} Copy-Item @HashArguments ``` -*Note: In the first command, the At symbol (@) indicates a hash table, not +Note: In the first command, the At symbol (@) indicates a hash table, not a splatted value. The syntax for hash tables in Windows PowerShell is: @{\=\; \=\; …}* @@ -106,11 +110,12 @@ omitted. The parameter values appear in position order in the command. Copy-Item "test.txt" "test2.txt" -WhatIf ``` -The second example uses array splatting. The first command creates an array -of the parameter values and stores it in the `$ArrayArguments` variable. The +The second example uses array splatting. The first command creates an array of +the parameter values and stores it in the `$ArrayArguments` variable. The values are in position order in the array. The second command uses the `$ArrayArguments` variable in a command in splatting. The At symbol -(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the command. +(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the +command. ```powershell $ArrayArguments = "test.txt", "test2.txt" @@ -120,10 +125,10 @@ Copy-Item @ArrayArguments -WhatIf # EXAMPLES -This example shows how to re-use splatted values in different commands. -The commands in this example use the Write-Host cmdlet to write messages -to the host program console. It uses splatting to specify the foreground -and background colors. +This example shows how to re-use splatted values in different commands. The +commands in this example use the Write-Host cmdlet to write messages to the +host program console. It uses splatting to specify the foreground and +background colors. To change the colors of all commands, just change the value of the `$Colors` variable. @@ -143,7 +148,8 @@ Write-Host command. To use the `$Colors variable`, replace the dollar sign #Write a message with the colors in $Colors Write-Host "This is a test." @Colors -#Write second message with same colors. The position of splatted hash table does not matter. +#Write second message with same colors. The position of splatted +#hash table does not matter. Write-Host @Colors "This is another test." ``` @@ -193,22 +199,19 @@ Test2 -a 1 -b 2 -c 3 # SPLATTING COMMAND PARAMETERS -You can use splatting to represent the parameters of -a command. This technique is useful when you are creating -a proxy function, that is, a function that calls another -command. This feature is introduced in Windows PowerShell 3.0. +You can use splatting to represent the parameters of a command. This technique +is useful when you are creating a proxy function, that is, a function that +calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent -the command parameters. This technique is easier than -enumerating command parameters and it works without revision -even if the parameters of the called command change. +To splat the parameters of a command, use `@Args` to represent the command +parameters. This technique is easier than enumerating command parameters and +it works without revision even if the parameters of the called command change. The feature uses the `$Args` automatic variable, which contains all unassigned parameter values. -For example, the following function calls the Get-Process -cmdlet. In this function, `@Args` represents all of the parameters -of the Get-Process cmdlet. +For example, the following function calls the Get-Process cmdlet. In this +function, `@Args` represents all of the parameters of the Get-Process cmdlet. ```powershell function Get-MyProcess { Get-Process @Args } @@ -223,20 +226,18 @@ Get-MyProcess -Name PowerShell Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -463 46 225484 237196 719 15.86 3228 powershell + 463 46 225484 237196 719 15.86 3228 powershell Get-MyProcess -Name PowerShell_Ise -FileVersionInfo ProductVersion FileVersion FileName -------------- ----------- -------- -6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe +6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly -declared parameters. You can use it more than once in -a function, but all parameters that you enter are passed -to all instances of `@Args`, as shown in the following -example. +You can use `@Args` in a function that has explicitly declared parameters. You +can use it more than once in a function, but all parameters that you enter are +passed to all instances of `@Args`, as shown in the following example. ```powershell function Get-MyCommand @@ -252,9 +253,9 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 408 28 75568 83176 620 1.33 1692 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -265,10 +266,11 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell + \v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616) + FileVersion: 10.0.14393.0 (rs1_release.160715-1616 FileDescription: Windows PowerShell Product: Microsoft® Windows® Operating System ProductVersion: 10.0.14393.0 @@ -289,4 +291,3 @@ FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1. [about_Hash_Tables](about_Hash_Tables.md) [about_Parameters](about_Parameters.md) - diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md index 9154bed7ea49..98b97dd2dab7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -19,22 +19,21 @@ The Split operator splits one or more strings into substrings. You can change the following elements of the Split operation: * Delimiter. The default is whitespace, but you can specify characters, -strings, patterns, or script blocks that specify the delimiter. The Split -operator in Windows PowerShell uses a regular expression in the delimiter, -rather than a simple character. + strings, patterns, or script blocks that specify the delimiter. The Split + operator in Windows PowerShell uses a regular expression in the delimiter, + rather than a simple character. * Maximum number of substrings. The default is to return all substrings. If -you specify a number less than the number of substrings, the remaining -substrings are concatenated in the last substring. + you specify a number less than the number of substrings, the remaining + substrings are concatenated in the last substring. * Options that specify the conditions under which the delimiter is matched, -such as SimpleMatch and Multiline. + such as SimpleMatch and Multiline. ## SYNTAX The following diagram shows the syntax for the -split operator. -The parameter names do not appear in the command. Include only the -parameter values. The values must appear in the order specified in the -syntax diagram. +The parameter names do not appear in the command. Include only the parameter +values. The values must appear in the order specified in the syntax diagram. ```powershell -Split @@ -45,17 +44,17 @@ syntax diagram. ``` You can substitute `-iSplit` or `-cSplit` for `-split` in any binary Split -statement (a Split statement that includes a delimiter or script block). -The `-iSplit` and `-split` operators are case-insensitive. The `-cSplit` -operator is case-sensitive, meaning that case is considered when the -delimiter rules are applied. +statement (a Split statement that includes a delimiter or script block). The +`-iSplit` and `-split` operators are case-insensitive. The `-cSplit` operator +is case-sensitive, meaning that case is considered when the delimiter rules +are applied. ## PARAMETERS ### \ -Specifies one or more strings to be split. If you submit multiple -strings, all the strings are split using the same delimiter rules. +Specifies one or more strings to be split. If you submit multiple strings, all +the strings are split using the same delimiter rules. Example: @@ -69,10 +68,10 @@ green ### \ -The characters that identify the end of a substring. The default delimiter -is whitespace, including spaces and non-printable characters, such as -newline (\`n) and tab (\`t). When the strings are split, the delimiter is -omitted from all the substrings. Example: +The characters that identify the end of a substring. The default delimiter is +whitespace, including spaces and non-printable characters, such as newline +(\`n) and tab (\`t). When the strings are split, the delimiter is omitted from +all the substrings. Example: ```powershell "Lastname:FirstName:Address" -split ":" @@ -81,13 +80,13 @@ FirstName Address ``` -By default, the delimiter is omitted from the results. To preserve all or -part of the delimiter, enclose in parentheses the part that you want to -preserve. If the \ parameter is added, this takes -precedence when your command splits up the collection. If you opt to -include a delimiter as part of the output, the command returns the -delimiter as part of the output; however, splitting the string to return -the delimiter as part of output does not count as a split. +By default, the delimiter is omitted from the results. To preserve all or part +of the delimiter, enclose in parentheses the part that you want to preserve. +If the \ parameter is added, this takes precedence when your +command splits up the collection. If you opt to include a delimiter as part of +the output, the command returns the delimiter as part of the output; however, +splitting the string to return the delimiter as part of output does not count +as a split. Examples: @@ -124,17 +123,16 @@ Strawberry-Blueberry ### \ -Specifies the maximum number of times that a string is split. The default -is all the substrings split by the delimiter. If there are more substrings, -they are concatenated to the final substring. If there are fewer -substrings, all the substrings are returned. A value of 0 and negative -values return all the substrings. +Specifies the maximum number of times that a string is split. The default is +all the substrings split by the delimiter. If there are more substrings, they +are concatenated to the final substring. If there are fewer substrings, all +the substrings are returned. A value of 0 and negative values return all the +substrings. Max-substrings does not specify the maximum number of objects that are -returned; its value equals the maximum number of times that a string is -split. If you submit more than one string (an array of strings) to the -Split operator , the Max-substrings limit is applied to each string -separately. +returned; its value equals the maximum number of times that a string is split. +If you submit more than one string (an array of strings) to the Split operator +, the Max-substrings limit is applied to each string separately. Example: @@ -150,9 +148,8 @@ Jupiter,Saturn,Uranus,Neptune ### \ -An expression that specifies rules for applying the delimiter. The -expression must evaluate to $true or $false. Enclose the script block in -braces. +An expression that specifies rules for applying the delimiter. The expression +must evaluate to $true or $false. Enclose the script block in braces. Example: @@ -187,63 +184,62 @@ The syntax for the Options parameter is: The SimpleMatch options are: * **SimpleMatch**: Use simple string comparison when evaluating the -delimiter. Cannot be used with RegexMatch. + delimiter. Cannot be used with RegexMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. The RegexMatch options are: * **RegexMatch**: Use regular expression matching to evaluate the -delimiter. This is the default behavior. Cannot be used with -SimpleMatch. + delimiter. This is the default behavior. Cannot be used with + SimpleMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. * **CultureInvariant**: Ignores cultural differences in language -when evaluting the delimiter. Valid only with RegexMatch. + when evaluting the delimiter. Valid only with RegexMatch. * IgnorePatternWhitespace: Ignores unescaped whitespace and -comments marked with the number sign (#). Valid only with -RegexMatch. + comments marked with the number sign (#). Valid only with + RegexMatch. * **Multiline**: Multiline mode recognizes the start and end of lines -and strings. Valid only with RegexMatch. Singleline is the default. + and strings. Valid only with RegexMatch. Singleline is the default. * **Singleline**: Singleline mode recognizes only the start and end of -strings. Valid only with RegexMatch. Singleline is the default. + strings. Valid only with RegexMatch. Singleline is the default. * **ExplicitCapture**: Ignores non-named match groups so that only -explicit capture groups are returned in the result list. Valid -only with RegexMatch. + explicit capture groups are returned in the result list. Valid + only with RegexMatch. ## UNARY and BINARY SPLIT OPERATORS The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the -unary split operator, only the first string (before the first comma) is -split. +unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( --split ). Enclose all the strings in parentheses, or store the -strings in a variable, and then submit the variable to the split operator. +To split more than one string, use the binary split operator ( -split +). Enclose all the strings in parentheses, or store the strings in +a variable, and then submit the variable to the split operator. Consider the following example: ```powershell -PS C:\> -split "1 2", "a b" +PS > -split "1 2", "a b" 1 2 a b -PS C:\> "1 2", "a b" -split " " +PS > "1 2", "a b" -split " " 1 2 a b -PS C:\> -split ("1 2", "a b") +PS > -split ("1 2", "a b") 1 2 a b -PS C:\> $a = "1 2", "a b" -PS C:\> -split $a +PS > $a = "1 2", "a b" +PS > -split $a 1 2 a @@ -255,7 +251,7 @@ b The following statement splits the string at whitespace. ```powershell -PS C:\> -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" Windows PowerShell 2.0 @@ -268,7 +264,7 @@ remoting The following statement splits the string at any comma. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' Mercury Venus Earth @@ -282,17 +278,16 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune ``` -The following statement performs a case-sensitive split at the -letter "N". +The following statement performs a case-sensitive split at the letter "N". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -300,7 +295,7 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' M rcury,V nus, @@ -317,7 +312,8 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` + -split '[er]', 6 M cu @@ -329,7 +325,7 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS C:\> "a,b,c,d,e,f,g,h" -split ",", 3 +PS > "a,b,c,d,e,f,g,h" -split ",", 3 a b c,d,e,f,g,h @@ -339,7 +335,7 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS C:\> "a,b,c,d", "e,f,g,h" -split ",", 3 +PS > "a,b,c,d", "e,f,g,h" -split ",", 3 a b c,d @@ -352,18 +348,18 @@ The following statement splits each line in the here-string at the first digit. It uses the Multiline option to recognize the beginning of each line and string. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as Multiline, only when the Max-substrings value -is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as Multiline, only when the Max-substrings value is +specified. ```powershell -PS C:\> $a = @' +PS > $a = @' 1The first line. 2The second line. 3The third of three lines. '@ -PS C:\> $a -split "^\d", 0, "multiline" +PS > $a -split "^\d", 0, "multiline" The first line. @@ -380,12 +376,12 @@ interpreted to match any character except for a newline character. As a result, the Split statement returns a blank line for every character except newline. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as SimpleMatch, only when the Max-substrings -value is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as SimpleMatch, only when the Max-substrings value is +specified. ```powershell -PS C:\> "This.is.a.test" -split ".", 0, "simplematch" +PS > "This.is.a.test" -split ".", 0, "simplematch" This is @@ -393,13 +389,13 @@ a test ``` -The following statement splits the string at one of two delimiters, -depending on the value of a variable. +The following statement splits the string at one of two delimiters, depending +on the value of a variable. ```powershell -PS C:\> $i = 1 -PS C:\> $c = "LastName, FirstName; Address, City, State, Zip" -PS C:\> $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +PS > $i = 1 +PS > $c = "LastName, FirstName; Address, City, State, Zip" +PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} LastName, FirstName Address, City, State, Zip @@ -407,7 +403,7 @@ Address, City, State, Zip ## SEE ALSO -Split-Path +[Split-Path](../../Microsoft.PowerShell.Management/Split-Path.md) [about_Operators](about_Operators.md) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md index 90658fd83ff1..1bfafbe78470 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -148,13 +148,25 @@ Default clause is permitted in each Switch statement. Switch has the following parameters: -|Parameter|Description| -|---|---| -| Wildcard | Indicates that the condition is a wildcard string. If you use Wildcard, Regex and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| Exact | Indicates that the match clause, if it is a string, must match exactly. If you use Exact, Regex and Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| CaseSensitive | Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. | -| File | Takes input from a file rather than a value statement. If multiple File parameters are included, only the last one is used. Each line of the file is read and evaluated by the Switch statement. | -| Regex | Performs regular expression matching of the value to the condition. If you use Regex, Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | +|Parameter |Description | +|-------------|-----------------------------------------------------------| +|Wildcard |Indicates that the condition is a wildcard string. If you | +| |you use Wildcard, Regex and Exact are ignored. Also, if | +| |the match clause is not a string, the parameter is ignored.| +|Exact |Indicates that the match clause, if it is a string, must | +| |match exactly. Regex and Wildcard and Exact are ignored. | +| |Also, if the match clause is not a string, this parameter | +| |is ignored. | +|CaseSensitive|Performs a case-sensitive match. If the match clause is not| +| |a string, this parameter is ignored. | +|File |Takes input from a file rather than a value statement. If | +| |multiple File parameters are included, only the last one is| +| |used. Each line of the file is read and evaluated by the | +| |Switch statement. | +|Regex |Performs regular expression matching of the value to the | +| |condition. Wildcard and Exact are ignored. Also, if the | +| |match clause is not a string, this parameter is ignored. | + ```powershell Example: diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Throw.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Throw.md index 2deea43ade1b..08fe2f6e5c7e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Throw.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Throw.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -14,16 +14,16 @@ Describes the Throw keyword, which generates a terminating error. ## LONG DESCRIPTION -The Throw keyword causes a terminating error. You can use the Throw keyword -to stop the processing of a command, function, or script. +The Throw keyword causes a terminating error. You can use the Throw keyword to +stop the processing of a command, function, or script. For example, you can use the Throw keyword in the script block of an If statement to respond to a condition or in the Catch block of a -Try-Catch-Finally statement. You can also use the Throw keyword in a -parameter declaration to make a function parameter mandatory. +Try-Catch-Finally statement. You can also use the Throw keyword in a parameter +declaration to make a function parameter mandatory. -The Throw keyword can throw any object, such as a user message string or -the object that caused the error. +The Throw keyword can throw any object, such as a user message string or the +object that caused the error. ## SYNTAX @@ -33,8 +33,8 @@ The syntax of the Throw keyword is as follows: throw [] ``` -The expression in the Throw syntax is optional. When the Throw statement -does not appear in a Catch block, and it does not include an expression, it +The expression in the Throw syntax is optional. When the Throw statement does +not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error. ```powershell @@ -47,13 +47,14 @@ At line:1 char:6 + FullyQualifiedErrorId : ScriptHalted ``` -If the Throw keyword is used in a Catch block without an expression, it -throws the current RuntimeException again. For more information, see +If the Throw keyword is used in a Catch block without an expression, it throws +the current RuntimeException again. For more information, see about_Try_Catch_Finally. ## THROWING A STRING -The optional expression in a Throw statement can be a string, as shown in -the following example: + +The optional expression in a Throw statement can be a string, as shown in the +following example: ```powershell C:\PS> throw "This is an error." @@ -61,7 +62,8 @@ C:\PS> throw "This is an error." This is an error. At line:1 char:6 + throw <<<< "This is an error." -+ CategoryInfo : OperationStopped: (This is an error.:String) [], RuntimeException ++ CategoryInfo : OperationStopped: (This is an error.:String) [], R +untimeException + FullyQualifiedErrorId : This is an error. ``` @@ -76,7 +78,8 @@ C:\PS> throw (get-process PowerShell) System.Diagnostics.Process (PowerShell) At line:1 char:6 + throw <<<< (get-process PowerShell) -+ CategoryInfo : OperationStopped: (System.Diagnostics.Process (PowerShell):Process) [], ++ CategoryInfo : OperationStopped: (System.Diagnostics.Process (Pow +erShell):Process) [], RuntimeException + FullyQualifiedErrorId : System.Diagnostics.Process (PowerShell) ``` @@ -105,15 +108,16 @@ One of the identified items was in an invalid format. At line:1 char:6 + throw <<<< $formatError + CategoryInfo : OperationStopped: (:) [], FormatException -+ FullyQualifiedErrorId : One of the identified items was in an invalid format. ++ FullyQualifiedErrorId : One of the identified items was in an invalid +format. ``` ## RESULTING ERROR -The Throw keyword can generate an ErrorRecord object. The Exception -property of the ErrorRecord object contains a RuntimeException object. The -remainder of the ErrorRecord object and the RuntimeException object vary -with the object that the Throw keyword throws. +The Throw keyword can generate an ErrorRecord object. The Exception property +of the ErrorRecord object contains a RuntimeException object. The remainder of +the ErrorRecord object and the RuntimeException object vary with the object +that the Throw keyword throws. The RunTimeException object is wrapped in an ErrorRecord object, and the ErrorRecord object is automatically saved in the $Error automatic variable. @@ -139,7 +143,9 @@ optional. function Get-XMLFiles { param ($path = $(throw "The Path parameter is required.")) - dir -path $path\*.xml -recurse | sort lastwritetime | ft lastwritetime, attributes, name -auto + dir -path $path\*.xml -recurse | + sort lastwritetime | + ft lastwritetime, attributes, name -auto } ``` @@ -154,4 +160,3 @@ function Get-XMLFiles [about_Trap](about_Trap.md) [about_Try_Catch_Finally](about_Try_Catch_Finally.md) - diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Trap.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Trap.md index 338030fa058b..bc042324bc4b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Trap.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Trap.md @@ -130,7 +130,9 @@ statement that specifies the CommandNotFoundException type. ```powershell trap {"Other terminating error trapped" } -trap [System.Management.Automation.CommandNotFoundException] {"Command error trapped"} +trap [System.Management.Automation.CommandNotFoundException] { + "Command error trapped" +} nonsenseString ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md index a94e962d87b3..531eb8a2f9da 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-091 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -26,11 +26,16 @@ fails, it returns nothing. It does not return an error. The following table lists the type operators in Windows PowerShell. -|Operator|Description|Example| -|---|---|---| -|`-is`|Returns TRUE when the input is an instance of the specified.NET Framework type.|`C:\PS> (get-date) -is [DateTime]`
`True`| -|`-isNot`|Returns TRUE when the input is not an instance of the specified.NET Framework type.|`C:\PS> (get-date) -isNot [DateTime]`
`False`| -|`-as`|Converts the input to the specified.NET Framework type.|`C:\PS> 12/31/07 -as [DateTime]`
`Monday, December 31, 2007 12:00:00 AM`| +|Operator|Description |Example | +|--------|---------------------------|---------------------------------| +|`-is` |Returns TRUE when the input|`(get-date) -is [DateTime]` | +| |is an instance of the |`True` | +| |specified .NET type. | | +|`-isNot`|Returns TRUE when the input|`(get-date) -isNot [DateTime]` | +| |not an instance of the |`False` | +| |specified.NET type. | | +|`-as` |Converts the input to the |`"5/7/07" -as [DateTime]` | +| |specified .NET type. |`Monday, May 7, 2007 12:00:00 AM`| The syntax of the type operators is as follows: @@ -64,7 +69,7 @@ property of this method. For example, the following statement gets the type of the return value of a Get-Culture command: ```powershell -C:\PS> (get-culture).gettype().fullname +PS> (get-culture).gettype().fullname System.Globalization.CultureInfo ``` @@ -72,25 +77,25 @@ System.Globalization.CultureInfo The following examples show some uses of the Type operators: ```powershell -C:\PS> 32 -is [Float] +PS> 32 -is [Float] False -C:\PS> 32 -is "int" +PS> 32 -is "int" True -C:\PS> (get-date) -is [DateTime] +PS> (get-date) -is [DateTime] True -C:\PS> "12/31/2007" -is [DateTime] +PS> "12/31/2007" -is [DateTime] False -C:\PS> "12/31/2007" -is [String] +PS> "12/31/2007" -is [String] True -C:\PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] +PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] True -C:\PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] +PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] True ``` @@ -103,53 +108,55 @@ return System.Globalization.CultureInfo objects, a collection of these objects is a System.Object array. ```powershell -C:\PS> (get-culture) -is [System.Globalization.CultureInfo] +PS> (get-culture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-uiculture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] False -C:\PS> (get-culture), (get-uiculture) -is [Array] +PS> (get-culture), (get-uiculture) -is [Array] True -C:\PS> (get-culture), (get-uiculture) | foreach {$_ -is [System.Globalization.CultureInfo]) +PS> (get-culture), (get-uiculture) | foreach { + $_ -is [System.Globalization.CultureInfo]) +} True True -C:\PS> (get-culture), (get-uiculture) -is [Object] +PS> (get-culture), (get-uiculture) -is [Object] True ``` The following examples show how to use the -as operator. ```powershell -C:\PS> "12/31/07" -is [DateTime] +PS> "12/31/07" -is [DateTime] False -C:\PS> "12/31/07" -as [DateTime] +PS> "12/31/07" -as [DateTime] Monday, December 31, 2007 12:00:00 AM -C:\PS> $date = "12/31/07" -as [DateTime] +PS> $date = "12/31/07" -as [DateTime] C:\PS>$a -is [DateTime] True -C:\PS> 1031 -as [System.Globalization.CultureInfo] +PS> 1031 -as [System.Globalization.CultureInfo] -LCID Name DisplayName ----- ---- ----------- -1031 de-DE German (Germany) +LCID Name DisplayName +---- ---- ----------- +1031 de-DE German (Germany) ``` The following example shows that when the -as operator cannot convert the input object to the .NET Framework type, it returns nothing. ```powershell -C:\PS> 1031 -as [System.Diagnostic.Process] -C:\PS> +PS> 1031 -as [System.Diagnostic.Process] +PS> ``` ## SEE ALSO diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md index 96d2292ea00c..3888516c6096 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,9 +7,6 @@ title: about_Types.ps1xml --- # About Types.ps1xml -## about_Types.ps1xml - - # SHORT DESCRIPTION @@ -27,16 +24,16 @@ extended type data to a Windows PowerShell session. extended data for types in the current session. This topic describes Types.ps1xml files. For more information about using the -`Update-TypeData` cmdlet to add dynamic extended type data to the current session -see [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). +`Update-TypeData` cmdlet to add dynamic extended type data to the current +session see +[Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). ## About Extended Type Data -Extended type data defines additional properties and methods ("members") -of object types in Windows PowerShell. You can extend any type that is -supported by Windows PowerShell and use the added properties and methods -in the same way that you use the properties that are defined on the object -types. +Extended type data defines additional properties and methods ("members") of +object types in Windows PowerShell. You can extend any type that is supported +by Windows PowerShell and use the added properties and methods in the same way +that you use the properties that are defined on the object types. For example, Windows PowerShell adds a `DateTime` property to all `System.DateTime` objects, such as the ones that the `Get-Date` cmdlet @@ -47,27 +44,27 @@ PS C:> (Get-Date).DateTime Sunday, January 29, 2012 9:43:57 AM ``` -You won't find the `DateTime` property in the description of the [`System.DateTime` -structure](http://msdn.microsoft.com/library/system.datetime.aspx), -because Windows PowerShell adds the property and it is visible only in -Windows PowerShell. +You won't find the `DateTime` property in the description of the +[`System.DateTime` structure](http://msdn.microsoft.com/library/system.datetime.aspx), +because Windows PowerShell adds the property and it is visible only in Windows +PowerShell. -To add the `DateTime` property to all Windows PowerShell sessions, Windows PowerShell -defines the `DateTime` property in the Types.ps1xml file in the Windows PowerShell -installation directory (`$PSHOME`). +To add the `DateTime` property to all Windows PowerShell sessions, Windows +PowerShell defines the `DateTime` property in the Types.ps1xml file in the +Windows PowerShell installation directory (`$PSHOME`). ## Adding Extended Type Data to Windows PowerShell. There are three sources of extended type data in Windows PowerShell sessions. - The Types.ps1xml files in the Windows PowerShell installation directory -are loaded automatically into every Windows PowerShell session. + are loaded automatically into every Windows PowerShell session. - The Types.ps1xml files that modules export are loaded when the module -is imported into the current session. + is imported into the current session. - Extended type data that is defined by using the `Update-TypeData` cmdlet -is added only to the current session. It is not saved in a file. + is added only to the current session. It is not saved in a file. In the session, the extended type data from the three sources is applied to objects in the same way and is available on all objects of the specified @@ -78,11 +75,10 @@ types. The following TypeData cmdlets are included in the Microsoft.PowerShell.Utility module in Windows PowerShell 3.0 and later versions of Windows PowerShell. -| | | -| --------------- | --------------------------------------------------------------- | -| Get-TypeData | Gets extended type data in the current session. | -| Update-TypeData | Reloads Types.ps1xml files. Adds extended type data to the current session. | -| Remove-TypeData | Removes extended type data from the current session. +- `Get-TypeData`: Gets extended type data in the current session. +- `Update-TypeData`: Reloads Types.ps1xml files. Adds extended type data to the + current session. +- `Remove-TypeData`: Removes extended type data from the current session. For more information about these cmdlets, see the help topic for each cmdlet. @@ -118,8 +114,8 @@ value. The following XML adds the Count property to the `System.Array` type. ``` -To get the new `AliasProperty`, use a `Get-Member` command on any array, as shown -in the following example. +To get the new `AliasProperty`, use a `Get-Member` command on any array, as +shown in the following example. ```powershell Get-Member -InputObject (1,2,3,4) @@ -127,15 +123,15 @@ Get-Member -InputObject (1,2,3,4) The command returns the following results. -```powershell -Name MemberType Definition ----- ---------- ---------- -Count AliasProperty Count = Length -Address Method System.Object& Address(Int32) -Clone Method System.Object Clone() -CopyTo Method System.Void CopyTo(Array array, Int32 index): -Equals Method System.Boolean Equals(Object obj) -Get Method System.Object Get(Int32) +```output +Name MemberType Definition +---- ---------- ---------- +Count AliasProperty Count = Length +Address Method System.Object& Address(Int32) +Clone Method System.Object Clone() +CopyTo Method System.Void CopyTo(Array array, Int32 index): +Equals Method System.Boolean Equals(Object obj) +Get Method System.Object Get(Int32) # ... ``` @@ -344,7 +340,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -369,7 +367,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -510,21 +510,21 @@ methods of the `System.Management.ManagementDateTimeConverter` class. ```xml - System.Management.ManagementObject - - - ConvertToDateTime - - - - ConvertFromDateTime - - - + System.Management.ManagementObject + + + ConvertToDateTime + + + + ConvertFromDateTime + + + ``` @@ -547,7 +547,7 @@ property of the `GetVersionInfo` static method of VersionInfo - [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) + [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) @@ -585,8 +585,9 @@ use method syntax. ## Signing a Types.ps1xml File -To protect users of your Types.ps1xml file, you can sign the file using -a digital signature. For more information, see [about_Signing](about_Signing.md). +To protect users of your Types.ps1xml file, you can sign the file using a +digital signature. For more information, see +[about_Signing](about_Signing.md). # SEE ALSO @@ -603,4 +604,3 @@ a digital signature. For more information, see [about_Signing](about_Signing.md) [Remove-TypeData](../../Microsoft.PowerShell.Utility/Remove-TypeData.md) [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md) - diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md index 8f2a53213e37..08ee68185fcb 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,86 +7,90 @@ title: about_WMI_Cmdlets --- # About WMI Cmdlets -## about_WMI_Cmdlets - ## SHORT DESCRIPTION -Provides background information about Windows Management Instrumentation (WMI) and Windows PowerShell. +Provides background information about Windows Management Instrumentation (WMI) +and Windows PowerShell. ## LONG DESCRIPTION -This topic provides information about WMI technology, the WMI cmdlets for Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI troubleshooting. This topic also provides links to more information about WMI. +This topic provides information about WMI technology, the WMI cmdlets for +Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI +troubleshooting. This topic also provides links to more information about WMI. ### ABOUT WMI -Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF). You can use WMI to manage both local and remote computers. For example, you can use WMI to do the following: - --- Start a process on a remote computer. - --- Restart a computer remotely. - --- Get a list of the applications that are installed on a local or remote computer. - --- Query the Windows event logs on a local or remote computer. +Windows Management Instrumentation (WMI) is the Microsoft implementation of +Web-Based Enterprise Management (WBEM), which is an industry initiative to +develop a standard technology for accessing management information in an +enterprise environment. WMI uses the Common Information Model (CIM) industry +standard to represent systems, applications, networks, devices, and other +managed components. CIM is developed and maintained by the Distributed +Management Task Force (DMTF). You can use WMI to manage both local and remote +computers. For example, you can use WMI to do the following: + +- Start a process on a remote computer. +- Restart a computer remotely. +- Get a list of the applications that are installed on a local or remote + computer. +- Query the Windows event logs on a local or remote computer. ### THE WMI CMDLETS FOR WINDOWS POWERSHELL -Windows PowerShell implements WMI functionality through a set of cmdlets that are available in Windows PowerShell by default. You can use these cmdlets to complete the end-to-end tasks necessary to manage local and remote computers. - -The following WMI cmdlets are included. +Windows PowerShell implements WMI functionality through a set of cmdlets that +are available in Windows PowerShell by default. You can use these cmdlets to +complete the end-to-end tasks necessary to manage local and remote computers. -``` -Cmdlet Description ------------------- ---------------------------------------------- -Get-WmiObject Gets instances of WMI classes or information - about the available classes. - -Invoke-WmiMethod Calls WMI methods. - -Register-WmiEvent Subscribes to a WMI event. - -Remove-WmiObject Deletes WMI classes and instances. - -Set-WmiInstance Creates or modifies instances of WMI classes. -``` - +The following WMI cmdlets are included. +|Cmdlet |Description | +|-----------------|----------------------------------------------| +|Get-WmiObject |Gets instances of WMI classes or information | +| |about the available classes. | +|Invoke-WmiMethod |Calls WMI methods. | +|Register-WmiEvent|Subscribes to a WMI event. | +|Remove-WmiObject |Deletes WMI classes and instances. | +|Set-WmiInstance |Creates or modifies instances of WMI classes. | ### SAMPLE COMMANDS The following command displays the BIOS information for the local computer. - -``` +```powershell C:\PS> get-wmiobject win32_bios | format-list * ``` +The following command displays information about the WinRM service for three +remote computers. -The following command displays information about the WinRM service for three remote computers. - - -``` -C:\PS> get-wmiobject -query "select * from win32_service where name='WinRM'" -computername server01, server01, server03 +```powershell +$wql = "select * from win32_service where name='WinRM'" +get-wmiobject -query $wql -computername server01, server01, server03 ``` - The following more complex command exits all instances of a program. - -``` -C:\PS> notepad.exe -C:\PS> $np = get-wmiobject -query "select * from win32_process where name='notepad.exe'" +```powershell +C:\PS> notepad.exe +C:\PS> $wql = "select * from win32_process where name='notepad.exe'" +C:\PS> $np = get-wmiobject -query $wql C:\PS> $np | remove-wmiobject ``` - - ### WMI-BASED REMOTING -While the ability to manage a local system through WMI is useful, it is the remoting capabilities that make WMI a powerful administrative tool. WMI uses Microsoft's Distributed Component Object Model (DCOM) to connect to and manage systems. You might have to configure some systems to allow DCOM connections. Firewall settings and locked-down DCOM permissions can block WMI's ability to remotely manage systems. +While the ability to manage a local system through WMI is useful, it is the +remoting capabilities that make WMI a powerful administrative tool. WMI uses +Microsoft's Distributed Component Object Model (DCOM) to connect to and manage +systems. You might have to configure some systems to allow DCOM connections. +Firewall settings and locked-down DCOM permissions can block WMI's ability to +remotely manage systems. ### WMI TYPE ACCELERATORS -Windows PowerShell includes WMI type accelerators. These WMI type accelerators (shortcuts) allow more direct access to a WMI objects than a non-type accelerator approach would allow. + +Windows PowerShell includes WMI type accelerators. These WMI type accelerators +(shortcuts) allow more direct access to a WMI objects than a non-type +accelerator approach would allow. The following type accelerators are supported with WMI: @@ -96,123 +100,116 @@ The following type accelerators are supported with WMI: [WMI] - A shortcut for getting a single instance of a class. -[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can take a string constructor to create a searcher that you can then do a GET() on. +[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can +take a string constructor to create a searcher that you can then do a GET() +on. For example: +```powershell +PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' +PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto +count __PATH name +----- ------ ---- +1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... +1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe +1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe +1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE +1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe +2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe ``` -PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' -PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto - -handlecount __PATH name ------------ ------ ---- -1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... -1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe -1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe -1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE -1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe -2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe -``` - -[WMICLASS] is a type accelerator for ManagementClass. This has a string constructor that takes a local or absolute WMI path to a WMI class and returns an object that is bound to that class. +[WMICLASS] is a type accelerator for ManagementClass. This has a string +constructor that takes a local or absolute WMI path to a WMI class and returns +an object that is bound to that class. For example: - -``` -PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" -PS> $c |fl * -Name : Win32_Process -__GENUS : 1 -__CLASS : Win32_Process -__SUPERCLASS : CIM_Process -__DYNASTY : CIM_ManagedSystemElement -__RELPATH : Win32_Process -__PROPERTY_COUNT : 45 -__DERIVATION : {CIM_Process, CIM_LogicalElement, CIM_ManagedSystemElement} -__SERVER : SERVER01 -__NAMESPACE : ROOT\cimv2 +```powershell +PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" +PS> $c |fl * +Name : Win32_Process +__GENUS : 1 +__CLASS : Win32_Process +__SUPERCLASS : CIM_Process +__DYNASTY : CIM_ManagedSystemElement +__RELPATH : Win32_Process +__PROPERTY_COUNT : 45 +__DERIVATION : {CIM_Process, CIM_LogicalElement, + CIM_ManagedSystemElement} +__SERVER : SERVER01 +__NAMESPACE : ROOT\cimv2 __PATH : \\SERVER01\ROOT\cimv2:Win32_Process ``` - -[WMI] is a type accelerator for ManagementObject. This has a string constructor that takes a local or absolute WMI path to a WMI instance and returns an object that is bound to that instance. +[WMI] is a type accelerator for ManagementObject. This has a string +constructor that takes a local or absolute WMI path to a WMI instance and +returns an object that is bound to that instance. For example: - -``` -PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' -PS> $p.Name +```powershell +PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' +PS> $p.Name OUTLOOK.EXE ``` - - ### WMI TROUBLESHOOTING -The following problems are the most common problems that might occur when you try to connect to a remote computer. -Problem 1: The remote computer is not online. - -If a computer is offline, you will not be able to connect to it by using WMI. You may receive the following error message: +The following problems are the most common problems that might occur when you +try to connect to a remote computer. +Problem 1: The remote computer is not online. -``` -"Remote server machine does not exist or is unavailable" -``` +If a computer is offline, you will not be able to connect to it by using WMI. +You may receive the following error message: + Remote server machine does not exist or is unavailable -If you receive this error message, verify that the computer is online. Try to ping the remote computer. +If you receive this error message, verify that the computer is online. Try to +ping the remote computer. Problem 2: You do not have local administrator rights on the remote computer. -To use WMI remotely, you must have local administrator rights on the remote computer. If you do not, access to that computer will be denied. +To use WMI remotely, you must have local administrator rights on the remote +computer. If you do not, access to that computer will be denied. To verify namespace security: -- a. Click Start, right-click My Computer, and then click Manage. - -- b. In Computer Management, expand Services and Applications, right-click WMI Control, and then click Properties. - -- c. In the WMI Control Properties dialog box, click the Security tab. +1. Click Start, right-click My Computer, and then click Manage. +2. In Computer Management, expand Services and Applications, right-click WMI + Control, and then click Properties. +3. In the WMI Control Properties dialog box, click the Security tab. Problem 3: A firewall is blocking access to the remote computer. -WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols to traverse the network. By default, many firewalls block DCOM and RPC traffic. If your firewall is blocking these protocols, your connection will fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is configured to automatically block all unsolicited network traffic, including DCOM and WMI. In its default configuration, Windows Firewall rejects an incoming WMI request, and you receive the following error message: - - -``` -"Remote server machine does not exist or is unavailable" -``` - +WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols +to traverse the network. By default, many firewalls block DCOM and RPC +traffic. If your firewall is blocking these protocols, your connection will +fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is +configured to automatically block all unsolicited network traffic, including +DCOM and WMI. In its default configuration, Windows Firewall rejects an +incoming WMI request, and you receive the following error message: + Remote server machine does not exist or is unavailable ### MORE INFORMATION ABOUT WMI -For more information about WMI, see the following topics in the MSDN (Microsoft Developer Network) library: +For more information about WMI, see the following topics in the MSDN +(Microsoft Developer Network) library: -``` -"About WMI: -http://go.microsoft.com/fwlink/?LinkId=142212 - -"WMI Troubleshooting" -http://go.microsoft.com/fwlink/?LinkId=142213 -``` - +About WMI: http://go.microsoft.com/fwlink/?LinkId=142212 -And, see "Secrets of Windows Management Instrumentation - Troubleshooting and Tips" in the Microsoft TechNet Script Center: +WMI Troubleshooting: http://go.microsoft.com/fwlink/?LinkId=142213 +And, see "Secrets of Windows Management Instrumentation - Troubleshooting and +Tips" in the Microsoft TechNet Script Center: -``` http://go.microsoft.com/fwlink/?LinkId=142214 -``` - ## SEE ALSO -Online version: http:\/\/go.microsoft.com\/fwlink\/?LinkId\=142219 Get-WmiObject diff --git a/reference/6/Microsoft.PowerShell.Core/About/About_Using.md b/reference/6/Microsoft.PowerShell.Core/About/About_Using.md index f834a0324955..4fbccbdc21cf 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/About_Using.md +++ b/reference/6/Microsoft.PowerShell.Core/About/About_Using.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,7 +7,6 @@ title: about_Using --- # About Using -## about_Using # SHORT DESCRIPTION @@ -15,47 +14,49 @@ Allows to indicate which namespaces are used in the session. # LONG DESCRIPTION - -The `using` statement allows to indicate which namespaces are used in the session. -Making easier to mention classes and members, as it requires less typing to mention them; -also, classes from modules can be referenced too. +The `using` statement allows to indicate which namespaces are used in the +session. Making easier to mention classes and members, as it requires less +typing to mention them; also, classes from modules can be referenced too. The `using` statement needs to be the first statement in the script. Syntax #1, to reference .Net Framework namespaces: + ``` using namespace <.Net-framework-namespace> ``` Syntax #2, to reference PowerShell modules: + ``` using module ``` -> **Note** The `using` statetement, for modules, is intended to surface the classes in the module. -> If the module isn't loaded, the `using` fails. +**Note**: The `using` statetement, for modules, is intended to surface the +classes in the module. If the module isn't loaded, the `using` fails. ## Example 1 The following script gets the cryptographic hash for the "Hello World" string. -Note how the `using namespace System.Text` and `using namespace System.IO` simplify -the references to `[UnicodeEncoding]` in *System.Text*; and, to `[Stream]` -and to `[MemoryStream]` in *System.IO*. - +Note how the `using namespace System.Text` and `using namespace System.IO` +simplify the references to `[UnicodeEncoding]` in *System.Text*; and, to +`[Stream]` and to `[MemoryStream]` in *System.IO*. ```powershell - using namespace System.Text - using namespace System.IO +using namespace System.Text +using namespace System.IO - [string]$string = "Hello World" - [string]$algorithm = "SHA256" ## Valid values are "SHA1", "SHA256", "SHA384", "SHA512", "MD5" +[string]$string = "Hello World" +## Valid values are "SHA1", "SHA256", "SHA384", "SHA512", "MD5" +[string]$algorithm = "SHA256" - [byte[]]$stringbytes = [UnicodeEncoding]::Unicode.GetBytes($string) +[byte[]]$stringbytes = [UnicodeEncoding]::Unicode.GetBytes($string) - [Stream]$memorystream = [MemoryStream]::new($stringbytes) - $hashfromstream = Get-FileHash -InputStream $memorystream -Algorithm $algorithm - $hashfromstream.Hash.ToString() +[Stream]$memorystream = [MemoryStream]::new($stringbytes) +$hashfromstream = Get-FileHash -InputStream $memorystream ` + -Algorithm $algorithm +$hashfromstream.Hash.ToString() ``` ## Example 2 @@ -77,4 +78,3 @@ $deck.Shuffle() [Card[]]$hand2 = $deck.Deal(5) [Card[]]$hand3 = $deck.Deal(5) ``` - diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Splatting.md b/reference/6/Microsoft.PowerShell.Core/About/about_Splatting.md index 0d9fbe39f89d..10b1d7bc00db 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Splatting.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Splatting.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -74,20 +74,24 @@ are included. Copy-Item -Path "test.txt" -Destination "test2.txt" -WhatIf ``` -The second example uses hash table splatting. The first command creates -a hash table of parameter-name and parameter-value pairs and stores it -in the $HashArguments variable. The second command uses the `$HashArguments` -variable in a command with splatting. The At symbol (`@HashArguments`) -replaces the dollar sign (`$HashArguments`) in the command. +The second example uses hash table splatting. The first command creates a hash +table of parameter-name and parameter-value pairs and stores it in the +\$HashArguments variable. The second command uses the `$HashArguments` variable +in a command with splatting. The At symbol (`@HashArguments`) replaces the +dollar sign (`$HashArguments`) in the command. To provide a value for the WhatIf switch parameter, use $True or $False. ```powershell -$HashArguments = @{ Path = "test.txt"; Destination = "test2.txt"; WhatIf = $true } +$HashArguments = @{ + Path = "test.txt" + Destination = "test2.txt" + WhatIf = $true +} Copy-Item @HashArguments ``` -*Note: In the first command, the At symbol (@) indicates a hash table, not +Note: In the first command, the At symbol (@) indicates a hash table, not a splatted value. The syntax for hash tables in Windows PowerShell is: @{\=\; \=\; …}* @@ -106,11 +110,12 @@ omitted. The parameter values appear in position order in the command. Copy-Item "test.txt" "test2.txt" -WhatIf ``` -The second example uses array splatting. The first command creates an array -of the parameter values and stores it in the `$ArrayArguments` variable. The +The second example uses array splatting. The first command creates an array of +the parameter values and stores it in the `$ArrayArguments` variable. The values are in position order in the array. The second command uses the `$ArrayArguments` variable in a command in splatting. The At symbol -(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the command. +(`@ArrayArguments`) replaces the dollar sign (`$ArrayArguments`) in the +command. ```powershell $ArrayArguments = "test.txt", "test2.txt" @@ -120,10 +125,10 @@ Copy-Item @ArrayArguments -WhatIf # EXAMPLES -This example shows how to re-use splatted values in different commands. -The commands in this example use the Write-Host cmdlet to write messages -to the host program console. It uses splatting to specify the foreground -and background colors. +This example shows how to re-use splatted values in different commands. The +commands in this example use the Write-Host cmdlet to write messages to the +host program console. It uses splatting to specify the foreground and +background colors. To change the colors of all commands, just change the value of the `$Colors` variable. @@ -143,7 +148,8 @@ Write-Host command. To use the `$Colors variable`, replace the dollar sign #Write a message with the colors in $Colors Write-Host "This is a test." @Colors -#Write second message with same colors. The position of splatted hash table does not matter. +#Write second message with same colors. The position of splatted +#hash table does not matter. Write-Host @Colors "This is another test." ``` @@ -193,22 +199,19 @@ Test2 -a 1 -b 2 -c 3 # SPLATTING COMMAND PARAMETERS -You can use splatting to represent the parameters of -a command. This technique is useful when you are creating -a proxy function, that is, a function that calls another -command. This feature is introduced in Windows PowerShell 3.0. +You can use splatting to represent the parameters of a command. This technique +is useful when you are creating a proxy function, that is, a function that +calls another command. This feature is introduced in Windows PowerShell 3.0. -To splat the parameters of a command, use `@Args` to represent -the command parameters. This technique is easier than -enumerating command parameters and it works without revision -even if the parameters of the called command change. +To splat the parameters of a command, use `@Args` to represent the command +parameters. This technique is easier than enumerating command parameters and +it works without revision even if the parameters of the called command change. The feature uses the `$Args` automatic variable, which contains all unassigned parameter values. -For example, the following function calls the Get-Process -cmdlet. In this function, `@Args` represents all of the parameters -of the Get-Process cmdlet. +For example, the following function calls the Get-Process cmdlet. In this +function, `@Args` represents all of the parameters of the Get-Process cmdlet. ```powershell function Get-MyProcess { Get-Process @Args } @@ -223,20 +226,18 @@ Get-MyProcess -Name PowerShell Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- -463 46 225484 237196 719 15.86 3228 powershell + 463 46 225484 237196 719 15.86 3228 powershell Get-MyProcess -Name PowerShell_Ise -FileVersionInfo ProductVersion FileVersion FileName -------------- ----------- -------- -6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe +6.2.9200.16384 6.2.9200.1638... C:\Windows\system32\WindowsPowerShell\... ``` -You can use `@Args` in a function that has explicitly -declared parameters. You can use it more than once in -a function, but all parameters that you enter are passed -to all instances of `@Args`, as shown in the following -example. +You can use `@Args` in a function that has explicitly declared parameters. You +can use it more than once in a function, but all parameters that you enter are +passed to all instances of `@Args`, as shown in the following example. ```powershell function Get-MyCommand @@ -252,9 +253,9 @@ Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 408 28 75568 83176 620 1.33 1692 powershell -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Extension : .exe -Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Definition : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.e Visibility : Public OutputType : {System.String} Name : powershell.exe @@ -265,10 +266,11 @@ RemotingCapability : PowerShell Parameters : ParameterSets : HelpUri : -FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell + \v1.0\powershell.exe InternalName: POWERSHELL OriginalFilename: PowerShell.EXE.MUI - FileVersion: 10.0.14393.0 (rs1_release.160715-1616) + FileVersion: 10.0.14393.0 (rs1_release.160715-1616 FileDescription: Windows PowerShell Product: Microsoft® Windows® Operating System ProductVersion: 10.0.14393.0 @@ -289,4 +291,3 @@ FileVersionInfo : File: C:\Windows\System32\WindowsPowerShell\v1. [about_Hash_Tables](about_Hash_Tables.md) [about_Parameters](about_Parameters.md) - diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Split.md b/reference/6/Microsoft.PowerShell.Core/About/about_Split.md index 9154bed7ea49..98b97dd2dab7 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -19,22 +19,21 @@ The Split operator splits one or more strings into substrings. You can change the following elements of the Split operation: * Delimiter. The default is whitespace, but you can specify characters, -strings, patterns, or script blocks that specify the delimiter. The Split -operator in Windows PowerShell uses a regular expression in the delimiter, -rather than a simple character. + strings, patterns, or script blocks that specify the delimiter. The Split + operator in Windows PowerShell uses a regular expression in the delimiter, + rather than a simple character. * Maximum number of substrings. The default is to return all substrings. If -you specify a number less than the number of substrings, the remaining -substrings are concatenated in the last substring. + you specify a number less than the number of substrings, the remaining + substrings are concatenated in the last substring. * Options that specify the conditions under which the delimiter is matched, -such as SimpleMatch and Multiline. + such as SimpleMatch and Multiline. ## SYNTAX The following diagram shows the syntax for the -split operator. -The parameter names do not appear in the command. Include only the -parameter values. The values must appear in the order specified in the -syntax diagram. +The parameter names do not appear in the command. Include only the parameter +values. The values must appear in the order specified in the syntax diagram. ```powershell -Split @@ -45,17 +44,17 @@ syntax diagram. ``` You can substitute `-iSplit` or `-cSplit` for `-split` in any binary Split -statement (a Split statement that includes a delimiter or script block). -The `-iSplit` and `-split` operators are case-insensitive. The `-cSplit` -operator is case-sensitive, meaning that case is considered when the -delimiter rules are applied. +statement (a Split statement that includes a delimiter or script block). The +`-iSplit` and `-split` operators are case-insensitive. The `-cSplit` operator +is case-sensitive, meaning that case is considered when the delimiter rules +are applied. ## PARAMETERS ### \ -Specifies one or more strings to be split. If you submit multiple -strings, all the strings are split using the same delimiter rules. +Specifies one or more strings to be split. If you submit multiple strings, all +the strings are split using the same delimiter rules. Example: @@ -69,10 +68,10 @@ green ### \ -The characters that identify the end of a substring. The default delimiter -is whitespace, including spaces and non-printable characters, such as -newline (\`n) and tab (\`t). When the strings are split, the delimiter is -omitted from all the substrings. Example: +The characters that identify the end of a substring. The default delimiter is +whitespace, including spaces and non-printable characters, such as newline +(\`n) and tab (\`t). When the strings are split, the delimiter is omitted from +all the substrings. Example: ```powershell "Lastname:FirstName:Address" -split ":" @@ -81,13 +80,13 @@ FirstName Address ``` -By default, the delimiter is omitted from the results. To preserve all or -part of the delimiter, enclose in parentheses the part that you want to -preserve. If the \ parameter is added, this takes -precedence when your command splits up the collection. If you opt to -include a delimiter as part of the output, the command returns the -delimiter as part of the output; however, splitting the string to return -the delimiter as part of output does not count as a split. +By default, the delimiter is omitted from the results. To preserve all or part +of the delimiter, enclose in parentheses the part that you want to preserve. +If the \ parameter is added, this takes precedence when your +command splits up the collection. If you opt to include a delimiter as part of +the output, the command returns the delimiter as part of the output; however, +splitting the string to return the delimiter as part of output does not count +as a split. Examples: @@ -124,17 +123,16 @@ Strawberry-Blueberry ### \ -Specifies the maximum number of times that a string is split. The default -is all the substrings split by the delimiter. If there are more substrings, -they are concatenated to the final substring. If there are fewer -substrings, all the substrings are returned. A value of 0 and negative -values return all the substrings. +Specifies the maximum number of times that a string is split. The default is +all the substrings split by the delimiter. If there are more substrings, they +are concatenated to the final substring. If there are fewer substrings, all +the substrings are returned. A value of 0 and negative values return all the +substrings. Max-substrings does not specify the maximum number of objects that are -returned; its value equals the maximum number of times that a string is -split. If you submit more than one string (an array of strings) to the -Split operator , the Max-substrings limit is applied to each string -separately. +returned; its value equals the maximum number of times that a string is split. +If you submit more than one string (an array of strings) to the Split operator +, the Max-substrings limit is applied to each string separately. Example: @@ -150,9 +148,8 @@ Jupiter,Saturn,Uranus,Neptune ### \ -An expression that specifies rules for applying the delimiter. The -expression must evaluate to $true or $false. Enclose the script block in -braces. +An expression that specifies rules for applying the delimiter. The expression +must evaluate to $true or $false. Enclose the script block in braces. Example: @@ -187,63 +184,62 @@ The syntax for the Options parameter is: The SimpleMatch options are: * **SimpleMatch**: Use simple string comparison when evaluating the -delimiter. Cannot be used with RegexMatch. + delimiter. Cannot be used with RegexMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. The RegexMatch options are: * **RegexMatch**: Use regular expression matching to evaluate the -delimiter. This is the default behavior. Cannot be used with -SimpleMatch. + delimiter. This is the default behavior. Cannot be used with + SimpleMatch. * **IgnoreCase**: Forces case-insensitive matching, even if the -cSplit -operator is specified. + operator is specified. * **CultureInvariant**: Ignores cultural differences in language -when evaluting the delimiter. Valid only with RegexMatch. + when evaluting the delimiter. Valid only with RegexMatch. * IgnorePatternWhitespace: Ignores unescaped whitespace and -comments marked with the number sign (#). Valid only with -RegexMatch. + comments marked with the number sign (#). Valid only with + RegexMatch. * **Multiline**: Multiline mode recognizes the start and end of lines -and strings. Valid only with RegexMatch. Singleline is the default. + and strings. Valid only with RegexMatch. Singleline is the default. * **Singleline**: Singleline mode recognizes only the start and end of -strings. Valid only with RegexMatch. Singleline is the default. + strings. Valid only with RegexMatch. Singleline is the default. * **ExplicitCapture**: Ignores non-named match groups so that only -explicit capture groups are returned in the result list. Valid -only with RegexMatch. + explicit capture groups are returned in the result list. Valid + only with RegexMatch. ## UNARY and BINARY SPLIT OPERATORS The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the -unary split operator, only the first string (before the first comma) is -split. +unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( --split ). Enclose all the strings in parentheses, or store the -strings in a variable, and then submit the variable to the split operator. +To split more than one string, use the binary split operator ( -split +). Enclose all the strings in parentheses, or store the strings in +a variable, and then submit the variable to the split operator. Consider the following example: ```powershell -PS C:\> -split "1 2", "a b" +PS > -split "1 2", "a b" 1 2 a b -PS C:\> "1 2", "a b" -split " " +PS > "1 2", "a b" -split " " 1 2 a b -PS C:\> -split ("1 2", "a b") +PS > -split ("1 2", "a b") 1 2 a b -PS C:\> $a = "1 2", "a b" -PS C:\> -split $a +PS > $a = "1 2", "a b" +PS > -split $a 1 2 a @@ -255,7 +251,7 @@ b The following statement splits the string at whitespace. ```powershell -PS C:\> -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" Windows PowerShell 2.0 @@ -268,7 +264,7 @@ remoting The following statement splits the string at any comma. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' Mercury Venus Earth @@ -282,17 +278,16 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune ``` -The following statement performs a case-sensitive split at the -letter "N". +The following statement performs a case-sensitive split at the letter "N". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -300,7 +295,7 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' M rcury,V nus, @@ -317,7 +312,8 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS C:\> "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` + -split '[er]', 6 M cu @@ -329,7 +325,7 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS C:\> "a,b,c,d,e,f,g,h" -split ",", 3 +PS > "a,b,c,d,e,f,g,h" -split ",", 3 a b c,d,e,f,g,h @@ -339,7 +335,7 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS C:\> "a,b,c,d", "e,f,g,h" -split ",", 3 +PS > "a,b,c,d", "e,f,g,h" -split ",", 3 a b c,d @@ -352,18 +348,18 @@ The following statement splits each line in the here-string at the first digit. It uses the Multiline option to recognize the beginning of each line and string. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as Multiline, only when the Max-substrings value -is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as Multiline, only when the Max-substrings value is +specified. ```powershell -PS C:\> $a = @' +PS > $a = @' 1The first line. 2The second line. 3The third of three lines. '@ -PS C:\> $a -split "^\d", 0, "multiline" +PS > $a -split "^\d", 0, "multiline" The first line. @@ -380,12 +376,12 @@ interpreted to match any character except for a newline character. As a result, the Split statement returns a blank line for every character except newline. -The 0 represents the "return all" value of the Max-substrings parameter. -You can use options, such as SimpleMatch, only when the Max-substrings -value is specified. +The 0 represents the "return all" value of the Max-substrings parameter. You +can use options, such as SimpleMatch, only when the Max-substrings value is +specified. ```powershell -PS C:\> "This.is.a.test" -split ".", 0, "simplematch" +PS > "This.is.a.test" -split ".", 0, "simplematch" This is @@ -393,13 +389,13 @@ a test ``` -The following statement splits the string at one of two delimiters, -depending on the value of a variable. +The following statement splits the string at one of two delimiters, depending +on the value of a variable. ```powershell -PS C:\> $i = 1 -PS C:\> $c = "LastName, FirstName; Address, City, State, Zip" -PS C:\> $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +PS > $i = 1 +PS > $c = "LastName, FirstName; Address, City, State, Zip" +PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} LastName, FirstName Address, City, State, Zip @@ -407,7 +403,7 @@ Address, City, State, Zip ## SEE ALSO -Split-Path +[Split-Path](../../Microsoft.PowerShell.Management/Split-Path.md) [about_Operators](about_Operators.md) diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/6/Microsoft.PowerShell.Core/About/about_Switch.md index 90658fd83ff1..1bfafbe78470 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -148,13 +148,25 @@ Default clause is permitted in each Switch statement. Switch has the following parameters: -|Parameter|Description| -|---|---| -| Wildcard | Indicates that the condition is a wildcard string. If you use Wildcard, Regex and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| Exact | Indicates that the match clause, if it is a string, must match exactly. If you use Exact, Regex and Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | -| CaseSensitive | Performs a case-sensitive match. If the match clause is not a string, this parameter is ignored. | -| File | Takes input from a file rather than a value statement. If multiple File parameters are included, only the last one is used. Each line of the file is read and evaluated by the Switch statement. | -| Regex | Performs regular expression matching of the value to the condition. If you use Regex, Wildcard and Exact are ignored. Also, if the match clause is not a string, this parameter is ignored. | +|Parameter |Description | +|-------------|-----------------------------------------------------------| +|Wildcard |Indicates that the condition is a wildcard string. If you | +| |you use Wildcard, Regex and Exact are ignored. Also, if | +| |the match clause is not a string, the parameter is ignored.| +|Exact |Indicates that the match clause, if it is a string, must | +| |match exactly. Regex and Wildcard and Exact are ignored. | +| |Also, if the match clause is not a string, this parameter | +| |is ignored. | +|CaseSensitive|Performs a case-sensitive match. If the match clause is not| +| |a string, this parameter is ignored. | +|File |Takes input from a file rather than a value statement. If | +| |multiple File parameters are included, only the last one is| +| |used. Each line of the file is read and evaluated by the | +| |Switch statement. | +|Regex |Performs regular expression matching of the value to the | +| |condition. Wildcard and Exact are ignored. Also, if the | +| |match clause is not a string, this parameter is ignored. | + ```powershell Example: diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Throw.md b/reference/6/Microsoft.PowerShell.Core/About/about_Throw.md index 2deea43ade1b..08fe2f6e5c7e 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Throw.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Throw.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -14,16 +14,16 @@ Describes the Throw keyword, which generates a terminating error. ## LONG DESCRIPTION -The Throw keyword causes a terminating error. You can use the Throw keyword -to stop the processing of a command, function, or script. +The Throw keyword causes a terminating error. You can use the Throw keyword to +stop the processing of a command, function, or script. For example, you can use the Throw keyword in the script block of an If statement to respond to a condition or in the Catch block of a -Try-Catch-Finally statement. You can also use the Throw keyword in a -parameter declaration to make a function parameter mandatory. +Try-Catch-Finally statement. You can also use the Throw keyword in a parameter +declaration to make a function parameter mandatory. -The Throw keyword can throw any object, such as a user message string or -the object that caused the error. +The Throw keyword can throw any object, such as a user message string or the +object that caused the error. ## SYNTAX @@ -33,8 +33,8 @@ The syntax of the Throw keyword is as follows: throw [] ``` -The expression in the Throw syntax is optional. When the Throw statement -does not appear in a Catch block, and it does not include an expression, it +The expression in the Throw syntax is optional. When the Throw statement does +not appear in a Catch block, and it does not include an expression, it generates a ScriptHalted error. ```powershell @@ -47,13 +47,14 @@ At line:1 char:6 + FullyQualifiedErrorId : ScriptHalted ``` -If the Throw keyword is used in a Catch block without an expression, it -throws the current RuntimeException again. For more information, see +If the Throw keyword is used in a Catch block without an expression, it throws +the current RuntimeException again. For more information, see about_Try_Catch_Finally. ## THROWING A STRING -The optional expression in a Throw statement can be a string, as shown in -the following example: + +The optional expression in a Throw statement can be a string, as shown in the +following example: ```powershell C:\PS> throw "This is an error." @@ -61,7 +62,8 @@ C:\PS> throw "This is an error." This is an error. At line:1 char:6 + throw <<<< "This is an error." -+ CategoryInfo : OperationStopped: (This is an error.:String) [], RuntimeException ++ CategoryInfo : OperationStopped: (This is an error.:String) [], R +untimeException + FullyQualifiedErrorId : This is an error. ``` @@ -76,7 +78,8 @@ C:\PS> throw (get-process PowerShell) System.Diagnostics.Process (PowerShell) At line:1 char:6 + throw <<<< (get-process PowerShell) -+ CategoryInfo : OperationStopped: (System.Diagnostics.Process (PowerShell):Process) [], ++ CategoryInfo : OperationStopped: (System.Diagnostics.Process (Pow +erShell):Process) [], RuntimeException + FullyQualifiedErrorId : System.Diagnostics.Process (PowerShell) ``` @@ -105,15 +108,16 @@ One of the identified items was in an invalid format. At line:1 char:6 + throw <<<< $formatError + CategoryInfo : OperationStopped: (:) [], FormatException -+ FullyQualifiedErrorId : One of the identified items was in an invalid format. ++ FullyQualifiedErrorId : One of the identified items was in an invalid +format. ``` ## RESULTING ERROR -The Throw keyword can generate an ErrorRecord object. The Exception -property of the ErrorRecord object contains a RuntimeException object. The -remainder of the ErrorRecord object and the RuntimeException object vary -with the object that the Throw keyword throws. +The Throw keyword can generate an ErrorRecord object. The Exception property +of the ErrorRecord object contains a RuntimeException object. The remainder of +the ErrorRecord object and the RuntimeException object vary with the object +that the Throw keyword throws. The RunTimeException object is wrapped in an ErrorRecord object, and the ErrorRecord object is automatically saved in the $Error automatic variable. @@ -139,7 +143,9 @@ optional. function Get-XMLFiles { param ($path = $(throw "The Path parameter is required.")) - dir -path $path\*.xml -recurse | sort lastwritetime | ft lastwritetime, attributes, name -auto + dir -path $path\*.xml -recurse | + sort lastwritetime | + ft lastwritetime, attributes, name -auto } ``` @@ -154,4 +160,3 @@ function Get-XMLFiles [about_Trap](about_Trap.md) [about_Try_Catch_Finally](about_Try_Catch_Finally.md) - diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Trap.md b/reference/6/Microsoft.PowerShell.Core/About/about_Trap.md index 338030fa058b..bc042324bc4b 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Trap.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Trap.md @@ -130,7 +130,9 @@ statement that specifies the CommandNotFoundException type. ```powershell trap {"Other terminating error trapped" } -trap [System.Management.Automation.CommandNotFoundException] {"Command error trapped"} +trap [System.Management.Automation.CommandNotFoundException] { + "Command error trapped" +} nonsenseString ``` diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md b/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md index a94e962d87b3..531eb8a2f9da 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Type_Operators.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-091 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -26,11 +26,16 @@ fails, it returns nothing. It does not return an error. The following table lists the type operators in Windows PowerShell. -|Operator|Description|Example| -|---|---|---| -|`-is`|Returns TRUE when the input is an instance of the specified.NET Framework type.|`C:\PS> (get-date) -is [DateTime]`
`True`| -|`-isNot`|Returns TRUE when the input is not an instance of the specified.NET Framework type.|`C:\PS> (get-date) -isNot [DateTime]`
`False`| -|`-as`|Converts the input to the specified.NET Framework type.|`C:\PS> 12/31/07 -as [DateTime]`
`Monday, December 31, 2007 12:00:00 AM`| +|Operator|Description |Example | +|--------|---------------------------|---------------------------------| +|`-is` |Returns TRUE when the input|`(get-date) -is [DateTime]` | +| |is an instance of the |`True` | +| |specified .NET type. | | +|`-isNot`|Returns TRUE when the input|`(get-date) -isNot [DateTime]` | +| |not an instance of the |`False` | +| |specified.NET type. | | +|`-as` |Converts the input to the |`"5/7/07" -as [DateTime]` | +| |specified .NET type. |`Monday, May 7, 2007 12:00:00 AM`| The syntax of the type operators is as follows: @@ -64,7 +69,7 @@ property of this method. For example, the following statement gets the type of the return value of a Get-Culture command: ```powershell -C:\PS> (get-culture).gettype().fullname +PS> (get-culture).gettype().fullname System.Globalization.CultureInfo ``` @@ -72,25 +77,25 @@ System.Globalization.CultureInfo The following examples show some uses of the Type operators: ```powershell -C:\PS> 32 -is [Float] +PS> 32 -is [Float] False -C:\PS> 32 -is "int" +PS> 32 -is "int" True -C:\PS> (get-date) -is [DateTime] +PS> (get-date) -is [DateTime] True -C:\PS> "12/31/2007" -is [DateTime] +PS> "12/31/2007" -is [DateTime] False -C:\PS> "12/31/2007" -is [String] +PS> "12/31/2007" -is [String] True -C:\PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] +PS> (get-process PowerShell)[0] -is [System.Diagnostics.Process] True -C:\PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] +PS> (get-command get-member) -is [System.Management.Automation.CmdletInfo] True ``` @@ -103,53 +108,55 @@ return System.Globalization.CultureInfo objects, a collection of these objects is a System.Object array. ```powershell -C:\PS> (get-culture) -is [System.Globalization.CultureInfo] +PS> (get-culture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-uiculture) -is [System.Globalization.CultureInfo] True -C:\PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] +PS> (get-culture), (get-uiculture) -is [System.Globalization.CultureInfo] False -C:\PS> (get-culture), (get-uiculture) -is [Array] +PS> (get-culture), (get-uiculture) -is [Array] True -C:\PS> (get-culture), (get-uiculture) | foreach {$_ -is [System.Globalization.CultureInfo]) +PS> (get-culture), (get-uiculture) | foreach { + $_ -is [System.Globalization.CultureInfo]) +} True True -C:\PS> (get-culture), (get-uiculture) -is [Object] +PS> (get-culture), (get-uiculture) -is [Object] True ``` The following examples show how to use the -as operator. ```powershell -C:\PS> "12/31/07" -is [DateTime] +PS> "12/31/07" -is [DateTime] False -C:\PS> "12/31/07" -as [DateTime] +PS> "12/31/07" -as [DateTime] Monday, December 31, 2007 12:00:00 AM -C:\PS> $date = "12/31/07" -as [DateTime] +PS> $date = "12/31/07" -as [DateTime] C:\PS>$a -is [DateTime] True -C:\PS> 1031 -as [System.Globalization.CultureInfo] +PS> 1031 -as [System.Globalization.CultureInfo] -LCID Name DisplayName ----- ---- ----------- -1031 de-DE German (Germany) +LCID Name DisplayName +---- ---- ----------- +1031 de-DE German (Germany) ``` The following example shows that when the -as operator cannot convert the input object to the .NET Framework type, it returns nothing. ```powershell -C:\PS> 1031 -as [System.Diagnostic.Process] -C:\PS> +PS> 1031 -as [System.Diagnostic.Process] +PS> ``` ## SEE ALSO diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md b/reference/6/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md index 96d2292ea00c..3888516c6096 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Types.ps1xml.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,9 +7,6 @@ title: about_Types.ps1xml --- # About Types.ps1xml -## about_Types.ps1xml - - # SHORT DESCRIPTION @@ -27,16 +24,16 @@ extended type data to a Windows PowerShell session. extended data for types in the current session. This topic describes Types.ps1xml files. For more information about using the -`Update-TypeData` cmdlet to add dynamic extended type data to the current session -see [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). +`Update-TypeData` cmdlet to add dynamic extended type data to the current +session see +[Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md). ## About Extended Type Data -Extended type data defines additional properties and methods ("members") -of object types in Windows PowerShell. You can extend any type that is -supported by Windows PowerShell and use the added properties and methods -in the same way that you use the properties that are defined on the object -types. +Extended type data defines additional properties and methods ("members") of +object types in Windows PowerShell. You can extend any type that is supported +by Windows PowerShell and use the added properties and methods in the same way +that you use the properties that are defined on the object types. For example, Windows PowerShell adds a `DateTime` property to all `System.DateTime` objects, such as the ones that the `Get-Date` cmdlet @@ -47,27 +44,27 @@ PS C:> (Get-Date).DateTime Sunday, January 29, 2012 9:43:57 AM ``` -You won't find the `DateTime` property in the description of the [`System.DateTime` -structure](http://msdn.microsoft.com/library/system.datetime.aspx), -because Windows PowerShell adds the property and it is visible only in -Windows PowerShell. +You won't find the `DateTime` property in the description of the +[`System.DateTime` structure](http://msdn.microsoft.com/library/system.datetime.aspx), +because Windows PowerShell adds the property and it is visible only in Windows +PowerShell. -To add the `DateTime` property to all Windows PowerShell sessions, Windows PowerShell -defines the `DateTime` property in the Types.ps1xml file in the Windows PowerShell -installation directory (`$PSHOME`). +To add the `DateTime` property to all Windows PowerShell sessions, Windows +PowerShell defines the `DateTime` property in the Types.ps1xml file in the +Windows PowerShell installation directory (`$PSHOME`). ## Adding Extended Type Data to Windows PowerShell. There are three sources of extended type data in Windows PowerShell sessions. - The Types.ps1xml files in the Windows PowerShell installation directory -are loaded automatically into every Windows PowerShell session. + are loaded automatically into every Windows PowerShell session. - The Types.ps1xml files that modules export are loaded when the module -is imported into the current session. + is imported into the current session. - Extended type data that is defined by using the `Update-TypeData` cmdlet -is added only to the current session. It is not saved in a file. + is added only to the current session. It is not saved in a file. In the session, the extended type data from the three sources is applied to objects in the same way and is available on all objects of the specified @@ -78,11 +75,10 @@ types. The following TypeData cmdlets are included in the Microsoft.PowerShell.Utility module in Windows PowerShell 3.0 and later versions of Windows PowerShell. -| | | -| --------------- | --------------------------------------------------------------- | -| Get-TypeData | Gets extended type data in the current session. | -| Update-TypeData | Reloads Types.ps1xml files. Adds extended type data to the current session. | -| Remove-TypeData | Removes extended type data from the current session. +- `Get-TypeData`: Gets extended type data in the current session. +- `Update-TypeData`: Reloads Types.ps1xml files. Adds extended type data to the + current session. +- `Remove-TypeData`: Removes extended type data from the current session. For more information about these cmdlets, see the help topic for each cmdlet. @@ -118,8 +114,8 @@ value. The following XML adds the Count property to the `System.Array` type. ``` -To get the new `AliasProperty`, use a `Get-Member` command on any array, as shown -in the following example. +To get the new `AliasProperty`, use a `Get-Member` command on any array, as +shown in the following example. ```powershell Get-Member -InputObject (1,2,3,4) @@ -127,15 +123,15 @@ Get-Member -InputObject (1,2,3,4) The command returns the following results. -```powershell -Name MemberType Definition ----- ---------- ---------- -Count AliasProperty Count = Length -Address Method System.Object& Address(Int32) -Clone Method System.Object Clone() -CopyTo Method System.Void CopyTo(Array array, Int32 index): -Equals Method System.Boolean Equals(Object obj) -Get Method System.Object Get(Int32) +```output +Name MemberType Definition +---- ---------- ---------- +Count AliasProperty Count = Length +Address Method System.Object& Address(Int32) +Clone Method System.Object Clone() +CopyTo Method System.Void CopyTo(Array array, Int32 index): +Equals Method System.Boolean Equals(Object obj) +Get Method System.Object Get(Int32) # ... ``` @@ -344,7 +340,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -369,7 +367,9 @@ FileSystem provider. Mode - Microsoft.PowerShell.Commands.FileSystemProvider + + Microsoft.PowerShell.Commands.FileSystemProvider + Mode @@ -510,21 +510,21 @@ methods of the `System.Management.ManagementDateTimeConverter` class. ```xml - System.Management.ManagementObject - - - ConvertToDateTime - - - - ConvertFromDateTime - - - + System.Management.ManagementObject + + + ConvertToDateTime + + + + ConvertFromDateTime + + + ``` @@ -547,7 +547,7 @@ property of the `GetVersionInfo` static method of VersionInfo - [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) + [System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName) @@ -585,8 +585,9 @@ use method syntax. ## Signing a Types.ps1xml File -To protect users of your Types.ps1xml file, you can sign the file using -a digital signature. For more information, see [about_Signing](about_Signing.md). +To protect users of your Types.ps1xml file, you can sign the file using a +digital signature. For more information, see +[about_Signing](about_Signing.md). # SEE ALSO @@ -603,4 +604,3 @@ a digital signature. For more information, see [about_Signing](about_Signing.md) [Remove-TypeData](../../Microsoft.PowerShell.Utility/Remove-TypeData.md) [Update-TypeData](../../Microsoft.PowerShell.Utility/Update-TypeData.md) - diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md b/reference/6/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md index 8f2a53213e37..08ee68185fcb 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_WMI_Cmdlets.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-01 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,86 +7,90 @@ title: about_WMI_Cmdlets --- # About WMI Cmdlets -## about_WMI_Cmdlets - ## SHORT DESCRIPTION -Provides background information about Windows Management Instrumentation (WMI) and Windows PowerShell. +Provides background information about Windows Management Instrumentation (WMI) +and Windows PowerShell. ## LONG DESCRIPTION -This topic provides information about WMI technology, the WMI cmdlets for Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI troubleshooting. This topic also provides links to more information about WMI. +This topic provides information about WMI technology, the WMI cmdlets for +Windows PowerShell, WMI-based remoting, WMI accelerators, and WMI +troubleshooting. This topic also provides links to more information about WMI. ### ABOUT WMI -Windows Management Instrumentation (WMI) is the Microsoft implementation of Web-Based Enterprise Management (WBEM), which is an industry initiative to develop a standard technology for accessing management information in an enterprise environment. WMI uses the Common Information Model (CIM) industry standard to represent systems, applications, networks, devices, and other managed components. CIM is developed and maintained by the Distributed Management Task Force (DMTF). You can use WMI to manage both local and remote computers. For example, you can use WMI to do the following: - --- Start a process on a remote computer. - --- Restart a computer remotely. - --- Get a list of the applications that are installed on a local or remote computer. - --- Query the Windows event logs on a local or remote computer. +Windows Management Instrumentation (WMI) is the Microsoft implementation of +Web-Based Enterprise Management (WBEM), which is an industry initiative to +develop a standard technology for accessing management information in an +enterprise environment. WMI uses the Common Information Model (CIM) industry +standard to represent systems, applications, networks, devices, and other +managed components. CIM is developed and maintained by the Distributed +Management Task Force (DMTF). You can use WMI to manage both local and remote +computers. For example, you can use WMI to do the following: + +- Start a process on a remote computer. +- Restart a computer remotely. +- Get a list of the applications that are installed on a local or remote + computer. +- Query the Windows event logs on a local or remote computer. ### THE WMI CMDLETS FOR WINDOWS POWERSHELL -Windows PowerShell implements WMI functionality through a set of cmdlets that are available in Windows PowerShell by default. You can use these cmdlets to complete the end-to-end tasks necessary to manage local and remote computers. - -The following WMI cmdlets are included. +Windows PowerShell implements WMI functionality through a set of cmdlets that +are available in Windows PowerShell by default. You can use these cmdlets to +complete the end-to-end tasks necessary to manage local and remote computers. -``` -Cmdlet Description ------------------- ---------------------------------------------- -Get-WmiObject Gets instances of WMI classes or information - about the available classes. - -Invoke-WmiMethod Calls WMI methods. - -Register-WmiEvent Subscribes to a WMI event. - -Remove-WmiObject Deletes WMI classes and instances. - -Set-WmiInstance Creates or modifies instances of WMI classes. -``` - +The following WMI cmdlets are included. +|Cmdlet |Description | +|-----------------|----------------------------------------------| +|Get-WmiObject |Gets instances of WMI classes or information | +| |about the available classes. | +|Invoke-WmiMethod |Calls WMI methods. | +|Register-WmiEvent|Subscribes to a WMI event. | +|Remove-WmiObject |Deletes WMI classes and instances. | +|Set-WmiInstance |Creates or modifies instances of WMI classes. | ### SAMPLE COMMANDS The following command displays the BIOS information for the local computer. - -``` +```powershell C:\PS> get-wmiobject win32_bios | format-list * ``` +The following command displays information about the WinRM service for three +remote computers. -The following command displays information about the WinRM service for three remote computers. - - -``` -C:\PS> get-wmiobject -query "select * from win32_service where name='WinRM'" -computername server01, server01, server03 +```powershell +$wql = "select * from win32_service where name='WinRM'" +get-wmiobject -query $wql -computername server01, server01, server03 ``` - The following more complex command exits all instances of a program. - -``` -C:\PS> notepad.exe -C:\PS> $np = get-wmiobject -query "select * from win32_process where name='notepad.exe'" +```powershell +C:\PS> notepad.exe +C:\PS> $wql = "select * from win32_process where name='notepad.exe'" +C:\PS> $np = get-wmiobject -query $wql C:\PS> $np | remove-wmiobject ``` - - ### WMI-BASED REMOTING -While the ability to manage a local system through WMI is useful, it is the remoting capabilities that make WMI a powerful administrative tool. WMI uses Microsoft's Distributed Component Object Model (DCOM) to connect to and manage systems. You might have to configure some systems to allow DCOM connections. Firewall settings and locked-down DCOM permissions can block WMI's ability to remotely manage systems. +While the ability to manage a local system through WMI is useful, it is the +remoting capabilities that make WMI a powerful administrative tool. WMI uses +Microsoft's Distributed Component Object Model (DCOM) to connect to and manage +systems. You might have to configure some systems to allow DCOM connections. +Firewall settings and locked-down DCOM permissions can block WMI's ability to +remotely manage systems. ### WMI TYPE ACCELERATORS -Windows PowerShell includes WMI type accelerators. These WMI type accelerators (shortcuts) allow more direct access to a WMI objects than a non-type accelerator approach would allow. + +Windows PowerShell includes WMI type accelerators. These WMI type accelerators +(shortcuts) allow more direct access to a WMI objects than a non-type +accelerator approach would allow. The following type accelerators are supported with WMI: @@ -96,123 +100,116 @@ The following type accelerators are supported with WMI: [WMI] - A shortcut for getting a single instance of a class. -[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can take a string constructor to create a searcher that you can then do a GET() on. +[WMISEARCHER] is a type accelerator for a ManagementObjectSearcher. It can +take a string constructor to create a searcher that you can then do a GET() +on. For example: +```powershell +PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' +PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto +count __PATH name +----- ------ ---- +1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... +1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe +1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe +1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE +1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe +2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe ``` -PS> $s = [WmiSearcher]'Select * from Win32_Process where Handlecount > 1000' -PS> $s.Get() |sort handlecount |ft handlecount,__path,name -auto - -handlecount __PATH name ------------ ------ ---- -1105 \\SERVER01\root\cimv2:Win32_Process.Handle="3724" PowerShell... -1132 \\SERVER01\root\cimv2:Win32_Process.Handle="1388" winlogon.exe -1495 \\SERVER01\root\cimv2:Win32_Process.Handle="2852" iexplore.exe -1699 \\SERVER01\root\cimv2:Win32_Process.Handle="1204" OUTLOOK.EXE -1719 \\SERVER01\root\cimv2:Win32_Process.Handle="1912" iexplore.exe -2579 \\SERVER01\root\cimv2:Win32_Process.Handle="1768" svchost.exe -``` - -[WMICLASS] is a type accelerator for ManagementClass. This has a string constructor that takes a local or absolute WMI path to a WMI class and returns an object that is bound to that class. +[WMICLASS] is a type accelerator for ManagementClass. This has a string +constructor that takes a local or absolute WMI path to a WMI class and returns +an object that is bound to that class. For example: - -``` -PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" -PS> $c |fl * -Name : Win32_Process -__GENUS : 1 -__CLASS : Win32_Process -__SUPERCLASS : CIM_Process -__DYNASTY : CIM_ManagedSystemElement -__RELPATH : Win32_Process -__PROPERTY_COUNT : 45 -__DERIVATION : {CIM_Process, CIM_LogicalElement, CIM_ManagedSystemElement} -__SERVER : SERVER01 -__NAMESPACE : ROOT\cimv2 +```powershell +PS> $c = [WMICLASS]"root\cimv2:WIn32_Process" +PS> $c |fl * +Name : Win32_Process +__GENUS : 1 +__CLASS : Win32_Process +__SUPERCLASS : CIM_Process +__DYNASTY : CIM_ManagedSystemElement +__RELPATH : Win32_Process +__PROPERTY_COUNT : 45 +__DERIVATION : {CIM_Process, CIM_LogicalElement, + CIM_ManagedSystemElement} +__SERVER : SERVER01 +__NAMESPACE : ROOT\cimv2 __PATH : \\SERVER01\ROOT\cimv2:Win32_Process ``` - -[WMI] is a type accelerator for ManagementObject. This has a string constructor that takes a local or absolute WMI path to a WMI instance and returns an object that is bound to that instance. +[WMI] is a type accelerator for ManagementObject. This has a string +constructor that takes a local or absolute WMI path to a WMI instance and +returns an object that is bound to that instance. For example: - -``` -PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' -PS> $p.Name +```powershell +PS> $p = [WMI]'\\SERVER01\root\cimv2:Win32_Process.Handle="1204"' +PS> $p.Name OUTLOOK.EXE ``` - - ### WMI TROUBLESHOOTING -The following problems are the most common problems that might occur when you try to connect to a remote computer. -Problem 1: The remote computer is not online. - -If a computer is offline, you will not be able to connect to it by using WMI. You may receive the following error message: +The following problems are the most common problems that might occur when you +try to connect to a remote computer. +Problem 1: The remote computer is not online. -``` -"Remote server machine does not exist or is unavailable" -``` +If a computer is offline, you will not be able to connect to it by using WMI. +You may receive the following error message: + Remote server machine does not exist or is unavailable -If you receive this error message, verify that the computer is online. Try to ping the remote computer. +If you receive this error message, verify that the computer is online. Try to +ping the remote computer. Problem 2: You do not have local administrator rights on the remote computer. -To use WMI remotely, you must have local administrator rights on the remote computer. If you do not, access to that computer will be denied. +To use WMI remotely, you must have local administrator rights on the remote +computer. If you do not, access to that computer will be denied. To verify namespace security: -- a. Click Start, right-click My Computer, and then click Manage. - -- b. In Computer Management, expand Services and Applications, right-click WMI Control, and then click Properties. - -- c. In the WMI Control Properties dialog box, click the Security tab. +1. Click Start, right-click My Computer, and then click Manage. +2. In Computer Management, expand Services and Applications, right-click WMI + Control, and then click Properties. +3. In the WMI Control Properties dialog box, click the Security tab. Problem 3: A firewall is blocking access to the remote computer. -WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols to traverse the network. By default, many firewalls block DCOM and RPC traffic. If your firewall is blocking these protocols, your connection will fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is configured to automatically block all unsolicited network traffic, including DCOM and WMI. In its default configuration, Windows Firewall rejects an incoming WMI request, and you receive the following error message: - - -``` -"Remote server machine does not exist or is unavailable" -``` - +WMI uses the DCOM (Distributed COM) and RPC (Remote Procedure Call) protocols +to traverse the network. By default, many firewalls block DCOM and RPC +traffic. If your firewall is blocking these protocols, your connection will +fail. For example, Windows Firewall in Microsoft Windows XP Service Pack 2 is +configured to automatically block all unsolicited network traffic, including +DCOM and WMI. In its default configuration, Windows Firewall rejects an +incoming WMI request, and you receive the following error message: + Remote server machine does not exist or is unavailable ### MORE INFORMATION ABOUT WMI -For more information about WMI, see the following topics in the MSDN (Microsoft Developer Network) library: +For more information about WMI, see the following topics in the MSDN +(Microsoft Developer Network) library: -``` -"About WMI: -http://go.microsoft.com/fwlink/?LinkId=142212 - -"WMI Troubleshooting" -http://go.microsoft.com/fwlink/?LinkId=142213 -``` - +About WMI: http://go.microsoft.com/fwlink/?LinkId=142212 -And, see "Secrets of Windows Management Instrumentation - Troubleshooting and Tips" in the Microsoft TechNet Script Center: +WMI Troubleshooting: http://go.microsoft.com/fwlink/?LinkId=142213 +And, see "Secrets of Windows Management Instrumentation - Troubleshooting and +Tips" in the Microsoft TechNet Script Center: -``` http://go.microsoft.com/fwlink/?LinkId=142214 -``` - ## SEE ALSO -Online version: http:\/\/go.microsoft.com\/fwlink\/?LinkId\=142219 Get-WmiObject diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Windows_RT.md b/reference/6/Microsoft.PowerShell.Core/About/about_Windows_RT.md deleted file mode 100644 index b58501e4a35e..000000000000 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Windows_RT.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -title: about_Windows_RT ---- - -# About Windows RT -## about_Windows_RT - - -## SHORT DESCRIPTION -Explains limitations of Windows PowerShell 4.0 on Windows RT 8.1. - - -## LONG DESCRIPTION -The Windows RT 8.1 operating system is installed on computers and devices (such as Microsoft Surface 2, on which it is the operating system that ships with the computer) that use Advanced RISC Machine (ARM) processors. - -Windows PowerShell 4.0 is included in Windows RT 8.1. All cmdlets, providers, and modules, and most scripts designed for Windows PowerShell 2.0 and later releases run on Windows RT 8.1 without changes. - -Because Windows RT 8.1 does not include all Windows features, some Windows PowerShell features work differently or do not work on Windows RT-based devices. The following list explains the differences. - --- Windows PowerShell ISE is not included in and cannot run on Windows RT 8.1. Windows PowerShell ISE requires Windows Presentation Foundation, which is not included in Windows RT 8.1. - --- Windows PowerShell remoting and the WinRM service are disabled by default. To enable remoting, run the Enable-PSRemoting cmdlet. Also, run the Set-Service cmdlet to set the startup type of the WinRM service to Automatic, or Automatic (Delayed Start). - -While remoting is disabled, you can use Windows PowerShell remoting to run commands on other computers, but other computers cannot run commands on the Windows RT device. Also, implicit remoting—that is, remoting that is built in to a cmdlet or script, and not explicitly requested with added parameters—does not work in Windows PowerShell running on Windows RT 8.1. - --- Domain-joined computing and Kerberos authentication are not supported on Windows RT 8.1. You cannot use Windows PowerShell to add or manage these features. - --- Microsoft .NET Framework classes that are not supported on Windows RT 8.1 are also not supported by Windows PowerShell on Windows RT 8.1. - --- Transactions are not enabled on Windows RT 8.1. Transaction cmdlets, such as Start-Transaction, and transaction parameters, such as UseTransaction, do not work properly. - --- All Windows PowerShell sessions on Windows RT 8.1 devices use the ConstrainedLanguage language mode. ConstrainedLanguage language mode is a companion to User Mode Code Integrity (UMCI). It permits all Windows cmdlets and Windows PowerShell language elements, but restricts types to ensure that users cannot use Windows PowerShell to circumvent or violate the UMCI protections. - -For more information about ConstrainedLanguage language mode, see about_Language_Modes. - -## SEE ALSO - -[about_Language_Modes](about_Language_Modes.md) - -[about_Remote](about_Remote.md) - -about_Workflows - -Windows PowerShell System Requirements: (http://technet.microsoft.com/library/hh857337.aspx) - -## KEYWORDS -about_ARM, about_PowerShell_on_ARM, about_PowerShell_on_Surface, about_Windows_RT_8.1 about_WindowsRT - From bbe8f07b2131e4d633c7365697b7e4b8514a7da6 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 4 Dec 2017 10:43:35 -0800 Subject: [PATCH 086/145] Fixed formatting of output per issue #808 --- .../Export-Csv.md | 122 +++++++------ .../Export-Csv.md | 128 ++++++++------ .../Export-Csv.md | 96 +++++----- .../Export-Csv.md | 97 ++++++----- .../Export-Csv.md | 164 +++++++++--------- 5 files changed, 322 insertions(+), 285 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/3.0/Microsoft.PowerShell.Utility/Export-Csv.md index 66d8cbcfc72f..9b41f2e80631 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Export-Csv.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-04 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -9,8 +9,10 @@ title: Export-Csv --- # Export-Csv + ## SYNOPSIS Converts objects into a series of comma-separated (CSV) strings and saves the strings in a CSV file. + ## SYNTAX ### Delimiter (Default) @@ -48,37 +50,35 @@ This command selects a few properties of the WmiPrvse process and exports them t ### Example 2: Export processes to a comma-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` -This command exports objects representing the processes on the computer to the Processes.csv file in the current directory. +This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. Because it does not specify a delimiter, a comma (`,`) is used to separate the fields in the file. ### Example 3: Export processes to a semicolon-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -Delimiter ";" -<# - -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... -Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... +__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... +Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... Process;powershell;257;151920640;38322176;37052416;7836;C:\WINDOWS\... -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-Delimiter` parameter to specify the semicolon (`;`). +It uses the **-Delimiter** parameter to specify the semicolon (`;`). As a result, the fields in the file are separated by semicolons. ### Example 4: Export using the list separator of the current culture @@ -87,23 +87,22 @@ Get-Process | Export-Csv -Path "processes.csv" -UseCulture ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the ListSeparator property of the current culture. +It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the **ListSeparator** property of the current culture. ### Example 5: Export processes without type information ```powershell Get-Process | Export-Csv -Path "processes.csv" -NoTypeInformation -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +```Output +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-NoTypeInformation` parameter to suppress the type information in the file. +It uses the **-NoTypeInformation** parameter to suppress the type information in the file. ### Example 6: Export and append script properties ```powershell @@ -116,7 +115,7 @@ The second command uses the `Select-Object` cmdlet to select the relevant proper The third command uses a pipeline operator (`|`) to send the script file information in the `$ScriptFiles` variable to the `Export-CSV` cmdlet. The command uses the `-Path` parameter to specify the output file and the `-Append` parameter to add the new script data to the end of the output file, instead of replacing the existing file contents. -These commands add information about new Windows PowerShell scripts to a script inventory file. +These commands add information about new PowerShell scripts to a script inventory file. The first command uses the `Get-ChildItem` cmdlet to do a recursive search in the `D:` drive for files with the `.ps1` file name extension. It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, which gets only files that were created after January 1, 2011, and then saves them in the `$ScriptFiles` variable. @@ -124,27 +123,31 @@ It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, w ### Example 7: Select properties to export ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: - -"DateTime","Day","DayOfWeek","DayOfYear""Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +Get-Content -Path "Date.csv" +``` -#> +```Output +"DateTime","Day","DayOfWeek","DayOfYear" +"Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +``` +```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: +Get-Content -Path "Date.csv" +``` +```Output "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" -"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo","9e210fe47d09416682b841769c78b8a3" -,,,,,"27c87ef9bbda4f709f6b4002fa4af63c",,,,,"4ec4f0187cb04f4cb6973460dfe252df",,,,,"cf522b78d86c486691226b40aa69e95c",,,,, - -#> +"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", +"9e210fe47d09416682b841769c78b8a3",,,,, +"27c87ef9bbda4f709f6b4002fa4af63c",,,,, +"4ec4f0187cb04f4cb6973460dfe252df",,,,, +"cf522b78d86c486691226b40aa69e95c",,,,, ``` The first command shows how to select properties of an object and export them to a CSV file. This command uses the `Get-Date` cmdlet to get the current date and time. It uses the `Select-Object` cmdlet to select the desired properties, and the `Export-CSV` cmdlet to export the object and its properties to the `Date.csv` file. The output shows the expected content in the `Date.csv` file. -The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. +The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. This example demonstrates one of most common problems that users encounter when using the `Export-CSV` cmdlet. It explains how to recognize and avoid this error. @@ -166,7 +169,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -199,11 +202,11 @@ To specify a semicolon (`;`), enclose it in quotation marks. ```yaml Type: Char Parameter Sets: Delimiter -Aliases: +Aliases: Required: False -Position: 2 -Default value: , (comma) +Position: 1 +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -226,22 +229,23 @@ The default value is ASCII. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, OEM Required: False Position: Named -Default value: ASCII +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Force -Overwrites the file specified in path without prompting. +Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -304,7 +308,8 @@ Accept wildcard characters: False ### -NoTypeInformation Indicates that this cmdlet omits the type information from the CSV file. -By default, the first line of the CSV file contains `#TYPE` followed by the fully-qualified name of the type of the object. +This is the default behavior beginning with PowerShell 6.0. +This parameter is included for backwards compatibility. ```yaml Type: SwitchParameter @@ -313,7 +318,7 @@ Aliases: NTI Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -325,30 +330,30 @@ This parameter is required. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False -Position: 1 -Default value: Current location +Position: 0 +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -UseCulture -Use the list separator for the current culture as the item delimiter. -The default is a comma (,). +Indicates that this cmdlet uses the list separator for the current culture as the item delimiter. +The default is a comma (`,`). This parameter is very useful in scripts that are being distributed to users worldwide. -To find the list separator for a culture, use the following command: (Get-Culture).TextInfo.ListSeparator. +To find the list separator for a culture, use the following command: `(Get-Culture).TextInfo.ListSeparator`. ```yaml Type: SwitchParameter Parameter Sets: UseCulture -Aliases: +Aliases: Required: False Position: Named -Default value: Comma +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -383,7 +388,8 @@ You can pipe any object with an Extended Type System (ETS) adapter to `Export-CS The CSV list is sent to the file designated in the Path parameter. ## NOTES -* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. +* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. + You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. In the CSV file, each object is represented by a comma-separated list of the property values of the object. The property values are converted to strings (by using the `ToString()` method of the object), so they are generally represented by the name of the property value. @@ -391,8 +397,8 @@ The property values are converted to strings (by using the `ToString()` method o The format of an exported file is as follows: - - The first line of the CSV file contains the string `#TYPE` followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. -To suppress this line, use the `-NoTypeInformation` parameter. + - The first line of the CSV file contains the string #TYPE followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. +This line will not be included by default. You must specify `-IncludeTypeInformation` to include type information. - The next line of the CSV file represents the column headers. It contains a comma-separated list of the names of all the properties of the first object. @@ -415,3 +421,5 @@ It contains a comma-separated list of the names of all the properties of the fir [Select-Object](Select-Object.md) +[Where-Object](../Microsoft.PowerShell.Core/Where-Object.md) + diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/4.0/Microsoft.PowerShell.Utility/Export-Csv.md index e1f7eb42bdf8..f4b027909e92 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Export-Csv.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-04 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -50,37 +50,35 @@ This command selects a few properties of the WmiPrvse process and exports them t ### Example 2: Export processes to a comma-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` -This command exports objects representing the processes on the computer to the Processes.csv file in the current directory. +This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. Because it does not specify a delimiter, a comma (`,`) is used to separate the fields in the file. ### Example 3: Export processes to a semicolon-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -Delimiter ";" -<# - -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... -Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... +__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... +Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... Process;powershell;257;151920640;38322176;37052416;7836;C:\WINDOWS\... -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-Delimiter` parameter to specify the semicolon (`;`). +It uses the **-Delimiter** parameter to specify the semicolon (`;`). As a result, the fields in the file are separated by semicolons. ### Example 4: Export using the list separator of the current culture @@ -89,23 +87,22 @@ Get-Process | Export-Csv -Path "processes.csv" -UseCulture ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the ListSeparator property of the current culture. +It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the **ListSeparator** property of the current culture. ### Example 5: Export processes without type information ```powershell Get-Process | Export-Csv -Path "processes.csv" -NoTypeInformation -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +```Output +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-NoTypeInformation` parameter to suppress the type information in the file. +It uses the **-NoTypeInformation** parameter to suppress the type information in the file. ### Example 6: Export and append script properties ```powershell @@ -118,7 +115,7 @@ The second command uses the `Select-Object` cmdlet to select the relevant proper The third command uses a pipeline operator (`|`) to send the script file information in the `$ScriptFiles` variable to the `Export-CSV` cmdlet. The command uses the `-Path` parameter to specify the output file and the `-Append` parameter to add the new script data to the end of the output file, instead of replacing the existing file contents. -These commands add information about new Windows PowerShell scripts to a script inventory file. +These commands add information about new PowerShell scripts to a script inventory file. The first command uses the `Get-ChildItem` cmdlet to do a recursive search in the `D:` drive for files with the `.ps1` file name extension. It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, which gets only files that were created after January 1, 2011, and then saves them in the `$ScriptFiles` variable. @@ -126,27 +123,31 @@ It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, w ### Example 7: Select properties to export ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: - -"DateTime","Day","DayOfWeek","DayOfYear""Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +Get-Content -Path "Date.csv" +``` -#> +```Output +"DateTime","Day","DayOfWeek","DayOfYear" +"Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +``` +```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: +Get-Content -Path "Date.csv" +``` +```Output "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" -"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo","9e210fe47d09416682b841769c78b8a3" -,,,,,"27c87ef9bbda4f709f6b4002fa4af63c",,,,,"4ec4f0187cb04f4cb6973460dfe252df",,,,,"cf522b78d86c486691226b40aa69e95c",,,,, - -#> +"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", +"9e210fe47d09416682b841769c78b8a3",,,,, +"27c87ef9bbda4f709f6b4002fa4af63c",,,,, +"4ec4f0187cb04f4cb6973460dfe252df",,,,, +"cf522b78d86c486691226b40aa69e95c",,,,, ``` The first command shows how to select properties of an object and export them to a CSV file. This command uses the `Get-Date` cmdlet to get the current date and time. It uses the `Select-Object` cmdlet to select the desired properties, and the `Export-CSV` cmdlet to export the object and its properties to the `Date.csv` file. The output shows the expected content in the `Date.csv` file. -The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. +The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. This example demonstrates one of most common problems that users encounter when using the `Export-CSV` cmdlet. It explains how to recognize and avoid this error. @@ -168,7 +169,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -201,39 +202,50 @@ To specify a semicolon (`;`), enclose it in quotation marks. ```yaml Type: Char Parameter Sets: Delimiter -Aliases: +Aliases: Required: False -Position: 2 -Default value: , (comma) +Position: 1 +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Encoding Specifies the encoding for the exported CSV file. -Valid values are Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, and OEM. -The default is ASCII. +The acceptable values for this parameter are: + +- Unicode +- UTF7 +- UTF8 +- ASCII +- UTF32 +- BigEndianUnicode +- Default +- OEM + +The default value is ASCII. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: +Accepted values: Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, OEM Required: False Position: Named -Default value: ASCII +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ### -Force -Overwrites the file specified in path without prompting. +Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -296,7 +308,8 @@ Accept wildcard characters: False ### -NoTypeInformation Indicates that this cmdlet omits the type information from the CSV file. -By default, the first line of the CSV file contains `#TYPE` followed by the fully-qualified name of the type of the object. +This is the default behavior beginning with PowerShell 6.0. +This parameter is included for backwards compatibility. ```yaml Type: SwitchParameter @@ -305,7 +318,7 @@ Aliases: NTI Required: False Position: Named -Default value: False +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -317,11 +330,11 @@ This parameter is required. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False -Position: 1 -Default value: Current location +Position: 0 +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -336,11 +349,11 @@ To find the list separator for a culture, use the following command: `(Get-Cultu ```yaml Type: SwitchParameter Parameter Sets: UseCulture -Aliases: +Aliases: Required: False Position: Named -Default value: Comma +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` @@ -375,7 +388,8 @@ You can pipe any object with an Extended Type System (ETS) adapter to `Export-CS The CSV list is sent to the file designated in the Path parameter. ## NOTES -* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. +* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. + You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. In the CSV file, each object is represented by a comma-separated list of the property values of the object. The property values are converted to strings (by using the `ToString()` method of the object), so they are generally represented by the name of the property value. @@ -383,8 +397,8 @@ The property values are converted to strings (by using the `ToString()` method o The format of an exported file is as follows: - - The first line of the CSV file contains the string `#TYPE` followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. -To suppress this line, use the `-NoTypeInformation` parameter. + - The first line of the CSV file contains the string #TYPE followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. +This line will not be included by default. You must specify `-IncludeTypeInformation` to include type information. - The next line of the CSV file represents the column headers. It contains a comma-separated list of the names of all the properties of the first object. @@ -407,3 +421,5 @@ It contains a comma-separated list of the names of all the properties of the fir [Select-Object](Select-Object.md) +[Where-Object](../Microsoft.PowerShell.Core/Where-Object.md) + diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/5.0/Microsoft.PowerShell.Utility/Export-Csv.md index ccc555d2720c..f628f366c865 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Export-Csv.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-04 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -50,37 +50,35 @@ This command selects a few properties of the WmiPrvse process and exports them t ### Example 2: Export processes to a comma-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` -This command exports objects representing the processes on the computer to the Processes.csv file in the current directory. +This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. Because it does not specify a delimiter, a comma (`,`) is used to separate the fields in the file. ### Example 3: Export processes to a semicolon-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -Delimiter ";" -<# - -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... -Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... +__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... +Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... Process;powershell;257;151920640;38322176;37052416;7836;C:\WINDOWS\... -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-Delimiter` parameter to specify the semicolon (`;`). +It uses the **-Delimiter** parameter to specify the semicolon (`;`). As a result, the fields in the file are separated by semicolons. ### Example 4: Export using the list separator of the current culture @@ -89,23 +87,22 @@ Get-Process | Export-Csv -Path "processes.csv" -UseCulture ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the ListSeparator property of the current culture. +It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the **ListSeparator** property of the current culture. ### Example 5: Export processes without type information ```powershell Get-Process | Export-Csv -Path "processes.csv" -NoTypeInformation -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +```Output +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-NoTypeInformation` parameter to suppress the type information in the file. +It uses the **-NoTypeInformation** parameter to suppress the type information in the file. ### Example 6: Export and append script properties ```powershell @@ -118,7 +115,7 @@ The second command uses the `Select-Object` cmdlet to select the relevant proper The third command uses a pipeline operator (`|`) to send the script file information in the `$ScriptFiles` variable to the `Export-CSV` cmdlet. The command uses the `-Path` parameter to specify the output file and the `-Append` parameter to add the new script data to the end of the output file, instead of replacing the existing file contents. -These commands add information about new Windows PowerShell scripts to a script inventory file. +These commands add information about new PowerShell scripts to a script inventory file. The first command uses the `Get-ChildItem` cmdlet to do a recursive search in the `D:` drive for files with the `.ps1` file name extension. It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, which gets only files that were created after January 1, 2011, and then saves them in the `$ScriptFiles` variable. @@ -126,27 +123,31 @@ It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, w ### Example 7: Select properties to export ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: - -"DateTime","Day","DayOfWeek","DayOfYear""Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +Get-Content -Path "Date.csv" +``` -#> +```Output +"DateTime","Day","DayOfWeek","DayOfYear" +"Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +``` +```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: +Get-Content -Path "Date.csv" +``` +```Output "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" -"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo","9e210fe47d09416682b841769c78b8a3" -,,,,,"27c87ef9bbda4f709f6b4002fa4af63c",,,,,"4ec4f0187cb04f4cb6973460dfe252df",,,,,"cf522b78d86c486691226b40aa69e95c",,,,, - -#> +"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", +"9e210fe47d09416682b841769c78b8a3",,,,, +"27c87ef9bbda4f709f6b4002fa4af63c",,,,, +"4ec4f0187cb04f4cb6973460dfe252df",,,,, +"cf522b78d86c486691226b40aa69e95c",,,,, ``` The first command shows how to select properties of an object and export them to a CSV file. This command uses the `Get-Date` cmdlet to get the current date and time. It uses the `Select-Object` cmdlet to select the desired properties, and the `Export-CSV` cmdlet to export the object and its properties to the `Date.csv` file. The output shows the expected content in the `Date.csv` file. -The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. +The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. This example demonstrates one of most common problems that users encounter when using the `Export-CSV` cmdlet. It explains how to recognize and avoid this error. @@ -168,7 +169,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -201,7 +202,7 @@ To specify a semicolon (`;`), enclose it in quotation marks. ```yaml Type: Char Parameter Sets: Delimiter -Aliases: +Aliases: Required: False Position: 1 @@ -228,7 +229,7 @@ The default value is ASCII. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, OEM Required: False @@ -244,7 +245,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -307,7 +308,8 @@ Accept wildcard characters: False ### -NoTypeInformation Indicates that this cmdlet omits the type information from the CSV file. -By default, the first line of the CSV file contains `#TYPE` followed by the fully-qualified name of the type of the object. +This is the default behavior beginning with PowerShell 6.0. +This parameter is included for backwards compatibility. ```yaml Type: SwitchParameter @@ -323,11 +325,12 @@ Accept wildcard characters: False ### -Path Specifies the path to the CSV output file. +This parameter is required. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -346,7 +349,7 @@ To find the list separator for a culture, use the following command: `(Get-Cultu ```yaml Type: SwitchParameter Parameter Sets: UseCulture -Aliases: +Aliases: Required: False Position: Named @@ -385,7 +388,8 @@ You can pipe any object with an Extended Type System (ETS) adapter to `Export-CS The CSV list is sent to the file designated in the Path parameter. ## NOTES -* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. +* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. + You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. In the CSV file, each object is represented by a comma-separated list of the property values of the object. The property values are converted to strings (by using the `ToString()` method of the object), so they are generally represented by the name of the property value. @@ -393,8 +397,8 @@ The property values are converted to strings (by using the `ToString()` method o The format of an exported file is as follows: - - The first line of the CSV file contains the string `#TYPE` followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. -To suppress this line, use the `-NoTypeInformation` parameter. + - The first line of the CSV file contains the string #TYPE followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. +This line will not be included by default. You must specify `-IncludeTypeInformation` to include type information. - The next line of the CSV file represents the column headers. It contains a comma-separated list of the names of all the properties of the first object. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md index fb8faa02bb42..f628f366c865 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-04 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -50,37 +50,35 @@ This command selects a few properties of the WmiPrvse process and exports them t ### Example 2: Export processes to a comma-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` -This command exports objects representing the processes on the computer to the Processes.csv file in the current directory. +This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. Because it does not specify a delimiter, a comma (`,`) is used to separate the fields in the file. ### Example 3: Export processes to a semicolon-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -Delimiter ";" -<# - -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... -Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... +__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... +Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... Process;powershell;257;151920640;38322176;37052416;7836;C:\WINDOWS\... -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-Delimiter` parameter to specify the semicolon (`;`). +It uses the **-Delimiter** parameter to specify the semicolon (`;`). As a result, the fields in the file are separated by semicolons. ### Example 4: Export using the list separator of the current culture @@ -89,23 +87,22 @@ Get-Process | Export-Csv -Path "processes.csv" -UseCulture ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the ListSeparator property of the current culture. +It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the **ListSeparator** property of the current culture. ### Example 5: Export processes without type information ```powershell Get-Process | Export-Csv -Path "processes.csv" -NoTypeInformation -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +```Output +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-NoTypeInformation` parameter to suppress the type information in the file. +It uses the **-NoTypeInformation** parameter to suppress the type information in the file. ### Example 6: Export and append script properties ```powershell @@ -118,7 +115,7 @@ The second command uses the `Select-Object` cmdlet to select the relevant proper The third command uses a pipeline operator (`|`) to send the script file information in the `$ScriptFiles` variable to the `Export-CSV` cmdlet. The command uses the `-Path` parameter to specify the output file and the `-Append` parameter to add the new script data to the end of the output file, instead of replacing the existing file contents. -These commands add information about new Windows PowerShell scripts to a script inventory file. +These commands add information about new PowerShell scripts to a script inventory file. The first command uses the `Get-ChildItem` cmdlet to do a recursive search in the `D:` drive for files with the `.ps1` file name extension. It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, which gets only files that were created after January 1, 2011, and then saves them in the `$ScriptFiles` variable. @@ -126,27 +123,31 @@ It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, w ### Example 7: Select properties to export ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: - -"DateTime","Day","DayOfWeek","DayOfYear""Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +Get-Content -Path "Date.csv" +``` -#> +```Output +"DateTime","Day","DayOfWeek","DayOfYear" +"Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +``` +```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation -<# -In Date.csv: +Get-Content -Path "Date.csv" +``` +```Output "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" -"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo","9e210fe47d09416682b841769c78b8a3" -,,,,,"27c87ef9bbda4f709f6b4002fa4af63c",,,,,"4ec4f0187cb04f4cb6973460dfe252df",,,,,"cf522b78d86c486691226b40aa69e95c",,,,, - -#> +"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", +"9e210fe47d09416682b841769c78b8a3",,,,, +"27c87ef9bbda4f709f6b4002fa4af63c",,,,, +"4ec4f0187cb04f4cb6973460dfe252df",,,,, +"cf522b78d86c486691226b40aa69e95c",,,,, ``` The first command shows how to select properties of an object and export them to a CSV file. This command uses the `Get-Date` cmdlet to get the current date and time. It uses the `Select-Object` cmdlet to select the desired properties, and the `Export-CSV` cmdlet to export the object and its properties to the `Date.csv` file. The output shows the expected content in the `Date.csv` file. -The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. +The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. This example demonstrates one of most common problems that users encounter when using the `Export-CSV` cmdlet. It explains how to recognize and avoid this error. @@ -168,7 +169,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -201,7 +202,7 @@ To specify a semicolon (`;`), enclose it in quotation marks. ```yaml Type: Char Parameter Sets: Delimiter -Aliases: +Aliases: Required: False Position: 1 @@ -228,7 +229,7 @@ The default value is ASCII. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, OEM Required: False @@ -244,7 +245,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -307,7 +308,8 @@ Accept wildcard characters: False ### -NoTypeInformation Indicates that this cmdlet omits the type information from the CSV file. -By default, the first line of the CSV file contains `#TYPE` followed by the fully-qualified name of the type of the object. +This is the default behavior beginning with PowerShell 6.0. +This parameter is included for backwards compatibility. ```yaml Type: SwitchParameter @@ -328,7 +330,7 @@ This parameter is required. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: 0 @@ -347,7 +349,7 @@ To find the list separator for a culture, use the following command: `(Get-Cultu ```yaml Type: SwitchParameter Parameter Sets: UseCulture -Aliases: +Aliases: Required: False Position: Named @@ -386,7 +388,8 @@ You can pipe any object with an Extended Type System (ETS) adapter to `Export-CS The CSV list is sent to the file designated in the Path parameter. ## NOTES -* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. +* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. + You can use `Export-CSV` to save objects in a CSV file and then use the Import-Csv cmdlet to create objects from the text in the CSV file. In the CSV file, each object is represented by a comma-separated list of the property values of the object. The property values are converted to strings (by using the `ToString()` method of the object), so they are generally represented by the name of the property value. @@ -394,8 +397,8 @@ The property values are converted to strings (by using the `ToString()` method o The format of an exported file is as follows: - - The first line of the CSV file contains the string `#TYPE` followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. -To suppress this line, use the `-NoTypeInformation` parameter. + - The first line of the CSV file contains the string #TYPE followed by the fully qualified name of the object, such as `#TYPE System.Diagnostics.Process`. +This line will not be included by default. You must specify `-IncludeTypeInformation` to include type information. - The next line of the CSV file represents the column headers. It contains a comma-separated list of the names of all the properties of the first object. @@ -418,3 +421,5 @@ It contains a comma-separated list of the names of all the properties of the fir [Select-Object](Select-Object.md) +[Where-Object](../Microsoft.PowerShell.Core/Where-Object.md) + diff --git a/reference/6/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/6/Microsoft.PowerShell.Utility/Export-Csv.md index 6ee5c4d96817..339d69c93d9d 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/6/Microsoft.PowerShell.Utility/Export-Csv.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-06-09 +ms.date: 2017-12-04 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -51,14 +51,13 @@ This command selects a few properties of the WmiPrvse process and exports them t ### Example 2: Export processes to a comma-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +```Output +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. @@ -67,18 +66,18 @@ Because it does not specify a delimiter, a comma (`,`) is used to separate the f ### Example 3: Export processes to a semicolon-delimited file ```powershell Get-Process | Export-Csv -Path "processes.csv" -Delimiter ";" -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` -__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... -Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... +```Output +__NounName;Name;Handles;VM;WS;PM;NPM;Path;Company;CPU;FileVersion;... +Process;powershell;626;201666560;76058624;61943808;11960;C:\WINDOWS... Process;powershell;257;151920640;38322176;37052416;7836;C:\WINDOWS\... -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-Delimiter` parameter to specify the semicolon `;`. +It uses the **-Delimiter** parameter to specify the semicolon (`;`). As a result, the fields in the file are separated by semicolons. ### Example 4: Export using the list separator of the current culture @@ -87,24 +86,23 @@ Get-Process | Export-Csv -Path "processes.csv" -UseCulture ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the `ListSeparator` property of the current culture. +It uses the `-UseCulture` parameter to direct `Export-CSV` to use the delimiter specified by the **ListSeparator** property of the current culture. ### Example 5: Export processes with type information ```powershell Get-Process | Export-Csv -Path "processes.csv" -IncludeTypeInformation -<# -In processes.csv: +Get-Content -Path "processes.csv" +``` +```Output #TYPE System.Diagnostics.Process -__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... -Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... +__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... +Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\... - -#> ``` This command exports objects representing the processes on the computer to the `processes.csv` file in the current directory. -It uses the `-IncludeTypeInformation` parameter to include the type information in the file. +It uses the **-NoTypeInformation** parameter to suppress the type information in the file. ### Example 6: Export and append script properties ```powershell @@ -124,28 +122,32 @@ It uses a pipeline operator to sends the results to the `Where-Object` cmdlet, w ### Example 7: Select properties to export ```powershell -Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -<# -In Date.csv: - -"DateTime","Day","DayOfWeek","DayOfYear""Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation +Get-Content -Path "Date.csv" +``` -#> +```Output +"DateTime","Day","DayOfWeek","DayOfYear" +"Tuesday, October 05, 2010 2:45:13 PM","5","Tuesday","278" +``` -Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -<# -In Date.csv: +```powershell +Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path Date.csv -NoTypeInformation +Get-Content -Path "Date.csv" +``` +```Output "ClassId2e4f51ef21dd47e99d3c952918aff9cd","pageHeaderEntry","pageFooterEntry","autosizeInfo","shapeInfo","groupingEntry" -"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo","9e210fe47d09416682b841769c78b8a3" -,,,,,"27c87ef9bbda4f709f6b4002fa4af63c",,,,,"4ec4f0187cb04f4cb6973460dfe252df",,,,,"cf522b78d86c486691226b40aa69e95c",,,,, - -#> +"033ecb2bc07a4d43b5ef94ed5a35d280",,,,"Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo", +"9e210fe47d09416682b841769c78b8a3",,,,, +"27c87ef9bbda4f709f6b4002fa4af63c",,,,, +"4ec4f0187cb04f4cb6973460dfe252df",,,,, +"cf522b78d86c486691226b40aa69e95c",,,,, ``` The first command shows how to select properties of an object and export them to a CSV file. This command uses the `Get-Date` cmdlet to get the current date and time. It uses the `Select-Object` cmdlet to select the desired properties, and the `Export-CSV` cmdlet to export the object and its properties to the `Date.csv` file. The output shows the expected content in the `Date.csv` file. -The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. +The second command shows that when you use the `Format-Table` cmdlet to format your data before exporting it, the output is not useful. This example demonstrates one of most common problems that users encounter when using the `Export-CSV` cmdlet. It explains how to recognize and avoid this error. @@ -167,7 +169,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -176,6 +178,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Delimiter Specifies a delimiter to separate the property values. The default is a comma (`,`). @@ -185,10 +202,10 @@ To specify a semicolon (`;`), enclose it in quotation marks. ```yaml Type: Char Parameter Sets: Delimiter -Aliases: +Aliases: Required: False -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -212,7 +229,7 @@ The default value is ASCII. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: Unicode, UTF7, UTF8, ASCII, UTF32, BigEndianUnicode, Default, OEM Required: False @@ -228,7 +245,7 @@ Forces the command to run without asking for user confirmation. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -264,7 +281,7 @@ You can also pipe objects to `Export-CSV`. ```yaml Type: PSObject Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: Named @@ -273,6 +290,25 @@ Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` +### -LiteralPath +Specifies the path to the CSV output file. +Unlike `-Path`, the value of the `-LiteralPath` parameter is used exactly as it is typed. +No characters are interpreted as wildcards. +If the path includes escape characters, enclose it in single quotation marks. +Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: PSPath + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -NoClobber Indicates that this cmdlet does not overwrite of an existing file. By default, if a file exists in the specified path, `Export-CSV` overwrites the file without warning. @@ -291,7 +327,8 @@ Accept wildcard characters: False ### -NoTypeInformation Indicates that this cmdlet omits the type information from the CSV file. -This behavior is default beginning with PowerShell 6.0. This parameter is included for backwards compatibility. +This is the default behavior beginning with PowerShell 6.0. +This parameter is included for backwards compatibility. ```yaml Type: SwitchParameter @@ -312,10 +349,10 @@ This parameter is required. ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -331,7 +368,7 @@ To find the list separator for a culture, use the following command: `(Get-Cultu ```yaml Type: SwitchParameter Parameter Sets: UseCulture -Aliases: +Aliases: Required: False Position: Named @@ -340,40 +377,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -LiteralPath -Specifies the path to the CSV output file. -Unlike `-Path`, the value of the `-LiteralPath` parameter is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: PSPath - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -WhatIf Shows what would happen if the cmdlet runs. The cmdlet is not run. @@ -404,7 +407,8 @@ You can pipe any object with an Extended Type System (ETS) adapter to `Export-CS The CSV list is sent to the file designated in the Path parameter. ## NOTES -* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. You can use `Export-CSV -IncludeTypeInformation` to save objects in a CSV file and then use the `Import-Csv` cmdlet to create objects from the text in the CSV file. +* The `Export-CSV` cmdlet converts the objects that you submit into a series of CSV variable-length strings and saves them in the specified text file. + You can use `Export-CSV -IncludeTypeInformation` to save objects in a CSV file and then use the `Import-Csv` cmdlet to create objects from the text in the CSV file. In the CSV file, each object is represented by a comma-separated list of the property values of the object. The property values are converted to strings (by using the `ToString()` method of the object), so they are generally represented by the name of the property value. From 6976ff46ac07cc417dcd8738df9a7e224c452d83 Mon Sep 17 00:00:00 2001 From: Pete DiSalvo Date: Wed, 6 Dec 2017 09:36:35 -0600 Subject: [PATCH 087/145] Fix typo in syntax description (#1931) --- reference/5.1/Microsoft.PowerShell.Core/About/about_For.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_For.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_For.md index c8343e7483e3..5c8f723bb156 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_For.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_For.md @@ -25,7 +25,7 @@ all the values in an array, consider using a Foreach statement. The following shows the For statement syntax. ```powershell -for (>init>; ; ) +for (; ; ) {} ``` From 6712f85223a7f9763f0edd93085fa5653464302b Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 7 Dec 2017 00:45:43 +0900 Subject: [PATCH 088/145] Fix parameter's position in ConvertTo-Xml.md (#1929) --- .../ConvertTo-Xml.md | 8 ++-- .../ConvertTo-Xml.md | 8 ++-- .../ConvertTo-Xml.md | 6 +-- .../ConvertTo-Xml.md | 6 +-- .../ConvertTo-Xml.md | 47 ++----------------- 5 files changed, 18 insertions(+), 57 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 4fe62732be0a..5816d9b32571 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -13,9 +13,9 @@ title: ConvertTo-Xml Creates an XML-based representation of an object. ## SYNTAX -``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +```powershell +ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION @@ -97,7 +97,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 7f95fdce91cc..6eca43ab5af2 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -15,9 +15,9 @@ Creates an XML-based representation of an object. ## SYNTAX -``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +```powershell +ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION @@ -102,7 +102,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: True diff --git a/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index f51e7a3c3c11..b47236614682 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -15,9 +15,9 @@ Creates an XML-based representation of an object. ## SYNTAX -``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +```powershell +ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 35d59e5290ec..aa71466398ef 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -15,9 +15,9 @@ Creates an XML-based representation of an object. ## SYNTAX -``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +```powershell +ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 4c23cb83c792..aa71466398ef 100644 --- a/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -15,9 +15,9 @@ Creates an XML-based representation of an object. ## SYNTAX -``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION @@ -95,45 +95,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction --- String: Returns a single string. - --- Stream: Returns an array of strings. - --- Document: Returns an XmlDocument object. - -The default is Document.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable --- String: Returns a single string. - --- Stream: Returns an array of strings. - --- Document: Returns an XmlDocument object. - -The default is Document.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the object to be converted. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -145,7 +106,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False From 6686c2345de19f4a1dcc20484e24e921836a6c1f Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 7 Dec 2017 00:46:16 +0900 Subject: [PATCH 089/145] Remove descriptions about ComputerName parameter in Get-Process.md v6.0 (#1928) --- .../Get-Process.md | 79 +++---------------- 1 file changed, 10 insertions(+), 69 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Process.md b/reference/6/Microsoft.PowerShell.Management/Get-Process.md index 89bb191d56a4..b74e7c647d37 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Process.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Process.md @@ -11,48 +11,44 @@ title: Get-Process # Get-Process ## SYNOPSIS -Gets the processes that are running on the local computer or a remote computer. +Gets the processes that are running on the local computer. ## SYNTAX ### Name (Default) ``` -Get-Process [[-Name] ] [-ComputerName ] [-Module] [-FileVersionInfo] - [-InformationAction ] [-InformationVariable ] [] +Get-Process [[-Name] ] [-Module] [-FileVersionInfo] + [] ``` ### NameWithUserName ``` -Get-Process [[-Name] ] [-IncludeUserName] [-InformationAction ] - [-InformationVariable ] [] +Get-Process [[-Name] ] [-IncludeUserName] [] ``` ### Id ``` -Get-Process -Id [-ComputerName ] [-Module] [-FileVersionInfo] - [-InformationAction ] [-InformationVariable ] [] +Get-Process -Id [-Module] [-FileVersionInfo] [] ``` ### IdWithUserName ``` -Get-Process -Id [-IncludeUserName] [-InformationAction ] - [-InformationVariable ] [] +Get-Process -Id [-IncludeUserName] [] ``` ### InputObject ``` -Get-Process -InputObject [-ComputerName ] [-Module] [-FileVersionInfo] - [-InformationAction ] [-InformationVariable ] [] +Get-Process -InputObject [-Module] [-FileVersionInfo] + [] ``` ### InputObjectWithUserName ``` -Get-Process -InputObject [-IncludeUserName] [-InformationAction ] - [-InformationVariable ] [] +Get-Process -InputObject [-IncludeUserName] [] ``` ## DESCRIPTION -The **Get-Process** cmdlet gets the processes on a local or remote computer. +The **Get-Process** cmdlet gets the processes on a local computer. Without parameters, this cmdlet gets all of the processes on the local computer. You can also specify a particular process by process name or process ID (PID) or pass a process object through the pipeline to this cmdlet. @@ -201,34 +197,11 @@ To view all of the properties, pipe the results of a **Get-Process** command to ## PARAMETERS -### -ComputerName -Specifies the computers for which this cmdlet gets active processes. -The default is the local computer. - -Type the NetBIOS name, an IP address, or a fully qualified domain name (FQDN) of one or more computers. -To specify the local computer, type the computer name, a dot (.), or localhost. - -This parameter does not rely on Windows PowerShell remoting. -You can use the *ComputerName* parameter of this cmdlet even if your computer is not configured to run remote commands. - -```yaml -Type: String[] -Parameter Sets: Name, Id, InputObject -Aliases: Cn - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -FileVersionInfo Indicates that this cmdlet gets the file version information for the program that runs in the process. On Windows Vista and later versions of Windows, you must open Windows PowerShell with the Run as administrator option to use this parameter on processes that you do not own. -You cannot use the *FileVersionInfo* and *ComputerName* parameters of the **Get-Process** cmdlet in the same command. To get file version information for a process on a remote computer, use the Invoke-Command cmdlet. Using this parameter is equivalent to getting the **MainModule.FileVersionInfo** property of each process object. @@ -279,37 +252,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more computers. To specify the local computer, type the computer name, a dot (.), or "localhost". - -This parameter does not rely on Windows PowerShell remoting. You can use the ComputerName parameter of Get-Process even if your computer is not configured to run remote commands.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -Type the NetBIOS name, an IP address, or a fully qualified domain name of one or more computers. To specify the local computer, type the computer name, a dot (.), or "localhost". - -This parameter does not rely on Windows PowerShell remoting. You can use the ComputerName parameter of Get-Process even if your computer is not configured to run remote commands.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies one or more process objects. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -331,7 +273,6 @@ Indicates that this cmdlet gets the modules that have been loaded by the process On Windows Vista and later versions of Windows, you must open Windows PowerShell with the Run as administrator option to use this parameter on processes that you do not own. -You cannot use the *Module* and *ComputerName* parameters of the **Get-Process** cmdlet in the same command. To get the modules that have been loaded by a process on a remote computer, use the **Invoke-Command** cmdlet. This parameter is equivalent to getting the Modules property of each process object. From a0b25021a24aab37a778ed29fb046e35a5cb5ec1 Mon Sep 17 00:00:00 2001 From: Yuriy Samorodov Date: Wed, 6 Dec 2017 19:54:53 +0300 Subject: [PATCH 090/145] Line 192 Single Quote Breaks Example (#1930) * Line 192 Single Quote Breaks Example * clarified the example for -Regex --- .../About/about_Switch.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md index 1bfafbe78470..cf7500531b40 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Switch.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-06 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -167,9 +167,9 @@ Switch has the following parameters: | |condition. Wildcard and Exact are ignored. Also, if the | | |match clause is not a string, this parameter is ignored. | +In this example, there is no matching case so there is no output. ```powershell -Example: PS> switch ("fourteen") { 1 {"It is one."; Break} @@ -179,7 +179,12 @@ Example: 3 {"Three again."; Break} "fo*" {"That's too many."} } +``` + +For the word "fourteen" to match a case you must use the **-Wildcard** or +**-Regex** parameter. +```powershell PS> switch -Regex ("fourteen") { 1 {"It is one."; Break} @@ -189,6 +194,11 @@ Example: 3 {"Three again."; Break} "fo*" {"That's too many."} } + ``` + + Result: + + ```Output That's too many. ``` From 00a26753530f2b1df8eb13c213db6ce8874408ea Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 8 Dec 2017 00:29:32 +0900 Subject: [PATCH 091/145] Update Example 2 in Get-Alias.md (ineffective Exclude) (#1935) `-Exclude Get-*` is ineffective because there are no aliases that begin with `Get-`. --- reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md | 7 ++++--- reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md | 6 +++--- reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md | 6 +++--- reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md | 6 +++--- reference/6/Microsoft.PowerShell.Utility/Get-Alias.md | 6 +++--- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md index 7758497fdfb1..d5cc83616c44 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md @@ -66,11 +66,12 @@ This command gets all aliases in the current session. The output shows the "\ -\> \" format that was introduced in Windows PowerShell 3.0. This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames. ### Example 2 +```powershell +Get-Alias -Name gp*, sp* -Exclude *ps ``` -PS C:\> Get-Alias -Name g*, s* -Exclude Get-* -``` -This command gets all aliases that begin with "g" or "s", except for aliases that begin with "get-". +This command gets all aliases that begin with gp or sp, except for aliases that end with ps. + ### Example 3 ``` PS C:\> Get-Alias -Definition Get-ChildItem diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md index 614f1c824b52..32666d375c1e 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md @@ -70,11 +70,11 @@ The output shows the "\ -\> \" format that was introduced i This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames. ### Example 2 -``` -PS C:\> Get-Alias -Name g*, s* -Exclude Get-* +```powershell +Get-Alias -Name gp*, sp* -Exclude *ps ``` -This command gets all aliases that begin with "g" or "s", except for aliases that begin with "get-". +This command gets all aliases that begin with gp or sp, except for aliases that end with ps. ### Example 3 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md index baa2ea6a5e33..b98e54e4a55d 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md @@ -70,11 +70,11 @@ The output shows the \ -\> \ format that was introduced in This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames. ### Example 2: Get aliases by name -``` -PS C:\> Get-Alias -Name g*, s* -Exclude Get-* +```powershell +Get-Alias -Name gp*, sp* -Exclude *ps ``` -This command gets all aliases that begin with g or s, except for aliases that begin with Get-. +This command gets all aliases that begin with gp or sp, except for aliases that end with ps. ### Example 3: Get aliases for a cmdlet ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md index 900d5cb3a0e7..dbdaf6e0741b 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md @@ -59,11 +59,11 @@ The output shows the \ -\> \ format that was introduced in This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames. ### Example 2: Get aliases by name -``` -PS C:\> Get-Alias -Name g*, s* -Exclude Get-* +```powershell +Get-Alias -Name gp*, sp* -Exclude *ps ``` -This command gets all aliases that begin with g or s, except for aliases that begin with Get-. +This command gets all aliases that begin with gp or sp, except for aliases that end with ps. ### Example 3: Get aliases for a cmdlet ``` diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md index abff6fe42c9d..7747dc402bdc 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md @@ -61,11 +61,11 @@ The output shows the \ -\> \ format that was introduced in This format is used only for aliases that do not include hyphens, because aliases with hyphens are typically preferred names for cmdlets and functions, rather than nicknames. ### Example 2: Get aliases by name -``` -PS C:\> Get-Alias -Name g*, s* -Exclude Get-* +```powershell +Get-Alias -Name gp*, sp* -Exclude *ps ``` -This command gets all aliases that begin with g or s, except for aliases that begin with Get-. +This command gets all aliases that begin with gp or sp, except for aliases that end with ps. ### Example 3: Get aliases for a cmdlet ``` From 010d9e508f8586245534713d50bdf7306411e9c3 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 8 Dec 2017 00:30:37 +0900 Subject: [PATCH 092/145] Fix formatting: DESCRIPTION section in ConvertTo-Xml.md (#1934) --- .../3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md | 11 ++++++----- .../4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md | 10 +++++----- .../5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md | 10 +++++----- .../5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md | 10 +++++----- .../6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md | 10 +++++----- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 5816d9b32571..9c5fdbd01416 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -19,13 +19,14 @@ ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] ``` ## DESCRIPTION -The ConvertTo-Xml cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. -To use this cmdlet, pipe one or more objects to the cmdlet, or use the InputObject parameter to specify the object. +The `ConvertTo-Xml` cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. +To use this cmdlet, pipe one or more objects to the cmdlet, or use the **InputObject** parameter to specify the object. -When you pipe multiple objects to ConvertTo-XML or use the InputObject parameter to submit multiple objects, ConvertTo-XML returns a single XML document that includes representations of all of the objects. +When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** parameter to submit multiple objects, `ConvertTo-Xml` returns a single XML document that includes representations of all of the objects. + +This cmdlet is similar to `Export-Clixml` except that `Export-Clixml` stores the resulting XML in a file. +`ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell. -This cmdlet is similar to Export-Clixml except that Export-Clixml stores the resulting XML in a file. -ConvertTo-XML returns the XML, so you can continue to process it in Windows PowerShell. ## EXAMPLES ### Example 1 diff --git a/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 6eca43ab5af2..7264fe0a4fcb 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -21,13 +21,13 @@ ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] ``` ## DESCRIPTION -The ConvertTo-Xml cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. -To use this cmdlet, pipe one or more objects to the cmdlet, or use the InputObject parameter to specify the object. +The `ConvertTo-Xml` cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. +To use this cmdlet, pipe one or more objects to the cmdlet, or use the **InputObject** parameter to specify the object. -When you pipe multiple objects to ConvertTo-XML or use the InputObject parameter to submit multiple objects, ConvertTo-XML returns a single XML document that includes representations of all of the objects. +When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** parameter to submit multiple objects, `ConvertTo-Xml` returns a single XML document that includes representations of all of the objects. -This cmdlet is similar to Export-Clixml except that Export-Clixml stores the resulting XML in a file. -ConvertTo-XML returns the XML, so you can continue to process it in Windows PowerShell. +This cmdlet is similar to `Export-Clixml` except that `Export-Clixml` stores the resulting XML in a file. +`ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell. ## EXAMPLES diff --git a/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index b47236614682..d50c8bc36cc8 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -21,13 +21,13 @@ ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] ``` ## DESCRIPTION -The **ConvertTo-Xml** cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. -To use this cmdlet, pipe one or more objects to the cmdlet, or use the *InputObject* parameter to specify the object. +The `ConvertTo-Xml` cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. +To use this cmdlet, pipe one or more objects to the cmdlet, or use the **InputObject** parameter to specify the object. -When you pipe multiple objects to **ConvertTo-XML** or use the *InputObject* parameter to submit multiple objects, **ConvertTo-XML** returns a single XML document that includes representations of all of the objects. +When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** parameter to submit multiple objects, `ConvertTo-Xml` returns a single XML document that includes representations of all of the objects. -This cmdlet is similar to Export-Clixml except that **Export-Clixml** stores the resulting XML in a file**. -ConvertTo-XML** returns the XML, so you can continue to process it in Windows PowerShell. +This cmdlet is similar to `Export-Clixml` except that `Export-Clixml` stores the resulting XML in a file. +`ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell. ## EXAMPLES diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index aa71466398ef..0ca7799ae25c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -21,13 +21,13 @@ ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] ``` ## DESCRIPTION -The **ConvertTo-Xml** cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. -To use this cmdlet, pipe one or more objects to the cmdlet, or use the *InputObject* parameter to specify the object. +The `ConvertTo-Xml` cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. +To use this cmdlet, pipe one or more objects to the cmdlet, or use the **InputObject** parameter to specify the object. -When you pipe multiple objects to **ConvertTo-XML** or use the *InputObject* parameter to submit multiple objects, **ConvertTo-XML** returns a single XML document that includes representations of all of the objects. +When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** parameter to submit multiple objects, `ConvertTo-Xml` returns a single XML document that includes representations of all of the objects. -This cmdlet is similar to Export-Clixml except that **Export-Clixml** stores the resulting XML in a file**. -ConvertTo-XML** returns the XML, so you can continue to process it in Windows PowerShell. +This cmdlet is similar to `Export-Clixml` except that `Export-Clixml` stores the resulting XML in a file. +`ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell. ## EXAMPLES diff --git a/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index aa71466398ef..0ca7799ae25c 100644 --- a/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -21,13 +21,13 @@ ConvertTo-Xml [-InputObject] [-Depth ] [-NoTypeInformation] ``` ## DESCRIPTION -The **ConvertTo-Xml** cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. -To use this cmdlet, pipe one or more objects to the cmdlet, or use the *InputObject* parameter to specify the object. +The `ConvertTo-Xml` cmdlet creates an XML-based representation of one or more Microsoft .NET Framework objects. +To use this cmdlet, pipe one or more objects to the cmdlet, or use the **InputObject** parameter to specify the object. -When you pipe multiple objects to **ConvertTo-XML** or use the *InputObject* parameter to submit multiple objects, **ConvertTo-XML** returns a single XML document that includes representations of all of the objects. +When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** parameter to submit multiple objects, `ConvertTo-Xml` returns a single XML document that includes representations of all of the objects. -This cmdlet is similar to Export-Clixml except that **Export-Clixml** stores the resulting XML in a file**. -ConvertTo-XML** returns the XML, so you can continue to process it in Windows PowerShell. +This cmdlet is similar to `Export-Clixml` except that `Export-Clixml` stores the resulting XML in a file. +`ConvertTo-Xml` returns the XML, so you can continue to process it in PowerShell. ## EXAMPLES From 89de81359c5545f7ae3f30478781a9bb605bddd3 Mon Sep 17 00:00:00 2001 From: Wemyss Date: Fri, 8 Dec 2017 02:31:57 +1100 Subject: [PATCH 093/145] Fix typo in Unregister-ScheduledJob (#1932) * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md * Update Unregister-ScheduledJob.md --- reference/3.0/PSScheduledJob/Unregister-ScheduledJob.md | 2 +- reference/4.0/PSScheduledJob/Unregister-ScheduledJob.md | 2 +- reference/5.0/PSScheduledJob/Unregister-ScheduledJob.md | 2 +- reference/5.1/PSScheduledJob/Unregister-ScheduledJob.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/3.0/PSScheduledJob/Unregister-ScheduledJob.md b/reference/3.0/PSScheduledJob/Unregister-ScheduledJob.md index 016ef1ae0e8b..4d15ed82f883 100644 --- a/reference/3.0/PSScheduledJob/Unregister-ScheduledJob.md +++ b/reference/3.0/PSScheduledJob/Unregister-ScheduledJob.md @@ -59,7 +59,7 @@ This command deletes the TestJob scheduled job on the local computer. PS C:\> Get-ScheduledJob | Unregister-ScheduledJob -Force -PS C:\> Unregistered-ScheduledJob -Name * -Force +PS C:\> Unregister-ScheduledJob -Name * -Force ``` This examples shows two different commands that delete all scheduled jobs on the local computer. diff --git a/reference/4.0/PSScheduledJob/Unregister-ScheduledJob.md b/reference/4.0/PSScheduledJob/Unregister-ScheduledJob.md index 56a1d064a7fb..03152e950ccf 100644 --- a/reference/4.0/PSScheduledJob/Unregister-ScheduledJob.md +++ b/reference/4.0/PSScheduledJob/Unregister-ScheduledJob.md @@ -63,7 +63,7 @@ This command deletes the TestJob scheduled job on the local computer. PS C:\> Get-ScheduledJob | Unregister-ScheduledJob -Force -PS C:\> Unregistered-ScheduledJob -Name * -Force +PS C:\> Unregister-ScheduledJob -Name * -Force ``` This examples shows two different commands that delete all scheduled jobs on the local computer. diff --git a/reference/5.0/PSScheduledJob/Unregister-ScheduledJob.md b/reference/5.0/PSScheduledJob/Unregister-ScheduledJob.md index 59d72e80aaab..21db69497205 100644 --- a/reference/5.0/PSScheduledJob/Unregister-ScheduledJob.md +++ b/reference/5.0/PSScheduledJob/Unregister-ScheduledJob.md @@ -61,7 +61,7 @@ This command deletes the TestJob scheduled job on the local computer. ### Example 2: Delete all scheduled jobs ``` PS C:\> Get-ScheduledJob | Unregister-ScheduledJob -Force -PS C:\> Unregistered-ScheduledJob -Name "*" -Force +PS C:\> Unregister-ScheduledJob -Name "*" -Force ``` This example shows two different commands that delete all scheduled jobs on the local computer. diff --git a/reference/5.1/PSScheduledJob/Unregister-ScheduledJob.md b/reference/5.1/PSScheduledJob/Unregister-ScheduledJob.md index 387329625fa2..3a53902864d6 100644 --- a/reference/5.1/PSScheduledJob/Unregister-ScheduledJob.md +++ b/reference/5.1/PSScheduledJob/Unregister-ScheduledJob.md @@ -61,7 +61,7 @@ This command deletes the TestJob scheduled job on the local computer. ### Example 2: Delete all scheduled jobs ``` PS C:\> Get-ScheduledJob | Unregister-ScheduledJob -Force -PS C:\> Unregistered-ScheduledJob -Name "*" -Force +PS C:\> Unregister-ScheduledJob -Name "*" -Force ``` This example shows two different commands that delete all scheduled jobs on the local computer. From 59ff97e0f5981e9413464e47edc35e8227a51ca4 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 9 Dec 2017 02:35:51 +0900 Subject: [PATCH 094/145] Fix parameter's position in ConvertFrom-Csv.md (#1937) --- .../ConvertFrom-Csv.md | 14 +++--- .../ConvertFrom-Csv.md | 14 +++--- .../ConvertFrom-Csv.md | 10 +++-- .../ConvertFrom-Csv.md | 10 +++-- .../ConvertFrom-Csv.md | 43 ++++--------------- 5 files changed, 36 insertions(+), 55 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/3.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 1a219adb9539..94b116ae16a3 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -14,13 +14,15 @@ Converts object properties in comma-separated value (CSV) format into CSV versio ## SYNTAX ### Delimiter (Default) -``` -ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] [[-Delimiter] ] + [-Header ] [] ``` ### UseCulture -``` -ConvertFrom-Csv [-UseCulture] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] -UseCulture + [-Header ] [] ``` ## DESCRIPTION @@ -136,7 +138,7 @@ Parameter Sets: Delimiter Aliases: Required: False -Position: 2 +Position: 1 Default value: "," (comma) Accept pipeline input: False Accept wildcard characters: False @@ -178,7 +180,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/4.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 6b5806726c56..d9e96d8d198c 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -16,13 +16,15 @@ Converts object properties in comma-separated value (CSV) format into CSV versio ## SYNTAX ### Delimiter (Default) -``` -ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] [[-Delimiter] ] + [-Header ] [] ``` ### UseCulture -``` -ConvertFrom-Csv [-UseCulture] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] -UseCulture + [-Header ] [] ``` ## DESCRIPTION @@ -143,7 +145,7 @@ Parameter Sets: Delimiter Aliases: Required: False -Position: 2 +Position: 1 Default value: "," (comma) Accept pipeline input: False Accept wildcard characters: False @@ -185,7 +187,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/5.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/5.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index e4100ace0887..d1b32e448c41 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -16,13 +16,15 @@ Converts object properties in comma-separated value (CSV) format into CSV versio ## SYNTAX ### Delimiter (Default) -``` -ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] [[-Delimiter] ] + [-Header ] [] ``` ### UseCulture -``` -ConvertFrom-Csv [-UseCulture] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] -UseCulture + [-Header ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 2b203caae1e3..5be5d45052e9 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -16,13 +16,15 @@ Converts object properties in comma-separated value (CSV) format into CSV versio ## SYNTAX ### Delimiter (Default) -``` -ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] [[-Delimiter] ] + [-Header ] [] ``` ### UseCulture -``` -ConvertFrom-Csv [-UseCulture] [-InputObject] [-Header ] [] +```powershell +ConvertFrom-Csv [-InputObject] -UseCulture + [-Header ] [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 53c663e892be..5be5d45052e9 100644 --- a/reference/6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -16,15 +16,15 @@ Converts object properties in comma-separated value (CSV) format into CSV versio ## SYNTAX ### Delimiter (Default) -``` -ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +ConvertFrom-Csv [-InputObject] [[-Delimiter] ] + [-Header ] [] ``` ### UseCulture -``` -ConvertFrom-Csv [-UseCulture] [-InputObject] [-Header ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +ConvertFrom-Csv [-InputObject] -UseCulture + [-Header ] [] ``` ## DESCRIPTION @@ -144,7 +144,7 @@ Parameter Sets: Delimiter Aliases: Required: False -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -175,33 +175,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -If you specify a character other than the delimiter used in the CSV strings, ConvertFrom-CSV cannot create objects from the CSV strings. Instead, it returns the strings.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -If you specify a character other than the delimiter used in the CSV strings, ConvertFrom-CSV cannot create objects from the CSV strings. Instead, it returns the strings.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the CSV strings to be converted to objects. Enter a variable that contains the CSV strings or type a command or expression that gets the CSV strings. @@ -213,7 +186,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False From d4289869a3b0b460110cce09f9810cd315b04889 Mon Sep 17 00:00:00 2001 From: DaniSQL Date: Fri, 8 Dec 2017 12:36:54 -0500 Subject: [PATCH 095/145] fix typo on metaConfig.md (#1936) fixed typo --- dsc/metaConfig.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsc/metaConfig.md b/dsc/metaConfig.md index 561b7a423003..6992810d6307 100644 --- a/dsc/metaConfig.md +++ b/dsc/metaConfig.md @@ -77,7 +77,7 @@ The following properties are available in a **Settings** block. | Property | Type | Description | |----------- |------- |--------------- | -| ActionAfterReboot| string| Specifies what happens after a reboot during the application of a configuration. The possible values are __"ContinueConfiguration"__ and __"StopConfiguration"__.
  • __ContinueConfiguration__: Continue applying the current configuration after machine reboot. This is the default falue
  • __StopConfiguration__: Stop the current configuration after machine reboot.
| +| ActionAfterReboot| string| Specifies what happens after a reboot during the application of a configuration. The possible values are __"ContinueConfiguration"__ and __"StopConfiguration"__.
  • __ContinueConfiguration__: Continue applying the current configuration after machine reboot. This is the default value
  • __StopConfiguration__: Stop the current configuration after machine reboot.
| | AllowModuleOverwrite| bool| __$TRUE__ if new configurations downloaded from the pull service are allowed to overwrite the old ones on the target node. Otherwise, $FALSE.| | CertificateID| string| The thumbprint of a certificate used to secure credentials passed in a configuration. For more information see [Want to secure credentials in Windows PowerShell Desired State Configuration](http://blogs.msdn.com/b/powershell/archive/2014/01/31/want-to-secure-credentials-in-windows-powershell-desired-state-configuration.aspx)?.
__Note:__ this is managed automatically if using Azure Automation DSC pull service.| | ConfigurationDownloadManagers| CimInstance[]| Obsolete. Use __ConfigurationRepositoryWeb__ and __ConfigurationRepositoryShare__ blocks to define configuration pull service endpoints.| From c070f79bb40f42564cf7f80a6859491015e73ec6 Mon Sep 17 00:00:00 2001 From: "J. Keith Bankston [MSFT]" Date: Fri, 8 Dec 2017 12:39:51 -0800 Subject: [PATCH 096/145] Quick edits (#1938) * Changed required PSGet version to 1.6.0 * Fixes to PSGet TOC and WMF 5.1 compat page --- gallery/TOC.md | 3 ++- wmf/5.1/productincompat.md | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery/TOC.md b/gallery/TOC.md index dadea276e34c..27e3168f84e9 100644 --- a/gallery/TOC.md +++ b/gallery/TOC.md @@ -39,6 +39,7 @@ ### [Publish](psget/module/psget_publish-module.md) ### [Modules with PSEditions](psget/module/modulewithpseditionsupport.md) ### [Modules Requiring License Acceptance](psget/module/RequireLicenseAcceptance.md) +### [Prerelease Versions](psget/module/PreReleaseModule.md) ### [Troubleshooting](psget/psget_cmdlets_troubleshooting.md) ## Script @@ -54,7 +55,7 @@ ### [Publish](psget/script/psget_publish-script.md) ### [Scripts with PSEditions](psget/script/scriptwithpseditionsupport.md) ### [Require License Acceptance for Scripts](psget/script/script_RequireLicenseAcceptance.md) - +### [Prerelease Versions](psget/script/PreReleaseScript.md) ## Repository management ### [Bootstrapping NuGet provider and NuGet.exe](psget/repository/bootstrapping_nuget_proivder_and_exe.md) ### [Registering repository](psget/repository/psget_register-psrepository.md) diff --git a/wmf/5.1/productincompat.md b/wmf/5.1/productincompat.md index c5aa832dca9a..fd1154a578ae 100644 --- a/wmf/5.1/productincompat.md +++ b/wmf/5.1/productincompat.md @@ -11,10 +11,12 @@ keywords: wmf,powershell,setup > Systems that are running the following server applications **can run** Windows Management Framework 5.1: - Microsoft SharePoint Server 2013 -- Skype for Business Server 2015 +- Skype for Business Server 2015 (_See Note_) - Microsoft Lync Server 2013 - System Center 2012 Configuration Manager +_Note: Skype for Business Server 2015 compatibility with WMF 5.1 has been tested only with Windows Server 2012 R2._ + ## Not Tested: > Systems that are running the following server applications **have not tested** against Windows Management Framework 5.1: From 5119bdaf6f02a588623a4272b697ade221c134e4 Mon Sep 17 00:00:00 2001 From: skycommand Date: Mon, 11 Dec 2017 19:45:46 +0330 Subject: [PATCH 097/145] Update Get-Item.md (#1942) Proof-read some of the examples. The first two were wrong entirely: The user must be in the ps-test folder for the result shown to happen. --- .../Get-Item.md | 136 ++++++++++++++---- 1 file changed, 108 insertions(+), 28 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md index a3c15c3316aa..28e1eed37e7f 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md @@ -16,13 +16,13 @@ Gets the item at the specified location. ## SYNTAX ### Path (Default) -``` +```powershell Get-Item [-Path] [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] [-Stream ] [] ``` ### LiteralPath -``` +```powershell Get-Item -LiteralPath [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] [-Stream ] [] ``` @@ -37,16 +37,14 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ### Example 1: Get the current directory ``` -PS C:\> Get-Item . - +PS C:\ps-test> Get-Item . + Directory: C:\ - -Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- -d---- 7/26/2006 10:01 AM ps-test +d----- 7/26/2006 10:01 AM ps-test ``` This command gets the current directory. @@ -54,27 +52,19 @@ The dot (.) represents the item at the current location (not its contents). ### Example 2: Get all the items in the current directory ``` -PS C:\> Get-Item * - - - - - - - - +PS C:\ps-test> Get-Item * + Directory: C:\ps-test -Directory: C:\ps-test Mode LastWriteTime Length Name ---- ------------- ------ ---- -d---- 7/26/2006 9:29 AM Logs -d---- 7/26/2006 9:26 AM Recs --a--- 7/26/2006 9:28 AM 80 date.csv --a--- 7/26/2006 10:01 AM 30 filenoext --a--- 7/26/2006 9:30 AM 11472 process.doc --a--- 7/14/2006 10:47 AM 30 test.txt +d----- 7/26/2006 9:29 AM Logs +d----- 7/26/2006 9:26 AM Recs +-a---- 7/26/2006 9:28 AM 80 date.csv +-a---- 7/26/2006 10:01 AM 30 filenoext +-a---- 7/26/2006 9:30 AM 11472 process.doc +-a---- 7/14/2006 10:47 AM 30 test.txt ``` This command gets all the items in the current directory. @@ -82,15 +72,35 @@ The wildcard character (*) represents all the contents of the current item. ### Example 3: Get the current directory of a drive ``` -PS C:\> Get-Item C:\ +PS C:\ps-test> Get-Item C:\ + + + Directory: + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d--hs- 12/10/2017 1:16 PM C:\ ``` This command gets the current directory of the C: drive. The object that is retrieved represents only the directory, not its contents. -### Example 4: Get items in the specified drive +### Example 4: Get items in the specified drive root ``` -PS C:\> Get-Item C:\* +PS C:\ps-test> Get-Item C:\* + + + Directory: C:\ + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d----- 3/19/2017 12:33 AM PerfLogs +d-r--- 11/29/2017 2:36 PM Program Files +d-r--- 11/29/2017 2:14 PM Program Files (x86) +d-r--- 7/16/2017 4:03 PM Users +d----- 12/10/2017 1:16 PM Windows ``` This command gets the items in the C: drive. @@ -102,6 +112,8 @@ The format is interpreted literally, so *.* would not retrieve directories or fi ### Example 5: Get a property in the specified directory ``` PS C:\> (Get-Item C:\Windows).LastAccessTime + +Sunday, December 10, 2017 1:16:45 PM ``` This command gets the LastAccessTime property of the C:\Windows directory. @@ -110,15 +122,83 @@ To see all of the properties of a directory, type `(Get-Item \) ### Example 6: Show the contents of a registry key ``` -PS C:\> Get-Item hklm:\software\microsoft\powershell\1\shellids\microsoft.powershell\* +PS C:\Windows> Get-Item "hklm:\Software\Microsoft\Windows NT\*" + + + Hive: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT + + +Name Property +---- -------- +CurrentVersion SystemRoot : C:\WINDOWS + BuildBranch : rs2_release + BuildGUID : ffffffff-ffff-ffff-ffff-ffffffffffff + BuildLab : 15063.rs2_release.170317-1834 + BuildLabEx : 15063.0.amd64fre.rs2_release.170317-1834 + CompositionEditionID : Enterprise + CurrentBuild : 15063 + CurrentBuildNumber : 15063 + CurrentMajorVersionNumber : 10 + CurrentMinorVersionNumber : 0 + CurrentType : Multiprocessor Free + CurrentVersion : 6.3 + EditionID : Enterprise + EditionSubstring : + InstallationType : Client + InstallDate : 1495262485 + ProductName : Windows 10 Enterprise + ReleaseId : 1703 + SoftwareType : System + UBR : 726 + PathName : C:\WINDOWS + DigitalProductId : {164, 0, 0, 0...} + DigitalProductId4 : {248, 4, 0, 0...} + ProductId : 00329-00000-00003-AA840 + RegisteredOrganization : + RegisteredOwner : + InstallTime : 131397360853701614 ``` -This command shows the contents of the Microsoft.PowerShell registry key. +This command shows the contents of the "Windows NT" registry key. You can use this cmdlet with the Windows PowerShell Registry provider to get registry keys and subkeys, but you must use the **Get-ItemProperty** cmdlet to get the registry values and data. ### Example 7: Get items in a directory that have an exclusion ``` PS C:\> Get-Item c:\Windows\*.* -exclude "w*" + + + Directory: C:\Windows + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d-r--- 12/11/2017 10:25 AM Microsoft.NET +d----- 4/5/2017 4:34 PM SoftwareDistribution.bak +-a---- 5/20/2017 10:54 AM 0 ativpsrm.bin +-a---- 8/25/2008 10:31 PM 292352 atprs.exe +-a---- 6/3/2017 1:21 PM 64512 bfsvc.exe +-a--s- 12/11/2017 1:10 PM 67584 bootstat.dat +-a---- 10/30/2015 10:48 AM 31816 CoreSingleLanguage.xml +-a---- 10/8/2016 9:45 PM 232960 DfsrAdmin.exe +-a---- 5/22/2017 10:24 AM 1315 DfsrAdmin.exe.config +-a---- 12/10/2017 1:21 PM 1908 diagerr.xml +-a---- 12/10/2017 1:21 PM 1908 diagwrn.xml +-a---- 3/19/2017 12:29 AM 34774 Enterprise.xml +-a---- 10/7/2015 2:11 AM 2238152 ETDUninst.dll +-a---- 9/30/2017 9:12 AM 4848952 explorer.exe +-a---- 6/3/2017 1:29 PM 975360 HelpPane.exe +-a---- 3/19/2017 12:27 AM 18432 hh.exe +-a---- 12/14/2016 10:57 AM 0 HPMProp.INI +-a---- 3/19/2017 12:27 AM 43131 mib.bin +-a---- 4/9/2008 6:00 PM 53478 mvtcpui.ini +-a---- 3/19/2017 12:28 AM 246784 notepad.exe +-a---- 11/29/2017 4:23 PM 686 PFRO.log +-a---- 3/19/2017 12:27 AM 321024 regedit.exe +-a---- 12/10/2017 1:21 PM 445 setupact.log +-a---- 12/10/2017 1:16 PM 0 setuperr.log +-a---- 3/19/2017 12:28 AM 130560 splwow64.exe +-a---- 10/30/2015 10:51 AM 219 system.ini +-a---- 3/19/2017 12:28 AM 65536 twain_32.dll ``` This command gets items in the Windows directory with names that include a dot (.), but do not begin with w*. From 54a3de477dc100f31756957aff37986d18ccc0f4 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Tue, 12 Dec 2017 01:17:43 +0900 Subject: [PATCH 098/145] Add description about Format-Hex -InputObject (#1939) --- reference/5.0/Microsoft.PowerShell.Utility/Format-Hex.md | 3 ++- reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md | 3 ++- reference/6/Microsoft.PowerShell.Utility/Format-Hex.md | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/5.0/Microsoft.PowerShell.Utility/Format-Hex.md index 01584c491eb8..f65cde9915c1 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Format-Hex.md @@ -92,7 +92,8 @@ Accept wildcard characters: False ``` ### -InputObject -Specifies the objects to be formatted. Enter a variable that contains the objects or type a command or expression that gets the objects. +Specifies the objects to be formatted. +Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: Object diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md index 125545cb9096..191040e1ad45 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md @@ -92,7 +92,8 @@ Accept wildcard characters: False ``` ### -InputObject -{{Fill InputObject Description}} +Specifies the objects to be formatted. +Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: Object diff --git a/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md index 125545cb9096..191040e1ad45 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/6/Microsoft.PowerShell.Utility/Format-Hex.md @@ -92,7 +92,8 @@ Accept wildcard characters: False ``` ### -InputObject -{{Fill InputObject Description}} +Specifies the objects to be formatted. +Enter a variable that contains the objects or type a command or expression that gets the objects. ```yaml Type: Object From 4e663d65bb8d60d7129fdd944ca999a14fef4c4d Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 13 Dec 2017 00:45:53 +0900 Subject: [PATCH 099/145] Fix parameter's position in Add-Member.md (#1946) --- .../Add-Member.md | 45 ++++++------ .../Add-Member.md | 69 ++++++++++--------- .../Add-Member.md | 27 +++++--- .../Add-Member.md | 27 +++++--- .../Add-Member.md | 68 ++++++------------ 5 files changed, 115 insertions(+), 121 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Add-Member.md b/reference/3.0/Microsoft.PowerShell.Utility/Add-Member.md index 0ac7eec0ffc1..6546d97278e6 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Add-Member.md @@ -14,26 +14,31 @@ Adds custom properties and methods to an instance of a Windows PowerShell object ## SYNTAX ### TypeNameSet (Default) -``` -Add-Member -InputObject -TypeName [-PassThru] [] +```powershell +Add-Member -InputObject -TypeName [-PassThru] + [] ``` -### NotePropertyMultiMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] - [-NotePropertyMembers] [] +### MemberSet +```powershell +Add-Member [-MemberType] [-Name] + [[-Value] ] [[-SecondValue] ] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ### NotePropertySingleMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] [-NotePropertyName] - [-NotePropertyValue] [] +```powershell +Add-Member [-NotePropertyName] [-NotePropertyValue] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` -### MemberSet -``` -Add-Member -InputObject [-MemberType] [-Name] [[-Value] ] - [[-SecondValue] ] [-TypeName ] [-Force] [-PassThru] [] +### NotePropertyMultiMemberSet +```powershell +Add-Member [-NotePropertyMembers] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ## DESCRIPTION @@ -281,7 +286,7 @@ Parameter Sets: MemberSet Aliases: Type Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True @@ -296,7 +301,7 @@ Parameter Sets: MemberSet Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -341,7 +346,7 @@ Parameter Sets: MemberSet Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -357,7 +362,7 @@ Parameter Sets: MemberSet Aliases: Required: False -Position: 3 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -377,7 +382,7 @@ Parameter Sets: NotePropertyMultiMemberSet Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -397,7 +402,7 @@ Parameter Sets: NotePropertySingleMemberSet Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -417,7 +422,7 @@ Parameter Sets: NotePropertySingleMemberSet Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Add-Member.md b/reference/4.0/Microsoft.PowerShell.Utility/Add-Member.md index f684ead84333..66f4ef5e109e 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Add-Member.md @@ -15,27 +15,32 @@ Adds custom properties and methods to an instance of a Windows PowerShell object ## SYNTAX -### UNNAMED_PARAMETER_SET_1 -``` -Add-Member [-PassThru] -InputObject -TypeName +### TypeNameSet (Default) +```powershell +Add-Member -InputObject -TypeName [-PassThru] + [] ``` -### UNNAMED_PARAMETER_SET_2 -``` -Add-Member [-NotePropertyName] [-NotePropertyValue] [-Force] [-PassThru] [-TypeName ] - -InputObject +### MemberSet +```powershell +Add-Member [-MemberType] [-Name] + [[-Value] ] [[-SecondValue] ] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` -### UNNAMED_PARAMETER_SET_3 -``` -Add-Member [-NotePropertyMembers] [-Force] [-PassThru] [-TypeName ] - -InputObject +### NotePropertySingleMemberSet +```powershell +Add-Member [-NotePropertyName] [-NotePropertyValue] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` -### UNNAMED_PARAMETER_SET_4 -``` -Add-Member [-MemberType] [-Name] [[-Value] ] [[-SecondValue] ] - [-Force] [-PassThru] [-TypeName ] -InputObject +### NotePropertyMultiMemberSet +```powershell +Add-Member [-NotePropertyMembers] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ## DESCRIPTION @@ -245,7 +250,7 @@ You cannot use **the** Force parameter to replace a standard member of a type. ```yaml Type: SwitchParameter -Parameter Sets: UNNAMED_PARAMETER_SET_2, UNNAMED_PARAMETER_SET_3, UNNAMED_PARAMETER_SET_4 +Parameter Sets: MemberSet, NotePropertySingleMemberSet, NotePropertyMultiMemberSet Aliases: Required: False @@ -284,11 +289,11 @@ If you specify a member type that the object does not have, Windows PowerShell r ```yaml Type: PSMemberTypes -Parameter Sets: UNNAMED_PARAMETER_SET_4 +Parameter Sets: MemberSet Aliases: Type Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -299,11 +304,11 @@ Specifies the name of the member to be added. ```yaml Type: String -Parameter Sets: UNNAMED_PARAMETER_SET_4 +Parameter Sets: MemberSet Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -344,11 +349,11 @@ The second ScriptBlock, specified in the SecondValue parameter, is used to set t ```yaml Type: Object -Parameter Sets: UNNAMED_PARAMETER_SET_4 +Parameter Sets: MemberSet Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -360,11 +365,11 @@ If you add an **AliasProperty**, **CodeProperty**, **ScriptProperty** or **CodeM ```yaml Type: Object -Parameter Sets: UNNAMED_PARAMETER_SET_4 +Parameter Sets: MemberSet Aliases: Required: False -Position: 3 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -380,11 +385,11 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: IDictionary -Parameter Sets: UNNAMED_PARAMETER_SET_3 +Parameter Sets: NotePropertyMultiMemberSet Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -400,11 +405,11 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String -Parameter Sets: UNNAMED_PARAMETER_SET_2 +Parameter Sets: NotePropertySingleMemberSet Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -420,11 +425,11 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: Object -Parameter Sets: UNNAMED_PARAMETER_SET_2 +Parameter Sets: NotePropertySingleMemberSet Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -441,7 +446,7 @@ This parameter is introduced in Windows PowerShell 3.0. ```yaml Type: String -Parameter Sets: UNNAMED_PARAMETER_SET_1 +Parameter Sets: TypeNameSet Aliases: Required: True @@ -453,7 +458,7 @@ Accept wildcard characters: False ```yaml Type: String -Parameter Sets: UNNAMED_PARAMETER_SET_2, UNNAMED_PARAMETER_SET_3, UNNAMED_PARAMETER_SET_4 +Parameter Sets: MemberSet, NotePropertySingleMemberSet, NotePropertyMultiMemberSet Aliases: Required: False diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Add-Member.md b/reference/5.0/Microsoft.PowerShell.Utility/Add-Member.md index c5cfe0e04e70..ac32f312e12f 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Add-Member.md @@ -16,26 +16,31 @@ Adds custom properties and methods to an instance of a Windows PowerShell object ## SYNTAX ### TypeNameSet (Default) -``` -Add-Member -InputObject -TypeName [-PassThru] [] +```powershell +Add-Member -InputObject -TypeName [-PassThru] + [] ``` ### MemberSet -``` -Add-Member -InputObject [-MemberType] [-Name] [[-Value] ] - [[-SecondValue] ] [-TypeName ] [-Force] [-PassThru] [] +```powershell +Add-Member [-MemberType] [-Name] + [[-Value] ] [[-SecondValue] ] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ### NotePropertySingleMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] [-NotePropertyName] - [-NotePropertyValue] [] +```powershell +Add-Member [-NotePropertyName] [-NotePropertyValue] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ### NotePropertyMultiMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] - [-NotePropertyMembers] [] +```powershell +Add-Member [-NotePropertyMembers] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md b/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md index 0c54c380010e..a799760f2a88 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Add-Member.md @@ -16,26 +16,31 @@ Adds custom properties and methods to an instance of a Windows PowerShell object ## SYNTAX ### TypeNameSet (Default) -``` -Add-Member -InputObject -TypeName [-PassThru] [] +```powershell +Add-Member -InputObject -TypeName [-PassThru] + [] ``` ### MemberSet -``` -Add-Member -InputObject [-MemberType] [-Name] [[-Value] ] - [[-SecondValue] ] [-TypeName ] [-Force] [-PassThru] [] +```powershell +Add-Member [-MemberType] [-Name] + [[-Value] ] [[-SecondValue] ] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ### NotePropertySingleMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] [-NotePropertyName] - [-NotePropertyValue] [] +```powershell +Add-Member [-NotePropertyName] [-NotePropertyValue] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ### NotePropertyMultiMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] - [-NotePropertyMembers] [] +```powershell +Add-Member [-NotePropertyMembers] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/Add-Member.md b/reference/6/Microsoft.PowerShell.Utility/Add-Member.md index d119a02b4ece..d81088e3732a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Add-Member.md +++ b/reference/6/Microsoft.PowerShell.Utility/Add-Member.md @@ -16,29 +16,30 @@ Adds custom properties and methods to an instance of a Windows PowerShell object ## SYNTAX ### TypeNameSet (Default) -``` -Add-Member -InputObject -TypeName [-PassThru] [-InformationAction ] - [-InformationVariable ] [] +```powershell +Add-Member -InputObject -TypeName [-PassThru] + [] ``` ### MemberSet -``` -Add-Member -InputObject [-MemberType] [-Name] [[-Value] ] - [[-SecondValue] ] [-TypeName ] [-Force] [-PassThru] [-InformationAction ] - [-InformationVariable ] [] +```powershell +Add-Member [-MemberType] [-Name] + [[-Value] ] [[-SecondValue] ] + -InputObject [-TypeName ] [-Force] [-PassThru] + [] ``` ### NotePropertySingleMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] [-NotePropertyName] - [-NotePropertyValue] [-InformationAction ] [-InformationVariable ] +```powershell +Add-Member [-NotePropertyName] [-NotePropertyValue] + -InputObject [-TypeName ] [-Force] [-PassThru] [] ``` ### NotePropertyMultiMemberSet -``` -Add-Member -InputObject [-TypeName ] [-Force] [-PassThru] - [-NotePropertyMembers] [-InformationAction ] [-InformationVariable ] +```powershell +Add-Member [-NotePropertyMembers] + -InputObject [-TypeName ] [-Force] [-PassThru] [] ``` @@ -261,33 +262,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the object to which the new member is added. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -328,7 +302,7 @@ Aliases: Type Accepted values: AliasProperty, CodeProperty, Property, NoteProperty, ScriptProperty, Properties, PropertySet, Method, CodeMethod, ScriptMethod, Methods, ParameterizedProperty, MemberSet, Event, Dynamic, All Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -343,7 +317,7 @@ Parameter Sets: MemberSet Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -388,7 +362,7 @@ Parameter Sets: MemberSet Aliases: Required: False -Position: 4 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -404,7 +378,7 @@ Parameter Sets: MemberSet Aliases: Required: False -Position: 3 +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -424,7 +398,7 @@ Parameter Sets: NotePropertyMultiMemberSet Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -444,7 +418,7 @@ Parameter Sets: NotePropertySingleMemberSet Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -464,7 +438,7 @@ Parameter Sets: NotePropertySingleMemberSet Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False From 2342a7ebae2d45899b6e65c6402a2a8f2fb7cafc Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 13 Dec 2017 00:46:43 +0900 Subject: [PATCH 100/145] Fix parameter's position in Select-Object.md (#1945) --- .../Select-Object.md | 15 ++--- .../Select-Object.md | 15 ++--- .../Select-Object.md | 20 +++--- .../Select-Object.md | 20 +++--- .../Select-Object.md | 61 ++++--------------- 5 files changed, 49 insertions(+), 82 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Select-Object.md b/reference/3.0/Microsoft.PowerShell.Utility/Select-Object.md index dba09329960f..b75ff792c7d5 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Select-Object.md @@ -14,15 +14,16 @@ Selects objects or object properties. ## SYNTAX ### DefaultParameter (Default) -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-Last ] [-First ] [-Skip ] [-Wait] - [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-Last ] [-First ] [-Skip ] [-Wait] [] ``` ### IndexParameter -``` -Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] [] +```powershell +Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] + [] ``` ## DESCRIPTION @@ -279,7 +280,7 @@ Parameter Sets: DefaultParameter Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Select-Object.md b/reference/4.0/Microsoft.PowerShell.Utility/Select-Object.md index cabef927b5ee..0254695f3498 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Select-Object.md @@ -16,15 +16,16 @@ Selects objects or object properties. ## SYNTAX ### DefaultParameter (Default) -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-Last ] [-First ] [-Skip ] [-Wait] - [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-Last ] [-First ] [-Skip ] [-Wait] [] ``` ### IndexParameter -``` -Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] [] +```powershell +Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] + [] ``` ## DESCRIPTION @@ -290,7 +291,7 @@ Parameter Sets: DefaultParameter Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md index a4c27a971c6a..2241889e3840 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Select-Object.md @@ -16,21 +16,23 @@ Selects objects or object properties. ## SYNTAX ### DefaultParameter (Default) -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-Last ] [-First ] [-Skip ] [-Wait] - [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-Last ] [-First ] [-Skip ] [-Wait] [] ``` ### SkipLastParameter -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-SkipLast ] [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-SkipLast ] [] ``` ### IndexParameter -``` -Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] [] +```powershell +Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md index 2b7b70b965e6..7d72e4b53e8e 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-Object.md @@ -16,21 +16,23 @@ Selects objects or object properties. ## SYNTAX ### DefaultParameter (Default) -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-Last ] [-First ] [-Skip ] [-Wait] - [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-Last ] [-First ] [-Skip ] [-Wait] [] ``` ### SkipLastParameter -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-SkipLast ] [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-SkipLast ] [] ``` ### IndexParameter -``` -Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] [] +```powershell +Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/Select-Object.md b/reference/6/Microsoft.PowerShell.Utility/Select-Object.md index b20a15a7fcca..57c67d3a2dae 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Select-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Select-Object.md @@ -16,23 +16,23 @@ Selects objects or object properties. ## SYNTAX ### DefaultParameter (Default) -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-Last ] [-First ] [-Skip ] [-Wait] - [-InformationAction ] [-InformationVariable ] [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-Last ] [-First ] [-Skip ] [-Wait] [] ``` ### SkipLastParameter -``` -Select-Object [-InputObject ] [[-Property] ] [-ExcludeProperty ] - [-ExpandProperty ] [-Unique] [-SkipLast ] [-InformationAction ] - [-InformationVariable ] [] +```powershell +Select-Object [[-Property] ] [-InputObject ] + [-ExcludeProperty ] [-ExpandProperty ] [-Unique] + [-SkipLast ] [] ``` ### IndexParameter -``` +```powershell Select-Object [-InputObject ] [-Unique] [-Wait] [-Index ] - [-InformationAction ] [-InformationVariable ] [] + [] ``` ## DESCRIPTION @@ -225,45 +225,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -The value of the property parameter can be a calculated property, which is a hash table that specifies a name and calculates a value for the property display. Valid keys are: - --- Name or Label - --- Expression or - -For more information, see the examples.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -The value of the property parameter can be a calculated property, which is a hash table that specifies a name and calculates a value for the property display. Valid keys are: - --- Name or Label - --- Expression or - -For more information, see the examples.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies objects to send to the cmdlet through the pipeline. This parameter enables you to pipe objects to **Select-Object**. @@ -315,7 +276,7 @@ Parameter Sets: DefaultParameter, SkipLastParameter Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False From 7e23ff9298c23554ace2af0ca43161ef8e5b0a80 Mon Sep 17 00:00:00 2001 From: Derek Robinson Date: Tue, 12 Dec 2017 09:47:20 -0600 Subject: [PATCH 101/145] Correcting add to hash table example (#1944) * Update about_Hash_Tables.md corrected add to hash table example in 3.0 * Update about_Hash_Tables.md corrected add to hash table examples in 4.0 * Update about_Hash_Tables.md corrected add to hash table example in 5.0 * Update about_Hash_Tables.md corrected add to hash table example in 5.1 * Update about_Hash_Tables.md corrected add to hash table example in 6 --- .../3.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md | 2 +- .../4.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md | 2 +- .../5.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md | 2 +- .../5.1/Microsoft.PowerShell.Core/About/about_Hash_Tables.md | 2 +- .../6/Microsoft.PowerShell.Core/About/about_Hash_Tables.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md index 174cf4dd2d6a..d13ac50fe00f 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md @@ -245,7 +245,7 @@ For example, to add a "Time" key with a value of "Now" to the hash table, use the following statement format. ```powershell -$hash = $hash.Add("Time", "Now") +$hash.Add("Time", "Now") ``` And, you can add keys and values to a hash table by using the addition diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md index 174cf4dd2d6a..d13ac50fe00f 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md @@ -245,7 +245,7 @@ For example, to add a "Time" key with a value of "Now" to the hash table, use the following statement format. ```powershell -$hash = $hash.Add("Time", "Now") +$hash.Add("Time", "Now") ``` And, you can add keys and values to a hash table by using the addition diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md index 174cf4dd2d6a..d13ac50fe00f 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Hash_Tables.md @@ -245,7 +245,7 @@ For example, to add a "Time" key with a value of "Now" to the hash table, use the following statement format. ```powershell -$hash = $hash.Add("Time", "Now") +$hash.Add("Time", "Now") ``` And, you can add keys and values to a hash table by using the addition diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Hash_Tables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Hash_Tables.md index 174cf4dd2d6a..d13ac50fe00f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Hash_Tables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Hash_Tables.md @@ -245,7 +245,7 @@ For example, to add a "Time" key with a value of "Now" to the hash table, use the following statement format. ```powershell -$hash = $hash.Add("Time", "Now") +$hash.Add("Time", "Now") ``` And, you can add keys and values to a hash table by using the addition diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Hash_Tables.md b/reference/6/Microsoft.PowerShell.Core/About/about_Hash_Tables.md index 174cf4dd2d6a..d13ac50fe00f 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Hash_Tables.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Hash_Tables.md @@ -245,7 +245,7 @@ For example, to add a "Time" key with a value of "Now" to the hash table, use the following statement format. ```powershell -$hash = $hash.Add("Time", "Now") +$hash.Add("Time", "Now") ``` And, you can add keys and values to a hash table by using the addition From 4e99941819ca50a31c47831d4f2caa131d2f0782 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 14 Dec 2017 00:43:59 +0900 Subject: [PATCH 102/145] Fix Set-TraceSource -ListenerOption parameter (#1949) * Fixed the value of "Accepted values:" * Fixed minor differences in formatting and wording --- .../Set-TraceSource.md | 20 ++++++++++++++----- .../Set-TraceSource.md | 20 ++++++++++++++----- .../Set-TraceSource.md | 4 ++-- .../Set-TraceSource.md | 3 ++- .../Set-TraceSource.md | 7 ++++--- 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/3.0/Microsoft.PowerShell.Utility/Set-TraceSource.md index a9445e46eb7d..56ed0a2a9ac6 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -102,20 +102,30 @@ Accept wildcard characters: False ``` ### -ListenerOption -Adds optional data to the prefix of each trace message in the output. -The valid values are "None", "LogicalOperationStack", "DateTime", "Timestamp", "ProcessId", "ThreadId", and "Callstack". -"None" is the default. +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: + +- None +- LogicalOperationStack +- DateTime +- Timestamp +- ProcessId +- ThreadId +- Callstack + +None is the default. To specify multiple options, separate them with commas, but with no spaces, and enclose them in quotation marks, such as "ProcessID,ThreadID". ```yaml Type: TraceOptions Parameter Sets: optionsSet -Aliases: +Aliases: +Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False Position: Named -Default value: "None" +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/4.0/Microsoft.PowerShell.Utility/Set-TraceSource.md index e2dc620f9ae1..32c4b0f0cf4a 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -107,20 +107,30 @@ Accept wildcard characters: False ``` ### -ListenerOption -Adds optional data to the prefix of each trace message in the output. -The valid values are "None", "LogicalOperationStack", "DateTime", "Timestamp", "ProcessId", "ThreadId", and "Callstack". -"None" is the default. +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: + +- None +- LogicalOperationStack +- DateTime +- Timestamp +- ProcessId +- ThreadId +- Callstack + +None is the default. To specify multiple options, separate them with commas, but with no spaces, and enclose them in quotation marks, such as "ProcessID,ThreadID". ```yaml Type: TraceOptions Parameter Sets: optionsSet -Aliases: +Aliases: +Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False Position: Named -Default value: "None" +Default value: None Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/5.0/Microsoft.PowerShell.Utility/Set-TraceSource.md index 85e2f7b1414a..eebe12d65260 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -107,7 +107,7 @@ Accept wildcard characters: False ``` ### -ListenerOption -Specifies optional data to add to the prefix of each trace message in the output. +Specifies optional data to the prefix of each trace message in the output. The acceptable values for this parameter are: - None @@ -125,7 +125,7 @@ To specify multiple options, separate them with commas, but with no spaces, and ```yaml Type: TraceOptions Parameter Sets: optionsSet -Aliases: +Aliases: Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/5.1/Microsoft.PowerShell.Utility/Set-TraceSource.md index 3a159fa67a1a..12a086c65715 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -107,7 +107,8 @@ Accept wildcard characters: False ``` ### -ListenerOption -Specifies optional data to add to the prefix of each trace message in the output.The acceptable values for this parameter are: +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: - None - LogicalOperationStack diff --git a/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md b/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md index 2b255f16c570..d6850b719466 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md +++ b/reference/6/Microsoft.PowerShell.Utility/Set-TraceSource.md @@ -137,7 +137,8 @@ Accept wildcard characters: False ``` ### -ListenerOption -Specifies optional data to add to the prefix of each trace message in the output.The acceptable values for this parameter are: +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: - None - LogicalOperationStack @@ -154,8 +155,8 @@ To specify multiple options, separate them with commas, but with no spaces, and ```yaml Type: TraceOptions Parameter Sets: optionsSet -Aliases: -Accepted values: None, Constructor, Dispose, Finalizer, Method, Property, Delegates, Events, Exception, Lock, Error, Errors, Warning, Verbose, WriteLine, Data, Scope, ExecutionFlow, Assert, All +Aliases: +Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False Position: Named From 85a3adb57f82cff480d65dfa36a0a990779532c0 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 14 Dec 2017 00:44:46 +0900 Subject: [PATCH 103/145] Fix Trace-Command -ListenerOption parameter (#1948) * Fixed the value of "Accepted values:" * Fixed minor differences in formatting and wording --- .../Trace-Command.md | 16 +++++++++++++--- .../Trace-Command.md | 16 +++++++++++++--- .../Trace-Command.md | 3 ++- .../Trace-Command.md | 5 +++-- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/3.0/Microsoft.PowerShell.Utility/Trace-Command.md index 9435adfbd072..4721f2eaf9af 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Trace-Command.md @@ -178,9 +178,18 @@ Accept wildcard characters: False ``` ### -ListenerOption -Adds optional data to the prefix of each trace message in the output. -The valid values are None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, and Callstack. -"None" is the default. +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: + +- None +- LogicalOperationStack +- DateTime +- Timestamp +- ProcessId +- ThreadId +- Callstack + +None is the default. To specify multiple options, separate them with commas, but with no spaces, and enclose them in quotation marks, such as "ProcessID,ThreadID". @@ -188,6 +197,7 @@ To specify multiple options, separate them with commas, but with no spaces, and Type: TraceOptions Parameter Sets: (All) Aliases: +Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False Position: Named diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/4.0/Microsoft.PowerShell.Utility/Trace-Command.md index 3feca7361691..4afcacb5117d 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Trace-Command.md @@ -183,9 +183,18 @@ Accept wildcard characters: False ``` ### -ListenerOption -Adds optional data to the prefix of each trace message in the output. -The valid values are None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, and Callstack. -"None" is the default. +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: + +- None +- LogicalOperationStack +- DateTime +- Timestamp +- ProcessId +- ThreadId +- Callstack + +None is the default. To specify multiple options, separate them with commas, but with no spaces, and enclose them in quotation marks, such as "ProcessID,ThreadID". @@ -193,6 +202,7 @@ To specify multiple options, separate them with commas, but with no spaces, and Type: TraceOptions Parameter Sets: (All) Aliases: +Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False Position: Named diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md index a61abffdee59..a2a243e10d0b 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Trace-Command.md @@ -183,7 +183,8 @@ Accept wildcard characters: False ``` ### -ListenerOption -Specifies optional data to the prefix of each trace message in the output.The acceptable values for this parameter are: +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: - None - LogicalOperationStack diff --git a/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md b/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md index cb751988bf9c..f4db42f35e2a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md +++ b/reference/6/Microsoft.PowerShell.Utility/Trace-Command.md @@ -183,7 +183,8 @@ Accept wildcard characters: False ``` ### -ListenerOption -Specifies optional data to the prefix of each trace message in the output.The acceptable values for this parameter are: +Specifies optional data to the prefix of each trace message in the output. +The acceptable values for this parameter are: - None - LogicalOperationStack @@ -201,7 +202,7 @@ To specify multiple options, separate them with commas, but with no spaces, and Type: TraceOptions Parameter Sets: (All) Aliases: -Accepted values: None, Constructor, Dispose, Finalizer, Method, Property, Delegates, Events, Exception, Lock, Error, Errors, Warning, Verbose, WriteLine, Data, Scope, ExecutionFlow, Assert, All +Accepted values: None, LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack Required: False Position: Named From ba3ae323d9640a69fc206509a683394517ee0c1b Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 15 Dec 2017 01:11:47 +0900 Subject: [PATCH 104/145] Fix parameter's position in Select-Xml.md (#1953) --- .../Select-Xml.md | 26 +++++---- .../Select-Xml.md | 26 +++++---- .../Select-Xml.md | 20 ++++--- .../Select-Xml.md | 20 ++++--- .../Select-Xml.md | 57 +++++-------------- 5 files changed, 69 insertions(+), 80 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/3.0/Microsoft.PowerShell.Utility/Select-Xml.md index 1a383fcb6644..30edc8f4ddf8 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Select-Xml.md @@ -14,23 +14,27 @@ Finds text in an XML string or document. ## SYNTAX ### Xml (Default) -``` -Select-Xml [-Xml] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Xml] [-Namespace ] + [] ``` ### Path -``` -Select-Xml [-Path] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Path] [-Namespace ] + [] ``` ### LiteralPath -``` -Select-Xml -LiteralPath [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -LiteralPath [-Namespace ] + [] ``` ### Content -``` -Select-Xml -Content [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -Content [-Namespace ] + [] ``` ## DESCRIPTION @@ -214,7 +218,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True @@ -231,7 +235,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -249,7 +253,7 @@ Parameter Sets: Xml Aliases: Node Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/4.0/Microsoft.PowerShell.Utility/Select-Xml.md index 27dd86a4e05c..5d88cc4b07f2 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Select-Xml.md @@ -16,23 +16,27 @@ Finds text in an XML string or document. ## SYNTAX ### Xml (Default) -``` -Select-Xml [-Xml] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Xml] [-Namespace ] + [] ``` ### Path -``` -Select-Xml [-Path] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Path] [-Namespace ] + [] ``` ### LiteralPath -``` -Select-Xml -LiteralPath [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -LiteralPath [-Namespace ] + [] ``` ### Content -``` -Select-Xml -Content [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -Content [-Namespace ] + [] ``` ## DESCRIPTION @@ -222,7 +226,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True @@ -239,7 +243,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -257,7 +261,7 @@ Parameter Sets: Xml Aliases: Node Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/5.0/Microsoft.PowerShell.Utility/Select-Xml.md index d148c2dee109..1ed9f4cbf757 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Select-Xml.md @@ -16,23 +16,27 @@ Finds text in an XML string or document. ## SYNTAX ### Xml (Default) -``` -Select-Xml [-Xml] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Xml] [-Namespace ] + [] ``` ### Path -``` -Select-Xml [-Path] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Path] [-Namespace ] + [] ``` ### LiteralPath -``` -Select-Xml -LiteralPath [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -LiteralPath [-Namespace ] + [] ``` ### Content -``` -Select-Xml -Content [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -Content [-Namespace ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md index d148c2dee109..1ed9f4cbf757 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-Xml.md @@ -16,23 +16,27 @@ Finds text in an XML string or document. ## SYNTAX ### Xml (Default) -``` -Select-Xml [-Xml] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Xml] [-Namespace ] + [] ``` ### Path -``` -Select-Xml [-Path] [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] [-Path] [-Namespace ] + [] ``` ### LiteralPath -``` -Select-Xml -LiteralPath [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -LiteralPath [-Namespace ] + [] ``` ### Content -``` -Select-Xml -Content [-XPath] [-Namespace ] [] +```powershell +Select-Xml [-XPath] -Content [-Namespace ] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md b/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md index 049b264b4022..68018279e772 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md +++ b/reference/6/Microsoft.PowerShell.Utility/Select-Xml.md @@ -16,27 +16,27 @@ Finds text in an XML string or document. ## SYNTAX ### Xml (Default) -``` -Select-Xml [-Xml] [-XPath] [-Namespace ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +Select-Xml [-XPath] [-Xml] [-Namespace ] + [] ``` ### Path -``` -Select-Xml [-Path] [-XPath] [-Namespace ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +Select-Xml [-XPath] [-Path] [-Namespace ] + [] ``` ### LiteralPath -``` -Select-Xml -LiteralPath [-XPath] [-Namespace ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +Select-Xml [-XPath] -LiteralPath [-Namespace ] + [] ``` ### Content -``` -Select-Xml -Content [-XPath] [-Namespace ] - [-InformationAction ] [-InformationVariable ] [] +```powershell +Select-Xml [-XPath] -Content [-Namespace ] + [] ``` ## DESCRIPTION @@ -203,33 +203,6 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -InformationAction -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Namespace Specifies a hash table of the namespaces used in the XML. Use the format @{\ = \}. @@ -260,7 +233,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False @@ -277,7 +250,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -295,7 +268,7 @@ Parameter Sets: Xml Aliases: Node Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False From e9721d208e9e42f7967675b976bb1c1f6c80afa9 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 15 Dec 2017 01:13:16 +0900 Subject: [PATCH 105/145] Fix Get-Alias -Name parameter (#1952) * Position: 0 * Default value: All aliases * Accept wildcard characters: True * Fixed minor differences in formatting and wording And also removed InformationAction/InformationVariable in v6.0. --- .../Microsoft.PowerShell.Utility/Get-Alias.md | 22 ++++---- .../Microsoft.PowerShell.Utility/Get-Alias.md | 22 ++++---- .../Microsoft.PowerShell.Utility/Get-Alias.md | 22 ++++---- .../Microsoft.PowerShell.Utility/Get-Alias.md | 22 ++++---- .../Microsoft.PowerShell.Utility/Get-Alias.md | 51 +++++-------------- 5 files changed, 60 insertions(+), 79 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md index d5cc83616c44..0d3b2fa3b993 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Get-Alias.md @@ -14,13 +14,15 @@ Gets the aliases for the current session. ## SYNTAX ### Default (Default) -``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +```powershell +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition -``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +```powershell +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -139,19 +141,19 @@ Accept wildcard characters: True ``` ### -Name -Specifies the aliases to retrieve. +Specifies the aliases that this cmdlet gets. Wildcards are permitted. -By default, Get-Alias retrieves all aliases defined for the current session. -The parameter name ("Name") is optional. -You can also pipe alias names to Get-Alias. +By default, `Get-Alias` retrieves all aliases defined for the current session. +The parameter name **Name** is optional. +You can also pipe alias names to `Get-Alias`. ```yaml Type: String[] Parameter Sets: Default -Aliases: +Aliases: Required: False -Position: 1 +Position: 0 Default value: All aliases Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md index 32666d375c1e..33741ff3cc8a 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Get-Alias.md @@ -16,13 +16,15 @@ Gets the aliases for the current session. ## SYNTAX ### Default (Default) -``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +```powershell +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition -``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +```powershell +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -146,19 +148,19 @@ Accept wildcard characters: True ``` ### -Name -Specifies the aliases to retrieve. +Specifies the aliases that this cmdlet gets. Wildcards are permitted. -By default, Get-Alias retrieves all aliases defined for the current session. -The parameter name ("Name") is optional. -You can also pipe alias names to Get-Alias. +By default, `Get-Alias` retrieves all aliases defined for the current session. +The parameter name **Name** is optional. +You can also pipe alias names to `Get-Alias`. ```yaml Type: String[] Parameter Sets: Default -Aliases: +Aliases: Required: False -Position: 1 +Position: 0 Default value: All aliases Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: True diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md index b98e54e4a55d..3a0dfb2d541b 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-Alias.md @@ -16,13 +16,15 @@ Gets the aliases for the current session. ## SYNTAX ### Default (Default) -``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +```powershell +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition -``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +```powershell +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -148,20 +150,20 @@ Accept wildcard characters: False ### -Name Specifies the aliases that this cmdlet gets. Wildcards are permitted. -By default, **Get-Alias** retrieves all aliases defined for the current session. -The parameter name *Name* is optional. -You can also pipe alias names to **Get-Alias**. +By default, `Get-Alias` retrieves all aliases defined for the current session. +The parameter name **Name** is optional. +You can also pipe alias names to `Get-Alias`. ```yaml Type: String[] Parameter Sets: Default -Aliases: +Aliases: Required: False Position: 0 -Default value: None +Default value: All aliases Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Scope diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md index dbdaf6e0741b..9b7cea698f66 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md @@ -16,13 +16,15 @@ Gets the aliases for the current session. ## SYNTAX ### Default (Default) -``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +```powershell +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition -``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +```powershell +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -137,20 +139,20 @@ Accept wildcard characters: False ### -Name Specifies the aliases that this cmdlet gets. Wildcards are permitted. -By default, **Get-Alias** retrieves all aliases defined for the current session. -The parameter name *Name* is optional. -You can also pipe alias names to **Get-Alias**. +By default, `Get-Alias` retrieves all aliases defined for the current session. +The parameter name **Name** is optional. +You can also pipe alias names to `Get-Alias`. ```yaml Type: String[] Parameter Sets: Default -Aliases: +Aliases: Required: False Position: 0 -Default value: None +Default value: All aliases Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Scope diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md index 7747dc402bdc..9b7cea698f66 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Alias.md @@ -16,15 +16,15 @@ Gets the aliases for the current session. ## SYNTAX ### Default (Default) -``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [-InformationAction ] - [-InformationVariable ] [] +```powershell +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition -``` +```powershell Get-Alias [-Exclude ] [-Scope ] [-Definition ] - [-InformationAction ] [-InformationVariable ] [] + [] ``` ## DESCRIPTION @@ -136,50 +136,23 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -This parameter is called Definition, because it searches for the item name in the Definition property of the alias object.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -This parameter is called Definition, because it searches for the item name in the Definition property of the alias object.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Name Specifies the aliases that this cmdlet gets. Wildcards are permitted. -By default, **Get-Alias** retrieves all aliases defined for the current session. -The parameter name *Name* is optional. -You can also pipe alias names to **Get-Alias**. +By default, `Get-Alias` retrieves all aliases defined for the current session. +The parameter name **Name** is optional. +You can also pipe alias names to `Get-Alias`. ```yaml Type: String[] Parameter Sets: Default -Aliases: +Aliases: Required: False -Position: 1 -Default value: None +Position: 0 +Default value: All aliases Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Scope From 41dc145eed06a733743c5ec766a7fca1f65f54db Mon Sep 17 00:00:00 2001 From: "J. Keith Bankston [MSFT]" Date: Thu, 14 Dec 2017 08:22:14 -0800 Subject: [PATCH 106/145] Wmf 5.1 cleanup (#1950) * Changed required PSGet version to 1.6.0 * Fixes to PSGet TOC and WMF 5.1 compat page * Add note explaining WMF does not ship in Windows --- wmf/5.1/compatibility.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wmf/5.1/compatibility.md b/wmf/5.1/compatibility.md index e3225df9033b..4f5fdc3cbec4 100644 --- a/wmf/5.1/compatibility.md +++ b/wmf/5.1/compatibility.md @@ -32,3 +32,7 @@ The features of WMF 5.1 were included in Windows Server 2016 and Windows 10 Anni WMF 5.1 is not applicable for these operating system versions, as the updates are provided via Windows Update. +One thing to note is that WMF does not ship in Windows. +WMF is an upgrade package that provides a set of Windows features to previously released Windows versions. +This can make an important difference when seeking assistance for any of those features, as the version of those components will not match what shipped in the original operating system. + From c11cc97183d8b4e41eef05bae64fceca0e72932b Mon Sep 17 00:00:00 2001 From: Finn Ellis Date: Thu, 14 Dec 2017 08:45:05 -0800 Subject: [PATCH 107/145] Typo fix ("you will are not" -> "you will not"). (#1951) * Typo fix ("you will are not" -> "you will not"). * Changed from passive voice to active voice --- reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md b/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md index db23cdff05dc..bc67d80cd668 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Stop-Process.md @@ -36,7 +36,7 @@ You can specify a process by process name or process ID (PID), or pass a process **Stop-Process** works only on processes running on the local computer. On Windows Vista and later versions of the Windows operating system, to stop a process that is not owned by the current user, you must start Windows PowerShell by using the Run as administrator option. -Also, you are will not be prompted for confirmation unless you specify the *Confirm* parameter. +Also, you are not prompted for confirmation unless you specify the *Confirm* parameter. ## EXAMPLES From 8be92ec3673ebedf30f75f7e86511711c8f0dd53 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 14 Dec 2017 09:57:36 -0800 Subject: [PATCH 108/145] added article about formatting code samples --- CONTRIBUTING.md | 1 + contributing/FORAMTTING-CODE.md | 169 ++++++++++++++++++++++++++++++++ contributing/STYLE.md | 43 +------- 3 files changed, 175 insertions(+), 38 deletions(-) create mode 100644 contributing/FORAMTTING-CODE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf075f5c0f25..cd24fefc9385 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,3 +7,4 @@ The following topics explain how to contribute to the PowerShell documentation. 1. [Get started](./contributing/GETSTARTED.md) 2. [Writing PowerShell documentation](./contributing/WRITING.md) 3. [Style Guide](./contributing/STYLE.md) +4. [Formatting code blocks](./contributing/FORMATTING-CODE.md). diff --git a/contributing/FORAMTTING-CODE.md b/contributing/FORAMTTING-CODE.md new file mode 100644 index 000000000000..113995fc6d67 --- /dev/null +++ b/contributing/FORAMTTING-CODE.md @@ -0,0 +1,169 @@ +# Formatting code blocks + +We want to adopt a consistent style for PowerShell code blocks and output in our documentation. +The existing documentation has uses multiple styles and the formatting rules have changed multiple times. +The current Open Publishing System (OPS) we use has a syntax highlighting feature that support many languages. +OPS also adds a **Copy** button that copies the contents of the code block to the clipboard. +This allows you to quickly paste the code into a script for testing the code example. +However, not all examples in our documentation are intended to be run. +Some code blocks are simple illustrations of a PowerShell concept. + +We are defining two scenarios for code blocks: + +1. Illustrative examples +2. Executable examples + +## Formatting illustrative examples + +Illustrative examples are used to explain a PowerShell concept. +They are not meant to be copied to the clipboard for execution. +These are most commonly used for simple examples that are easy to type. +They are also used for syntax examples where you are illustrating the syntax of a command. + +Illustrative examples use a "naked" code fence to mark the beginning and end of the code block. +The code block may contain example output from the command being illustrated. + +### Syntax block + +Here is an example of a syntax block: + + ``` + Get-Command [-Verb ] [-Noun ] [-Module ] + [-FullyQualifiedModule ] [-TotalCount ] [-Syntax] [-ShowCommandInfo] + [[-ArgumentList] ] [-All] [-ListImported] [-ParameterName ] + [-ParameterType ] [] + ``` + +This is example is illustrating all of the possible parameters of the `Get-Command` cmdlet. + +Here is another syntax example that is describing the `for` statement in general terms: + + ``` + for (>init>; ; ) + {} + ``` + +### Simple illustration example + +Here is an example illustrating PowerShell comparison operators: + + ``` + PS> 2 -eq 2 + True + + PS> 2 -eq 3 + False + + PS> 1,2,3 -eq 2 + 2 + + PS> "abc" -eq "abc" + True + + PS> "abc" -eq "abc", "def" + False + + PS> "abc", "def" -eq "abc" + abc + ``` + +Note that this example has the simplified PowerShell prompt and shows the resulting output. +In this case, we don't intend the reader to copy this example and try to run the copied code. + +## Formatting executable examples + +More complex examples or examples that would be useful to copy and execute should use \`\`\`powershell\`\`\` code fence markers. +Output emitted by PowerShell commands should be enclosed in a **Output** code block to prevent syntax highlighting. + + For example: + + ```powershell + Get-Command -Module Microsoft.PowerShell.Security + ``` + + ```Output + CommandType Name Version Source + ----------- ---- ------- ------ + Cmdlet ConvertFrom-SecureString 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet ConvertTo-SecureString 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Get-Acl 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Get-AuthenticodeSignature 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Get-CmsMessage 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Get-Credential 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Get-ExecutionPolicy 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Get-PfxCertificate 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet New-FileCatalog 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Protect-CmsMessage 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Set-Acl 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Set-AuthenticodeSignature 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Set-ExecutionPolicy 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Test-FileCatalog 3.0.0.0 Microsoft.PowerShell.Security + Cmdlet Unprotect-CmsMessage 3.0.0.0 Microsoft.PowerShell.Security + ``` + +The **Output** code label is not an official "language" supported by the syntax highlighting system. +However, this label is useful because OPS adds the "Output" label to the code box on the web page. +And this "Output" code box has no syntax highlighting. + +## Understanding the COPY button + +OPS also adds a **Copy** button that copies the contents of the code block to the clipboard. +This allows you to quickly paste the code into a script for testing the code example. +The **Copy** button also removes PowerShell prompts from the text before copying it to the clipboard. +The **Copy** button uses the following javascript code to remove the prompts. + +```javascript +if (language === 'powershell') { + text = text.replace(/\bPS [a-z]:\\>\s?/gi, ''); +} +``` + +Note that the regex used only matches simple prompts like "`PS C:\>`". +Prompts that include subdirectories or paths from other PSDrive providers will not be removed. +See the general guidelines, in the next section, for the appropriate use of prompts in examples. + +## General guidelines + +- Code fences + + Markdown allows for indentation to signal code block, however, all code blocks should be contained in a code fence. + A code fence is a block of code surrounded by \`\`\` strings. + The code fence markers must be on their own line before and after the code sample. + The marker at the start of the code block may have an optional language label. + See the previous discussion about illustrative and executable examples for the proper use of language labels. + +- Line continuation in code samples + + Avoid using line continuation characters (\`) in PowerShell code examples. + These are a hard to see and can cause problems if there are extra spaces on the end of the line. + Use PowerShell splatting to reduce line length for cmdlets that have a lot of parameters. + Take advantage of PowerShell's natural line break opportunities, like after pipe (\|) characters and opening braces, parentheses, and brackets. + +- PowerShell prompts in examples + + PowerShell prompts should only be used in illustrative examples (as defined previously). + For most of these examples, the prompt string should be "`PS>`". + This prompt is independent of OS-specific indicators. + Use of the prompt string is discouraged and should be limited to scenarios that are meant to illustrate command line usage. + More complex prompt strings are required for examples that illustrate commands that alter the prompt + or when the path displayed is significant to the scenario being illustrated. + The following example illustrate how the prompt changes when using the Registry provider. + + ``` + PS C:\> cd HKCU:\System\ + PS HKEY_CURRENT_USER\System\> dir + + + Hive: HKEY_CURRENT_USER\System + + + Name Property + ---- -------- + CurrentControlSet + GameConfigStore GameDVR_Enabled : 1 + GameDVR_FSEBehaviorMode : 2 + Win32_AutoGameModeDefaultProfile : {2, 0, 1, 0...} + Win32_GameModeRelatedProcesses : {1, 0, 1, 0...} + GameDVR_HonorUserFSEBehaviorMode : 0 + GameDVR_DXGIHonorFSEWindowsCompatible : 0 + ``` diff --git a/contributing/STYLE.md b/contributing/STYLE.md index cef7671966eb..c17e3e0562a8 100644 --- a/contributing/STYLE.md +++ b/contributing/STYLE.md @@ -6,7 +6,7 @@ There are several variants of PowerShell. This table defines some of the different terms used to discuss PowerShell. | Terminology | Definition | -| ----- | -----| +| ----- | ----- | | PowerShell | This is the default. We are shipping PowerShell. The term PowerShell can be legitimately used to indicate any of the particular editions. This can be used to refer to the language, framework and default cmdlets, etc. | | PowerShell Core (PSCore) | PowerShell built on .NET Core Common Language Runtime (CoreCLR) for any of the platforms. | | Windows PowerShell | PowerShell built on .NET Common Language Runtime (CLR). Windows PowerShell ships only on Windows and requires the complete CLR. | @@ -84,43 +84,6 @@ Adding or removing H2 causes a build break. This [`Write-Host`](..\reference\6\Microsoft.PowerShell.Utility\Write-Host.md) cmdlet uses the **-Object** parameter to ... -## Formatting code blocks - -* All PowerShell syntax blocks should use \`\`\`powershell\`\`\` code fence markers. - -* Do **NOT** start PowerShell commands with the PowerShell prompt ("`PS C:\>`"). - -* Avoid using line continuation characters (\`) in PowerShell code examples. - These are a hard to see and can cause problems if there are extra spaces on the end of the line. - -* Output emitted by PowerShell commands should be enclosed in a naked code block to prevent it from recieving syntax highlighting. - - For example: - - ```powershell - Get-Command -Module Microsoft.PowerShell.Security - ``` - - ``` - CommandType Name Version Source - ----------- ---- ------- ------ - Cmdlet ConvertFrom-SecureString 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet ConvertTo-SecureString 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Get-Acl 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Get-AuthenticodeSignature 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Get-CmsMessage 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Get-Credential 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Get-ExecutionPolicy 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Get-PfxCertificate 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet New-FileCatalog 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Protect-CmsMessage 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Set-Acl 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Set-AuthenticodeSignature 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Set-ExecutionPolicy 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Test-FileCatalog 3.0.0.0 Microsoft.PowerShell.Security - Cmdlet Unprotect-CmsMessage 3.0.0.0 Microsoft.PowerShell.Security - ``` - ## Lists * Do not end list items with a period (unless they contain multiple sentences) @@ -162,6 +125,10 @@ There are special rules for linking to reference topics from conceptual topics. \[TO DO\] - document special rules +## Next steps + +See [Formatting code blocks](FORMATTING-CODE.md). + [pascal-case]: https://en.wikipedia.org/wiki/PascalCase [issue1806]: https://github.com/PowerShell/PowerShell-Docs/issues/1806 From 52c3d1d3291f977d13974267055a8e8c43417820 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 14 Dec 2017 10:10:25 -0800 Subject: [PATCH 109/145] fixing typos --- contributing/FORAMTTING-CODE.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contributing/FORAMTTING-CODE.md b/contributing/FORAMTTING-CODE.md index 113995fc6d67..c7f261f04df5 100644 --- a/contributing/FORAMTTING-CODE.md +++ b/contributing/FORAMTTING-CODE.md @@ -1,8 +1,8 @@ # Formatting code blocks +The existing documentation has used multiple styles, over time, and the formatting rules have changed multiple times. We want to adopt a consistent style for PowerShell code blocks and output in our documentation. -The existing documentation has uses multiple styles and the formatting rules have changed multiple times. -The current Open Publishing System (OPS) we use has a syntax highlighting feature that support many languages. +The current Open Publishing System (OPS) we use has a syntax highlighting feature that supports many languages. OPS also adds a **Copy** button that copies the contents of the code block to the clipboard. This allows you to quickly paste the code into a script for testing the code example. However, not all examples in our documentation are intended to be run. @@ -141,7 +141,8 @@ See the general guidelines, in the next section, for the appropriate use of prom - PowerShell prompts in examples - PowerShell prompts should only be used in illustrative examples (as defined previously). + PowerShell prompts should only be used in illustrative examples. + Prompts should **NOT** be used in executable examples. For most of these examples, the prompt string should be "`PS>`". This prompt is independent of OS-specific indicators. Use of the prompt string is discouraged and should be limited to scenarios that are meant to illustrate command line usage. From da136b5c4e3db391a6a49f8e5ea516bb2845fda9 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 14 Dec 2017 10:39:29 -0800 Subject: [PATCH 110/145] fixed typos and incorporated feedback --- contributing/FORAMTTING-CODE.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/contributing/FORAMTTING-CODE.md b/contributing/FORAMTTING-CODE.md index c7f261f04df5..2a3c43e6ff88 100644 --- a/contributing/FORAMTTING-CODE.md +++ b/contributing/FORAMTTING-CODE.md @@ -34,12 +34,12 @@ Here is an example of a syntax block: [-ParameterType ] [] ``` -This is example is illustrating all of the possible parameters of the `Get-Command` cmdlet. +This example illustrates all of the possible parameters of the `Get-Command` cmdlet. -Here is another syntax example that is describing the `for` statement in general terms: +Here is another syntax example describing the `for` statement in generalized terms: ``` - for (>init>; ; ) + for (; ; ) {} ``` @@ -126,7 +126,8 @@ See the general guidelines, in the next section, for the appropriate use of prom - Code fences - Markdown allows for indentation to signal code block, however, all code blocks should be contained in a code fence. + Markdown allows for indentation to signify a code block, but this pattern can be problematic and should be avoided. + All code blocks should be contained in a code fence. A code fence is a block of code surrounded by \`\`\` strings. The code fence markers must be on their own line before and after the code sample. The marker at the start of the code block may have an optional language label. @@ -135,7 +136,7 @@ See the general guidelines, in the next section, for the appropriate use of prom - Line continuation in code samples Avoid using line continuation characters (\`) in PowerShell code examples. - These are a hard to see and can cause problems if there are extra spaces on the end of the line. + These are hard to see and can cause problems if there are extra spaces on the end of the line. Use PowerShell splatting to reduce line length for cmdlets that have a lot of parameters. Take advantage of PowerShell's natural line break opportunities, like after pipe (\|) characters and opening braces, parentheses, and brackets. From 7f1bfb61282994c74a2f4e20d5d7935638113c3d Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 14 Dec 2017 11:48:45 -0800 Subject: [PATCH 111/145] updating metadata tags in docfx.json --- dsc/docfx.json | 2 +- gallery/docfx.json | 4 ++-- jea/docfx.json | 2 +- reference/docfx.json | 4 ++-- reference/docs-conceptual/docfx.json | 4 ++-- wmf/docfx.json | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dsc/docfx.json b/dsc/docfx.json index 6efaf25b9e83..723ddcc7b52b 100644 --- a/dsc/docfx.json +++ b/dsc/docfx.json @@ -20,7 +20,7 @@ "manager": "carmonm", "ms.devlang": "powershell", "ms.tgt_pltfr": "windows", - "ms.author": "eslesar" + "ms.author": "sewhee" }, "resource": [ { diff --git a/gallery/docfx.json b/gallery/docfx.json index 3b4663cfff20..7015d17719f4 100644 --- a/gallery/docfx.json +++ b/gallery/docfx.json @@ -18,8 +18,8 @@ "manager": "carmonm", "ms.devlang": "powershell", "ms.tgt_pltfr": "windows, macos, linux", - "author": "juanpablojofre", - "ms.author": "jpjofre" + "author": "JKeithB", + "ms.author": "keithb" }, "resource": [ { diff --git a/jea/docfx.json b/jea/docfx.json index eab8a2008c19..431b86b21360 100644 --- a/jea/docfx.json +++ b/jea/docfx.json @@ -18,7 +18,7 @@ "manager": "carmonm", "ms.devlang": "powershell", "ms.tgt_pltfr": "windows", - "ms.author": "jpjofre" + "ms.author": "sewhee" }, "resource": [ { diff --git a/reference/docfx.json b/reference/docfx.json index 681ad61f080d..a8365f764236 100644 --- a/reference/docfx.json +++ b/reference/docfx.json @@ -238,8 +238,8 @@ "ms.topic": "reference", "manager": "carmonm", "ms.tgt_pltfr": "windows, macos, linux", - "author": "juanpablojofre", - "ms.author": "jpjofre" + "author": "sdwheeler", + "ms.author": "sewhee" }, "fileMetadata": {}, "template": [], diff --git a/reference/docs-conceptual/docfx.json b/reference/docs-conceptual/docfx.json index a95f0da40d0b..a557e8d563cb 100644 --- a/reference/docs-conceptual/docfx.json +++ b/reference/docs-conceptual/docfx.json @@ -16,8 +16,8 @@ "manager": "carmonm", "ms.devlang": "powershell", "ms.tgt_pltfr": "windows, macos, linux", - "author": "juanpablojofre", - "ms.author": "jpjofre" + "author": "sdwheeler", + "ms.author": "sewhee" }, "resource": [ { diff --git a/wmf/docfx.json b/wmf/docfx.json index a372afa1f7b3..baf309eb2474 100644 --- a/wmf/docfx.json +++ b/wmf/docfx.json @@ -14,11 +14,11 @@ "uhfHeaderId": "MSDocsHeader-Powershell", "ROBOTS": "INDEX, FOLLOW", "ms.prod": "powershell", - "ms.technology": "wmf", + "ms.technology": "", "manager": "carmonm", "ms.devlang": "powershell", "ms.tgt_pltfr": "windows", - "ms.author": "jpjofre" + "ms.author": "keithb" }, "resource": [ { From d0b75bba3f769ad5599932d468d3fc75ada28a30 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 14 Dec 2017 15:24:56 -0800 Subject: [PATCH 112/145] fixing filename spelling --- contributing/{FORAMTTING-CODE.md => FORMATTING-CODE.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename contributing/{FORAMTTING-CODE.md => FORMATTING-CODE.md} (100%) diff --git a/contributing/FORAMTTING-CODE.md b/contributing/FORMATTING-CODE.md similarity index 100% rename from contributing/FORAMTTING-CODE.md rename to contributing/FORMATTING-CODE.md From 8c303f12a48e360e6c15e54da6727c0e19a40a00 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 16 Dec 2017 01:58:19 +0900 Subject: [PATCH 113/145] Fix parameter's position in Get-Content.md (#1959) --- .../Get-Content.md | 24 ++++---- .../Get-Content.md | 24 ++++---- .../Get-Content.md | 22 +++++--- .../Get-Content.md | 22 +++++--- .../Get-Content.md | 55 +++++-------------- 5 files changed, 67 insertions(+), 80 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md index 04238e93f1d4..8d68eac2331a 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md @@ -14,19 +14,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION @@ -311,7 +315,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md index f800a5413a72..f68c52f161b7 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md @@ -16,19 +16,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION @@ -198,7 +202,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: True diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md index 2e35c6b18336..3c363fae179e 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md @@ -16,19 +16,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md index 2e35c6b18336..3c363fae179e 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md @@ -16,19 +16,23 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-UseTransaction] [-Delimiter ] [-Wait] [-Raw] [-Encoding ] - [-Stream ] [] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Content.md b/reference/6/Microsoft.PowerShell.Management/Get-Content.md index 3d791cf66471..a1e2150bf7b4 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Content.md @@ -16,20 +16,22 @@ Gets the content of the item at the specified location. ## SYNTAX ### Path (Default) -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] [-Path] [-Filter ] - [-Include ] [-Exclude ] [-Force] [-Credential ] - [-InformationAction ] [-InformationVariable ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content [-Path] [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` ### LiteralPath -``` -Get-Content [-ReadCount ] [-TotalCount ] [-Tail ] -LiteralPath - [-Filter ] [-Include ] [-Exclude ] [-Force] [-Credential ] - [-InformationAction ] [-InformationVariable ] [-UseTransaction] - [-Delimiter ] [-Wait] [-Raw] [-Encoding ] [-Stream ] +```powershell +Get-Content -LiteralPath [-ReadCount ] [-TotalCount ] + [-Tail ] [-Filter ] [-Include ] [-Exclude ] + [-Force] [-Credential ] [-UseTransaction] + [-Delimiter ] [-Wait] [-Raw] + [-Encoding ] [-Stream ] [] ``` @@ -263,37 +265,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers that are installed with Windows PowerShell.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -Type a user name, such as "User01" or "Domain01\User01", or enter a PSCredential object, such as one generated by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password. - -This parameter is not supported by any providers that are installed with Windows PowerShell.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -LiteralPath Specifies the path to an item. Unlike the *Path* parameter, the value of *LiteralPath* is used exactly as it is typed. @@ -324,7 +295,7 @@ Parameter Sets: Path Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False From 2dffaffcd703baebde205c6a08e2b4a222552205 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 16 Dec 2017 02:00:55 +0900 Subject: [PATCH 114/145] Fix parameter's position in Get-Member.md (#1958) --- .../Get-Member.md | 9 +-- .../Get-Member.md | 9 +-- .../Get-Member.md | 7 ++- .../Get-Member.md | 7 ++- .../Get-Member.md | 57 ++----------------- 5 files changed, 23 insertions(+), 66 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md b/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md index 954078f45989..d364f15c5e28 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Get-Member.md @@ -13,9 +13,10 @@ title: Get-Member Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION @@ -332,7 +333,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md b/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md index 48eb34b9689e..03013d53f605 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,9 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION @@ -342,7 +343,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md index 420debf1684a..fc77c370bcb4 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,9 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md index d2e853f4466e..04e3bdb0df2b 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,9 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-Member.md b/reference/6/Microsoft.PowerShell.Utility/Get-Member.md index 81731190de48..04e3bdb0df2b 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-Member.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-Member.md @@ -15,10 +15,10 @@ Gets the properties and methods of objects. ## SYNTAX -``` -Get-Member [-InputObject ] [[-Name] ] [-MemberType ] - [-View ] [-Static] [-Force] [-InformationAction ] - [-InformationVariable ] [] +```powershell +Get-Member [[-Name] ] [-InputObject ] + [-MemberType ] [-View ] [-Static] [-Force] + [] ``` ## DESCRIPTION @@ -267,53 +267,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -The following list describes the properties that are added when you use the Force parameter: - --- PSBase: The original properties of the .NET Framework object without extension or adaptation. These are the properties defined for the object class and listed in MSDN. - --- PSAdapted: The properties and methods defined in the Windows PowerShell extended type system. - --- PSExtended: The properties and methods that were added in the Types.ps1xml files or by using the Add-Member cmdlet. - --- PSObject: The adapter that converts the base object to a Windows PowerShell PSObject object. - --- PSTypeNames: A list of object types that describe the object, in order of specificity. When formatting the object, Windows PowerShell searches for the types in the Format.ps1xml files in the Windows PowerShell installation directory ($pshome). It uses the formatting definition for the first type that it finds.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -The following list describes the properties that are added when you use the Force parameter: - --- PSBase: The original properties of the .NET Framework object without extension or adaptation. These are the properties defined for the object class and listed in MSDN. - --- PSAdapted: The properties and methods defined in the Windows PowerShell extended type system. - --- PSExtended: The properties and methods that were added in the Types.ps1xml files or by using the Add-Member cmdlet. - --- PSObject: The adapter that converts the base object to a Windows PowerShell PSObject object. - --- PSTypeNames: A list of object types that describe the object, in order of specificity. When formatting the object, Windows PowerShell searches for the types in the Format.ps1xml files in the Windows PowerShell installation directory ($pshome). It uses the formatting definition for the first type that it finds.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the object whose members are retrieved. @@ -393,7 +346,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False From fa5064be89bdfd036ebcdc53ef9e9a6b418423f5 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 16 Dec 2017 02:02:30 +0900 Subject: [PATCH 115/145] Update PSGallery "Items Tab" (for the new prerelease feature) (#1957) --- gallery/psgallery/psgallery_items_tab.md | 64 ++++++++++++++---------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/gallery/psgallery/psgallery_items_tab.md b/gallery/psgallery/psgallery_items_tab.md index 427fd211948d..e72a6326ef7d 100644 --- a/gallery/psgallery/psgallery_items_tab.md +++ b/gallery/psgallery/psgallery_items_tab.md @@ -6,40 +6,50 @@ keywords: gallery,powershell,cmdlet,psgallery title: psgallery_items_tab --- -Items Tab -========== +# Items Tab -The Items Tab displays all available items in the PowerShell Gallery. - -To see only Modules in the PowerShell Gallery, click Modules in the Items Tab drop down. Similarly, to see only Scripts in the PowerShell Gallery, click Scripts in the Items Tab drop down. +The [Items tab](https://www.powershellgallery.com/items) displays all available items in the PowerShell Gallery. +There are several ways to filter, sort, and search the items. To see more details about a particular item, click the item. -There are several ways to sort the items: +## Filter By + +The drop-down under "Filter By" allows users to filter the results by: +* Include Prerelease +* Stable Only + +For information about "Prerelease" and "Stable", see [Prerelease Versioning Added to PowerShellGet and PowerShell Gallery](https://blogs.msdn.microsoft.com/powershell/2017/12/05/prerelease-versioning-added-to-powershellget-and-powershell-gallery/) in the PowerShell Team Blog. + +The checkboxes under the drop-down allow users to filter the results by: +* Item Types + - Module + - Script +* Categories + - Cmdlet + - DSC Resource + - Function + - Role Capability + - Workflow -##Filter By## -The Filter By section allows users to filter the results by: -* Item Type: - * Modules - * Scripts -* Category: - * Cmdlet - * DSC Resource - * Function - * Workflow +To see only modules in the PowerShell Gallery, check Module in the Item Types. +Similarly, to see only scripts in the PowerShell Gallery, check Script in the Item Types. -Note: Filters are inclusive. -Example: An item containing both Cmdlets and Functions will appear if either Cmdlet or Function (or both) are checked. If neither are selected, the item will not appear. -Similarly, if all categories are selected, only items containing one of those categories will appear. **Items that do not belong to any of those categories will not appear.** +> [!NOTE] +> Filters are inclusive. +> Example: An item containing both cmdlets and functions will appear if either Cmdlet or Function (or both) are checked. +> If neither are selected, the item will not appear. +> Similarly, if all categories are selected, only items containing one of those categories will appear. +> **Items that do not belong to any of those categories will not appear.** -##Sort By## -The Sort By drop down allows users to sort the results by: -* Popularity - Popularity is determined by Download Count. -* A-Z - Alphabetically by item name. -* Recent - Items appear in order of publish date. +## Sort By +The Sort By drop-down allows users to sort the results by: +* Popularity - Popularity is determined by Download Count +* A-Z - Alphabetically by item name +* Recent - Items appear in order of publish date -##Search Box## -The Search Box allows users to search the items on keywords. -See [Search Syntax](./psgallery_search_syntax.md) for more details. +## Search Box +The Search Box allows users to search the items on keywords. +For more information, see [Gallery Search Syntax](psgallery_search_syntax.md). From 8190bfc1d01341ea866cd661db16955324a9ef58 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Tue, 19 Dec 2017 00:28:21 +0900 Subject: [PATCH 116/145] Fix link for about_WorkflowCommonParameters in New-PSWorkflowExecutionOption.md (#1962) --- reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md | 2 +- reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md | 2 +- reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md | 2 +- reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md index 32ef132f0e59..a2303245b219 100644 --- a/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/3.0/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -34,7 +34,7 @@ If you omit a parameter, the cmdlet creates the object with a default value for The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParametershttp://technet.microsoft.com/library/jj129719(v=wps.620).aspx. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet is introduced in Windows PowerShell 3.0. ## EXAMPLES diff --git a/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md index 5af451b1aa8d..aed6220891ee 100644 --- a/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/4.0/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -36,7 +36,7 @@ If you omit a parameter, the cmdlet creates the object with a default value for The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParametershttp://technet.microsoft.com/library/jj129719(v=wps.630).aspx. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet is introduced in Windows PowerShell 3.0. diff --git a/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md index 706681305c09..8ac686ea2fa5 100644 --- a/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/5.0/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -36,7 +36,7 @@ If you do not specify a parameter, the cmdlet creates the object that has a defa The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParameters. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet was introduced in Windows PowerShell 3.0. diff --git a/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md b/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md index f05b67d76beb..121ff390a00a 100644 --- a/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md +++ b/reference/5.1/PSWorkflow/New-PSWorkflowExecutionOption.md @@ -36,7 +36,7 @@ If you do not specify a parameter, the cmdlet creates the object that has a defa The **New-PSWorkflowExecutionOption** cmdlet is part of the Windows PowerShell Workflow feature. You can also add workflow common parameters to this command. -For more information about workflow common parameters, see about_WorkflowCommonParameters. +For more information about workflow common parameters, see [about_WorkflowCommonParameters](About/about_WorkflowCommonParameters.md). This cmdlet was introduced in Windows PowerShell 3.0. From 9cfd38ab5f72a7fdffd98216ed211a6df6308925 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Tue, 19 Dec 2017 00:29:05 +0900 Subject: [PATCH 117/145] Fix link for about_Types.ps1xml in Update-TypeData.md (#1961) --- reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md | 3 ++- reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md | 2 +- reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md | 2 +- reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md | 2 +- reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md index 844cffefac78..c1ecd88f89ad 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -59,7 +59,8 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the Update-TypeData cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (http://go.microsoft.com/fwlink/?LinkID=113274). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). + ## EXAMPLES ### Example 1 diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md index 2feec400b9c5..04dc761b9bd0 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -61,7 +61,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the Update-TypeData cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md index b9277d09b46b..0e3c0ac548db 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -61,7 +61,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the **Update-TypeData** cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md index b9277d09b46b..0e3c0ac548db 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -61,7 +61,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the **Update-TypeData** cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES diff --git a/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md b/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md index da6b69eeec7e..745f56fea75a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md +++ b/reference/6/Microsoft.PowerShell.Utility/Update-TypeData.md @@ -64,7 +64,7 @@ If you are getting .NET Framework properties, you can work around the suppressio Note that method syntax can only be used with .NET Framework properties. Properties that are added by running the **Update-TypeData** cmdlet cannot use method syntax. -For more information about the *types.ps1xml files in Windows PowerShell, see about_Types.ps1xml (..\Microsoft.PowerShell.Core\About\about_Types.ps1xml.md). +For more information about the *types.ps1xml files in PowerShell, see [about_Types.ps1xml](../Microsoft.PowerShell.Core/About/about_Types.ps1xml.md). ## EXAMPLES From 219e848e8e2582eba9d505d409e43d706a017689 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 20 Dec 2017 03:31:21 +0900 Subject: [PATCH 118/145] Fix parameter's position in Group-Object.md (#1966) --- .../Group-Object.md | 8 +++-- .../Group-Object.md | 7 ++-- .../Group-Object.md | 5 +-- .../Group-Object.md | 5 +-- .../Group-Object.md | 33 ++----------------- 5 files changed, 18 insertions(+), 40 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md index 21ab7f95fcd4..a9b3bf78c886 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -11,11 +11,13 @@ title: Group-Object # Group-Object ## SYNOPSIS Groups objects that contain the same value for specified properties. + ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION @@ -325,7 +327,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md index d504fce222a0..e5225ee55e0e 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,9 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION @@ -337,7 +338,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md index 1dc7b6a684c2..a3bde2c8b12c 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,9 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md index 454e3d84d85b..70a564b10018 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,9 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/Group-Object.md b/reference/6/Microsoft.PowerShell.Utility/Group-Object.md index 9f93095351f9..70a564b10018 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Group-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Group-Object.md @@ -16,8 +16,8 @@ Groups objects that contain the same value for specified properties. ## SYNTAX ``` -Group-Object [-NoElement] [-AsHashTable] [-AsString] [-InputObject ] [[-Property] ] - [-Culture ] [-CaseSensitive] [-InformationAction ] [-InformationVariable ] +Group-Object [[-Property] ] [-NoElement] [-AsHashTable] [-AsString] + [-InputObject ] [-Culture ] [-CaseSensitive] [] ``` @@ -277,33 +277,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -By itself, the AsHashTable parameter returns each hash table in which each key is an instance of the grouped object. When used with the AsString parameter, the keys in the hash table are strings.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -By itself, the AsHashTable parameter returns each hash table in which each key is an instance of the grouped object. When used with the AsString parameter, the keys in the hash table are strings.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the objects to group. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -353,7 +326,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False From 91a778ceae0f4c5c2c9ca693c42fec172b8e93fa Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 20 Dec 2017 03:32:18 +0900 Subject: [PATCH 119/145] Fix hex values in about_Arithmetic_Operators.md (#1965) --- .../About/about_Arithmetic_Operators.md | 4 ++-- .../About/about_Arithmetic_Operators.md | 4 ++-- .../About/about_Arithmetic_Operators.md | 4 ++-- .../About/about_Arithmetic_Operators.md | 4 ++-- .../About/about_Arithmetic_Operators.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md b/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md index a08a495cb977..e43e89a58ad6 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Arithmetic_Operators.md @@ -501,8 +501,8 @@ right operand determine how many bits of the left operand are shifted. |`21 -shr 31` | 0 | 0000 0000 | 0x00 | |`21 -shr 32` | 21 | 0001 0101 | 0x15 | |`21 -shr 64` | 21 | 0001 0101 | 0x15 | -|`21 -shr 65` | 10 | 0000 1010 | 0x15 | -|`21 -shr 66` | 5 | 0000 0101 | 0x15 | +|`21 -shr 65` | 10 | 0000 1010 | 0x0A | +|`21 -shr 66` | 5 | 0000 0101 | 0x05 | |`[int]::MaxValue -shr 1`| 1073741823 | | 0x3FFFFFFF | |`[int]::MinValue -shr 1`| -1073741824| | 0xC0000000 | |`-1 -shr 1` | -1 | | 0xFFFFFFFF | From 7569a34aa0fcde47211465335563f0f02bf14a52 Mon Sep 17 00:00:00 2001 From: Taylor Mansfield Date: Tue, 19 Dec 2017 13:01:11 -0800 Subject: [PATCH 120/145] Indent headers as subheaders (#1967) --- reference/docs-conceptual/setup/PS-remoting-second-hop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/docs-conceptual/setup/PS-remoting-second-hop.md b/reference/docs-conceptual/setup/PS-remoting-second-hop.md index c790cd80dc1f..937b7e20e5a8 100644 --- a/reference/docs-conceptual/setup/PS-remoting-second-hop.md +++ b/reference/docs-conceptual/setup/PS-remoting-second-hop.md @@ -271,12 +271,12 @@ You can pass credentials inside the **ScriptBlock** parameter of a call to the - Does not require special server configuration. - Works on any server running WMF 2.0 or later. -## Cons +### Cons - Requires an awkward code technique. - If running WMF 2.0, requires different syntax for passing arguments to a remote session. -## Example +### Example The following example shows how to pass credentials in an **Invoke-Command** script block: From a6c39a2411a254516b37e6be61d40bb3832d35e4 Mon Sep 17 00:00:00 2001 From: DannyMeister Date: Tue, 19 Dec 2017 17:03:33 -0600 Subject: [PATCH 121/145] Update minor typo in Limit-EventLog.md (#1968) --- reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md b/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md index 4a7f9c81226b..e91d68026643 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Limit-EventLog.md @@ -208,7 +208,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS ### None -You cannot pip input to this cmdlet. +You cannot pipe input to this cmdlet. ## OUTPUTS From 4dfa90f973d0ed8887e9268e98b268bfc173a7c9 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 21 Dec 2017 00:27:39 +0900 Subject: [PATCH 122/145] Update Example 3 in Get-FileHash.md (#1969) --- .../Get-FileHash.md | 64 +++++++++---------- .../Get-FileHash.md | 64 +++++++++---------- .../Get-FileHash.md | 64 +++++++++---------- .../Get-FileHash.md | 57 ++++++++--------- 4 files changed, 121 insertions(+), 128 deletions(-) diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md index 63d52939a386..76ec8806cbff 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -75,46 +75,44 @@ The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly ```powershell -PS C:> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) - -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 - -$testfilestream.Close() - -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 - -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path + +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 + +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() + +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List + +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md index 0dd967722ecb..8723a9cab1dd 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -74,46 +74,44 @@ The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly ```powershell -PS C:\> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) - -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 - -$testfilestream.Close() - -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 - -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path + +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 + +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() + +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List + +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md index adc69dc47b80..963bd48fb96a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -74,46 +74,44 @@ The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly ```powershell -PS C:\> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" - -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) - -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 - -$testfilestream.Close() - -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 - -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path + +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 + +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() + +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List + +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS diff --git a/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md b/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md index 4abb81aaa9f7..86bdfc3cdcc2 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md +++ b/reference/6/Microsoft.PowerShell.Utility/Get-FileHash.md @@ -72,47 +72,46 @@ This command uses the **Get-FileHash** cmdlet and the SHA384 algorithm to comput The output is piped to the Format-List cmdlet to format the output as a list. ### Example 3: Compute the hash value of a stream and compare the procedure with getting the hash from the file directly -``` -PS C:\> $testfile = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -## open $testfile as a stream -$testfilestream = [System.IO.File]::Open( - $testfile, - [System.IO.FileMode]::Open, - [System.IO.FileAccess]::Read) +```powershell +# Path of Microsoft.PowerShell.Utility.psd1 +$file = (Get-Module Microsoft.PowerShell.Utility).Path -$hashFromStream = Get-FileHash -InputStream $testfilestream -Algorithm MD5 +$hashFromFile = Get-FileHash -Path $file -Algorithm MD5 -$testfilestream.Close() +# Open $file as a stream +$stream = [System.IO.File]::OpenRead($file) +$hashFromStream = Get-FileHash -InputStream $stream -Algorithm MD5 +$stream.Close() -$hashFromFile = Get-FileHash -Path $testfile -Algorithm MD5 +Write-Host '### Hash from File ###' -NoNewline +$hashFromFile | Format-List +Write-Host '### Hash from Stream ###' -NoNewline +$hashFromStream | Format-List -## check both hashes are the same -if(($hashFromStream.Hash) -ne ($hashFromFile.Hash)) { - Write-Error "Get-FileHash results are inconsistent!!" -} -else { - Write-Output "Results from File:" - Write-Output "==================" - $hashFromFile | Format-List - Write-Output " " - Write-Output "Results from Stream:" - Write-Output "====================" - $hashFromStream | Format-List +# Check both hashes are the same +if ($hashFromFile.Hash -eq $hashFromStream.Hash) { + Write-Host 'Get-FileHash results are consistent' -ForegroundColor Green +} else { + Write-Host 'Get-FileHash results are inconsistent!!' -ForegroundColor Red } +``` +```output +### Hash from File ### -Results from File: -================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B -Path : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe +Hash : 593D6592BD9B7F9174711AB136F5E751 +Path : C:\Program Files\PowerShell\6.0.0\Modules\Microsoft.Powe + rShell.Utility\Microsoft.PowerShell.Utility.psd1 + +### Hash from Stream ### -Results from Stream: -==================== Algorithm : MD5 -Hash : 097CE5761C89434367598B34FE32893B +Hash : 593D6592BD9B7F9174711AB136F5E751 Path : + +Get-FileHash results are consistent ``` ## PARAMETERS From 9603e0f80b4fd5edffa83f06ee9d41128c83bacc Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 21 Dec 2017 00:37:11 +0900 Subject: [PATCH 123/145] Fix parameter's position in Tee-Object.md (#1970) --- .../Tee-Object.md | 11 +++-- .../Tee-Object.md | 11 +++-- .../Tee-Object.md | 9 ++-- .../Tee-Object.md | 9 ++-- .../Tee-Object.md | 41 ++++--------------- 5 files changed, 33 insertions(+), 48 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md index b6ed18f3dece..2001579b157d 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Tee-Object.md @@ -15,17 +15,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION @@ -103,7 +106,7 @@ Parameter Sets: File Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md index 10f7c6aa5b9e..9c8de6ab12bd 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,17 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION @@ -109,7 +112,7 @@ Parameter Sets: File Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: True diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md index 64bd44ead3ba..772546e26984 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,17 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md index 203ded45ea4d..423a05416065 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,17 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md b/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md index fdc489c66eab..0fd469983c2f 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Tee-Object.md @@ -17,20 +17,20 @@ Saves command output in a file or variable and also sends it down the pipeline. ### File (Default) ``` -Tee-Object [-InputObject ] [-FilePath] [-Append] [-InformationAction ] - [-InformationVariable ] [] +Tee-Object [-FilePath] [-InputObject ] [-Append] + [] ``` ### LiteralFile ``` -Tee-Object [-InputObject ] -LiteralPath [-InformationAction ] - [-InformationVariable ] [] +Tee-Object -LiteralPath [-InputObject ] + [] ``` ### Variable ``` -Tee-Object [-InputObject ] -Variable [-InformationAction ] - [-InformationVariable ] [] +Tee-Object -Variable [-InputObject ] + [] ``` ## DESCRIPTION @@ -109,34 +109,7 @@ Parameter Sets: File Aliases: Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationAction -This parameter is introduced in Windows PowerShell 3.0.```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -This parameter is introduced in Windows PowerShell 3.0.```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False From 45517f9e2280e7055ca8177f4505dad2bd770e41 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 20 Dec 2017 10:09:14 -0800 Subject: [PATCH 124/145] fixing output example per issue 1933 --- reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md | 4 ++-- reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md | 4 ++-- reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md | 4 ++-- reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md | 4 ++-- reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md b/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md index ae4224cc1336..385ad7e9e732 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Arrays.md @@ -617,8 +617,8 @@ $a[-1] ``` ```output -0 -0 +1 +1 4 4 ``` From 4c8ad5c74f3d51cf5bbbc6a2e6529e0c84ac0b97 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 20 Dec 2017 10:38:28 -0800 Subject: [PATCH 125/145] fix -Path metadata to reflect wildcard support --- .../Get-Item.md | 18 +++++----- .../Get-Item.md | 16 ++++----- .../Get-Item.md | 34 +++++-------------- .../Get-Item.md | 20 +++++------ .../Get-Item.md | 34 ++++++------------- 5 files changed, 44 insertions(+), 78 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md index 0c5f056c8b0f..959e487fd07f 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Item.md @@ -107,10 +107,11 @@ Gets the specified alternate NTFS file stream from the file. Enter the stream na Stream is a dynamic parameter that the FileSystem provider adds to the Get-Item cmdlet. This parameter works only in file system drives. -This parameter is introduced in Windows PowerShell 3.0.```yaml +This parameter is introduced in Windows PowerShell 3.0. +```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -131,7 +132,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -151,7 +152,7 @@ The Exclude parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -169,7 +170,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -187,7 +188,7 @@ Even using the Force parameter, the cmdlet cannot override security restrictions ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -207,7 +208,7 @@ The Include parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -247,7 +248,7 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -297,7 +298,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type "Get-PsProvider". For more information, see about_Providers. -* ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md index 236073b41147..d42b12ee02bb 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Item.md @@ -124,7 +124,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -144,7 +144,7 @@ The Exclude parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -162,7 +162,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -180,7 +180,7 @@ Even using the Force parameter, the cmdlet cannot override security restrictions ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -200,7 +200,7 @@ The Include parameter is effective only when the command includes the contents o ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -240,7 +240,7 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 @@ -288,7 +288,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -324,8 +324,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type "Get-PsProvider". For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md index a3c15c3316aa..1964d31f0ac9 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Item.md @@ -39,11 +39,7 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ``` PS C:\> Get-Item . - - - - -Directory: C:\ +Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 7/26/2006 10:01 AM ps-test @@ -56,16 +52,6 @@ The dot (.) represents the item at the current location (not its contents). ``` PS C:\> Get-Item * - - - - - - - - - - Directory: C:\ps-test Mode LastWriteTime Length Name ---- ------------- ------ ---- @@ -138,7 +124,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -158,7 +144,7 @@ The *Exclude* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -176,7 +162,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -194,7 +180,7 @@ Even using the *Force* parameter, the cmdlet cannot override security restrictio ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -214,7 +200,7 @@ The *Include* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -254,13 +240,13 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -283,7 +269,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -338,8 +324,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md index 28e1eed37e7f..2f635f18d85b 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Item.md @@ -39,7 +39,7 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ``` PS C:\ps-test> Get-Item . - Directory: C:\ + Directory: C:\ Mode LastWriteTime Length Name @@ -218,7 +218,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -238,7 +238,7 @@ The *Exclude* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -256,7 +256,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -274,7 +274,7 @@ Even using the *Force* parameter, the cmdlet cannot override security restrictio ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -294,7 +294,7 @@ The *Include* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -334,13 +334,13 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -Stream @@ -363,7 +363,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -418,8 +418,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Item.md b/reference/6/Microsoft.PowerShell.Management/Get-Item.md index af028cf5812e..ceae93923bf6 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Item.md @@ -39,11 +39,8 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen ``` PS C:\> Get-Item . +Directory: C:\ - - - -Directory: C:\ Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 7/26/2006 10:01 AM ps-test @@ -56,17 +53,8 @@ The dot (.) represents the item at the current location (not its contents). ``` PS C:\> Get-Item * - - - - - - - - - - Directory: C:\ps-test + Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 7/26/2006 9:29 AM Logs @@ -132,7 +120,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -153,7 +141,7 @@ This parameter is not supported by any providers installed with Windows PowerShe ```yaml Type: PSCredential Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -173,7 +161,7 @@ The *Exclude* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -191,7 +179,7 @@ Filters are more efficient than other parameters, because the provider applies t ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -209,7 +197,7 @@ Even using the *Force* parameter, the cmdlet cannot override security restrictio ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -229,7 +217,7 @@ The *Include* parameter is effective only when the command includes the contents ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -269,13 +257,13 @@ Use the wildcard character (*) to specify all the items in the current location. ```yaml Type: String[] Parameter Sets: Path -Aliases: +Aliases: Required: True Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False +Accept wildcard characters: True ``` ### -UseTransaction @@ -324,8 +312,6 @@ The registry values are considered to be properties of the registry key. To list the providers available in your session, type `Get-PsProvider`. For more information, see about_Providers. -* - ## RELATED LINKS [Clear-Item](Clear-Item.md) From 7f07ed27b8248bcfb1b16096a8f13e9e17f5c2ae Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 20 Dec 2017 12:29:03 -0800 Subject: [PATCH 126/145] fixing issue 1640 --- .../About/about_Split.md | 94 +++++++++++++------ .../About/about_Split.md | 94 +++++++++++++------ .../About/about_Split.md | 94 +++++++++++++------ .../About/about_Split.md | 94 +++++++++++++------ .../About/about_Split.md | 94 +++++++++++++------ 5 files changed, 330 insertions(+), 140 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Split.md b/reference/6/Microsoft.PowerShell.Core/About/about_Split.md index 98b97dd2dab7..523bd6d4e3cd 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Split.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Split.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-01 +ms.date: 2017-12-20 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -35,11 +35,10 @@ The following diagram shows the syntax for the -split operator. The parameter names do not appear in the command. Include only the parameter values. The values must appear in the order specified in the syntax diagram. -```powershell +``` -Split - +-Split () -Split [,[,""]] - -Split {} [,] ``` @@ -51,14 +50,14 @@ are applied. ## PARAMETERS -### \ +### \ or \ Specifies one or more strings to be split. If you submit multiple strings, all the strings are split using the same delimiter rules. Example: -```powershell +``` -split "red yellow blue green" red yellow @@ -73,7 +72,7 @@ whitespace, including spaces and non-printable characters, such as newline (\`n) and tab (\`t). When the strings are split, the delimiter is omitted from all the substrings. Example: -```powershell +``` "Lastname:FirstName:Address" -split ":" Lastname FirstName @@ -90,7 +89,7 @@ as a split. Examples: -```powershell +``` "Lastname:FirstName:Address" -split "(:)" Lastname : @@ -139,6 +138,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split ",", 5 +``` + +```Output Mercury Venus Earth @@ -156,6 +158,9 @@ Example: ```powershell $c = "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" $c -split {$_ -eq "e" -or $_ -eq "p"} +``` + +```Output M rcury,V nus, @@ -173,7 +178,7 @@ Enclose the option name in quotation marks. Options are valid only when the The syntax for the Options parameter is: -```powershell +``` "SimpleMatch [,IgnoreCase]" "[RegexMatch] [,IgnoreCase] [,CultureInvariant] @@ -214,13 +219,16 @@ The unary split operator (`-split `) has higher precedence than a comma. As a result, if you submit a comma-separated list of strings to the unary split operator, only the first string (before the first comma) is split. -To split more than one string, use the binary split operator ( -split -). Enclose all the strings in parentheses, or store the strings in -a variable, and then submit the variable to the split operator. +Use one of the following patterns to split more than one string: + +- Use the binary split operator (\ -split \) +- Enclose all the strings in parentheses +- Store the strings in a variable then submit the variable to the split + operator Consider the following example: -```powershell +``` PS > -split "1 2", "a b" 1 2 @@ -251,7 +259,11 @@ b The following statement splits the string at whitespace. ```powershell -PS > -split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +-split "Windows PowerShell 2.0`nWindows PowerShell with remoting" +``` + +```Output + Windows PowerShell 2.0 @@ -264,7 +276,10 @@ remoting The following statement splits the string at any comma. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split ',' +``` + +```Output Mercury Venus Earth @@ -278,7 +293,10 @@ Neptune The following statement splits the string at the pattern "er". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split 'er' +``` + +```Output M cury,Venus,Earth,Mars,Jupit ,Saturn,Uranus,Neptune @@ -287,7 +305,10 @@ cury,Venus,Earth,Mars,Jupit The following statement performs a case-sensitive split at the letter "N". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -cSplit 'N' +``` + +```Output Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus, eptune ``` @@ -295,7 +316,10 @@ eptune The following statement splits the string at "e" and "t". ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[et]' +``` + +```Output M rcury,V nus, @@ -312,8 +336,10 @@ The following statement splits the string at "e" and "r", but limits the resulting substrings to six substrings. ```powershell -PS > "Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" ` - -split '[er]', 6 +"Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune" -split '[er]', 6 +``` + +```Output M cu @@ -325,7 +351,10 @@ arth,Mars,Jupiter,Saturn,Uranus,Neptune The following statement splits a string into three substrings. ```powershell -PS > "a,b,c,d,e,f,g,h" -split ",", 3 +"a,b,c,d,e,f,g,h" -split ",", 3 +``` + +```Output a b c,d,e,f,g,h @@ -335,7 +364,10 @@ The following statement splits two strings into three substrings. (The limit is applied to each string independently.) ```powershell -PS > "a,b,c,d", "e,f,g,h" -split ",", 3 +"a,b,c,d", "e,f,g,h" -split ",", 3 +``` + +```Output a b c,d @@ -353,13 +385,15 @@ can use options, such as Multiline, only when the Max-substrings value is specified. ```powershell -PS > $a = @' +$a = @' 1The first line. 2The second line. 3The third of three lines. '@ +$a -split "^\d", 0, "multiline" +``` -PS > $a -split "^\d", 0, "multiline" +```Output The first line. @@ -381,8 +415,10 @@ can use options, such as SimpleMatch, only when the Max-substrings value is specified. ```powershell -PS > "This.is.a.test" -split ".", 0, "simplematch" +"This.is.a.test" -split ".", 0, "simplematch" +``` +```Output This is a @@ -393,10 +429,12 @@ The following statement splits the string at one of two delimiters, depending on the value of a variable. ```powershell -PS > $i = 1 -PS > $c = "LastName, FirstName; Address, City, State, Zip" -PS > $c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +$i = 1 +$c = "LastName, FirstName; Address, City, State, Zip" +$c -split {if ($i -lt 1) {$-eq ","} else {$-eq ";"}} +``` +```Output LastName, FirstName Address, City, State, Zip ``` From e3d2746990926a07eea424c6ecde3af7a39ff89a Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 20 Dec 2017 12:47:41 -0800 Subject: [PATCH 127/145] fixing issue 1651 --- .../Select-String.md | 28 +++++++++---------- .../Select-String.md | 28 +++++++++---------- .../Select-String.md | 28 +++++++++---------- .../Select-String.md | 28 +++++++++---------- .../Select-String.md | 28 +++++++++---------- 5 files changed, 70 insertions(+), 70 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md b/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md index 9852bad4959d..0934d20f8654 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Select-String.md @@ -192,7 +192,7 @@ When Select-String finds more than one match in a line of text, it still emits o ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -208,7 +208,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -239,7 +239,7 @@ When the context includes a match, the MatchInfo object for each match includes ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -259,7 +259,7 @@ Valid values are "UTF7", "UTF8", "UTF32", "ASCII", "Unicode", "BigEndianUnicode" ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -277,7 +277,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -295,7 +295,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -317,7 +317,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -333,7 +333,7 @@ By default, Select-String returns a MatchInfo object for each match it finds. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -348,7 +348,7 @@ Finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -368,7 +368,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 2 @@ -387,7 +387,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -403,7 +403,7 @@ The value is "true" if the pattern is found; otherwise, the value is "false". ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -420,7 +420,7 @@ It does not interpret the value of the Pattern parameter as a regular expression ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -461,7 +461,7 @@ By default, the output is a set of MatchInfo objects, one for each match found. If you use the Quiet parameter, the output is a Boolean value indicating whether the pattern was found. ## NOTES * Select-String is like the Grep command in UNIX and the FindStr command in Windows. -* The "sst" alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. +* The **sst** alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. * To use Select-String, type the text that you want to find as the value of the Pattern parameter. To specify the text to be searched, do the following: diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md b/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md index c1b6c5b49ab6..099569e2c325 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Select-String.md @@ -204,7 +204,7 @@ When Select-String finds more than one match in a line of text, it still emits o ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -220,7 +220,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -251,7 +251,7 @@ When the context includes a match, the MatchInfo object for each match includes ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -271,7 +271,7 @@ Valid values are "UTF7", "UTF8", "UTF32", "ASCII", "Unicode", "BigEndianUnicode" ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -289,7 +289,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -307,7 +307,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -329,7 +329,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -345,7 +345,7 @@ By default, Select-String returns a MatchInfo object for each match it finds. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -360,7 +360,7 @@ Finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -380,7 +380,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 2 @@ -399,7 +399,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -415,7 +415,7 @@ The value is "true" if the pattern is found; otherwise, the value is "false". ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -432,7 +432,7 @@ It does not interpret the value of the Pattern parameter as a regular expression ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -476,7 +476,7 @@ If you use the Quiet parameter, the output is a Boolean value indicating whether ## NOTES * Select-String is like the Grep command in UNIX and the FindStr command in Windows. -* The "sst" alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. +* The **sst** alias for the Select-String cmdlet was introduced in Windows PowerShell 3.0. * To use Select-String, type the text that you want to find as the value of the Pattern parameter. To specify the text to be searched, do the following: diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md b/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md index e255f4c64a7a..ffdfd934d2c1 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Select-String.md @@ -200,7 +200,7 @@ When **Select-String** finds more than one match in a line of text, it still emi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -216,7 +216,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -247,7 +247,7 @@ When the context includes a match, the **MatchInfo** object for each match inclu ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -277,7 +277,7 @@ OEM is the current original equipment manufacturer code page identifier for the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unicode, utf7, utf8, utf32, ascii, bigendianunicode, default, oem Required: False @@ -296,7 +296,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -314,7 +314,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -336,7 +336,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -352,7 +352,7 @@ By default, **Select-String** returns a **MatchInfo** object for each match it f ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -386,7 +386,7 @@ Indicates that the cmdlet finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -406,7 +406,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 1 @@ -425,7 +425,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -441,7 +441,7 @@ The value is True if the pattern is found; otherwise, the value is False. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -458,7 +458,7 @@ It does not interpret the value of the *Pattern* parameter as a regular expressi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -483,7 +483,7 @@ If you use the *Quiet* parameter, the output is a Boolean value indicating wheth ## NOTES * **Select-String** is like the Grep command in UNIX and the FindStr command in Windows. -* The **sst** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. +* The **sls** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. * To use **Select-String**, type the text that you want to find as the value of the *Pattern* parameter. To specify the text to be searched, do the following: diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md b/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md index f8f5a9a09bbc..94270f8604cd 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Select-String.md @@ -200,7 +200,7 @@ When **Select-String** finds more than one match in a line of text, it still emi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -216,7 +216,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -247,7 +247,7 @@ When the context includes a match, the **MatchInfo** object for each match inclu ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -277,7 +277,7 @@ OEM is the current original equipment manufacturer code page identifier for the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unicode, utf7, utf8, utf32, ascii, bigendianunicode, default, oem Required: False @@ -296,7 +296,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -314,7 +314,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -336,7 +336,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -352,7 +352,7 @@ By default, **Select-String** returns a **MatchInfo** object for each match it f ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -386,7 +386,7 @@ Indicates that the cmdlet finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -406,7 +406,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 1 @@ -425,7 +425,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 0 @@ -441,7 +441,7 @@ The value is True if the pattern is found; otherwise, the value is False. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -458,7 +458,7 @@ It does not interpret the value of the *Pattern* parameter as a regular expressi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -483,7 +483,7 @@ If you use the *Quiet* parameter, the output is a Boolean value indicating wheth ## NOTES * **Select-String** is like the Grep command in UNIX and the FindStr command in Windows. -* The **sst** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. +* The **sls** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. * To use **Select-String**, type the text that you want to find as the value of the *Pattern* parameter. To specify the text to be searched, do the following: diff --git a/reference/6/Microsoft.PowerShell.Utility/Select-String.md b/reference/6/Microsoft.PowerShell.Utility/Select-String.md index a6dfd436257e..d77c8cef990a 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Select-String.md +++ b/reference/6/Microsoft.PowerShell.Utility/Select-String.md @@ -203,7 +203,7 @@ When **Select-String** finds more than one match in a line of text, it still emi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -219,7 +219,7 @@ By default, matches are not case-sensitive. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -250,7 +250,7 @@ When the context includes a match, the **MatchInfo** object for each match inclu ```yaml Type: Int32[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -280,7 +280,7 @@ OEM is the current original equipment manufacturer code page identifier for the ```yaml Type: String Parameter Sets: (All) -Aliases: +Aliases: Accepted values: unicode, utf7, utf8, utf32, ascii, bigendianunicode, default, oem Required: False @@ -299,7 +299,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -317,7 +317,7 @@ Wildcards are permitted. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -366,7 +366,7 @@ The differences are as follows: ```yaml Type: PSObject Parameter Sets: Object -Aliases: +Aliases: Required: True Position: Named @@ -382,7 +382,7 @@ By default, **Select-String** returns a **MatchInfo** object for each match it f ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -397,7 +397,7 @@ Indicates that the cmdlet finds text that does not match the specified pattern. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -417,7 +417,7 @@ If you specify only a directory, the command fails. ```yaml Type: String[] Parameter Sets: File -Aliases: +Aliases: Required: True Position: 2 @@ -436,7 +436,7 @@ To learn about regular expressions, see about_Regular_Expressions. ```yaml Type: String[] Parameter Sets: (All) -Aliases: +Aliases: Required: True Position: 1 @@ -452,7 +452,7 @@ The value is True if the pattern is found; otherwise, the value is False. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -469,7 +469,7 @@ It does not interpret the value of the *Pattern* parameter as a regular expressi ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: +Aliases: Required: False Position: Named @@ -513,7 +513,7 @@ If you use the *Quiet* parameter, the output is a Boolean value indicating wheth ## NOTES * **Select-String** is like the Grep command in UNIX and the FindStr command in Windows. -* The **sst** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. +* The **sls** alias for the **Select-String** cmdlet was introduced in Windows PowerShell 3.0. * To use **Select-String**, type the text that you want to find as the value of the *Pattern* parameter. To specify the text to be searched, do the following: From 22470853a60e8b1e2b7ee2c6c6eb37915b5a3b8e Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 22 Dec 2017 01:13:25 +0900 Subject: [PATCH 128/145] Fix link for about_Remote_Requirements (#1976) --- reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md | 2 +- .../3.0/Microsoft.PowerShell.Management/Restart-Computer.md | 2 +- reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md | 2 +- .../4.0/Microsoft.PowerShell.Management/Restart-Computer.md | 2 +- reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md | 2 +- .../5.0/Microsoft.PowerShell.Management/Restart-Computer.md | 2 +- reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md | 2 +- reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md | 2 +- .../5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md | 2 +- .../PSDesiredStateConfiguration/Get-DscConfigurationStatus.md | 2 +- .../Get-DscLocalConfigurationManager.md | 2 +- .../Remove-DscConfigurationDocument.md | 2 +- .../5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md | 2 +- .../5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md | 2 +- .../5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md | 2 +- .../5.1/Microsoft.PowerShell.Management/Restart-Computer.md | 2 +- .../5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md | 2 +- reference/6/Microsoft.PowerShell.Core/New-PSSession.md | 2 +- reference/6/Microsoft.PowerShell.Management/Restart-Computer.md | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md index 13d86433fef5..0bc93758b2c5 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -541,7 +541,7 @@ You can pipe a computer name (string), ConnectionURI (URI), or session (PSSessio ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a PSSession on the local computer, start Windows PowerShell with the "Run as administrator" option. * When you are finished with the PSSession, use the Remove-PSSession cmdlet to delete the PSSession and release its resources. diff --git a/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md index 8a1fc41671dd..ddc7cdee315d 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Restart-Computer.md @@ -110,7 +110,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the **AsJob** parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md index 0ee9543c18f1..9d19e39af832 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Stop-Computer.md @@ -87,7 +87,7 @@ It also uses the ThrottleLimit parameter to limit the command to 10 concurrent c Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements". +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md index 2668bd38063c..9fa265db2749 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -557,7 +557,7 @@ You can pipe a computer name (string), ConnectionURI (URI), or session (PSSessio ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a PSSession on the local computer, start Windows PowerShell with the "Run as administrator" option. * When you are finished with the PSSession, use the Remove-PSSession cmdlet to delete the PSSession and release its resources. diff --git a/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md index 2a8c51709c7e..3f3082be3057 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Restart-Computer.md @@ -120,7 +120,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the **AsJob** parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md b/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md index 59e473c19536..b6a19dea2805 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Stop-Computer.md @@ -95,7 +95,7 @@ It also uses the ThrottleLimit parameter to limit the command to 10 concurrent c Runs the command as a background job. Note: To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of Windows, you must open Windows PowerShell with the "Run as administrator" option. -For more information, see about_Remote_Requirements". +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you use the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job completes. diff --git a/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md index 3e114fc85451..d9783d2476d3 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -567,7 +567,7 @@ You can pipe a string, URI, or session object to this cmdlet. ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a **PSSession** on the local computer, start Windows PowerShell with the Run as administrator option. * When you are finished with the **PSSession**, use the Remove-PSSession cmdlet to delete the **PSSession** and release its resources. diff --git a/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md index 01e756d47fde..0fa793265e8c 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Restart-Computer.md @@ -119,7 +119,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Indicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell by using the Run as administrator option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you specify the *AsJob* parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. diff --git a/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md b/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md index b07bfe49f555..e4b413daf3aa 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md +++ b/reference/5.0/PSDesiredStateConfiguration/Disable-DscDebug.md @@ -52,7 +52,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md b/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md index 9519c1bfa181..4c15d38e03a0 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md +++ b/reference/5.0/PSDesiredStateConfiguration/Enable-DscDebug.md @@ -53,7 +53,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md index 2a7b24fee892..d394eaab616a 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfiguration.md @@ -61,7 +61,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md index d05b7d341421..57af1f96c59f 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md +++ b/reference/5.0/PSDesiredStateConfiguration/Get-DscConfigurationStatus.md @@ -76,7 +76,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md b/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md index fab2e62d3f9b..cff12ebd393d 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md +++ b/reference/5.0/PSDesiredStateConfiguration/Get-DscLocalConfigurationManager.md @@ -62,7 +62,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md b/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md index ba5274ed6aa5..1f384839360e 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md +++ b/reference/5.0/PSDesiredStateConfiguration/Remove-DscConfigurationDocument.md @@ -54,7 +54,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md index 98babda9bb03..c9f7f29c0eae 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Restore-DscConfiguration.md @@ -65,7 +65,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md index fff26c6b5a22..22f5ad386761 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Stop-DscConfiguration.md @@ -56,7 +56,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md b/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md index 4fa7dbdfa609..e0ce6c4455ca 100644 --- a/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md +++ b/reference/5.0/PSDesiredStateConfiguration/Test-DscConfiguration.md @@ -118,7 +118,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md index 89fa4d35645b..0bf5a767f4c6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md @@ -665,7 +665,7 @@ You can pipe a string, URI, or session object to this cmdlet. ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a **PSSession** on the local computer, start Windows PowerShell with the Run as administrator option. * When you are finished with the **PSSession**, use the Remove-PSSession cmdlet to delete the **PSSession** and release its resources. diff --git a/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md index 01e756d47fde..0fa793265e8c 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Restart-Computer.md @@ -119,7 +119,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Indicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell by using the Run as administrator option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you specify the *AsJob* parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. diff --git a/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md b/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md index 418a44a0df63..bad7ab68910b 100644 --- a/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md +++ b/reference/5.1/PSDesiredStateConfiguration/Test-DscConfiguration.md @@ -118,7 +118,7 @@ To manage the job, use the Job cmdlets. To get the job results, use the Receive-Job cmdlet. To use this parameter, the local and remote computers must be configured for remoting, and on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell with the Run as administrator option. -For more information, see about_Remote_Requirementshttp://go.microsoft.com/fwlink/?LinkId=623526 (http://go.microsoft.com/fwlink/?LinkId=623526). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). For more information about Windows PowerShell background jobs, see [about_Jobs](../Microsoft.PowerShell.Core/About/about_Jobs.md) and [about_Remote_Jobs](../Microsoft.PowerShell.Core/About/about_Remote_Jobs.md). diff --git a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md index 22b6b5083c43..fb7d4e88e06d 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md @@ -803,7 +803,7 @@ You can pipe a string, URI, or session object to this cmdlet. ### System.Management.Automation.Runspaces.PSSession ## NOTES -* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +* This cmdlet uses the Windows PowerShell remoting infrastructure. To use this cmdlet, the local computer and any remote computers must be configured for Windows PowerShell remoting. For more information, see [about_Remote_Requirements](About/about_Remote_Requirements.md). * To create a **PSSession** on the local computer, start Windows PowerShell with the Run as administrator option. * When you are finished with the **PSSession**, use the Remove-PSSession cmdlet to delete the **PSSession** and release its resources. * The **HostName** and **SSHConnection** parameter sets were included starting with PowerShell 6.0. They were added to provide PowerShell remoting based on Secure Shell (SSH). Both SSH and PowerShell are supported on multiple platforms (Windows, Linux, macOS) and PowerShell remoting will work over these platforms where PowerShell and SSH are installed and configured. This is separate from the previous Windows only remoting that is based on WinRM and much of the WinRM specific features and limitations do not apply. For example WinRM based quotas, session options, custom endpoint configuration, and disconnect/reconnect features are currently not supported. diff --git a/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md index e05ecb6aca49..f314824de1c7 100644 --- a/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/6/Microsoft.PowerShell.Management/Restart-Computer.md @@ -119,7 +119,7 @@ These settings are designed for enterprises in which DCOM-based restarts fail be Indicates that this cmdlet runs as a background job. To use this parameter, the local and remote computers must be configured for remoting and, on Windows Vista and later versions of the Windows operating system, you must open Windows PowerShell by using the Run as administrator option. -For more information, see about_Remote_Requirements (http://go.microsoft.com/fwlink/?LinkID=135187). +For more information, see [about_Remote_Requirements](../Microsoft.PowerShell.Core/About/about_Remote_Requirements.md). When you specify the *AsJob* parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. From 2f7bd316a139a37dddc4c414d19d66ee7a5519b7 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Fri, 22 Dec 2017 01:14:06 +0900 Subject: [PATCH 129/145] Split parameter set in Sort-Object.md v6.0 (#1975) Since v6.0, Sort-Object cmdlet has two parameter sets, "Default" and "Bottom". --- .../Sort-Object.md | 47 ++++++------------- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md b/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md index e2a718aab1d4..8d1dfa5b1d00 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md +++ b/reference/6/Microsoft.PowerShell.Utility/Sort-Object.md @@ -15,10 +15,18 @@ Sorts objects by property values. ## SYNTAX +### Default ``` -Sort-Object [-Descending] [-Unique] [-InputObject ] [[-Property] ] [-Culture ] - [-CaseSensitive] [-InformationAction ] [-InformationVariable ] [] - [-Top ] [-Bottom ] +Sort-Object [[-Property] ] [-Descending] [-Unique] [-Top ] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] +``` + +### Bottom +``` +Sort-Object [[-Property] ] -Bottom [-Descending] [-Unique] + [-InputObject ] [-Culture ] [-CaseSensitive] + [] ``` ## DESCRIPTION @@ -182,7 +190,7 @@ Specifies the number of objects to get from the end of the sorted object array. ```yaml Type: Int32 -Parameter Sets: (All) +Parameter Sets: Bottom Aliases: Required: False @@ -242,33 +250,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies the objects to sort. @@ -315,7 +296,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 1 +Position: 0 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -326,7 +307,7 @@ Specifies the number of objects to get from the start of the sorted object array ```yaml Type: Int32 -Parameter Sets: (All) +Parameter Sets: Default Aliases: Required: False From 1854c4d5729599c7ba1404700d8b10c88324ed76 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 23 Dec 2017 01:25:40 +0900 Subject: [PATCH 130/145] Fix link for about_Preference_Variables (#1982) http://... -> relative path --- .../3.0/Microsoft.PowerShell.Core/About/about_History.md | 2 +- .../3.0/Microsoft.PowerShell.Core/Connect-PSSession.md | 2 +- .../3.0/Microsoft.PowerShell.Core/Enter-PSSession.md | 2 +- reference/3.0/Microsoft.PowerShell.Core/Get-Command.md | 6 +++--- reference/3.0/Microsoft.PowerShell.Core/Get-History.md | 2 +- reference/3.0/Microsoft.PowerShell.Core/Get-PSSession.md | 2 +- .../Get-PSSessionConfiguration.md | 2 +- reference/3.0/Microsoft.PowerShell.Core/Import-Module.md | 2 +- reference/3.0/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md | 6 +++--- .../3.0/Microsoft.PowerShell.Core/New-PSSessionOption.md | 6 +++--- .../3.0/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- .../3.0/Microsoft.PowerShell.Utility/Write-Verbose.md | 2 +- .../PSWorkflow/About/about_ActivityCommonParameters.md | 6 ++---- .../PSWorkflow/About/about_WorkflowCommonParameters.md | 8 ++++---- reference/3.0/PSWorkflow/New-PSWorkflowSession.md | 2 +- .../4.0/Microsoft.PowerShell.Core/About/about_History.md | 2 +- .../4.0/Microsoft.PowerShell.Core/Connect-PSSession.md | 2 +- .../4.0/Microsoft.PowerShell.Core/Enter-PSSession.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/Get-Command.md | 6 +++--- reference/4.0/Microsoft.PowerShell.Core/Get-History.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/Get-PSSession.md | 2 +- .../Get-PSSessionConfiguration.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/Import-Module.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md | 6 +++--- .../4.0/Microsoft.PowerShell.Core/New-PSSessionOption.md | 6 +++--- .../4.0/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- .../4.0/Microsoft.PowerShell.Utility/Write-Verbose.md | 2 +- .../PSWorkflow/About/about_ActivityCommonParameters.md | 6 ++---- .../PSWorkflow/About/about_WorkflowCommonParameters.md | 8 ++++---- reference/4.0/PSWorkflow/New-PSWorkflowSession.md | 2 +- .../5.0/Microsoft.PowerShell.Core/About/about_History.md | 2 +- .../5.0/Microsoft.PowerShell.Core/Connect-PSSession.md | 2 +- .../5.0/Microsoft.PowerShell.Core/Enter-PSSession.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Get-History.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Get-PSSession.md | 2 +- .../Get-PSSessionConfiguration.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Import-Module.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md | 6 +++--- .../5.0/Microsoft.PowerShell.Core/New-PSSessionOption.md | 6 +++--- .../5.0/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- .../5.0/Microsoft.PowerShell.Utility/Write-Verbose.md | 2 +- .../PSWorkflow/About/about_ActivityCommonParameters.md | 6 ++---- .../PSWorkflow/About/about_WorkflowCommonParameters.md | 8 ++++---- .../5.1/Microsoft.PowerShell.Core/About/about_History.md | 2 +- .../5.1/Microsoft.PowerShell.Core/Connect-PSSession.md | 2 +- .../5.1/Microsoft.PowerShell.Core/Enter-PSSession.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Get-History.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Get-PSSession.md | 2 +- .../Get-PSSessionConfiguration.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Import-Module.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md | 6 +++--- .../5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md | 6 +++--- .../5.1/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- .../5.1/Microsoft.PowerShell.Utility/Write-Verbose.md | 2 +- .../PSWorkflow/About/about_ActivityCommonParameters.md | 6 ++---- .../PSWorkflow/About/about_WorkflowCommonParameters.md | 8 ++++---- .../6/Microsoft.PowerShell.Core/About/about_History.md | 2 +- .../6/Microsoft.PowerShell.Core/Connect-PSSession.md | 2 +- reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md | 2 +- reference/6/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/6/Microsoft.PowerShell.Core/Get-History.md | 2 +- reference/6/Microsoft.PowerShell.Core/Get-PSSession.md | 2 +- .../Get-PSSessionConfiguration.md | 2 +- reference/6/Microsoft.PowerShell.Core/Import-Module.md | 2 +- reference/6/Microsoft.PowerShell.Core/Invoke-Command.md | 4 ++-- reference/6/Microsoft.PowerShell.Core/New-PSSession.md | 6 +++--- .../6/Microsoft.PowerShell.Core/New-PSSessionOption.md | 6 +++--- .../6/Microsoft.PowerShell.Core/Receive-PSSession.md | 2 +- reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md | 2 +- 75 files changed, 120 insertions(+), 128 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_History.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_History.md index 0a87bd50a2bb..4dca4b6a353c 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_History.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_History.md @@ -71,7 +71,7 @@ about profiles, see [about_Profiles](http://go.microsoft.com/fwlink/?LinkID=113729). For more information about the $MaximumHistoryCount preference variable, see -[about_Preference_Variables](http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](about_Preference_Variables.md). NOTE: In Windows PowerShell 2.0, the default value of the `$MaximumHistoryCount` preference variable is 64. diff --git a/reference/3.0/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/Connect-PSSession.md index fa46b8b0ae86..3dba36e90315 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -392,7 +392,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/3.0/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/Enter-PSSession.md index 7f628df1b996..6b22e21e5b03 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -471,7 +471,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md index 417d60238345..5865aed69a30 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md @@ -37,7 +37,7 @@ A "`Get-Command *`" command gets all types of commands, including all of the non A **Get-Command** command that uses the exact name of the command (without wildcard characters) automatically imports the module that contains the command so you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). **Get-Command** gets its data directly from the command code, unlike Get-Help, which gets its information from help topics. @@ -82,7 +82,7 @@ It also imports the **AppLocker** module, which adds all of the commands in the When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ### Example 6 ``` PS C:\> Get-Command Get-Childitem -Args Cert: -Syntax @@ -471,7 +471,7 @@ Represents functions and filters ## NOTES * When more than one command with the same name is available to the session, **Get-Command** returns the command that runs when you type the command name. To get commands with the same name (listed in execution order), use the **All** parameter. For more information, see about_Command_Precedence. -* When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ## RELATED LINKS [Export-PSSession](../Microsoft.PowerShell.Utility/Export-PSSession.md) diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-History.md b/reference/3.0/Microsoft.PowerShell.Core/Get-History.md index 15f083f55d56..95b4f7dc9783 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-History.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-History.md @@ -119,7 +119,7 @@ You can pipe a history ID to Get-History. Get-History returns a history object for each history item that it gets. ## NOTES * The session history is a list of the commands entered during the session. The session history represents the order of execution, the status, and the start and end times of the command. As you enter each command, Windows PowerShell adds it to the history so that you can reuse it. For more information about the command history, see about_History (http://go.microsoft.com/fwlink/?LinkID=113233). -* Beginning in Windows PowerShell 3.0, the default value of the **$MaximumHistoryCount** preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the **$MaximumHistoryCount** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* Beginning in Windows PowerShell 3.0, the default value of the **$MaximumHistoryCount** preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the **$MaximumHistoryCount** variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## RELATED LINKS [Add-History](Add-History.md) diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/Get-PSSession.md index c01877c4f91d..df58ce0d7558 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-PSSession.md @@ -563,7 +563,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md b/reference/3.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md index 4a64295b8603..eeedfddd454e 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md @@ -316,7 +316,7 @@ This command is useful when setting the value of the $PSSessionConfigurationName The $PSSessionConfiguationName variable specifies the default configuration that is used when you create a session. This variable is set on the local computer, but it specifies a configuration on the remote computer. -For more information about the $PSSessionConfiguration variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionConfiguration variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## PARAMETERS ### -Name diff --git a/reference/3.0/Microsoft.PowerShell.Core/Import-Module.md b/reference/3.0/Microsoft.PowerShell.Core/Import-Module.md index a4440b82e3c4..dd3ceb7c4a68 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Import-Module.md @@ -58,7 +58,7 @@ The modules that you import must be installed on the local computer or a remote Beginning in Windows PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the **Import-Module** command to import a module and you can enable and disable automatic module importing by using the **$PSModuleAutoloadingPreference** preference variable. For more information about modules, see about_Modules (http://go.microsoft.com/fwlink/?LinkID=144311). -For more information about the **$PSModuleAutoloadingPreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSModuleAutoloadingPreference** variable, see [about_Preference_Variables](About/about_Preference_Variables.md). A module is a package that contains members (such as cmdlets, providers, scripts, functions, variables, and other tools and files) that can be used in Windows PowerShell. After a module is imported, you can use the module members in your session. diff --git a/reference/3.0/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/3.0/Microsoft.PowerShell.Core/Invoke-Command.md index 3fe3afe57883..18ff23e19daa 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Invoke-Command.md @@ -430,7 +430,7 @@ Use this parameter to specify the application name when you are not using the ** The default value is the value of the **$PSSessionApplicationName** preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -880,7 +880,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md index 0bc93758b2c5..3dd020df36df 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -199,7 +199,7 @@ Use this parameter to specify the application name when you are not using the ** The default value is the value of the **$PSSessionApplicationName** preference variable on the local computer. If this preference variable is not defined, the default value is "WSMAN". This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -299,7 +299,7 @@ If the specified session configuration does not exist on the remote computer, th The default value is the value of the **$PSSessionConfigurationName** preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ```yaml Type: String @@ -476,7 +476,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/3.0/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/3.0/Microsoft.PowerShell.Core/New-PSSessionOption.md index 38cfae610515..e95fde89f559 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/3.0/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -33,7 +33,7 @@ Because all of the properties can be edited, you can use the resulting object as You can also save a session option object in the **$PSSessionOption** preference variable. The values of this variable establish new default values for the session options. They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. -For more information about the **$PSSessionOption** preference variable, see **about_Preference_Variables** (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the **$PSSessionOption** preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. @@ -155,7 +155,7 @@ When the **$PSSessionOption** preference variable exists in the session, it esta To make the **$PSSessionOption** variable available in all sessions, add it to your Windows PowerShell session and to your Windows PowerShell profile. -For more information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about profiles, see about_Profiles (http://go.microsoft.com/fwlink/?LinkID=113729). ### Example 6 ``` @@ -660,7 +660,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.Remoting.PSSessionOption ## NOTES -* If the **SessionOption** parameter is not used in a command to create a PSSession, the session options are determined by the property values of the **$PSSessionOption** preference variable, if it is set. For more information about the $PSSessionOption variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* If the **SessionOption** parameter is not used in a command to create a PSSession, the session options are determined by the property values of the **$PSSessionOption** preference variable, if it is set. For more information about the $PSSessionOption variable, see [about_Preference_Variables](About/about_Preference_Variables.md). * The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties. ## RELATED LINKS diff --git a/reference/3.0/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/3.0/Microsoft.PowerShell.Core/Receive-PSSession.md index ca4e43989bb1..0a7d6b673a10 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -631,7 +631,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Write-Verbose.md b/reference/3.0/Microsoft.PowerShell.Utility/Write-Verbose.md index 5d49f57119ea..c335e1077c38 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Write-Verbose.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Write-Verbose.md @@ -77,7 +77,7 @@ You can pipe a string that contains the message to **Write-Verbose**. **Write-Verbose** writes only to the verbose message stream. ## NOTES * Verbose messages are returned only when the command uses the **Verbose** common parameter. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). -* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ## RELATED LINKS [Write-Error](Write-Error.md) diff --git a/reference/3.0/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/3.0/PSWorkflow/About/about_ActivityCommonParameters.md index a184ba546a8b..a5afd6a87bf7 100644 --- a/reference/3.0/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/3.0/PSWorkflow/About/about_ActivityCommonParameters.md @@ -204,8 +204,7 @@ The default value is the value of the $PSSessionApplicationName preference variable on the target computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see -about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of @@ -522,8 +521,7 @@ New-PSSessionOption cmdlet (http://go.microsoft.com/fwlink/?LinkID=144305). For more information about the $PSSessionOption -preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +preference variable, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL A value of $True uses the Secure Sockets Layer (SSL) diff --git a/reference/3.0/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/3.0/PSWorkflow/About/about_WorkflowCommonParameters.md index b8e5aa5562a3..7536a06b0445 100644 --- a/reference/3.0/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/3.0/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -93,8 +93,7 @@ command. The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For -more information, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +more information, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value @@ -307,8 +306,9 @@ session uses the values specified in the session configuration. For a description of the session options, including the default values, see the help topic for the New-PSSessionOption cmdlet -(http://go.microsoft.com/fwlink/?LinkID=144305). For information about the $PSSessionOption preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +(http://go.microsoft.com/fwlink/?LinkID=144305). +For information about the $PSSessionOption preference variable, +see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL Uses the Secure Sockets Layer (SSL) protocol to establish a connection diff --git a/reference/3.0/PSWorkflow/New-PSWorkflowSession.md b/reference/3.0/PSWorkflow/New-PSWorkflowSession.md index 6bf8136ebd0a..e80631a95050 100644 --- a/reference/3.0/PSWorkflow/New-PSWorkflowSession.md +++ b/reference/3.0/PSWorkflow/New-PSWorkflowSession.md @@ -260,7 +260,7 @@ However, they do not take precedence over maximum values, quotas or limits set i For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). For a description of the session options, including the default values, see **New-PSSessionOption**. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ```yaml Type: PSSessionOption diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_History.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_History.md index 0a87bd50a2bb..4dca4b6a353c 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_History.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_History.md @@ -71,7 +71,7 @@ about profiles, see [about_Profiles](http://go.microsoft.com/fwlink/?LinkID=113729). For more information about the $MaximumHistoryCount preference variable, see -[about_Preference_Variables](http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](about_Preference_Variables.md). NOTE: In Windows PowerShell 2.0, the default value of the `$MaximumHistoryCount` preference variable is 64. diff --git a/reference/4.0/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/Connect-PSSession.md index ef073d90d6e2..d82e947eca8e 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -514,7 +514,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/4.0/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/Enter-PSSession.md index 92f6d57fb19a..842a484f1644 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -480,7 +480,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md index b62fdb95da32..373697a4fcfc 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md @@ -39,7 +39,7 @@ A "`Get-Command *`" command gets all types of commands, including all of the non A **Get-Command** command that uses the exact name of the command (without wildcard characters) automatically imports the module that contains the command so you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). **Get-Command** gets its data directly from the command code, unlike Get-Help, which gets its information from help topics. @@ -89,7 +89,7 @@ It also imports the **AppLocker** module, which adds all of the commands in the When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ### Example 6 ``` @@ -496,7 +496,7 @@ Represents functions and filters ## NOTES * When more than one command with the same name is available to the session, **Get-Command** returns the command that runs when you type the command name. To get commands with the same name (listed in execution order), use the **All** parameter. For more information, see about_Command_Precedence. -* When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* When a module is imported automatically, the effect is the same as using the Import-Module cmdlet. The module can add commands, types and formatting files, and run scripts in the session. To enable, disable, and configuration automatic importing of modules, use the **$PSModuleAutoLoadingPreference** preference variable. For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-History.md b/reference/4.0/Microsoft.PowerShell.Core/Get-History.md index 0e5407ffbd8e..d4f15c828e71 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-History.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-History.md @@ -130,7 +130,7 @@ Get-History returns a history object for each history item that it gets. ## NOTES * The session history is a list of the commands entered during the session. The session history represents the order of execution, the status, and the start and end times of the command. As you enter each command, Windows PowerShell adds it to the history so that you can reuse it. For more information about the command history, see about_History (http://go.microsoft.com/fwlink/?LinkID=113233). -* Beginning in Windows PowerShell 3.0, the default value of the **$MaximumHistoryCount** preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the **$MaximumHistoryCount** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* Beginning in Windows PowerShell 3.0, the default value of the **$MaximumHistoryCount** preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the **$MaximumHistoryCount** variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/Get-PSSession.md index 09a6f6c6f675..fc57ead477bf 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-PSSession.md @@ -510,7 +510,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md b/reference/4.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md index f9e53f0ae09f..cd9c60139404 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md @@ -326,7 +326,7 @@ This command is useful when setting the value of the $PSSessionConfigurationName The $PSSessionConfiguationName variable specifies the default configuration that is used when you create a session. This variable is set on the local computer, but it specifies a configuration on the remote computer. -For more information about the $PSSessionConfiguration variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionConfiguration variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## PARAMETERS diff --git a/reference/4.0/Microsoft.PowerShell.Core/Import-Module.md b/reference/4.0/Microsoft.PowerShell.Core/Import-Module.md index e12e532e1143..6a39d337e91a 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Import-Module.md @@ -60,7 +60,7 @@ The modules that you import must be installed on the local computer or a remote Beginning in Windows PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the **Import-Module** command to import a module and you can enable and disable automatic module importing by using the **$PSModuleAutoloadingPreference** preference variable. For more information about modules, see about_Modules (http://go.microsoft.com/fwlink/?LinkID=144311). -For more information about the **$PSModuleAutoloadingPreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSModuleAutoloadingPreference** variable, see [about_Preference_Variables](About/about_Preference_Variables.md). A module is a package that contains members (such as cmdlets, providers, scripts, functions, variables, and other tools and files) that can be used in Windows PowerShell. After a module is imported, you can use the module members in your session. diff --git a/reference/4.0/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/4.0/Microsoft.PowerShell.Core/Invoke-Command.md index a832903cf883..382a3458728c 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Invoke-Command.md @@ -449,7 +449,7 @@ Use this parameter to specify the application name when you are not using the ** The default value is the value of the **$PSSessionApplicationName** preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -939,7 +939,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md index 9fa265db2749..5f911d11a368 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -212,7 +212,7 @@ Use this parameter to specify the application name when you are not using the ** The default value is the value of the **$PSSessionApplicationName** preference variable on the local computer. If this preference variable is not defined, the default value is "WSMAN". This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -313,7 +313,7 @@ If the specified session configuration does not exist on the remote computer, th The default value is the value of the **$PSSessionConfigurationName** preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ```yaml Type: String @@ -490,7 +490,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/4.0/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/4.0/Microsoft.PowerShell.Core/New-PSSessionOption.md index 8a709e5e78d6..6172b316d6ee 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/4.0/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -35,7 +35,7 @@ Because all of the properties can be edited, you can use the resulting object as You can also save a session option object in the **$PSSessionOption** preference variable. The values of this variable establish new default values for the session options. They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. -For more information about the **$PSSessionOption** preference variable, see **about_Preference_Variables** (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the **$PSSessionOption** preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. @@ -162,7 +162,7 @@ When the **$PSSessionOption** preference variable exists in the session, it esta To make the **$PSSessionOption** variable available in all sessions, add it to your Windows PowerShell session and to your Windows PowerShell profile. -For more information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about profiles, see about_Profiles (http://go.microsoft.com/fwlink/?LinkID=113729). ### Example 6 @@ -675,7 +675,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.Remoting.PSSessionOption ## NOTES -* If the **SessionOption** parameter is not used in a command to create a PSSession, the session options are determined by the property values of the **$PSSessionOption** preference variable, if it is set. For more information about the $PSSessionOption variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* If the **SessionOption** parameter is not used in a command to create a PSSession, the session options are determined by the property values of the **$PSSessionOption** preference variable, if it is set. For more information about the $PSSessionOption variable, see [about_Preference_Variables](About/about_Preference_Variables.md). * The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties. ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/4.0/Microsoft.PowerShell.Core/Receive-PSSession.md index 2bc5422c53ce..fc89bc7c3aea 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -635,7 +635,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Write-Verbose.md b/reference/4.0/Microsoft.PowerShell.Utility/Write-Verbose.md index c4b00d05e6a3..a317e58a7fa0 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Write-Verbose.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Write-Verbose.md @@ -85,7 +85,7 @@ You can pipe a string that contains the message to **Write-Verbose**. ## NOTES * Verbose messages are returned only when the command uses the **Verbose** common parameter. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). -* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ## RELATED LINKS diff --git a/reference/4.0/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/4.0/PSWorkflow/About/about_ActivityCommonParameters.md index a184ba546a8b..a5afd6a87bf7 100644 --- a/reference/4.0/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/4.0/PSWorkflow/About/about_ActivityCommonParameters.md @@ -204,8 +204,7 @@ The default value is the value of the $PSSessionApplicationName preference variable on the target computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see -about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of @@ -522,8 +521,7 @@ New-PSSessionOption cmdlet (http://go.microsoft.com/fwlink/?LinkID=144305). For more information about the $PSSessionOption -preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +preference variable, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL A value of $True uses the Secure Sockets Layer (SSL) diff --git a/reference/4.0/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/4.0/PSWorkflow/About/about_WorkflowCommonParameters.md index b8e5aa5562a3..7536a06b0445 100644 --- a/reference/4.0/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/4.0/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -93,8 +93,7 @@ command. The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For -more information, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +more information, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value @@ -307,8 +306,9 @@ session uses the values specified in the session configuration. For a description of the session options, including the default values, see the help topic for the New-PSSessionOption cmdlet -(http://go.microsoft.com/fwlink/?LinkID=144305). For information about the $PSSessionOption preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +(http://go.microsoft.com/fwlink/?LinkID=144305). +For information about the $PSSessionOption preference variable, +see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL Uses the Secure Sockets Layer (SSL) protocol to establish a connection diff --git a/reference/4.0/PSWorkflow/New-PSWorkflowSession.md b/reference/4.0/PSWorkflow/New-PSWorkflowSession.md index 2f7d27bb59aa..b30f325f2483 100644 --- a/reference/4.0/PSWorkflow/New-PSWorkflowSession.md +++ b/reference/4.0/PSWorkflow/New-PSWorkflowSession.md @@ -265,7 +265,7 @@ However, they do not take precedence over maximum values, quotas or limits set i For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). For a description of the session options, including the default values, see **New-PSSessionOption**. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ```yaml Type: PSSessionOption diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_History.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_History.md index 0a87bd50a2bb..4dca4b6a353c 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_History.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_History.md @@ -71,7 +71,7 @@ about profiles, see [about_Profiles](http://go.microsoft.com/fwlink/?LinkID=113729). For more information about the $MaximumHistoryCount preference variable, see -[about_Preference_Variables](http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](about_Preference_Variables.md). NOTE: In Windows PowerShell 2.0, the default value of the `$MaximumHistoryCount` preference variable is 64. diff --git a/reference/5.0/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/Connect-PSSession.md index 9f624460f91f..6cead487d5ec 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -526,7 +526,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.0/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/Enter-PSSession.md index 377348f7561e..14642847cb61 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -512,7 +512,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see **New-PSSessionOption**. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md index 6984eda02619..885947657a4a 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md @@ -40,7 +40,7 @@ A `Get-Command *` command gets all types of commands, including all of the non-W A **Get-Command** command that uses the exact name of the command, without wildcard characters, automatically imports the module that contains the command so that you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the $PSModuleAutoLoadingPreference preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md) in the Microsoft TechNet library. **Get-Command** gets its data directly from the command code, unlike Get-Help, which gets its information from help topics. diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-History.md b/reference/5.0/Microsoft.PowerShell.Core/Get-History.md index 9330096be881..33a94081d97f 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-History.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-History.md @@ -133,7 +133,7 @@ This cmdlet returns a history object for each history item that it gets. ## NOTES * The session history is a list of the commands entered during the session. The session history represents the run order, the status, and the start and end times of the command. As you enter each command, Windows PowerShell adds it to the history so that you can reuse it. For more information about the command history, see about_History. -* Starting in Windows PowerShell 3.0, the default value of the $MaximumHistoryCount preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the $MaximumHistoryCount variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the TechNet library. +* Starting in Windows PowerShell 3.0, the default value of the $MaximumHistoryCount preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the $MaximumHistoryCount variable, see [about_Preference_Variables](About/about_Preference_Variables.md) in the TechNet library. ## RELATED LINKS diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/Get-PSSession.md index fa05262fac99..29a20d8bf5c9 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-PSSession.md @@ -527,7 +527,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md) in the Microsoft TechNet library. For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md b/reference/5.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md index 1e7b5d5afb80..782ca0e73e77 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md @@ -272,7 +272,7 @@ This command is useful when you set the value of the $PSSessionConfigurationName The $PSSessionConfiguationName variable specifies the default configuration that is used when you create a session. This variable is set on the local computer, but it specifies a configuration on the remote computer. -For more information about the $PSSessionConfiguration variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionConfiguration variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## PARAMETERS diff --git a/reference/5.0/Microsoft.PowerShell.Core/Import-Module.md b/reference/5.0/Microsoft.PowerShell.Core/Import-Module.md index 13dce5003615..ac236e7ea1da 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Import-Module.md @@ -75,7 +75,7 @@ The modules that you import must be installed on the local computer or a remote Starting in Windows PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the **Import-Module** command to import a module and you can enable and disable automatic module importing by using the $PSModuleAutoloadingPreference preference variable. For more information about modules, see about_Modules (http://go.microsoft.com/fwlink/?LinkID=144311). -For more information about the $PSModuleAutoloadingPreference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSModuleAutoloadingPreference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). A module is a package that contains members that can be used in Windows PowerShell. Members include cmdlets, providers, scripts, functions, variables, and other tools and files. diff --git a/reference/5.0/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/5.0/Microsoft.PowerShell.Core/Invoke-Command.md index 47c4ed4e8764..67bfedc2e1d2 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Invoke-Command.md @@ -478,7 +478,7 @@ Use this parameter to specify the application name when you are not using the *C The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -988,7 +988,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see **New-PSSessionOption**. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md index d9783d2476d3..d4350e421533 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/New-PSSession.md @@ -212,7 +212,7 @@ Use this parameter to specify the application name when you are not using the *C The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -323,7 +323,7 @@ If the specified session configuration does not exist on the remote computer, th The default value is the value of the $PSSessionConfigurationName preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ```yaml Type: String @@ -500,7 +500,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.0/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/5.0/Microsoft.PowerShell.Core/New-PSSessionOption.md index 9104938557b6..cf625d218b25 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/5.0/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -35,7 +35,7 @@ Because all of the properties can be edited, you can use the resulting object as You can also save a session option object in the **$PSSessionOption** preference variable. The values of this variable establish new default values for the session options. They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. -For more information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. @@ -161,7 +161,7 @@ When the $PSSessionOption preference variable occurs in the session, it establis To make the $PSSessionOption variable available in all sessions, add it to your Windows PowerShell session and to your Windows PowerShell profile. -For more information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about profiles, see about_Profiles (http://go.microsoft.com/fwlink/?LinkID=113729). ### Example 6: Fulfill the requirements for a remote session configuration @@ -703,7 +703,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.Remoting.PSSessionOption ## NOTES -* If the *SessionOption* parameter is not used in a command to create a **PSSession**, the session options are determined by the property values of the $PSSessionOption preference variable, if it is set. For more information about the $PSSessionOption variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* If the *SessionOption* parameter is not used in a command to create a **PSSession**, the session options are determined by the property values of the $PSSessionOption preference variable, if it is set. For more information about the $PSSessionOption variable, see [about_Preference_Variables](About/about_Preference_Variables.md). * The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties. ## RELATED LINKS diff --git a/reference/5.0/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/5.0/Microsoft.PowerShell.Core/Receive-PSSession.md index 9d1daa8c276a..5eb8c8a89b39 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -653,7 +653,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Write-Verbose.md b/reference/5.0/Microsoft.PowerShell.Utility/Write-Verbose.md index d768f6e75df2..9d70aa987c3b 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Write-Verbose.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Write-Verbose.md @@ -85,7 +85,7 @@ You can pipe a string that contains the message to **Write-Verbose**. ## NOTES * Verbose messages are returned only when the command uses the **Verbose** common parameter. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). -* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ## RELATED LINKS diff --git a/reference/5.0/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/5.0/PSWorkflow/About/about_ActivityCommonParameters.md index a184ba546a8b..a5afd6a87bf7 100644 --- a/reference/5.0/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/5.0/PSWorkflow/About/about_ActivityCommonParameters.md @@ -204,8 +204,7 @@ The default value is the value of the $PSSessionApplicationName preference variable on the target computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see -about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of @@ -522,8 +521,7 @@ New-PSSessionOption cmdlet (http://go.microsoft.com/fwlink/?LinkID=144305). For more information about the $PSSessionOption -preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +preference variable, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL A value of $True uses the Secure Sockets Layer (SSL) diff --git a/reference/5.0/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/5.0/PSWorkflow/About/about_WorkflowCommonParameters.md index e60988afbdf2..31bc58f9e1f3 100644 --- a/reference/5.0/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/5.0/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -93,8 +93,7 @@ command. The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For -more information, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +more information, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value @@ -307,8 +306,9 @@ session uses the values specified in the session configuration. For a description of the session options, including the default values, see the help topic for the New-PSSessionOption cmdlet -(http://go.microsoft.com/fwlink/?LinkID=144305). For information about the $PSSessionOption preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +(http://go.microsoft.com/fwlink/?LinkID=144305). +For information about the $PSSessionOption preference variable, +see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL Uses the Secure Sockets Layer (SSL) protocol to establish a connection diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_History.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_History.md index 0a87bd50a2bb..4dca4b6a353c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_History.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_History.md @@ -71,7 +71,7 @@ about profiles, see [about_Profiles](http://go.microsoft.com/fwlink/?LinkID=113729). For more information about the $MaximumHistoryCount preference variable, see -[about_Preference_Variables](http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](about_Preference_Variables.md). NOTE: In Windows PowerShell 2.0, the default value of the `$MaximumHistoryCount` preference variable is 64. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md index 0845e69c8853..df284abb6b7c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -526,7 +526,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md index 98509b2fc525..75c53682c98f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -551,7 +551,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see **New-PSSessionOption**. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md index 8d69c3ff3dab..f34d0e1f36c7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md @@ -40,7 +40,7 @@ A `Get-Command *` command gets all types of commands, including all of the non-W A **Get-Command** command that uses the exact name of the command, without wildcard characters, automatically imports the module that contains the command so that you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the $PSModuleAutoLoadingPreference preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md) in the Microsoft TechNet library. **Get-Command** gets its data directly from the command code, unlike Get-Help, which gets its information from help topics. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-History.md b/reference/5.1/Microsoft.PowerShell.Core/Get-History.md index 629d27a84e30..4e61be889c52 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-History.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-History.md @@ -133,7 +133,7 @@ This cmdlet returns a history object for each history item that it gets. ## NOTES * The session history is a list of the commands entered during the session. The session history represents the run order, the status, and the start and end times of the command. As you enter each command, Windows PowerShell adds it to the history so that you can reuse it. For more information about the command history, see about_History. -* Starting in Windows PowerShell 3.0, the default value of the $MaximumHistoryCount preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the $MaximumHistoryCount variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the TechNet library. +* Starting in Windows PowerShell 3.0, the default value of the $MaximumHistoryCount preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the $MaximumHistoryCount variable, see [about_Preference_Variables](About/about_Preference_Variables.md) in the TechNet library. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Get-PSSession.md index b3c32584cbbc..d9e274204bc7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-PSSession.md @@ -580,7 +580,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md) in the Microsoft TechNet library. For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md b/reference/5.1/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md index b963fc10683b..cb8e57ed1bd3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md @@ -272,7 +272,7 @@ This command is useful when you set the value of the $PSSessionConfigurationName The $PSSessionConfiguationName variable specifies the default configuration that is used when you create a session. This variable is set on the local computer, but it specifies a configuration on the remote computer. -For more information about the $PSSessionConfiguration variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionConfiguration variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## PARAMETERS diff --git a/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md index ea8ab4e9e121..78ecbfa24009 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md @@ -76,7 +76,7 @@ The modules that you import must be installed on the local computer or a remote Starting in Windows PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the **Import-Module** command to import a module and you can enable and disable automatic module importing by using the $PSModuleAutoloadingPreference preference variable. For more information about modules, see about_Modules (http://go.microsoft.com/fwlink/?LinkID=144311). -For more information about the $PSModuleAutoloadingPreference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSModuleAutoloadingPreference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). A module is a package that contains members that can be used in Windows PowerShell. Members include cmdlets, providers, scripts, functions, variables, and other tools and files. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md index 4f0097460ecd..6e918c3be7f4 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Invoke-Command.md @@ -492,7 +492,7 @@ Use this parameter to specify the application name when you are not using the *C The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -1032,7 +1032,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see **New-PSSessionOption**. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md index 0bf5a767f4c6..55b47d1bc5ae 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSession.md @@ -230,7 +230,7 @@ Use this parameter to specify the application name when you are not using the *C The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -341,7 +341,7 @@ If the specified session configuration does not exist on the remote computer, th The default value is the value of the $PSSessionConfigurationName preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ```yaml Type: String @@ -562,7 +562,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md index 9104938557b6..cf625d218b25 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/5.1/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -35,7 +35,7 @@ Because all of the properties can be edited, you can use the resulting object as You can also save a session option object in the **$PSSessionOption** preference variable. The values of this variable establish new default values for the session options. They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. -For more information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. @@ -161,7 +161,7 @@ When the $PSSessionOption preference variable occurs in the session, it establis To make the $PSSessionOption variable available in all sessions, add it to your Windows PowerShell session and to your Windows PowerShell profile. -For more information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about profiles, see about_Profiles (http://go.microsoft.com/fwlink/?LinkID=113729). ### Example 6: Fulfill the requirements for a remote session configuration @@ -703,7 +703,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.Remoting.PSSessionOption ## NOTES -* If the *SessionOption* parameter is not used in a command to create a **PSSession**, the session options are determined by the property values of the $PSSessionOption preference variable, if it is set. For more information about the $PSSessionOption variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* If the *SessionOption* parameter is not used in a command to create a **PSSession**, the session options are determined by the property values of the $PSSessionOption preference variable, if it is set. For more information about the $PSSessionOption variable, see [about_Preference_Variables](About/about_Preference_Variables.md). * The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md index 4e5dbb1b2245..a88787afc9c6 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -653,7 +653,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Write-Verbose.md b/reference/5.1/Microsoft.PowerShell.Utility/Write-Verbose.md index 1c9ed20b5d80..478227dbcd1f 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Write-Verbose.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Write-Verbose.md @@ -85,7 +85,7 @@ You can pipe a string that contains the message to **Write-Verbose**. ## NOTES * Verbose messages are returned only when the command uses the **Verbose** common parameter. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). -* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ## RELATED LINKS diff --git a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md index a184ba546a8b..a5afd6a87bf7 100644 --- a/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_ActivityCommonParameters.md @@ -204,8 +204,7 @@ The default value is the value of the $PSSessionApplicationName preference variable on the target computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For more information, see -about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of @@ -522,8 +521,7 @@ New-PSSessionOption cmdlet (http://go.microsoft.com/fwlink/?LinkID=144305). For more information about the $PSSessionOption -preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +preference variable, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL A value of $True uses the Secure Sockets Layer (SSL) diff --git a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md index e60988afbdf2..31bc58f9e1f3 100644 --- a/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md +++ b/reference/5.1/PSWorkflow/About/about_WorkflowCommonParameters.md @@ -93,8 +93,7 @@ command. The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. For -more information, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +more information, see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value @@ -307,8 +306,9 @@ session uses the values specified in the session configuration. For a description of the session options, including the default values, see the help topic for the New-PSSessionOption cmdlet -(http://go.microsoft.com/fwlink/?LinkID=144305). For information about the $PSSessionOption preference variable, see about_Preference_Variables -(http://go.microsoft.com/fwlink/?LinkID=113248). +(http://go.microsoft.com/fwlink/?LinkID=144305). +For information about the $PSSessionOption preference variable, +see [about_Preference_Variables](../../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). -PSUseSSL Uses the Secure Sockets Layer (SSL) protocol to establish a connection diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_History.md b/reference/6/Microsoft.PowerShell.Core/About/about_History.md index 0a87bd50a2bb..4dca4b6a353c 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_History.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_History.md @@ -71,7 +71,7 @@ about profiles, see [about_Profiles](http://go.microsoft.com/fwlink/?LinkID=113729). For more information about the $MaximumHistoryCount preference variable, see -[about_Preference_Variables](http://go.microsoft.com/fwlink/?LinkID=113248). +[about_Preference_Variables](about_Preference_Variables.md). NOTE: In Windows PowerShell 2.0, the default value of the `$MaximumHistoryCount` preference variable is 64. diff --git a/reference/6/Microsoft.PowerShell.Core/Connect-PSSession.md b/reference/6/Microsoft.PowerShell.Core/Connect-PSSession.md index 69d91a6e36ee..4b5ccc8a5b13 100644 --- a/reference/6/Microsoft.PowerShell.Core/Connect-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/Connect-PSSession.md @@ -526,7 +526,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md b/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md index db76eea92545..41e210857b3f 100644 --- a/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/Enter-PSSession.md @@ -587,7 +587,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see **New-PSSessionOption**. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/6/Microsoft.PowerShell.Core/Get-Command.md b/reference/6/Microsoft.PowerShell.Core/Get-Command.md index 8d69c3ff3dab..f34d0e1f36c7 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-Command.md @@ -40,7 +40,7 @@ A `Get-Command *` command gets all types of commands, including all of the non-W A **Get-Command** command that uses the exact name of the command, without wildcard characters, automatically imports the module that contains the command so that you can use the command immediately. To enable, disable, and configure automatic importing of modules, use the $PSModuleAutoLoadingPreference preference variable. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md) in the Microsoft TechNet library. **Get-Command** gets its data directly from the command code, unlike Get-Help, which gets its information from help topics. diff --git a/reference/6/Microsoft.PowerShell.Core/Get-History.md b/reference/6/Microsoft.PowerShell.Core/Get-History.md index 629d27a84e30..4e61be889c52 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-History.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-History.md @@ -133,7 +133,7 @@ This cmdlet returns a history object for each history item that it gets. ## NOTES * The session history is a list of the commands entered during the session. The session history represents the run order, the status, and the start and end times of the command. As you enter each command, Windows PowerShell adds it to the history so that you can reuse it. For more information about the command history, see about_History. -* Starting in Windows PowerShell 3.0, the default value of the $MaximumHistoryCount preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the $MaximumHistoryCount variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the TechNet library. +* Starting in Windows PowerShell 3.0, the default value of the $MaximumHistoryCount preference variable is 4096. In Windows PowerShell 2.0, the default value is 64. For more information about the $MaximumHistoryCount variable, see [about_Preference_Variables](About/about_Preference_Variables.md) in the TechNet library. ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Core/Get-PSSession.md b/reference/6/Microsoft.PowerShell.Core/Get-PSSession.md index cfe41bf57621..d54df38b65ab 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-PSSession.md @@ -563,7 +563,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options, including the default values, see New-PSSessionOption. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248) in the Microsoft TechNet library. +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md) in the Microsoft TechNet library. For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/6/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md b/reference/6/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md index b963fc10683b..cb8e57ed1bd3 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-PSSessionConfiguration.md @@ -272,7 +272,7 @@ This command is useful when you set the value of the $PSSessionConfigurationName The $PSSessionConfiguationName variable specifies the default configuration that is used when you create a session. This variable is set on the local computer, but it specifies a configuration on the remote computer. -For more information about the $PSSessionConfiguration variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionConfiguration variable, see [about_Preference_Variables](About/about_Preference_Variables.md). ## PARAMETERS diff --git a/reference/6/Microsoft.PowerShell.Core/Import-Module.md b/reference/6/Microsoft.PowerShell.Core/Import-Module.md index 55770a38af65..2c245881ce7d 100644 --- a/reference/6/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/6/Microsoft.PowerShell.Core/Import-Module.md @@ -76,7 +76,7 @@ The modules that you import must be installed on the local computer or a remote Starting in Windows PowerShell 3.0, installed modules are automatically imported to the session when you use any commands or providers in the module. However, you can still use the **Import-Module** command to import a module and you can enable and disable automatic module importing by using the $PSModuleAutoloadingPreference preference variable. For more information about modules, see about_Modules (http://go.microsoft.com/fwlink/?LinkID=144311). -For more information about the $PSModuleAutoloadingPreference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSModuleAutoloadingPreference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). A module is a package that contains members that can be used in Windows PowerShell. Members include cmdlets, providers, scripts, functions, variables, and other tools and files. diff --git a/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md b/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md index 4831882d74fe..11e44169a255 100644 --- a/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md +++ b/reference/6/Microsoft.PowerShell.Core/Invoke-Command.md @@ -542,7 +542,7 @@ Use this parameter to specify the application name when you are not using the *C The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -1052,7 +1052,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see **New-PSSessionOption**. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md index fb7d4e88e06d..b0c4db6eb5f0 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/New-PSSession.md @@ -261,7 +261,7 @@ Use this parameter to specify the application name when you are not using the *C The default value is the value of the $PSSessionApplicationName preference variable on the local computer. If this preference variable is not defined, the default value is WSMAN. This value is appropriate for most uses. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). The WinRM service uses the application name to select a listener to service the connection request. The value of this parameter should match the value of the **URLPrefix** property of a listener on the remote computer. @@ -372,7 +372,7 @@ If the specified session configuration does not exist on the remote computer, th The default value is the value of the $PSSessionConfigurationName preference variable on the local computer. If this preference variable is not set, the default is Microsoft.PowerShell. -For more information, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information, see [about_Preference_Variables](About/about_Preference_Variables.md). ```yaml Type: String @@ -569,7 +569,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/6/Microsoft.PowerShell.Core/New-PSSessionOption.md b/reference/6/Microsoft.PowerShell.Core/New-PSSessionOption.md index 9104938557b6..cf625d218b25 100644 --- a/reference/6/Microsoft.PowerShell.Core/New-PSSessionOption.md +++ b/reference/6/Microsoft.PowerShell.Core/New-PSSessionOption.md @@ -35,7 +35,7 @@ Because all of the properties can be edited, you can use the resulting object as You can also save a session option object in the **$PSSessionOption** preference variable. The values of this variable establish new default values for the session options. They effective when no session options are set for the session and they take precedence over options set in the session configuration, but you can override them by specifying session options or a session option object in a cmdlet that creates a session. -For more information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). When you use a session option object in a cmdlet that creates a session, the session option values take precedence over default values for sessions set in the $PSSessionOption preference variable and in the session configuration. However, they do not take precedence over maximum values, quotas or limits set in the session configuration. @@ -161,7 +161,7 @@ When the $PSSessionOption preference variable occurs in the session, it establis To make the $PSSessionOption variable available in all sessions, add it to your Windows PowerShell session and to your Windows PowerShell profile. -For more information about the $PSSessionOption preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For more information about the $PSSessionOption preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about profiles, see about_Profiles (http://go.microsoft.com/fwlink/?LinkID=113729). ### Example 6: Fulfill the requirements for a remote session configuration @@ -703,7 +703,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.Remoting.PSSessionOption ## NOTES -* If the *SessionOption* parameter is not used in a command to create a **PSSession**, the session options are determined by the property values of the $PSSessionOption preference variable, if it is set. For more information about the $PSSessionOption variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* If the *SessionOption* parameter is not used in a command to create a **PSSession**, the session options are determined by the property values of the $PSSessionOption preference variable, if it is set. For more information about the $PSSessionOption variable, see [about_Preference_Variables](About/about_Preference_Variables.md). * The properties of a session configuration object vary with the options set for the session configuration and the values of those options. Also, session configurations that use a session configuration file have additional properties. ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Core/Receive-PSSession.md b/reference/6/Microsoft.PowerShell.Core/Receive-PSSession.md index fa13ac6f209d..12cfd7e0e6b5 100644 --- a/reference/6/Microsoft.PowerShell.Core/Receive-PSSession.md +++ b/reference/6/Microsoft.PowerShell.Core/Receive-PSSession.md @@ -653,7 +653,7 @@ The session option values take precedence over default values for sessions set i However, they do not take precedence over maximum values, quotas or limits set in the session configuration. For a description of the session options that includes the default values, see New-PSSessionOption. -For information about the **$PSSessionOption** preference variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +For information about the **$PSSessionOption** preference variable, see [about_Preference_Variables](About/about_Preference_Variables.md). For more information about session configurations, see about_Session_Configurations (http://go.microsoft.com/fwlink/?LinkID=145152). ```yaml diff --git a/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md b/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md index d484fba5cdcb..5197197c370c 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md +++ b/reference/6/Microsoft.PowerShell.Utility/Write-Verbose.md @@ -113,7 +113,7 @@ You can pipe a string that contains the message to **Write-Verbose**. ## NOTES * Verbose messages are returned only when the command uses the **Verbose** common parameter. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). -* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see about_Preference_Variables (http://go.microsoft.com/fwlink/?LinkID=113248). +* In Windows PowerShell background jobs and remote commands, the **$VerbosePreference** variable in the job session and remote session determine whether the verbose message is displayed by default. For more information about the **$VerbosePreference** variable, see [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md). ## RELATED LINKS From 34e0059f54d982b253e757ef35bd53c0a2868b72 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 23 Dec 2017 01:26:18 +0900 Subject: [PATCH 131/145] Fix broken headers in Get-CimSession.md v6.0 (#1981) --- reference/6/CimCmdlets/Get-CimSession.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/6/CimCmdlets/Get-CimSession.md b/reference/6/CimCmdlets/Get-CimSession.md index 8cae0b6b7256..fa5a742c06e4 100644 --- a/reference/6/CimCmdlets/Get-CimSession.md +++ b/reference/6/CimCmdlets/Get-CimSession.md @@ -43,7 +43,7 @@ For more information about wps_2 sessions, see about_CimSessions ## EXAMPLES -### -------------------------- EXAMPLExample 1: Get CIM sessions from the current wps_2 session. --------------------------xample: Get CIM sessions from the current wps_2 session. +### Example 1: Get CIM sessions from the current wps_2 session ``` By default, Get-CimSession only gets information about the CIM sessions that exist in the current wps_2 session. Get-CimSession does not get CIM sessions that were created in other wps_2 sessions or that were created on other computers. PS C:\> New-CimSession -ComputerName Server01,Server02 @@ -84,7 +84,7 @@ Protocol : WSMAN This command first creates CIM sessions by using New-CimSession, and then gets the CIM sessions by using Get-CimSession. -### -------------------------- EXAMPLE xample 2: Get the CIM sessions from a specific computer --------------------------xample : Get the CIM sessions from a specific computer +### Example 2: Get the CIM sessions from a specific computer ``` PS C:\>Get-CimSession -ComputerName Server02 Id : 2 @@ -104,14 +104,14 @@ Protocol : WSMAN This command gets the CIM sessions that are connected to the computer named Server02. -### -------------------------- EXAMPLE xample 3: Get a list of CIM sessions and then format the list --------------------------xample : Get a list of CIM sessions and then format the list +### Example 3: Get a list of CIM sessions and then format the list ``` PS C:\>Get-CimSession | Format-Table -Property ComputerName,InstanceID ``` This command gets all of the CIM sessions in the current wps_2 session, and then formats the list in a table containing only the ComputerName and InstanceID parameters. -### -------------------------- EXAMPLExample 4: Get all the CIM sessions that have specific names --------------------------xample: Get all the CIM sessions that have specific names +### Example 4: Get all the CIM sessions that have specific names ``` PS C:\>Get-CimSession -ComputerName Serv* Id : 1 @@ -145,7 +145,7 @@ Protocol : WSMAN This command gets all of the CIM sessions that have names that begin with the characters serv. -### -------------------------- EXAMPLExample 5: Get a specific CIM session --------------------------xample: Get a specific CIM session +### Example 5: Get a specific CIM session ``` PS C:\>Get-CimSession -ID 2 ``` From bd76183893ad6225a169d4de58179510e678e862 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Sat, 23 Dec 2017 01:27:06 +0900 Subject: [PATCH 132/145] Update Example 1 in Import-Counter.md (#1980) --- .../3.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md | 7 ++++--- .../4.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md | 6 +++--- .../5.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md | 4 ++-- .../5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md | 6 +++--- .../6/Microsoft.PowerShell.Diagnostics/Import-Counter.md | 6 +++--- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md b/reference/3.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md index 39d90e193f2a..b097e100219f 100644 --- a/reference/3.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md +++ b/reference/3.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md @@ -41,11 +41,12 @@ Along with Get-Counter and Export-Counter, this feature lets you collect, export ## EXAMPLES ### Example 1 +```powershell +$Data = Import-Counter -Path ProcessorData.csv ``` -PS C:\> $Data = Import-Counter -Path ProcessorData.csv -``` -This command imports all of the counter data from the ProcessorData.csv file into the $Data variable. +This command imports all counter data from the ProcessorData.csv file into the $Data variable. + ### Example 2 ``` PS C:\> $i = Import-Counter -Path ProcessorData.blg -Counter "\\SERVER01\Processor(_Total)\Interrupts/sec" diff --git a/reference/4.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md b/reference/4.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md index 8c01170b5809..872e3ed26800 100644 --- a/reference/4.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md +++ b/reference/4.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md @@ -44,11 +44,11 @@ Along with Get-Counter and Export-Counter, this feature lets you collect, export ## EXAMPLES ### Example 1 -``` -PS C:\> $Data = Import-Counter -Path ProcessorData.csv +```powershell +$Data = Import-Counter -Path ProcessorData.csv ``` -This command imports all of the counter data from the ProcessorData.csv file into the $Data variable. +This command imports all counter data from the ProcessorData.csv file into the $Data variable. ### Example 2 ``` diff --git a/reference/5.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md b/reference/5.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md index 4d431bfe87d4..d18d0b3c71be 100644 --- a/reference/5.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md +++ b/reference/5.0/Microsoft.PowerShell.Diagnostics/Import-Counter.md @@ -44,8 +44,8 @@ Along with the Get-Counter and Export-Counter cmdlets, this feature lets you col ## EXAMPLES ### Example 1: Import all counter data from a file -``` -PS C:\> $Data = Import-Counter -Path ProcessorData.csv +```powershell +$Data = Import-Counter -Path ProcessorData.csv ``` This command imports all counter data from the ProcessorData.csv file into the $Data variable. diff --git a/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md b/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md index 6001182cf4fb..484d70c16efc 100644 --- a/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md +++ b/reference/5.1/Microsoft.PowerShell.Diagnostics/Import-Counter.md @@ -43,9 +43,9 @@ Along with the Get-Counter and Export-Counter cmdlets, this feature lets you col ## EXAMPLES -### -------------------------- EXAMPLE xample 1: Import all counter data from a file --------------------------xample : Import all counter data from a file -``` -PS C:\> $Data = Import-Counter -Path ProcessorData.csv +### Example 1: Import all counter data from a file +```powershell +$Data = Import-Counter -Path ProcessorData.csv ``` This command imports all counter data from the ProcessorData.csv file into the $Data variable. diff --git a/reference/6/Microsoft.PowerShell.Diagnostics/Import-Counter.md b/reference/6/Microsoft.PowerShell.Diagnostics/Import-Counter.md index bfbd861f7302..02a80bca1c0b 100644 --- a/reference/6/Microsoft.PowerShell.Diagnostics/Import-Counter.md +++ b/reference/6/Microsoft.PowerShell.Diagnostics/Import-Counter.md @@ -43,9 +43,9 @@ Along with the Get-Counter and Export-Counter cmdlets, this feature lets you col ## EXAMPLES -### -------------------------- EXAMPLE xample 1: Import all counter data from a file --------------------------xample : Import all counter data from a file -``` -PS C:\> $Data = Import-Counter -Path ProcessorData.csv +### Example 1: Import all counter data from a file +```powershell +$Data = Import-Counter -Path ProcessorData.csv ``` This command imports all counter data from the ProcessorData.csv file into the $Data variable. From ce0b7c1089e5b8c90b6b26ac35e2a0e8ea4c91f6 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Fri, 22 Dec 2017 08:28:25 -0800 Subject: [PATCH 133/145] move $OFS to prefs article added note about read-only (#1978) --- .../About/about_Automatic_Variables.md | 49 ++----------------- .../About/about_Preference_Variables.md | 42 +++++++++++++++- .../About/about_Automatic_Variables.md | 49 ++----------------- .../About/about_Preference_Variables.md | 42 +++++++++++++++- .../About/about_Automatic_Variables.md | 49 ++----------------- .../About/about_Preference_Variables.md | 42 +++++++++++++++- .../About/about_Automatic_Variables.md | 49 ++----------------- .../About/about_Preference_Variables.md | 42 +++++++++++++++- .../About/about_Automatic_Variables.md | 49 ++----------------- .../About/about_Preference_Variables.md | 42 +++++++++++++++- 10 files changed, 220 insertions(+), 235 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 0fe7b2fae3a1..8a1c7aa5898b 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-11-27 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell. ## LONG DESCRIPTION +Conceptually, these variables are considered to be read-only. +Even though they **can** be written to, for backward compatibility they **should not** be written to. + Here is a list of the automatic variables in PowerShell: ### $$ @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting Appointment on Friday: Team lunch ``` -### $OFS - -$OFS is a special variable that stores a string that you want to use as an -output field separator. Use this variable when you are converting an array -to a string. By default, the value of $OFS is " ", but you can change the -value of $OFS in your session, by typing `$OFS=""`. If you are -expecting the default value of " " in your script, module, or configuration -output, be careful that the $OFS default value has not been changed -elsewhere in your code. - -For example: - -```powershell -$a="1","2","3","4" -$a -[string]$a -$OFS="" -[string]$a -$OFS="," -[string]$a -$OFS="--PowerShellRocks--"; -[string]$a -$OFS="`n`n"; -[string]$a -``` - -```output -1 -2 -3 -4 -1 2 3 4 -1234 -1,2,3,4 -1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 -1 - -2 - -3 - -4 -``` - ### $PID Contains the process identifier (PID) of the process that is hosting the diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index 906dc159fb8a..d52a4d7a090c 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-05 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -835,7 +835,45 @@ Valid values: Any string. Default: Space By default, the \$OFS variable does not exist and the output file separator is -a space, but you can add this variable and set it to any string. +a space, but you can add this variable and set it to any string. You can change +the value of $OFS in your session, by typing `$OFS=""`. If you are +expecting the default value of " " in your script, module, or configuration +output, be careful that the $OFS default value has not been changed elsewhere +in your code. + +For example: + +```powershell +$a="1","2","3","4" +$a +[string]$a +$OFS="" +[string]$a +$OFS="," +[string]$a +$OFS="--PowerShellRocks--"; +[string]$a +$OFS="`n`n"; +[string]$a +``` + +```output +1 +2 +3 +4 +1 2 3 4 +1234 +1,2,3,4 +1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 +1 + +2 + +3 + +4 +``` ##### EXAMPLES diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 0fe7b2fae3a1..8a1c7aa5898b 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-11-27 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell. ## LONG DESCRIPTION +Conceptually, these variables are considered to be read-only. +Even though they **can** be written to, for backward compatibility they **should not** be written to. + Here is a list of the automatic variables in PowerShell: ### $$ @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting Appointment on Friday: Team lunch ``` -### $OFS - -$OFS is a special variable that stores a string that you want to use as an -output field separator. Use this variable when you are converting an array -to a string. By default, the value of $OFS is " ", but you can change the -value of $OFS in your session, by typing `$OFS=""`. If you are -expecting the default value of " " in your script, module, or configuration -output, be careful that the $OFS default value has not been changed -elsewhere in your code. - -For example: - -```powershell -$a="1","2","3","4" -$a -[string]$a -$OFS="" -[string]$a -$OFS="," -[string]$a -$OFS="--PowerShellRocks--"; -[string]$a -$OFS="`n`n"; -[string]$a -``` - -```output -1 -2 -3 -4 -1 2 3 4 -1234 -1,2,3,4 -1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 -1 - -2 - -3 - -4 -``` - ### $PID Contains the process identifier (PID) of the process that is hosting the diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index 906dc159fb8a..d52a4d7a090c 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-05 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -835,7 +835,45 @@ Valid values: Any string. Default: Space By default, the \$OFS variable does not exist and the output file separator is -a space, but you can add this variable and set it to any string. +a space, but you can add this variable and set it to any string. You can change +the value of $OFS in your session, by typing `$OFS=""`. If you are +expecting the default value of " " in your script, module, or configuration +output, be careful that the $OFS default value has not been changed elsewhere +in your code. + +For example: + +```powershell +$a="1","2","3","4" +$a +[string]$a +$OFS="" +[string]$a +$OFS="," +[string]$a +$OFS="--PowerShellRocks--"; +[string]$a +$OFS="`n`n"; +[string]$a +``` + +```output +1 +2 +3 +4 +1 2 3 4 +1234 +1,2,3,4 +1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 +1 + +2 + +3 + +4 +``` ##### EXAMPLES diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 0fe7b2fae3a1..8a1c7aa5898b 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-11-27 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell. ## LONG DESCRIPTION +Conceptually, these variables are considered to be read-only. +Even though they **can** be written to, for backward compatibility they **should not** be written to. + Here is a list of the automatic variables in PowerShell: ### $$ @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting Appointment on Friday: Team lunch ``` -### $OFS - -$OFS is a special variable that stores a string that you want to use as an -output field separator. Use this variable when you are converting an array -to a string. By default, the value of $OFS is " ", but you can change the -value of $OFS in your session, by typing `$OFS=""`. If you are -expecting the default value of " " in your script, module, or configuration -output, be careful that the $OFS default value has not been changed -elsewhere in your code. - -For example: - -```powershell -$a="1","2","3","4" -$a -[string]$a -$OFS="" -[string]$a -$OFS="," -[string]$a -$OFS="--PowerShellRocks--"; -[string]$a -$OFS="`n`n"; -[string]$a -``` - -```output -1 -2 -3 -4 -1 2 3 4 -1234 -1,2,3,4 -1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 -1 - -2 - -3 - -4 -``` - ### $PID Contains the process identifier (PID) of the process that is hosting the diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index 906dc159fb8a..d52a4d7a090c 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-05 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -835,7 +835,45 @@ Valid values: Any string. Default: Space By default, the \$OFS variable does not exist and the output file separator is -a space, but you can add this variable and set it to any string. +a space, but you can add this variable and set it to any string. You can change +the value of $OFS in your session, by typing `$OFS=""`. If you are +expecting the default value of " " in your script, module, or configuration +output, be careful that the $OFS default value has not been changed elsewhere +in your code. + +For example: + +```powershell +$a="1","2","3","4" +$a +[string]$a +$OFS="" +[string]$a +$OFS="," +[string]$a +$OFS="--PowerShellRocks--"; +[string]$a +$OFS="`n`n"; +[string]$a +``` + +```output +1 +2 +3 +4 +1 2 3 4 +1234 +1,2,3,4 +1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 +1 + +2 + +3 + +4 +``` ##### EXAMPLES diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 0fe7b2fae3a1..8a1c7aa5898b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-11-27 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell. ## LONG DESCRIPTION +Conceptually, these variables are considered to be read-only. +Even though they **can** be written to, for backward compatibility they **should not** be written to. + Here is a list of the automatic variables in PowerShell: ### $$ @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting Appointment on Friday: Team lunch ``` -### $OFS - -$OFS is a special variable that stores a string that you want to use as an -output field separator. Use this variable when you are converting an array -to a string. By default, the value of $OFS is " ", but you can change the -value of $OFS in your session, by typing `$OFS=""`. If you are -expecting the default value of " " in your script, module, or configuration -output, be careful that the $OFS default value has not been changed -elsewhere in your code. - -For example: - -```powershell -$a="1","2","3","4" -$a -[string]$a -$OFS="" -[string]$a -$OFS="," -[string]$a -$OFS="--PowerShellRocks--"; -[string]$a -$OFS="`n`n"; -[string]$a -``` - -```output -1 -2 -3 -4 -1 2 3 4 -1234 -1,2,3,4 -1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 -1 - -2 - -3 - -4 -``` - ### $PID Contains the process identifier (PID) of the process that is hosting the diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index 906dc159fb8a..d52a4d7a090c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-05 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -835,7 +835,45 @@ Valid values: Any string. Default: Space By default, the \$OFS variable does not exist and the output file separator is -a space, but you can add this variable and set it to any string. +a space, but you can add this variable and set it to any string. You can change +the value of $OFS in your session, by typing `$OFS=""`. If you are +expecting the default value of " " in your script, module, or configuration +output, be careful that the $OFS default value has not been changed elsewhere +in your code. + +For example: + +```powershell +$a="1","2","3","4" +$a +[string]$a +$OFS="" +[string]$a +$OFS="," +[string]$a +$OFS="--PowerShellRocks--"; +[string]$a +$OFS="`n`n"; +[string]$a +``` + +```output +1 +2 +3 +4 +1 2 3 4 +1234 +1,2,3,4 +1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 +1 + +2 + +3 + +4 +``` ##### EXAMPLES diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md b/reference/6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md index 0fe7b2fae3a1..8a1c7aa5898b 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-11-27 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell. ## LONG DESCRIPTION +Conceptually, these variables are considered to be read-only. +Even though they **can** be written to, for backward compatibility they **should not** be written to. + Here is a list of the automatic variables in PowerShell: ### $$ @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting Appointment on Friday: Team lunch ``` -### $OFS - -$OFS is a special variable that stores a string that you want to use as an -output field separator. Use this variable when you are converting an array -to a string. By default, the value of $OFS is " ", but you can change the -value of $OFS in your session, by typing `$OFS=""`. If you are -expecting the default value of " " in your script, module, or configuration -output, be careful that the $OFS default value has not been changed -elsewhere in your code. - -For example: - -```powershell -$a="1","2","3","4" -$a -[string]$a -$OFS="" -[string]$a -$OFS="," -[string]$a -$OFS="--PowerShellRocks--"; -[string]$a -$OFS="`n`n"; -[string]$a -``` - -```output -1 -2 -3 -4 -1 2 3 4 -1234 -1,2,3,4 -1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 -1 - -2 - -3 - -4 -``` - ### $PID Contains the process identifier (PID) of the process that is hosting the diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Preference_Variables.md b/reference/6/Microsoft.PowerShell.Core/About/about_Preference_Variables.md index 906dc159fb8a..d52a4d7a090c 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Preference_Variables.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Preference_Variables.md @@ -1,5 +1,5 @@ --- -ms.date: 2017-12-05 +ms.date: 2017-12-21 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -835,7 +835,45 @@ Valid values: Any string. Default: Space By default, the \$OFS variable does not exist and the output file separator is -a space, but you can add this variable and set it to any string. +a space, but you can add this variable and set it to any string. You can change +the value of $OFS in your session, by typing `$OFS=""`. If you are +expecting the default value of " " in your script, module, or configuration +output, be careful that the $OFS default value has not been changed elsewhere +in your code. + +For example: + +```powershell +$a="1","2","3","4" +$a +[string]$a +$OFS="" +[string]$a +$OFS="," +[string]$a +$OFS="--PowerShellRocks--"; +[string]$a +$OFS="`n`n"; +[string]$a +``` + +```output +1 +2 +3 +4 +1 2 3 4 +1234 +1,2,3,4 +1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4 +1 + +2 + +3 + +4 +``` ##### EXAMPLES From 62d8b8ae43da9eb649d9bfd27a57400362422db9 Mon Sep 17 00:00:00 2001 From: rockygiglio Date: Fri, 29 Dec 2017 22:33:55 -0500 Subject: [PATCH 134/145] Update decisionMaker.md (#1984) Slight, but critical corrections to the definition of DevOps. --- dsc/decisionMaker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsc/decisionMaker.md b/dsc/decisionMaker.md index a21a1eaa57e5..4698a44a2d1d 100644 --- a/dsc/decisionMaker.md +++ b/dsc/decisionMaker.md @@ -37,7 +37,7 @@ Configurations are also shareable via the [PowerShell Gallery](https://powershel ## Desired State Configuration and DevOps [DevOps](http://blogs.technet.com/b/ashleymcglone/archive/2015/11/20/devops-for-n00bs-ie-windows-people.aspx) is a combination of people, -technologies, and culture that allow for rapid deployment and iteration. +process, and tools that allow for rapid deployment and iteration focused on delivering value to end users whether internal or external. DSC was designed with DevOps in mind. Having a single configuration define an environment means that developers can encode their requirements into a configuration, check that configuration into source control, and operations teams can easily deploy code without having to go through error-prone manual processes. From 6a1218ac142125195ec1fad02298daeed82a751b Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Sat, 30 Dec 2017 14:34:20 +1100 Subject: [PATCH 135/145] Update configurations.md (#1985) --- dsc/configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsc/configurations.md b/dsc/configurations.md index fd8a6ef94543..a8f86877b180 100644 --- a/dsc/configurations.md +++ b/dsc/configurations.md @@ -65,7 +65,7 @@ MyDscConfiguration ``` -In this example, you specify the name of the node by passing it as the **ComputerName** parameter when you compile the configuraton. The name defaults to "localhost". +In this example, you specify the name of the node by passing it as the **ComputerName** parameter when you compile the configuration. The name defaults to "localhost". ## Compiling the configuration From ccb1710b88a7bd01faea96f51eff3bb18cf0b3fe Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 3 Jan 2018 01:18:32 +0900 Subject: [PATCH 136/145] Fix parameter's position in Restart-Service.md (#1993) --- .../Restart-Service.md | 19 ++++--- .../Restart-Service.md | 17 ++++--- .../Restart-Service.md | 13 +++-- .../Restart-Service.md | 13 +++-- .../Restart-Service.md | 49 +++++-------------- 5 files changed, 49 insertions(+), 62 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Restart-Service.md b/reference/3.0/Microsoft.PowerShell.Management/Restart-Service.md index 53dbed74a82a..bf7d8644dd48 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Restart-Service.md @@ -9,25 +9,30 @@ title: Restart-Service --- # Restart-Service + ## SYNOPSIS Stops and then starts one or more services. + ## SYNTAX ### InputObject (Default) ``` -Restart-Service [-Force] [-InputObject] [-PassThru] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Restart-Service [-InputObject] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### Default ``` -Restart-Service [-Force] [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Restart-Service [-Name] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Restart-Service [-Force] [-PassThru] -DisplayName [-Include ] [-Exclude ] +Restart-Service -DisplayName + [-Force] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` @@ -138,7 +143,7 @@ Parameter Sets: InputObject Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -153,7 +158,7 @@ Parameter Sets: Default Aliases: ServiceName Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Management/Restart-Service.md b/reference/4.0/Microsoft.PowerShell.Management/Restart-Service.md index c5bb1893694c..1ceee103a877 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Restart-Service.md @@ -17,19 +17,22 @@ Stops and then starts one or more services. ### InputObject (Default) ``` -Restart-Service [-Force] [-InputObject] [-PassThru] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Restart-Service [-InputObject] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### Default ``` -Restart-Service [-Force] [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Restart-Service [-Name] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Restart-Service [-Force] [-PassThru] -DisplayName [-Include ] [-Exclude ] +Restart-Service -DisplayName + [-Force] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` @@ -144,7 +147,7 @@ Parameter Sets: InputObject Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -159,7 +162,7 @@ Parameter Sets: Default Aliases: ServiceName Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/5.0/Microsoft.PowerShell.Management/Restart-Service.md b/reference/5.0/Microsoft.PowerShell.Management/Restart-Service.md index 058cf5c8df33..a30b808150a7 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Restart-Service.md @@ -17,19 +17,22 @@ Stops and then starts one or more services. ### InputObject (Default) ``` -Restart-Service [-Force] [-InputObject] [-PassThru] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Restart-Service [-InputObject] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### Default ``` -Restart-Service [-Force] [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Restart-Service [-Name] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Restart-Service [-Force] [-PassThru] -DisplayName [-Include ] [-Exclude ] +Restart-Service -DisplayName + [-Force] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` diff --git a/reference/5.1/Microsoft.PowerShell.Management/Restart-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Restart-Service.md index 5acef419a0e0..1a7270212f3d 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Restart-Service.md @@ -17,19 +17,22 @@ Stops and then starts one or more services. ### InputObject (Default) ``` -Restart-Service [-Force] [-InputObject] [-PassThru] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Restart-Service [-InputObject] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### Default ``` -Restart-Service [-Force] [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Restart-Service [-Name] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Restart-Service [-Force] [-PassThru] -DisplayName [-Include ] [-Exclude ] +Restart-Service -DisplayName + [-Force] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` diff --git a/reference/6/Microsoft.PowerShell.Management/Restart-Service.md b/reference/6/Microsoft.PowerShell.Management/Restart-Service.md index 4961451a4a8d..a1b5533651eb 100644 --- a/reference/6/Microsoft.PowerShell.Management/Restart-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Restart-Service.md @@ -17,23 +17,23 @@ Stops and then starts one or more services. ### InputObject (Default) ``` -Restart-Service [-Force] [-InputObject] [-PassThru] [-Include ] - [-Exclude ] [-InformationAction ] [-InformationVariable ] [-WhatIf] - [-Confirm] [] +Restart-Service [-InputObject] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### Default ``` -Restart-Service [-Force] [-Name] [-PassThru] [-Include ] [-Exclude ] - [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] - [] +Restart-Service [-Name] + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Restart-Service [-Force] [-PassThru] -DisplayName [-Include ] [-Exclude ] - [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] - [] +Restart-Service -DisplayName + [-Force] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -139,33 +139,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies **ServiceController** objects that represent the services to restart. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -176,7 +149,7 @@ Parameter Sets: InputObject Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -191,7 +164,7 @@ Parameter Sets: Default Aliases: ServiceName Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False From 8eca7bcab860ac429774555090a2e3777580e74d Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 3 Jan 2018 01:19:24 +0900 Subject: [PATCH 137/145] Fix link for logical operators in about_Operator_Precedence.md (#1992) --- .../About/about_Operator_Precedence.md | 2 +- .../About/about_Operator_Precedence.md | 2 +- .../About/about_Operator_Precedence.md | 2 +- .../About/about_Operator_Precedence.md | 2 +- .../About/about_Operator_Precedence.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md index 01d129ccc4bb..de68aea9a86c 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md @@ -77,7 +77,7 @@ order: |OPERATOR |REFERENCE| |--------------------------|---------| |`-band -bor -bxor` |[about_Arithmetic_Operators](about_Arithmetic_Operators.md)| -|`-and -or -xor` |[about_comparison_operators](about_comparison_operators.md)| +|`-and -or -xor` |[about_Logical_Operators](about_logical_operators.md)| |`.` (dot-source) |[about_Scopes](about_Scopes.md)| |`&` (call) |[about_Operators](about_Operators.md)| || (pipeline operator)|[about_Operators](about_Operators.md)| diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md index 01d129ccc4bb..de68aea9a86c 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md @@ -77,7 +77,7 @@ order: |OPERATOR |REFERENCE| |--------------------------|---------| |`-band -bor -bxor` |[about_Arithmetic_Operators](about_Arithmetic_Operators.md)| -|`-and -or -xor` |[about_comparison_operators](about_comparison_operators.md)| +|`-and -or -xor` |[about_Logical_Operators](about_logical_operators.md)| |`.` (dot-source) |[about_Scopes](about_Scopes.md)| |`&` (call) |[about_Operators](about_Operators.md)| || (pipeline operator)|[about_Operators](about_Operators.md)| diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md index 01d129ccc4bb..de68aea9a86c 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md @@ -77,7 +77,7 @@ order: |OPERATOR |REFERENCE| |--------------------------|---------| |`-band -bor -bxor` |[about_Arithmetic_Operators](about_Arithmetic_Operators.md)| -|`-and -or -xor` |[about_comparison_operators](about_comparison_operators.md)| +|`-and -or -xor` |[about_Logical_Operators](about_logical_operators.md)| |`.` (dot-source) |[about_Scopes](about_Scopes.md)| |`&` (call) |[about_Operators](about_Operators.md)| || (pipeline operator)|[about_Operators](about_Operators.md)| diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md index 01d129ccc4bb..de68aea9a86c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md @@ -77,7 +77,7 @@ order: |OPERATOR |REFERENCE| |--------------------------|---------| |`-band -bor -bxor` |[about_Arithmetic_Operators](about_Arithmetic_Operators.md)| -|`-and -or -xor` |[about_comparison_operators](about_comparison_operators.md)| +|`-and -or -xor` |[about_Logical_Operators](about_logical_operators.md)| |`.` (dot-source) |[about_Scopes](about_Scopes.md)| |`&` (call) |[about_Operators](about_Operators.md)| || (pipeline operator)|[about_Operators](about_Operators.md)| diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md b/reference/6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md index 01d129ccc4bb..de68aea9a86c 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Operator_Precedence.md @@ -77,7 +77,7 @@ order: |OPERATOR |REFERENCE| |--------------------------|---------| |`-band -bor -bxor` |[about_Arithmetic_Operators](about_Arithmetic_Operators.md)| -|`-and -or -xor` |[about_comparison_operators](about_comparison_operators.md)| +|`-and -or -xor` |[about_Logical_Operators](about_logical_operators.md)| |`.` (dot-source) |[about_Scopes](about_Scopes.md)| |`&` (call) |[about_Operators](about_Operators.md)| || (pipeline operator)|[about_Operators](about_Operators.md)| From 272aa18e11c91a401c6a5041cefb1d6f473ee974 Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Wed, 3 Jan 2018 04:03:12 +1100 Subject: [PATCH 138/145] Update scriptResource.md (#1986) Match specified GetScript rule --- dsc/scriptResource.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsc/scriptResource.md b/dsc/scriptResource.md index 4640c8156e34..1adb5ff7a676 100644 --- a/dsc/scriptResource.md +++ b/dsc/scriptResource.md @@ -79,13 +79,13 @@ Configuration ScriptTest { GetScript = { $currentVersion = Get-Content (Join-Path -Path $env:SYSTEMDRIVE -ChildPath 'version.txt') - return @{ 'Version' = "$currentVersion" } + return @{ 'Result' = "$currentVersion" } } TestScript = { $state = $GetScript - if( $state['Version'] -eq $using:version ) + if( $state['Result'] -eq $using:version ) { - Write-Verbose -Message ('{0} -eq {1}' -f $state['Version'],$using:version) + Write-Verbose -Message ('{0} -eq {1}' -f $state['Result'],$using:version) return $true } Write-Verbose -Message ('Version up-to-date: {0}' -f $using:version) From c454e5dca161b64f22dfcf10a1bc2966894e0be0 Mon Sep 17 00:00:00 2001 From: Luc FULLENWARTH Date: Tue, 2 Jan 2018 19:07:20 +0100 Subject: [PATCH 139/145] Bad link (#1988) The link "http://go.microsoft.com/fwlink/?LinkId=119096" is supposed to point to a page or a document about "Code-Signing Best Practices". However, it points to a video about "Understanding Extension INFs and Component INFs". I watched the whole video and there is nothing inside about "Code-Signing Best Practices". The best match I have found is the following one: http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/best_practices.doc It would be a very good idea to make a web page from this document. Pieces of advice it contains are still accurate. --- reference/5.1/Microsoft.PowerShell.Core/About/about_Signing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Signing.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Signing.md index e5836ac5ec8e..72d6fcce99a7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Signing.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Signing.md @@ -103,7 +103,7 @@ from other sources. Before you sign any script, examine each command to verify that it is safe to run. For best practices about code signing, see "Code-Signing -Best Practices" at http://go.microsoft.com/fwlink/?LinkId=119096. +Best Practices" at http://download.microsoft.com/download/a/f/7/af7777e5-7dcd-4800-8a0a-b18336565f5b/best_practices.doc. For more information about how to sign a script file, see Set-AuthenticodeSignature. From cb095ea8cf6f6021e4d0a88b7f342e4b6ae25f00 Mon Sep 17 00:00:00 2001 From: David Jones Date: Tue, 2 Jan 2018 12:08:47 -0600 Subject: [PATCH 140/145] Update Example 1 of Protect-CmsMessage (#1987) The existing example did not specify you needed to create the INF. This not only says so but does so using a script block piped to out-file --- .../Microsoft.PowerShell.Security/Protect-CmsMessage.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 894045645d19..b34df921d9ca 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -50,7 +50,9 @@ For an example of a certificate that would work for document encryption, see Exa ### Example 1: Create a certificate for encrypting content ``` -PS C:\> [Version] +PS C:\> # Create .INF file for certreq + +PS C:\> {[Version] Signature = "$Windows NT$" [Strings] @@ -71,8 +73,9 @@ ValidityPeriodUnits = "1000" [Extensions] %szOID_ENHANCED_KEY_USAGE% = "{text}%szOID_DOCUMENT_ENCRYPTION%" +} | Out-File -FilePath DocumentEncryption.inf -After you have created your certificate file, run the following command to add the certificate file to the certificate store.Now you are ready to encrypt and decrypt content with the next two examples. +# After you have created your certificate file, run the following command to add the certificate file to the certificate store.Now you are ready to encrypt and decrypt content with the next two examples. PS C:\> Certreq -new DocumentEncryption.inf DocumentEncryption.cer ``` From 8d405c1a2425dac99e1d4eb3394a4b9b7e07a00b Mon Sep 17 00:00:00 2001 From: Brett Hinton Date: Tue, 2 Jan 2018 11:09:11 -0700 Subject: [PATCH 141/145] Small edits for mispellings (#1989) --- dsc/configData.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsc/configData.md b/dsc/configData.md index 6c9bbf104959..62bcd1520241 100644 --- a/dsc/configData.md +++ b/dsc/configData.md @@ -159,7 +159,7 @@ For example, you could create a file named `MyData.psd1` with the following cont ## Compiling a configuration with configuration data -To compile a configuration for which you have defined configuration data, you pass the cofiguration data as the value of the **ConfigurationData** parameter. +To compile a configuration for which you have defined configuration data, you pass the configuration data as the value of the **ConfigurationData** parameter. This will create a MOF file for each entry in the **AllNodes** array. Each MOF file will be named with the `NodeName` property of the corresponding array entry. @@ -196,8 +196,8 @@ DSC provides three special variables that can be used in a configuration script: ## Using non-node data As we've seen in previous examples, the **ConfigurationData** hashtable can have one or more keys in addition to the required **AllNodes** key. -In the examples in this topic, we have used only a single addiontal node, and named it `NonNodeData`. -However, you can define any number of addiontal keys, and name them anything you want. +In the examples in this topic, we have used only a single additional node, and named it `NonNodeData`. +However, you can define any number of additional keys, and name them anything you want. For an example of using non-node data, see [Separating configuration and environment data](separatingEnvData.md). From e777b8392c7debb21818ed7a1dd7f1b29314b36d Mon Sep 17 00:00:00 2001 From: SwarfegaGit Date: Tue, 2 Jan 2018 18:09:24 +0000 Subject: [PATCH 142/145] Corrected command (#1990) The CanPauseAndContinue property is a boolean so the correct comparison to use is $true rather than "True". --- .../5.1/Microsoft.PowerShell.Management/Suspend-Service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md index 021f265adbe5..56de319378ef 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Suspend-Service.md @@ -226,7 +226,7 @@ Otherwise, this cmdlet does not generate any output. ## NOTES * **Suspend-Service** can control services only when the current user has permission to do this. If a command does not work correctly, you might not have the required permissions. -* **Suspend-Service** can suspend only services that support being suspended and resumed. To determine whether a particular service can be suspended, use the Get-Service cmdlet together with the **CanPauseAndContinue** property. For example, `Get-Service wmi | Format-List Name, CanPauseAndContinue`. To find all services on the computer that can be suspended, type `Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"}`. +* **Suspend-Service** can suspend only services that support being suspended and resumed. To determine whether a particular service can be suspended, use the Get-Service cmdlet together with the **CanPauseAndContinue** property. For example, `Get-Service wmi | Format-List Name, CanPauseAndContinue`. To find all services on the computer that can be suspended, type `Get-Service | Where-Object {$_.CanPauseAndContinue -eq $true}`. * To find the service names and display names of the services on your system, type **Get-Service**. The service names appear in the **Name** column, and the display names appear in the **DisplayName** column. ## RELATED LINKS From d0b6eb88886ed0ae51a2f8aee8eb11d145f8d93d Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Tue, 2 Jan 2018 14:32:28 -0800 Subject: [PATCH 143/145] removing module ref for modules that do not ship in v6-rc2 (#1996) --- .../Add-LocalGroupMember.md | 179 --------- .../Disable-LocalUser.md | 170 --------- .../Enable-LocalUser.md | 170 --------- .../Get-LocalGroup.md | 110 ------ .../Get-LocalGroupMember.md | 147 -------- .../Get-LocalUser.md | 134 ------- .../Microsoft.PowerShell.LocalAccounts.md | 75 ---- .../New-LocalGroup.md | 131 ------- .../New-LocalUser.md | 315 ---------------- .../Remove-LocalGroup.md | 181 --------- .../Remove-LocalGroupMember.md | 176 --------- .../Remove-LocalUser.md | 160 -------- .../Rename-LocalGroup.md | 171 --------- .../Rename-LocalUser.md | 175 --------- .../Set-LocalGroup.md | 172 --------- .../Set-LocalUser.md | 297 --------------- reference/6/Pester/AfterAll.md | 46 --- reference/6/Pester/AfterEach.md | 49 --- reference/6/Pester/Assert-MockCalled.md | 272 -------------- reference/6/Pester/Assert-VerifiableMocks.md | 66 ---- reference/6/Pester/BeforeAll.md | 46 --- reference/6/Pester/BeforeEach.md | 49 --- reference/6/Pester/Context.md | 110 ------ reference/6/Pester/Describe.md | 134 ------- .../6/Pester/Get-MockDynamicParameters.md | 124 ------ reference/6/Pester/Get-TestDriveItem.md | 61 --- reference/6/Pester/In.md | 75 ---- reference/6/Pester/InModuleScope.md | 109 ------ reference/6/Pester/Invoke-Mock.md | 164 -------- reference/6/Pester/Invoke-Pester.md | 353 ------------------ reference/6/Pester/It.md | 209 ----------- reference/6/Pester/Mock.md | 287 -------------- reference/6/Pester/New-Fixture.md | 115 ------ reference/6/Pester/Pester.md | 75 ---- .../6/Pester/Set-DynamicParameterVariables.md | 88 ----- reference/6/Pester/Setup.md | 121 ------ reference/6/Pester/Should.md | 46 --- 37 files changed, 5362 deletions(-) delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md delete mode 100644 reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md delete mode 100644 reference/6/Pester/AfterAll.md delete mode 100644 reference/6/Pester/AfterEach.md delete mode 100644 reference/6/Pester/Assert-MockCalled.md delete mode 100644 reference/6/Pester/Assert-VerifiableMocks.md delete mode 100644 reference/6/Pester/BeforeAll.md delete mode 100644 reference/6/Pester/BeforeEach.md delete mode 100644 reference/6/Pester/Context.md delete mode 100644 reference/6/Pester/Describe.md delete mode 100644 reference/6/Pester/Get-MockDynamicParameters.md delete mode 100644 reference/6/Pester/Get-TestDriveItem.md delete mode 100644 reference/6/Pester/In.md delete mode 100644 reference/6/Pester/InModuleScope.md delete mode 100644 reference/6/Pester/Invoke-Mock.md delete mode 100644 reference/6/Pester/Invoke-Pester.md delete mode 100644 reference/6/Pester/It.md delete mode 100644 reference/6/Pester/Mock.md delete mode 100644 reference/6/Pester/New-Fixture.md delete mode 100644 reference/6/Pester/Pester.md delete mode 100644 reference/6/Pester/Set-DynamicParameterVariables.md delete mode 100644 reference/6/Pester/Setup.md delete mode 100644 reference/6/Pester/Should.md diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md deleted file mode 100644 index 5a12c590c3fa..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822507 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Add-LocalGroupMember ---- - -# Add-LocalGroupMember - -## SYNOPSIS -Adds members to a local group. - -## SYNTAX - -### Group -``` -Add-LocalGroupMember [-Group] [-Member] [-WhatIf] [-Confirm] - [] -``` - -### Default -``` -Add-LocalGroupMember [-Member] [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Add-LocalGroupMember [-Member] [-SID] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -The **Add-LocalGroupMember** cmdlet adds users or groups to a local security group. -All the rights and permissions that are assigned to a group are assigned to all members of that group. - -Members of the Administrators group on a local computer have Full Control permissions on that computer. -Limit the number of users in the Administrators group. - -If the computer is joined to a domain, you can add user accounts, computer accounts, and group accounts from that domain and from trusted domains to a local group. - -## EXAMPLES - -### Example 1: Add members to the Administrators group -``` -PS C:\> Add-LocalGroupMember -Group "Administrators" -Member "Admin02", "MicrosoftAccount\username@Outlook.com", "AzureAD\DavidChew@contoso.com", "CONTOSO\Domain Admins" -``` - -This command adds several members to the local Administrators group. -The new members include a local user account, a Microsoft account, an Azure Active Directory account, and a domain group. -This example uses a placeholder value for the user name of an account at Outlook.com. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Group -Specifies the security group to which this cmdlet adds members. - -```yaml -Type: LocalGroup -Parameter Sets: Group -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Member -Specifies an array of users or groups that this cmdlet adds to a security group. -You can specify users or groups by name, security ID (SID), or **LocalPrincipal** objects. - -```yaml -Type: LocalPrincipal[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group to which this cmdlet adds members. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID of the security group to which this cmdlet adds members. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local principal, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroupMember](Get-LocalGroupMember.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroupMember](Remove-LocalGroupMember.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md deleted file mode 100644 index 8199883c16c3..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md +++ /dev/null @@ -1,170 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822508 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Disable-LocalUser ---- - -# Disable-LocalUser - -## SYNOPSIS -Disables a local user account. - -## SYNTAX - -### InputObject -``` -Disable-LocalUser [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Disable-LocalUser [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Disable-LocalUser [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Disable-LocalUser** cmdlet disables local user accounts. -When a user account is disabled, the user cannot log on. -When a user account is enabled, the user can log on. - -## EXAMPLES - -### Example 1: Disable an account by specifying a name -``` -PS C:\> Disable-LocalUser -Name "Admin02" -``` - -This command disables the user account named Admin02. - -### Example 2: Disable an account by using the pipeline -``` -PS C:\> Get-LocalUser Guest | Disable-LocalUser -``` - -This command gets the built-in Guest account by using **Get-LocalUser**, and then passes it to the current cmdlet by using the pipeline operator. -That cmdlet disables that account. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of user accounts that this cmdlet disables. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the user accounts that this cmdlet disables. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of user accounts that this cmdlet disables. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md deleted file mode 100644 index 513afc222907..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md +++ /dev/null @@ -1,170 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822510 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Enable-LocalUser ---- - -# Enable-LocalUser - -## SYNOPSIS -Enables a local user account. - -## SYNTAX - -### InputObject -``` -Enable-LocalUser [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Enable-LocalUser [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Enable-LocalUser [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Enable-LocalUser** cmdlet enables local user accounts. -When a user account is disabled, the user cannot log on. -When a user account is enabled, the user can log on. - -## EXAMPLES - -### Example 1: Enable an account by specifying a name -``` -PS C:\> Enable-LocalUser -Name "Admin02" -``` - -This command enables the user account named Admin02. - -### Example 2: Enable an account by using the pipeline -``` -PS C:\> Get-LocalUser -Name "Administrator" | Enable-LocalUser -``` - -This command gets the built-in Administrator account by using **Get-LocalUser**, and then passes it to the current cmdlet by using the pipeline operator. -That cmdlet enables that account. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of user accounts that this cmdlet enables. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the user accounts that this cmdlet enables. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of user accounts that this cmdlet enables. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md deleted file mode 100644 index 4f33f8d9a6fb..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822511 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Get-LocalGroup ---- - -# Get-LocalGroup - -## SYNOPSIS -Gets the local security groups. - -## SYNTAX - -### Default (Default) -``` -Get-LocalGroup [[-Name] ] [] -``` - -### SecurityIdentifier -``` -Get-LocalGroup [[-SID] ] [] -``` - -## DESCRIPTION -The **Get-LocalGroup** cmdlet gets local security groups in Security Account Manager. -This cmdlet gets default built-in groups and local security groups that you create. - -## EXAMPLES - -### Example 1: Get the Administrators group -``` -PS C:\> Get-LocalGroup -Name "Administrators" -Name Description ----- ----------- -Administrators Administrators have complete and unrestricted access to the computer/domain -``` - -This command gets the local Administrators group. -The command displays properties of the group in the console. - -## PARAMETERS - -### -Name -Specifies an array of names of security groups that this cmdlet gets. -You can use the wildcard character. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of security groups that this cmdlet gets. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String, System.Security.Principal.SecurityIdentifier -You can pipe a string or a SID to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup -This cmdlet returns a local group. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md deleted file mode 100644 index 05f3ead03de3..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822512 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Get-LocalGroupMember ---- - -# Get-LocalGroupMember - -## SYNOPSIS -Gets members from a local group. - -## SYNTAX - -### Default (Default) -``` -Get-LocalGroupMember [[-Member] ] [-Name] [] -``` - -### Group -``` -Get-LocalGroupMember [-Group] [[-Member] ] [] -``` - -### SecurityIdentifier -``` -Get-LocalGroupMember [[-Member] ] [-SID] [] -``` - -## DESCRIPTION -The **Get-LocalGroupMember** cmdlet gets members from a local group. - -## EXAMPLES - -### Example 1: Get all members of the Administrators group -``` -PS C:\> Get-LocalGroupMember -Group "Administrators" -ObjectClass Name PrincipalSource ------------ ---- --------------- -User CONTOSOPC\Administrator Local -User CONTOSOPC\LocalAdmin Local -``` - -This command gets all the members of the local Administrators group. - -## PARAMETERS - -### -Group -Specifies the security group from which this cmdlet gets members. - -```yaml -Type: LocalGroup -Parameter Sets: Group -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Member -Specifies a user or group that this cmdlet gets from a security group. -You can specify users or groups by name or security ID (SID). -Specify SID strings in S-R-I-S-S . -. . -format. -You can use wildcard characters. -If you do not specify this parameter, the cmdlet gets all members of the group. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group from which this cmdlet gets members. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID of the security group from which this cmdlet gets members. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### Microsoft.SecurityAccountsManager.LocalPrincipal -This cmdlet returns local principals. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Add-LocalGroupMember](Add-LocalGroupMember.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroupMember](Remove-LocalGroupMember.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md deleted file mode 100644 index a07c2f4dc537..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822514 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Get-LocalUser ---- - -# Get-LocalUser - -## SYNOPSIS -Gets local user accounts. - -## SYNTAX - -### Default (Default) -``` -Get-LocalUser [[-Name] ] [] -``` - -### SecurityIdentifier -``` -Get-LocalUser [[-SID] ] [] -``` - -## DESCRIPTION -The **Get-LocalUser** cmdlet gets local user accounts. -This cmdlet gets default built-in user accounts, local user accounts that you created, and local accounts that you connected to Microsoft accounts. - -## EXAMPLES - -### Example 1: Get an account by using its name -``` -PS C:\> Get-LocalUser -Name "AdminContoso02" -Name Enabled Description ----- ------- ----------- -AdminContoso02 True Description of this account. -``` - -This command gets a user account named AdminContoso02. - -### Example 2: Get an account that is connected to a Microsoft account -``` -PS C:\> Get-LocalUser -Name "MicrosoftAccount\username@Outlook.com" -Name Enabled Description ----- ------- ----------- -MicrosoftAccount\user name@outlook.com True Description of this account. -``` - -This command gets a user account that is connected to a Microsoft account. -This example uses a placeholder value for the user name of an account at Outlook.com. - -### Example 3: Get an account that is connected to a Microsoft account -``` -PS C:\> Get-LocalUser -SecurityIdentifier "S-1-5-2" -Name Enabled Description ----- ------- ----------- -MicrosoftAccount\user name@contoso.com True Description of this account. -``` - -This command gets a local user account that has the specified SID. - -## PARAMETERS - -### -Name -Specifies an array of names of user accounts that this cmdlet gets. -You can use the wildcard character. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of user accounts that this cmdlet gets. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String, System.Security.Principal.SecurityIdentifier -You can pipe a string or SID to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser[] -This cmdlet returns local user accounts. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md deleted file mode 100644 index 69f69afe3e2f..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-US -keywords: powershell,cmdlet -Help Version: 6.0 -Download Help Link: http://Please-enter-FwLink-manually -Module Guid: 8e362604-2c0b-448f-a414-a6a690a644e2 -title: Microsoft.PowerShell.LocalAccounts -Module Name: Microsoft.PowerShell.LocalAccounts ---- - -# Microsoft.PowerShell.LocalAccounts Module -## Description -This section contains the help topics for the Local Accounts cmdlets in Windows PowerShell. - -## Microsoft.PowerShell.LocalAccounts Cmdlets -### [Add-LocalGroupMember](Add-LocalGroupMember.md) -Adds members to a local group. - - -### [Disable-LocalUser](Disable-LocalUser.md) -Disables a local user account. - - -### [Enable-LocalUser](Enable-LocalUser.md) -Enables a local user account. - - -### [Get-LocalGroup](Get-LocalGroup.md) -Gets the local security groups. - - -### [Get-LocalGroupMember](Get-LocalGroupMember.md) -Gets members from a local group. - - -### [Get-LocalUser](Get-LocalUser.md) -Gets local user accounts. - - -### [New-LocalGroup](New-LocalGroup.md) -Creates a local security group. - - -### [New-LocalUser](New-LocalUser.md) -Creates a local user account. - - -### [Remove-LocalGroup](Remove-LocalGroup.md) -Deletes local security groups. - - -### [Remove-LocalGroupMember](Remove-LocalGroupMember.md) -Removes members from a local group. - - -### [Remove-LocalUser](Remove-LocalUser.md) -Deletes local user accounts. - - -### [Rename-LocalGroup](Rename-LocalGroup.md) -Renames a local security group. - - -### [Rename-LocalUser](Rename-LocalUser.md) -Renames a local user account. - - -### [Set-LocalGroup](Set-LocalGroup.md) -Changes a local security group. - - -### [Set-LocalUser](Set-LocalUser.md) -Modifies a local user account. diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md deleted file mode 100644 index a43f56baa414..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822515 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: New-LocalGroup ---- - -# New-LocalGroup - -## SYNOPSIS -Creates a local security group. - -## SYNTAX - -``` -New-LocalGroup [-Description ] [-Name] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **New-LocalGroup** cmdlet creates a local security group in the Security Account Manager. - -## EXAMPLES - -### Example 1: Create a security group -``` -PS C:\> New-LocalGroup -Name "SecurityGroup04" -``` - -This command creates a group named SecurityGroup04. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the group. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name -Specifies a name for the group. -The maximum length is 256 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String -You can pipe a string to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup -This cmdlet returns a security group. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md deleted file mode 100644 index d3a89f15fea1..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md +++ /dev/null @@ -1,315 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822516 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: New-LocalUser ---- - -# New-LocalUser - -## SYNOPSIS -Creates a local user account. - -## SYNTAX - -### Password (Default) -``` -New-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-Disabled] - [-FullName ] [-Name] -Password [-PasswordNeverExpires] - [-UserMayNotChangePassword] [-WhatIf] [-Confirm] [] -``` - -### NoPassword -``` -New-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-Disabled] - [-FullName ] [-Name] [-NoPassword] [-UserMayNotChangePassword] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -The **New-LocalUser** cmdlet creates a local user account. -This cmdlet creates a local user account or a local user account that is connected to a Microsoft account. - -## EXAMPLES - -### Example 1: Create a user account -``` -PS C:\> New-LocalUser -Name "User02" -Description "Description of this account." -NoPassword -Name Enabled Description ----- ------- ----------- -User02 True Description of this account. -``` - -This command creates a local user account. -The command does not specify the *AccountExpires* parameter. -Therefore, the account does not expire. - -### Example 2: Create a user account that has a password -``` -PS C:\> $Password = Read-Host -AsSecureString -PS C:\> New-LocalUser "User03" -Password $Password -FullName "Third User" -Description "Description of this account." -Name Enabled Description ----- ------- ----------- -User03 True Description of this account. -``` - -The first command prompts you for a password by using the Read-Host cmdlet. -The command stores the password as a secure string in the $Password variable. - -The second command creates a local user account by using the password stored in $Password. -The command specifies a user name, full name, and description for the user account. - -### Example 3: Create a user account that is connected to a Microsoft account -``` -PS C:\> New-LocalUser -Name "MicrosoftAccount\usr name@Outlook.com" -Description "Description of this account." -``` - -This command creates a local user account that is connected to a Microsoft account. -This example uses a placeholder value for the user name of an account at Outlook.com. -Because the account is connected to a Microsoft account, do not specify a password. - -## PARAMETERS - -### -AccountExpires -Specifies when the user account expires. -To obtain a **DateTime** object, use the Get-Date cmdlet. -If you do not specify this parameter, the account does not expire. - -```yaml -Type: DateTime -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -AccountNeverExpires -Indicates that the account does not expire. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the user account. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Disabled -Indicates that this cmdlet creates the user account as disabled. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -FullName -Specifies the full name for the user account. -The full name differs from the user name of the user account. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name -Specifies the user name for the user account. - -If you create a local user account that is connected to a Microsoft account, specify the user name in the following format: `MicrosoftAccount\\`\@`Outlook.com` for a user of a Microsoft account on Outlook.com. - -If you create a local user account for the local system, the user name can contain up to 20 uppercase characters or lowercase characters. -A user name cannot contain the following characters: - -" / \ \[ \] : ; | = , + * ? -\< \> @ - -A user name cannot consist only of periods (.) or spaces. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -NoPassword -Indicates that the user account does not have a password. - -```yaml -Type: SwitchParameter -Parameter Sets: NoPassword -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Password -Specifies a password for the user account. -You can use `Read-Host -GetCredential`, Get-Credential, or ConvertTo-SecureString to create a **SecureString** object for the password. - -If you omit the *Password* and *NoPassword* parameters, **New-LocalUser** prompts you for the new user's password. - -```yaml -Type: SecureString -Parameter Sets: Password -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -PasswordNeverExpires -Indicates whether the password expires. - -```yaml -Type: SwitchParameter -Parameter Sets: Password -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -UserMayNotChangePassword -Indicates that the user cannot change the password on the user account. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String, System.DateTime, System.Boolean, System.Security.SecureString -You can pipe a string, a **DateTime** object, a **Boolean** value, or a secure string to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser -This cmdlet returns a **LocalUser** object. -This object provides information about the user account. - -## NOTES -* A user name cannot be identical to any other user name or group name on the computer. A user name cannot consist only of periods (.) or spaces. A user name can contain up to 20 uppercase characters or lowercase characters. A user name cannot contain the following characters: - -" / \ \[ \] : ; | = , + * ? \< \> @ -* A password can contain up to 127 characters. -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md deleted file mode 100644 index afd958333f2e..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822517 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Remove-LocalGroup ---- - -# Remove-LocalGroup - -## SYNOPSIS -Deletes local security groups. - -## SYNTAX - -### InputObject -``` -Remove-LocalGroup [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Remove-LocalGroup [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Remove-LocalGroup [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Remove-LocalGroup** cmdlet deletes local security groups. -This cmdlet deletes only a local group. -It does not delete the user accounts, computer accounts, or group accounts that belong to that group. -You cannot recover a deleted group. - -If you delete a group and then create another group that has the same group name, you must set new permissions for the new group. -The new group does not inherit the permissions that were assigned to the group. - -## EXAMPLES - -### Example 1: Delete a security group -``` -PS C:\> Remove-LocalGroup -Name "SecurityGroup04" -``` - -This command deletes the group named SecurityGroup04. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of security groups that this cmdlet deletes. -To obtain groups, use the Get-LocalGroup cmdlet. - -```yaml -Type: LocalGroup[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the security groups that this cmdlet deletes. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of security groups that this cmdlet deletes. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a security group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* This cmdlet cannot delete the following default groups: - -- Administrators -- Backup Operators -- Cryptographic Operators -- Distributed COM Users -- Event Log Readers -- Guests -- Hyper-V Administrators -- IIS_IUSRS -- Network Configuration Operators -- Performance Log Users -- Performance Monitor Users -- Power Users -- Remote Desktop Users -- Remote Management Users -- Replicator -- Users -- WinRMRemoteWMIUsers__ -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md deleted file mode 100644 index b14a7ae141db..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822518 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Remove-LocalGroupMember ---- - -# Remove-LocalGroupMember - -## SYNOPSIS -Removes members from a local group. - -## SYNTAX - -### Group -``` -Remove-LocalGroupMember [-Group] [-Member] [-WhatIf] [-Confirm] - [] -``` - -### Default -``` -Remove-LocalGroupMember [-Member] [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Remove-LocalGroupMember [-Member] [-SID] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -The **Remove-LocalGroupMember** cmdlet removes users or groups from a local group. - -## EXAMPLES - -### Example 1: Remove members from the Administrators group -``` -PS C:\> Remove-LocalGroupMember -Group "Administrators" -Member "Admin02", "MicrosoftAccount\username@Outlook.com", "AzureAD\DavidChew@contoso.com", "CONTOSO\Domain Admins" -``` - -This command removes several members from the local Administrators group. -The members that this cmdlet removes include a local user account, a Microsoft account, an Azure Active Directory account, and a domain group. -This example uses a placeholder value for the user name of an account at Outlook.com. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Group -Specifies the security group from which this cmdlet removes members. - -```yaml -Type: LocalGroup -Parameter Sets: Group -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Member -Specifies an array of users or groups that this cmdlet removes from a security group. -You can specify users or groups by name, security ID (SID), or **LocalPrincipal** objects. -Specify SID strings in S-R-I-S-S . -. . -format. - -```yaml -Type: LocalPrincipal[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group from which this cmdlet removes members. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID of the security group from which this cmdlet removes members. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalPrincipal, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local principal, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Add-LocalGroupMember](Add-LocalGroupMember.md) - -[Get-LocalGroupMember](Get-LocalGroupMember.md) - -[New-LocalGroup](New-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md deleted file mode 100644 index 7ef7bbc5fccb..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822519 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Remove-LocalUser ---- - -# Remove-LocalUser - -## SYNOPSIS -Deletes local user accounts. - -## SYNTAX - -### InputObject -``` -Remove-LocalUser [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Remove-LocalUser [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Remove-LocalUser [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Remove-LocalUser** cmdlet deletes local user accounts. - -## EXAMPLES - -### Example 1: Delete a user account -``` -PS C:\> Remove-LocalUser -Name "AdminContoso02" -``` - -This command deletes the user account named AdminContoso02. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of user accounts that this cmdlet deletes. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the user accounts that this cmdlet deletes. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of user accounts that this cmdlet deletes. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md deleted file mode 100644 index 0d88c9795788..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822520 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Rename-LocalGroup ---- - -# Rename-LocalGroup - -## SYNOPSIS -Renames a local security group. - -## SYNTAX - -### InputObject -``` -Rename-LocalGroup [-InputObject] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Rename-LocalGroup [-Name] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Rename-LocalGroup [-NewName] [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Rename-LocalGroup** cmdlet renames a local security group. - -## EXAMPLES - -### Example 1: Change the name of a group -``` -PS C:\> Rename-LocalGroup -Name "SecurityGroup" -NewName "SecurityGroup04" -``` - -This command renames a security group named SecurityGroup. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the security group that this cmdlet renames. -To obtain a security group, use the Get-LocalGroup cmdlet. - -```yaml -Type: LocalGroup -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group that this cmdlet renames. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -NewName -Specifies a new name for the security group. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of a security group that this cmdlet renames. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a security group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md deleted file mode 100644 index fced244875f7..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md +++ /dev/null @@ -1,175 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822521 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Rename-LocalUser ---- - -# Rename-LocalUser - -## SYNOPSIS -Renames a local user account. - -## SYNTAX - -### InputObject -``` -Rename-LocalUser [-InputObject] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Rename-LocalUser [-Name] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Rename-LocalUser [-NewName] [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Rename-LocalUser** cmdlet renames a local user account. - -## EXAMPLES - -### Example 1: Rename a user account -``` -PS C:\> Rename-LocalUser -Name "Admin02" -NewName "AdminContoso02" -``` - -This command renames the user account named Admin02. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the user account that this cmdlet renames. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the user account that this cmdlet renames. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -NewName -Specifies a new name for the user account. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of a user accounts that this cmdlet renames. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md deleted file mode 100644 index 238d5bd6a331..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822522 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Set-LocalGroup ---- - -# Set-LocalGroup - -## SYNOPSIS -Changes a local security group. - -## SYNTAX - -### InputObject -``` -Set-LocalGroup -Description [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Set-LocalGroup -Description [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Set-LocalGroup -Description [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Set-LocalGroup** cmdlet changes a local security group. - -## EXAMPLES - -### Example 1: Change a group description -``` -PS C:\> Set-LocalGroup -Name "SecurityGroup04" -Description "This is a sample description." -``` - -This command changes the description of a local group. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the group. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the security group that this cmdlet changes. -To obtain a security group, use the Get-LocalGroup cmdlet. - -```yaml -Type: LocalGroup -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group that this cmdlet changes. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of the security group that this cmdlet changes. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a security group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md deleted file mode 100644 index f04f6453896c..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md +++ /dev/null @@ -1,297 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822523 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Set-LocalUser ---- - -# Set-LocalUser - -## SYNOPSIS -Modifies a local user account. - -## SYNTAX - -### Name (Default) -``` -Set-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-FullName ] - [-Name] [-Password ] [-PasswordNeverExpires ] - [-UserMayChangePassword ] [-WhatIf] [-Confirm] [] -``` - -### InputObject -``` -Set-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-FullName ] - [-InputObject] [-Password ] [-PasswordNeverExpires ] - [-UserMayChangePassword ] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Set-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-FullName ] - [-Password ] [-PasswordNeverExpires ] [-SID] - [-UserMayChangePassword ] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Set-LocalUser** cmdlet modifies a local user account. -This cmdlet can reset the password of a local user account. - -## EXAMPLES - -### Example 1: Change a description of a user account -``` -PS C:\> Set-LocalUser -Name "Admin07" -Description "Description of this account." -``` - -This command changes the description of a user account named Admin07. - -### Example 2: Change the password on an account -``` -PS C:\> $Password = Read-Host -AsSecureString -PS C:\> $UserAccount = Get-LocalUser -Name "User02" -PS C:\> $UserAccount | Set-LocalUser -Password $Password -``` - -The first command prompts you for a password by using the Read-Host cmdlet. -The command stores the password as a secure string in the $Password variable. - -The second command gets a user account named User02 by using **Get-LocalUser**. -The command stores the account in the $UserAccount variable. - -The third command sets the new password on the user account stored in $UserAccount. - -## PARAMETERS - -### -AccountExpires -Specifies when the user account expires. -To obtain a **DateTime** object, use the Get-Date cmdlet. - -If you do not want the account to expire, specify the *AccountNeverExpires* parameter. - -```yaml -Type: DateTime -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -AccountNeverExpires -Indicates that the account does not expire. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the user account. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FullName -Specifies the full name for the user account. -The full name differs from the user name of the user account. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the user account that this cmdlet changes. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the user account that this cmdlet changes. - -```yaml -Type: String -Parameter Sets: Name -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Password -Specifies a password for the user account. -If the user account is connected to a Microsoft account, do not set a password. - -You can use `Read-Host -GetCredential`, Get-Credential, or ConvertTo-SecureString to create a **SecureString** object for the password. - -If you omit the *Password* and *NoPassword* parameters, **Set-LocalUser** prompts you for the user's password. - -```yaml -Type: SecureString -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PasswordNeverExpires -Indicates whether the password expires. - -```yaml -Type: Boolean -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of the user account that this cmdlet changes. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -UserMayChangePassword -Indicates that the user can change the password on the user account. - -```yaml -Type: Boolean -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - diff --git a/reference/6/Pester/AfterAll.md b/reference/6/Pester/AfterAll.md deleted file mode 100644 index 01b5b6e83bac..000000000000 --- a/reference/6/Pester/AfterAll.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# AfterAll - -## SYNOPSIS -Defines a series of steps to perform at the end of every It block within -the current Context or Describe block. - -## SYNTAX - -``` -AfterAll -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/AfterEach.md b/reference/6/Pester/AfterEach.md deleted file mode 100644 index 8ba9f6673413..000000000000 --- a/reference/6/Pester/AfterEach.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# AfterEach - -## SYNOPSIS -Defines a series of steps to perform at the end of every It block within -the current Context or Describe block. - -## SYNTAX - -``` -AfterEach -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. -For a full description of this -behavior, as well as how multiple BeforeEach or AfterEach blocks interact -with each other, please refer to the about_BeforeEach_AfterEach help file. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/Assert-MockCalled.md b/reference/6/Pester/Assert-MockCalled.md deleted file mode 100644 index f59cd0ef26dc..000000000000 --- a/reference/6/Pester/Assert-MockCalled.md +++ /dev/null @@ -1,272 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Assert-MockCalled - -## SYNOPSIS -Checks if a Mocked command has been called a certain number of times -and throws an exception if it has not. - -## SYNTAX - -### ParameterFilter (Default) -``` -Assert-MockCalled [-CommandName] [[-Times] ] [[-ParameterFilter] ] - [[-ModuleName] ] [[-Scope] ] [-Exactly] -``` - -### ExclusiveFilter -``` -Assert-MockCalled [-CommandName] [[-Times] ] -ExclusiveFilter - [[-ModuleName] ] [[-Scope] ] [-Exactly] -``` - -## DESCRIPTION -This command verifies that a mocked command has been called a certain number -of times. -If the call history of the mocked command does not match the parameters -passed to Assert-MockCalled, Assert-MockCalled will throw an exception. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Mock Set-Content {} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content - -This will throw an exception and cause the test to fail if Set-Content is not called in Some Code. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Mock Set-Content -parameterFilter {$path.StartsWith("$env:temp\")} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content 2 { $path -eq "$env:temp\test.txt" } - -This will throw an exception if some code calls Set-Content on $path=$env:temp\test.txt less than 2 times - -### -------------------------- EXAMPLE 3 -------------------------- -``` -Mock Set-Content {} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content 0 - -This will throw an exception if some code calls Set-Content at all - -### -------------------------- EXAMPLE 4 -------------------------- -``` -Mock Set-Content {} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content -Exactly 2 - -This will throw an exception if some code does not call Set-Content Exactly two times. - -### -------------------------- EXAMPLE 5 -------------------------- -``` -Describe 'Assert-MockCalled Scope behavior' { -``` - -Mock Set-Content { } - - It 'Calls Set-Content at least once in the It block' { - {... -Some Code ...} - - Assert-MockCalled Set-Content -Exactly 0 -Scope It - } -} - -Checks for calls only within the current It block. - -### -------------------------- EXAMPLE 6 -------------------------- -``` -Describe 'Describe' { -``` - -Mock -ModuleName SomeModule Set-Content { } - - {... -Some Code ...} - - It 'Calls Set-Content at least once in the Describe block' { - Assert-MockCalled -ModuleName SomeModule Set-Content - } -} - -Checks for calls to the mock within the SomeModule module. -Note that both the Mock -and Assert-MockCalled commands use the same module name. - -### -------------------------- EXAMPLE 7 -------------------------- -``` -Assert-MockCalled Get-ChildItem -ExclusiveFilter { $Path -eq 'C:\' } -``` - -Checks to make sure that Get-ChildItem was called at least one time with -the -Path parameter set to 'C:\', and that it was not called at all with -the -Path parameter set to any other value. - -## PARAMETERS - -### -CommandName -The mocked command whose call history should be checked. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Times -The number of times that the mock must be called to avoid an exception -from throwing. - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: 1 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ParameterFilter -An optional filter to qualify wich calls should be counted. -Only those -calls to the mock whose parameters cause this filter to return true -will be counted. - -```yaml -Type: ScriptBlock -Parameter Sets: ParameterFilter -Aliases: - -Required: False -Position: 3 -Default value: {$True} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ExclusiveFilter -{{Fill ExclusiveFilter Description}} - -```yaml -Type: ScriptBlock -Parameter Sets: ExclusiveFilter -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -The module where the mock being checked was injected. -This is optional, -and must match the ModuleName that was used when setting up the Mock. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Scope -An optional parameter specifying the Pester scope in which to check for -calls to the mocked command. -By default, Assert-MockCalled will find -all calls to the mocked command in the current Context block (if present), -or the current Describe block (if there is no active Context.) Valid -values are Describe, Context and It. -If you use a scope of Describe or -Context, the command will identify all calls to the mocked command in the -current Describe / Context block, as well as all child scopes of that block. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Exactly -If this switch is present, the number specified in Times must match -exactly the number of times the mock has been called. -Otherwise it -must match "at least" the number of times specified. -If the value -passed to the Times parameter is zero, the Exactly switch is implied. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES -The parameter filter passed to Assert-MockCalled does not necessarily have to match the parameter filter -(if any) which was used to create the Mock. -Assert-MockCalled will find any entry in the command history -which matches its parameter filter, regardless of how the Mock was created. -However, if any calls to the -mocked command are made which did not match any mock's parameter filter (resulting in the original command -being executed instead of a mock), these calls to the original command are not tracked in the call history. -In other words, Assert-MockCalled can only be used to check for calls to the mocked implementation, not -to the original. - -## RELATED LINKS - diff --git a/reference/6/Pester/Assert-VerifiableMocks.md b/reference/6/Pester/Assert-VerifiableMocks.md deleted file mode 100644 index a3de168d7cda..000000000000 --- a/reference/6/Pester/Assert-VerifiableMocks.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Assert-VerifiableMocks - -## SYNOPSIS -Checks if any Verifiable Mock has not been invoked. -If so, this will throw an exception. - -## SYNTAX - -``` -Assert-VerifiableMocks -``` - -## DESCRIPTION -This can be used in tandem with the -Verifiable switch of the Mock -function. -Mock can be used to mock the behavior of an existing command -and optionally take a -Verifiable switch. -When Assert-VerifiableMocks -is called, it checks to see if any Mock marked Verifiable has not been -invoked. -If any mocks have been found that specified -Verifiable and -have not been invoked, an exception will be thrown. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Mock Set-Content {} -Verifiable -ParameterFilter {$Path -eq "some_path" -and $Value -eq "Expected Value"} -``` - -{ ...some code that never calls Set-Content some_path -Value "Expected Value"... -} - -Assert-VerifiableMocks - -This will throw an exception and cause the test to fail. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Mock Set-Content {} -Verifiable -ParameterFilter {$Path -eq "some_path" -and $Value -eq "Expected Value"} -``` - -Set-Content some_path -Value "Expected Value" - -Assert-VerifiableMocks - -This will not throw an exception because the mock was invoked. - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/BeforeAll.md b/reference/6/Pester/BeforeAll.md deleted file mode 100644 index da60bd35ef36..000000000000 --- a/reference/6/Pester/BeforeAll.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# BeforeAll - -## SYNOPSIS -Defines a series of steps to perform at the beginning of the current Context -or Describe block. - -## SYNTAX - -``` -BeforeAll -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/BeforeEach.md b/reference/6/Pester/BeforeEach.md deleted file mode 100644 index aba5f9c4e3a7..000000000000 --- a/reference/6/Pester/BeforeEach.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# BeforeEach - -## SYNOPSIS -Defines a series of steps to perform at the beginning of every It block within -the current Context or Describe block. - -## SYNTAX - -``` -BeforeEach -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. -For a full description of this -behavior, as well as how multiple BeforeEach or AfterEach blocks interact -with each other, please refer to the about_BeforeEach_AfterEach help file. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/Context.md b/reference/6/Pester/Context.md deleted file mode 100644 index f38e433771c6..000000000000 --- a/reference/6/Pester/Context.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Context - -## SYNOPSIS -Provides logical grouping of It blocks within a single Describe block. -Any Mocks defined -inside a Context are removed at the end of the Context scope, as are any files or folders -added to the TestDrive during the Context block's execution. -Any BeforeEach or AfterEach -blocks defined inside a Context also only apply to tests within that Context . - -## SYNTAX - -``` -Context [-Name] [[-Fixture] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - - Context "when root does not exist" { - It "..." { ... -} - } - - Context "when root does exist" { - It "..." { ... -} - It "..." { ... -} - It "..." { ... -} - } -} - -## PARAMETERS - -### -Name -The name of the Context. -This is a phrase describing a set of tests within a describe. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Fixture -Script that is executed. -This may include setup specific to the context and one or more It -blocks that validate the expected outcomes. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Describe](Describe.md) - -[It](It.md) - -[BeforeEach](BeforeEach.md) - -[AfterEach](AfterEach.md) - -[about_Should]() - -[about_Mocking]() - -[about_TestDrive]() \ No newline at end of file diff --git a/reference/6/Pester/Describe.md b/reference/6/Pester/Describe.md deleted file mode 100644 index 977c50108716..000000000000 --- a/reference/6/Pester/Describe.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Describe - -## SYNOPSIS -Creates a logical group of tests. -All Mocks and TestDrive contents -defined within a Describe block are scoped to that Describe; they -will no longer be present when the Describe block exits. -A Describe -block may contain any number of Context and It blocks. - -## SYNTAX - -``` -Describe [-Name] [-Tags ] [[-Fixture] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - It "adds positive numbers" { - $sum = Add-Numbers 2 3 - $sum | Should Be 5 - } - - It "adds negative numbers" { - $sum = Add-Numbers (-2) (-2) - $sum | Should Be (-4) - } - - It "adds one negative number to positive number" { - $sum = Add-Numbers (-2) 2 - $sum | Should Be 0 - } - - It "concatenates strings if given strings" { - $sum = Add-Numbers two three - $sum | Should Be "twothree" - } -} - -## PARAMETERS - -### -Name -The name of the test group. -This is often an expressive phrase describing the scenario being tested. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Tags -Optional parameter containing an array of strings. -When calling Invoke-Pester, it is possible to -specify a -Tag parameter which will only execute Describe blocks containing the same Tag. - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: @() -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Fixture -The actual test script. -If you are following the AAA pattern (Arrange-Act-Assert), this -typically holds the arrange and act sections. -The Asserts will also lie in this block but are -typically nested each in its own It block. -Assertions are typically performed by the Should -command within the It blocks. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[It](It.md) - -[Context](Context.md) - -[Invoke-Pester](Invoke-Pester.md) - -[about_Should]() - -[about_Mocking]() - -[about_TestDrive]() diff --git a/reference/6/Pester/Get-MockDynamicParameters.md b/reference/6/Pester/Get-MockDynamicParameters.md deleted file mode 100644 index 1940d0fffa79..000000000000 --- a/reference/6/Pester/Get-MockDynamicParameters.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Get-MockDynamicParameters - -## SYNOPSIS -This command is used by Pester's Mocking framework. -You do not need to call it directly. - -## SYNTAX - -### Cmdlet -``` -Get-MockDynamicParameters -CmdletName [-Parameters ] [-Cmdlet ] -``` - -### Function -``` -Get-MockDynamicParameters -FunctionName [-ModuleName ] [-Parameters ] - [-Cmdlet ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -CmdletName -{{Fill CmdletName Description}} - -```yaml -Type: String -Parameter Sets: Cmdlet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FunctionName -{{Fill FunctionName Description}} - -```yaml -Type: String -Parameter Sets: Function -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -{{Fill ModuleName Description}} - -```yaml -Type: String -Parameter Sets: Function -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Parameters -{{Fill Parameters Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Cmdlet -{{Fill Cmdlet Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Get-TestDriveItem.md b/reference/6/Pester/Get-TestDriveItem.md deleted file mode 100644 index 8efd4be3c273..000000000000 --- a/reference/6/Pester/Get-TestDriveItem.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Get-TestDriveItem - -## SYNOPSIS -{{Fill in the Synopsis}} - -## SYNTAX - -``` -Get-TestDriveItem [[-Path] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -Path -{{Fill Path Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -### None - - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/In.md b/reference/6/Pester/In.md deleted file mode 100644 index 4df24be3c78d..000000000000 --- a/reference/6/Pester/In.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# In - -## SYNOPSIS -A convenience function that executes a script from a specified path. - -## SYNTAX - -``` -In [[-path] ] [[-execute] ] -``` - -## DESCRIPTION -Before the script block passed to the execute parameter is invoked, -the current location is set to the path specified. -Once the script -block has been executed, the location will be reset to the location -the script was in prior to calling In. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -path -The path that the execute block will be executed in. - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -execute -The script to be executed in the path provided. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/InModuleScope.md b/reference/6/Pester/InModuleScope.md deleted file mode 100644 index d30844361fc8..000000000000 --- a/reference/6/Pester/InModuleScope.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# InModuleScope - -## SYNOPSIS -Allows you to execute parts of a test script within the -scope of a PowerShell script module. - -## SYNTAX - -``` -InModuleScope [-ModuleName] [-ScriptBlock] -``` - -## DESCRIPTION -By injecting some test code into the scope of a PowerShell -script module, you can use non-exported functions, aliases -and variables inside that module, to perform unit tests on -its internal implementation. - -InModuleScope may be used anywhere inside a Pester script, -either inside or outside a Describe block. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -# The script module: -``` - -function PublicFunction -{ - # Does something -} - -function PrivateFunction -{ - return $true -} - -Export-ModuleMember -Function PublicFunction - -The test script: - -Import-Module MyModule - -InModuleScope MyModule { - Describe 'Testing MyModule' { - It 'Tests the Private function' { - PrivateFunction | Should Be $true - } - } -} - -Normally you would not be able to access "PrivateFunction" from -the powershell session, because the module only exported -"PublicFunction". -Using InModuleScope allowed this call to -"PrivateFunction" to work successfully. - -## PARAMETERS - -### -ModuleName -The name of the module into which the test code should be -injected. -This module must already be loaded into the current -PowerShell session. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ScriptBlock -The code to be executed within the script module. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Invoke-Mock.md b/reference/6/Pester/Invoke-Mock.md deleted file mode 100644 index 733d4d2ada47..000000000000 --- a/reference/6/Pester/Invoke-Mock.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Invoke-Mock - -## SYNOPSIS -This command is used by Pester's Mocking framework. -You do not need to call it directly. - -## SYNTAX - -``` -Invoke-Mock [-CommandName] [-MockCallState] [[-ModuleName] ] - [[-BoundParameters] ] [[-ArgumentList] ] [[-CallerSessionState] ] - [[-FromBlock] ] [[-InputObject] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -CommandName -{{Fill CommandName Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MockCallState -{{Fill MockCallState Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -{{Fill ModuleName Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -BoundParameters -{{Fill BoundParameters Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: @{} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ArgumentList -{{Fill ArgumentList Description}} - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: @() -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -CallerSessionState -{{Fill CallerSessionState Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 6 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FromBlock -{{Fill FromBlock Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 7 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -{{Fill InputObject Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 8 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Invoke-Pester.md b/reference/6/Pester/Invoke-Pester.md deleted file mode 100644 index d0d84146ea1b..000000000000 --- a/reference/6/Pester/Invoke-Pester.md +++ /dev/null @@ -1,353 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Invoke-Pester - -## SYNOPSIS -Invokes Pester to run all tests (files containing *.Tests.ps1) recursively under the Path - -## SYNTAX - -### LegacyOutputXml (Default) -``` -Invoke-Pester [[-Script] ] [[-TestName] ] [-EnableExit] [[-OutputXml] ] - [[-Tag] ] [-ExcludeTag ] [-PassThru] [-CodeCoverage ] [-Strict] [-Quiet] - [-PesterOption ] -``` - -### NewOutputSet -``` -Invoke-Pester [[-Script] ] [[-TestName] ] [-EnableExit] [[-Tag] ] - [-ExcludeTag ] [-PassThru] [-CodeCoverage ] [-Strict] -OutputFile - -OutputFormat [-Quiet] [-PesterOption ] -``` - -## DESCRIPTION -Upon calling Invoke-Pester, all files that have a name containing -"*.Tests.ps1" will have the tests defined in their Describe blocks -executed. -Invoke-Pester begins at the location of Path and -runs recursively through each sub directory looking for -"*.Tests.ps1" files containing tests. -If a TestName is provided, -Invoke-Pester will only run tests that have a describe block with a -matching name. -By default, Invoke-Pester will end the test run with a -simple report of the number of tests passed and failed output to the -console. -One may want pester to "fail a build" in the event that any -tests fail. -To accomodate this, Invoke-Pester will return an exit -code equal to the number of failed tests if the EnableExit switch is -set. -Invoke-Pester will also write a NUnit style log of test results -if the OutputXml parameter is provided. -In these cases, Invoke-Pester -will write the result log to the path provided in the OutputXml -parameter. - -Optionally, Pester can generate a report of how much code is covered -by the tests, and information about any commands which were not -executed. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Invoke-Pester -``` - -This will find all *.Tests.ps1 files and run their tests. -No exit code will be returned and no log file will be saved. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Invoke-Pester -Script ./tests/Utils* -``` - -This will run all tests in files under ./Tests that begin with Utils and alsocontains .Tests. - -### -------------------------- EXAMPLE 3 -------------------------- -``` -Invoke-Pester -Script @{ Path = './tests/Utils*'; Parameters = @{ NamedParameter = 'Passed By Name' }; Arguments = @('Passed by position') } -``` - -Executes the same tests as in Example 1, but will run them with the equivalent of the following command line: & $testScriptPath -NamedParameter 'Passed By Name' 'Passed by position' - -### -------------------------- EXAMPLE 4 -------------------------- -``` -Invoke-Pester -TestName "Add Numbers" -``` - -This will only run the Describe block named "Add Numbers" - -### -------------------------- EXAMPLE 5 -------------------------- -``` -Invoke-Pester -EnableExit -OutputXml "./artifacts/TestResults.xml" -``` - -This runs all tests from the current directory downwards and writes the results according to the NUnit schema to artifacts/TestResults.xml just below the current directory. -The test run will return an exit code equal to the number of test failures. - -### -------------------------- EXAMPLE 6 -------------------------- -``` -Invoke-Pester -EnableExit -OutputFile "./artifacts/TestResults.xml" -OutputFormat NUnitxml -``` - -This runs all tests from the current directory downwards and writes the results to an output file and NUnitxml output format - -### -------------------------- EXAMPLE 7 -------------------------- -``` -Invoke-Pester -CodeCoverage 'ScriptUnderTest.ps1' -``` - -Runs all *.Tests.ps1 scripts in the current directory, and generates a coverage report for all commands in the "ScriptUnderTest.ps1" file. - -### -------------------------- EXAMPLE 8 -------------------------- -``` -Invoke-Pester -CodeCoverage @{ Path = 'ScriptUnderTest.ps1'; Function = 'FunctionUnderTest' } -``` - -Runs all *.Tests.ps1 scripts in the current directory, and generates a coverage report for all commands in the "FunctionUnderTest" function in the "ScriptUnderTest.ps1" file. - -### -------------------------- EXAMPLE 9 -------------------------- -``` -Invoke-Pester -CodeCoverage @{ Path = 'ScriptUnderTest.ps1'; StartLine = 10; EndLine = 20 } -``` - -Runs all *.Tests.ps1 scripts in the current directory, and generates a coverage report for all commands on lines 10 through 20 in the "ScriptUnderTest.ps1" file. - -## PARAMETERS - -### -Script -This parameter indicates which test scripts should be run. -This parameter may be passed simple strings (wildcards are allowed), or hashtables containing Path, Arguments and Parameters keys. -If hashtables are used, the Parameters key must refer to a hashtable, and the Arguments key must refer to an array; these will be splatted to the test script(s) indicated in the Path key. - -Note: If the path contains any wildcards, or if it refers to a directory, then Pester will search for and execute all test scripts named *.Tests.ps1 in the target path; the search is recursive. -If the path contains no wildcards and refers to a file, Pester will just try to execute that file regardless of its name. - -Aliased to 'Path' and 'relative_path' for backwards compatibility. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: Path, relative_path - -Required: False -Position: 1 -Default value: . -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -TestName -Informs Invoke-Pester to only run Describe blocks that match this name. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: Name - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -EnableExit -Will cause Invoke-Pester to exit with a exit code equal to the number of failed tests once all tests have been run. -Use this to "fail" a build when any tests fail. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -OutputXml -The path where Invoke-Pester will save a NUnit formatted test results log file. -If this path is not provided, no log will be generated. - -```yaml -Type: String -Parameter Sets: LegacyOutputXml -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Tag -Informs Invoke-Pester to only run Describe blocks tagged with the tags specified. -Aliased 'Tags' for backwards compatibility. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: Tags - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ExcludeTag -Informs Invoke-Pester to not run blocks tagged with the tags specified. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -Returns a Pester result object containing the information about the whole test run, and each test. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -CodeCoverage -Instructs Pester to generate a code coverage report in addition to running tests. -You may pass either hashtables or strings to this parameter. -If strings are used, they must be paths (wildcards allowed) to source files, and all commands in the files are analyzed for code coverage. -By passing hashtables instead, you can limit the analysis to specific lines or functions within a file. -Hashtables must contain a Path key (which can be abbreviated to just "P"), and may contain Function (or "F"), StartLine (or "S"), and EndLine ("E") keys to narrow down the commands to be analyzed. -If Function is specified, StartLine and EndLine are ignored. -If only StartLine is defined, the entire script file starting with StartLine is analyzed. -If only EndLine is present, all lines in the script file up to and including EndLine are analyzed. -Both Function and Path (as well as simple strings passed instead of hashtables) may contain wildcards. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: @() -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Strict -Makes Pending and Skipped tests to Failed tests. -Useful for continuous integration where you need to make sure all tests passed. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -OutputFile -{{Fill OutputFile Description}} - -```yaml -Type: String -Parameter Sets: NewOutputSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -OutputFormat -{{Fill OutputFormat Description}} - -```yaml -Type: String -Parameter Sets: NewOutputSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Quiet -Disables the output Pester writes to screen. -No other output is generated unless you specify PassThru, or one of the Output parameters. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PesterOption -Sets advanced options for the test execution. -Enter a PesterOption object, such as one that you create by using the New-PesterOption cmdlet, or a hash table in which the keys are option names and the values are option values. -For more information on the options available, see the help for New-PesterOption. - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Describe](describe.md) - diff --git a/reference/6/Pester/It.md b/reference/6/Pester/It.md deleted file mode 100644 index 23d8439bee6b..000000000000 --- a/reference/6/Pester/It.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# It - -## SYNOPSIS -Validates the results of a test inside of a Describe block. - -## SYNTAX - -### Normal (Default) -``` -It [-name] [[-test] ] [-TestCases ] -``` - -### Pending -``` -It [-name] [[-test] ] [-TestCases ] [-Pending] -``` - -### Skip -``` -It [-name] [[-test] ] [-TestCases ] [-Skip] -``` - -## DESCRIPTION -The It command is intended to be used inside of a Describe or Context Block. -If you are familiar with the AAA pattern (Arrange-Act-Assert), the body of -the It block is the appropriate location for an assert. -The convention is to -assert a single expectation for each It block. -The code inside of the It block -should throw a terminating error if the expectation of the test is not met and -thus cause the test to fail. -The name of the It block should expressively state -the expectation of the test. - -In addition to using your own logic to test expectations and throw exceptions, -you may also use Pester's Should command to perform assertions in plain language. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - It "adds positive numbers" { - $sum = Add-Numbers 2 3 - $sum | Should Be 5 - } - - It "adds negative numbers" { - $sum = Add-Numbers (-2) (-2) - $sum | Should Be (-4) - } - - It "adds one negative number to positive number" { - $sum = Add-Numbers (-2) 2 - $sum | Should Be 0 - } - - It "concatenates strings if given strings" { - $sum = Add-Numbers two three - $sum | Should Be "twothree" - } -} - -### -------------------------- EXAMPLE 2 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - $testCases = @( - @{ a = 2; b = 3; expectedResult = 5 } - @{ a = -2; b = -2; expectedResult = -4 } - @{ a = -2; b = 2; expectedResult = 0 } - @{ a = 'two'; b = 'three'; expectedResult = 'twothree' } - ) - - It 'Correctly adds \ and \ to get \' -TestCases $testCases { - param ($a, $b, $expectedResult) - - $sum = Add-Numbers $a $b - $sum | Should Be $expectedResult - } -} - -## PARAMETERS - -### -name -An expressive phsae describing the expected test outcome. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -test -The script block that should throw an exception if the -expectation of the test is not met.If you are following the -AAA pattern (Arrange-Act-Assert), this typically holds the -Assert. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: {} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -TestCases -Optional array of hashtable (or any IDictionary) objects. -If this parameter is used, -Pester will call the test script block once for each table in the TestCases array, -splatting the dictionary to the test script block as input. -If you want the name of -the test to appear differently for each test case, you can embed tokens into the Name -parameter with the syntax 'Adds numbers \ and \' (assuming you have keys named A and B -in your TestCases hashtables.) - -```yaml -Type: IDictionary[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Pending -Use this parameter to explicitly mark the test as work-in-progress/not implemented/pending when you -need to distinguish a test that fails because it is not finished yet from a tests -that fail as a result of changes being made in the code base. -An empty test, that is a -test that contains nothing except whitespace or comments is marked as Pending by default. - -```yaml -Type: SwitchParameter -Parameter Sets: Pending -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Skip -Use this parameter to explicitly mark the test to be skipped. -This is preferable to temporarily -commenting out a test, because the test remains listed in the output. -Use the Strict parameter -of Invoke-Pester to force all skipped tests to fail. - -```yaml -Type: SwitchParameter -Parameter Sets: Skip -Aliases: Ignore - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Describe](Describe.md) - -[Context](Context.md) - -[about_Should]() diff --git a/reference/6/Pester/Mock.md b/reference/6/Pester/Mock.md deleted file mode 100644 index 674ec8770136..000000000000 --- a/reference/6/Pester/Mock.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Mock - -## SYNOPSIS -Mocks the behavior of an existing command with an alternate -implementation. - -## SYNTAX - -``` -Mock [[-CommandName] ] [[-MockWith] ] [-Verifiable] [[-ParameterFilter] ] - [[-ModuleName] ] -``` - -## DESCRIPTION -This creates new behavior for any existing command within the scope of a -Describe or Context block. -The function allows you to specify a script block -that will become the command's new behavior. - -Optionally, you may create a Parameter Filter which will examine the -parameters passed to the mocked command and will invoke the mocked -behavior only if the values of the parameter values pass the filter. -If -they do not, the original command implementation will be invoked instead -of a mock. - -You may create multiple mocks for the same command, each using a different -ParameterFilter. -ParameterFilters will be evaluated in reverse order of -their creation. -The last one created will be the first to be evaluated. -The mock of the first filter to pass will be used. -The exception to this -rule are Mocks with no filters. -They will always be evaluated last since -they will act as a "catch all" mock. - -Mocks can be marked Verifiable. -If so, the Assert-VerifiableMocks command -can be used to check if all Verifiable mocks were actually called. -If any -verifiable mock is not called, Assert-VerifiableMocks will throw an -exception and indicate all mocks not called. - -If you wish to mock commands that are called from inside a script module, -you can do so by using the -ModuleName parameter to the Mock command. -This -injects the mock into the specified module. -If you do not specify a -module name, the mock will be created in the same scope as the test script. -You may mock the same command multiple times, in different scopes, as needed. -Each module's mock maintains a separate call history and verified status. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -``` - -Using this Mock, all calls to Get-ChildItem will return a hashtable with a -FullName property returning "A_File.TXT" - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp) } -``` - -This Mock will only be applied to Get-ChildItem calls within the user's temp directory. - -### -------------------------- EXAMPLE 3 -------------------------- -``` -Mock Set-Content {} -Verifiable -ParameterFilter { $Path -eq "some_path" -and $Value -eq "Expected Value" } -``` - -When this mock is used, if the Mock is never invoked and Assert-VerifiableMocks is called, an exception will be thrown. -The command behavior will do nothing since the ScriptBlock is empty. - -### -------------------------- EXAMPLE 4 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp\1) } -``` - -Mock Get-ChildItem { return @{FullName = "B_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp\2) } -Mock Get-ChildItem { return @{FullName = "C_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp\3) } - -Multiple mocks of the same command may be used. -The parameter filter determines which is invoked. -Here, if Get-ChildItem is called on the "2" directory of the temp folder, then B_File.txt will be returned. - -### -------------------------- EXAMPLE 5 -------------------------- -``` -Mock Get-ChildItem { return @{FullName="B_File.TXT"} } -ParameterFilter { $Path -eq "$env:temp\me" } -``` - -Mock Get-ChildItem { return @{FullName="A_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp) } - -Get-ChildItem $env:temp\me - -Here, both mocks could apply since both filters will pass. -A_File.TXT will be returned because it was the most recent Mock created. - -### -------------------------- EXAMPLE 6 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "B_File.TXT"} } -ParameterFilter { $Path -eq "$env:temp\me" } -``` - -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } - -Get-ChildItem c:\windows - -Here, A_File.TXT will be returned. -Since no filter was specified, it will apply to any call to Get-ChildItem that does not pass another filter. - -### -------------------------- EXAMPLE 7 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "B_File.TXT"} } -ParameterFilter { $Path -eq "$env:temp\me" } -``` - -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } - -Get-ChildItem $env:temp\me - -Here, B_File.TXT will be returned. -Even though the filterless mock was created more recently. -This illustrates that filterless Mocks are always evaluated last regardlss of their creation order. - -### -------------------------- EXAMPLE 8 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ModuleName MyTestModule -``` - -Using this Mock, all calls to Get-ChildItem from within the MyTestModule module -will return a hashtable with a FullName property returning "A_File.TXT" - -### -------------------------- EXAMPLE 9 -------------------------- -``` -Get-Module -Name ModuleMockExample | Remove-Module -``` - -New-Module -Name ModuleMockExample -ScriptBlock { - function Hidden { "Internal Module Function" } - function Exported { Hidden } - - Export-ModuleMember -Function Exported -} | Import-Module -Force - -Describe "ModuleMockExample" { - - It "Hidden function is not directly accessible outside the module" { - { Hidden } | Should Throw - } - - It "Original Hidden function is called" { - Exported | Should Be "Internal Module Function" - } - - It "Hidden is replaced with our implementation" { - Mock Hidden { "Mocked" } -ModuleName ModuleMockExample - Exported | Should Be "Mocked" - } -} - -This example shows how calls to commands made from inside a module can be -mocked by using the -ModuleName parameter. - -## PARAMETERS - -### -CommandName -The name of the command to be mocked. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MockWith -A ScriptBlock specifying the behvior that will be used to mock CommandName. -The default is an empty ScriptBlock. -NOTE: Do not specify param or dynamicparam blocks in this script block. -These will be injected automatically based on the signature of the command -being mocked, and the MockWith script block can contain references to the -mocked commands parameter variables. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: {} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Verifiable -When this is set, the mock will be checked when Assert-VerifiableMocks is -called. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ParameterFilter -An optional filter to limit mocking behavior only to usages of -CommandName where the values of the parameters passed to the command -pass the filter. - -This ScriptBlock must return a boolean value. -See examples for usage. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: {$True} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -Optional string specifying the name of the module where this command -is to be mocked. -This should be a module that _calls_ the mocked -command; it doesn't necessarily have to be the same module which -originally implemented the command. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Assert-MockCalled](Assert-MockCalled.md) - -[Assert-VerifiableMocks](Assert-VerifiableMocks.md) - -[Describe](Describe.md) - -[Context](Context.md) - -[It](It.md) - -[about_Should]() - -[about_Mocking]() diff --git a/reference/6/Pester/New-Fixture.md b/reference/6/Pester/New-Fixture.md deleted file mode 100644 index 3453128a1bf4..000000000000 --- a/reference/6/Pester/New-Fixture.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# New-Fixture - -## SYNOPSIS -This function generates two scripts, one that defines a function -and another one that contains its tests. - -## SYNTAX - -``` -New-Fixture [[-Path] ] [-Name] -``` - -## DESCRIPTION -This function generates two scripts, one that defines a function -and another one that contains its tests. -The files are by default -placed in the current directory and are called and populated as such: - - -The script defining the function: .\Clean.ps1: - -function Clean { - -} - -The script containg the example test .\Clean.Tests.ps1: - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. -"$here\$sut" - -Describe "Clean" { - - It "does something useful" { - $false | Should Be $true - } -} - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -New-Fixture -Name Clean -``` - -Creates the scripts in the current directory. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -New-Fixture C:\Projects\Cleaner Clean -``` - -Creates the scripts in the C:\Projects\Cleaner directory. - -### -------------------------- EXAMPLE 3 -------------------------- -``` -New-Fixture Cleaner Clean -``` - -Creates a new folder named Cleaner in the current directory and creates the scripts in it. - -## PARAMETERS - -### -Path -Defines path where the test and the function should be created, you can use full or relative path. -If the parameter is not specified the scripts are created in the current directory. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $PWD -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Defines the name of the function and the name of the test to be created. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_Pester](https://github.com/pester/Pester/blob/master/en-US/about_Pester.help.txt) - -[about_Should](https://github.com/pester/Pester/blob/master/en-US/about_Should.help.txt) - diff --git a/reference/6/Pester/Pester.md b/reference/6/Pester/Pester.md deleted file mode 100644 index 3f1e6ee9b3d6..000000000000 --- a/reference/6/Pester/Pester.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-US -keywords: powershell,cmdlet -Help Version: 6.0 -Download Help Link: http://Please-enter-FwLink-manually -Module Guid: a699dea5-2c73-4616-a270-1f7abb777e71 -Module Name: Pester ---- - -# Pester Module -## Description -{{Manually Enter Description Here}} - -## Pester Cmdlets -### [AfterAll](AfterAll.md) -{{Manually Enter AfterAll Description Here}} - -### [AfterEach](AfterEach.md) -{{Manually Enter AfterEach Description Here}} - -### [Assert-MockCalled](Assert-MockCalled.md) -{{Manually Enter Assert-MockCalled Description Here}} - -### [Assert-VerifiableMocks](Assert-VerifiableMocks.md) -{{Manually Enter Assert-VerifiableMocks Description Here}} - -### [BeforeAll](BeforeAll.md) -{{Manually Enter BeforeAll Description Here}} - -### [BeforeEach](BeforeEach.md) -{{Manually Enter BeforeEach Description Here}} - -### [Context](Context.md) -{{Manually Enter Context Description Here}} - -### [Describe](Describe.md) -{{Manually Enter Describe Description Here}} - -### [Get-MockDynamicParameters](Get-MockDynamicParameters.md) -{{Manually Enter Get-MockDynamicParameters Description Here}} - -### [Get-TestDriveItem](Get-TestDriveItem.md) -{{Manually Enter Get-TestDriveItem Description Here}} - -### [In](In.md) -{{Manually Enter In Description Here}} - -### [InModuleScope](InModuleScope.md) -{{Manually Enter InModuleScope Description Here}} - -### [Invoke-Mock](Invoke-Mock.md) -{{Manually Enter Invoke-Mock Description Here}} - -### [Invoke-Pester](Invoke-Pester.md) -{{Manually Enter Invoke-Pester Description Here}} - -### [It](It.md) -{{Manually Enter It Description Here}} - -### [Mock](Mock.md) -{{Manually Enter Mock Description Here}} - -### [New-Fixture](New-Fixture.md) -{{Manually Enter New-Fixture Description Here}} - -### [Set-DynamicParameterVariables](Set-DynamicParameterVariables.md) -{{Manually Enter Set-DynamicParameterVariables Description Here}} - -### [Setup](Setup.md) -{{Manually Enter Setup Description Here}} - -### [Should](Should.md) -{{Manually Enter Should Description Here}} diff --git a/reference/6/Pester/Set-DynamicParameterVariables.md b/reference/6/Pester/Set-DynamicParameterVariables.md deleted file mode 100644 index 4a21e44ff096..000000000000 --- a/reference/6/Pester/Set-DynamicParameterVariables.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Set-DynamicParameterVariables - -## SYNOPSIS -This command is used by Pester's Mocking framework. -You do not need to call it directly. - -## SYNTAX - -``` -Set-DynamicParameterVariables [-SessionState] [[-Parameters] ] - [[-Metadata] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -SessionState -{{Fill SessionState Description}} - -```yaml -Type: SessionState -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Parameters -{{Fill Parameters Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Metadata -{{Fill Metadata Description}} - -```yaml -Type: CommandMetadata -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Setup.md b/reference/6/Pester/Setup.md deleted file mode 100644 index bcaeb69b3c38..000000000000 --- a/reference/6/Pester/Setup.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Setup - -## SYNOPSIS -{{Fill in the Synopsis}} - -## SYNTAX - -``` -Setup [-Dir] [-File] [[-Path] ] [[-Content] ] [-PassThru] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -Content -{{Fill Content Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Dir -{{Fill Dir Description}} - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -File -{{Fill File Description}} - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -{{Fill PassThru Description}} - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Path -{{Fill Path Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -### None - - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Should.md b/reference/6/Pester/Should.md deleted file mode 100644 index eecaa08574ea..000000000000 --- a/reference/6/Pester/Should.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Should - -## SYNOPSIS -{{Fill in the Synopsis}} - -## SYNTAX - -``` -Should -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -### None - - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - From 160ba5e3d11c2adec4eca559e6ca3af631aeab32 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 4 Jan 2018 00:22:22 +0900 Subject: [PATCH 144/145] Fix parameter's position in Resume-Service.md (#1998) --- .../Resume-Service.md | 17 ++++--- .../Resume-Service.md | 17 ++++--- .../Resume-Service.md | 13 +++-- .../Resume-Service.md | 13 +++-- .../Resume-Service.md | 49 +++++-------------- 5 files changed, 47 insertions(+), 62 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Management/Resume-Service.md b/reference/3.0/Microsoft.PowerShell.Management/Resume-Service.md index 3f87445c0af4..c5e046d3136b 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Resume-Service.md @@ -15,20 +15,23 @@ Resumes one or more suspended (paused) services. ### InputObject (Default) ``` -Resume-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] +Resume-Service [-InputObject] + [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Resume-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Resume-Service [-Name] + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Resume-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Resume-Service -DisplayName + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -120,7 +123,7 @@ Parameter Sets: InputObject Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -138,7 +141,7 @@ Parameter Sets: Default Aliases: ServiceName Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/4.0/Microsoft.PowerShell.Management/Resume-Service.md b/reference/4.0/Microsoft.PowerShell.Management/Resume-Service.md index cbe185b557aa..4d54cba85312 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Resume-Service.md @@ -17,20 +17,23 @@ Resumes one or more suspended (paused) services. ### InputObject (Default) ``` -Resume-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] +Resume-Service [-InputObject] + [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Resume-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Resume-Service [-Name] + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Resume-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Resume-Service -DisplayName + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -125,7 +128,7 @@ Parameter Sets: InputObject Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -143,7 +146,7 @@ Parameter Sets: Default Aliases: ServiceName Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/reference/5.0/Microsoft.PowerShell.Management/Resume-Service.md b/reference/5.0/Microsoft.PowerShell.Management/Resume-Service.md index 6e2a3001e068..aed2fe434e88 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Resume-Service.md @@ -17,20 +17,23 @@ Resumes one or more suspended (paused) services. ### InputObject (Default) ``` -Resume-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] +Resume-Service [-InputObject] + [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Resume-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Resume-Service [-Name] + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Resume-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Resume-Service -DisplayName + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Management/Resume-Service.md b/reference/5.1/Microsoft.PowerShell.Management/Resume-Service.md index 6e2a3001e068..aed2fe434e88 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Resume-Service.md @@ -17,20 +17,23 @@ Resumes one or more suspended (paused) services. ### InputObject (Default) ``` -Resume-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] +Resume-Service [-InputObject] + [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Resume-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Resume-Service [-Name] + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Resume-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Resume-Service -DisplayName + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/6/Microsoft.PowerShell.Management/Resume-Service.md b/reference/6/Microsoft.PowerShell.Management/Resume-Service.md index 1a021d3214c5..408680262b4a 100644 --- a/reference/6/Microsoft.PowerShell.Management/Resume-Service.md +++ b/reference/6/Microsoft.PowerShell.Management/Resume-Service.md @@ -17,23 +17,23 @@ Resumes one or more suspended (paused) services. ### InputObject (Default) ``` -Resume-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] - [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] - [] +Resume-Service [-InputObject] + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### Default ``` -Resume-Service [-Name] [-PassThru] [-Include ] [-Exclude ] - [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] - [] +Resume-Service [-Name] + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Resume-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] - [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] - [] +Resume-Service -DisplayName + [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -119,33 +119,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -InformationAction -```yaml -Type: ActionPreference -Parameter Sets: (All) -Aliases: infa -Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InformationVariable -```yaml -Type: String -Parameter Sets: (All) -Aliases: iv - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -InputObject Specifies **ServiceController** objects that represent the services to resumed. Enter a variable that contains the objects, or type a command or expression that gets the objects. @@ -156,7 +129,7 @@ Parameter Sets: InputObject Aliases: Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False @@ -171,7 +144,7 @@ Parameter Sets: Default Aliases: ServiceName Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False From 0e1efd4888e1cb2e74602dd7f28e6eb7b3ce7f24 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Thu, 4 Jan 2018 00:23:05 +0900 Subject: [PATCH 145/145] Fix link for about_Providers (#1999) --- reference/3.0/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/3.0/Microsoft.PowerShell.Core/Get-Help.md | 2 +- reference/3.0/Microsoft.PowerShell.Management/Get-Content.md | 2 +- reference/3.0/Microsoft.PowerShell.Management/Get-PSDrive.md | 2 +- reference/3.0/Microsoft.PowerShell.Management/New-PSDrive.md | 2 +- reference/3.0/Microsoft.PowerShell.Management/Remove-PSDrive.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/4.0/Microsoft.PowerShell.Core/Get-Help.md | 2 +- reference/4.0/Microsoft.PowerShell.Management/Get-Content.md | 2 +- reference/4.0/Microsoft.PowerShell.Management/Get-PSDrive.md | 2 +- reference/4.0/Microsoft.PowerShell.Management/New-PSDrive.md | 2 +- reference/4.0/Microsoft.PowerShell.Management/Remove-PSDrive.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/5.0/Microsoft.PowerShell.Core/Get-Help.md | 2 +- reference/5.0/Microsoft.PowerShell.Management/Get-Content.md | 2 +- reference/5.0/Microsoft.PowerShell.Management/Get-PSDrive.md | 2 +- reference/5.0/Microsoft.PowerShell.Management/New-PSDrive.md | 2 +- reference/5.0/Microsoft.PowerShell.Management/Remove-PSDrive.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/5.1/Microsoft.PowerShell.Core/Get-Help.md | 2 +- reference/5.1/Microsoft.PowerShell.Management/Get-Content.md | 2 +- reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md | 2 +- reference/5.1/Microsoft.PowerShell.Management/New-PSDrive.md | 2 +- reference/5.1/Microsoft.PowerShell.Management/Remove-PSDrive.md | 2 +- reference/6/Microsoft.PowerShell.Core/Get-Command.md | 2 +- reference/6/Microsoft.PowerShell.Core/Get-Help.md | 2 +- reference/6/Microsoft.PowerShell.Core/help.md | 2 +- reference/6/Microsoft.PowerShell.Management/Get-Content.md | 2 +- reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md | 2 +- reference/6/Microsoft.PowerShell.Management/New-PSDrive.md | 2 +- reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md index 5865aed69a30..5b011161f813 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-Command.md @@ -232,7 +232,7 @@ To detect dynamic parameters that are available only when certain other paramete To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the **ArgumentList** parameter to a path in the provider drive, such as "WSMan:", "HKLM:" or "Cert:". When the command is a Windows PowerShell provider cmdlet, enter only one path in each command; the provider cmdlets return only the dynamic parameters for the first path the value of **ArgumentList**. -For information about the provider cmdlets, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +For information about the provider cmdlets, see [about_Providers](About/about_Providers.md). ```yaml Type: Object[] diff --git a/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md b/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md index 0b102d43b26e..8cc6b01cfac6 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/3.0/Microsoft.PowerShell.Core/Get-Help.md @@ -474,7 +474,7 @@ To see the custom cmdlet help for a provider path, go to the provider path locat You can also find custom cmdlet help online in the provider help section of the help topics. For example, you can find help for the **New-Item** cmdlet in the Wsman:\*\ClientCertificate path (http://go.microsoft.com/fwlink/?LinkID=158676). -For more information about Windows PowerShell providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +For more information about Windows PowerShell providers, see [about_Providers](About/about_Providers.md). ```yaml Type: String diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md index 8d68eac2331a..a459dc0acb9c 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-Content.md @@ -391,7 +391,7 @@ You cannot pipe input to **Get-Content**. **Get-Content** returns strings or bytes. The output type depends upon the content that it gets. ## NOTES -* The **Get-Content** cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the **Get-PsProvider** cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **Get-Content** cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the **Get-PsProvider** cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * ## RELATED LINKS diff --git a/reference/3.0/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/3.0/Microsoft.PowerShell.Management/Get-PSDrive.md index 7a6ab17b723f..d4406cc39af1 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -300,7 +300,7 @@ You cannot pipe objects to **Get-PSDrive**. ### System.Management.Automation.PSDriveInfo **Get-PSDrive** returns objects that represent the drives in the session. ## NOTES -* The **Get-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **Get-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives that are created by using the **Persist** parameter of the New-PSDrive cmdlet are specific to a user account. Mapped network drives that you create in sessions that are started with the "Run as administrator" option or with the credentials of another user are not visible in sessions that are started without explicit credentials or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/3.0/Microsoft.PowerShell.Management/New-PSDrive.md b/reference/3.0/Microsoft.PowerShell.Management/New-PSDrive.md index 691727712599..413678992d94 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/New-PSDrive.md +++ b/reference/3.0/Microsoft.PowerShell.Management/New-PSDrive.md @@ -366,7 +366,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.PSDriveInfo ## NOTES -* The **New-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information about providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **New-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information about providers, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives are specific to a user account. Mapped network drives that you create in sessions that are started with the "Run as administrator" option or with the credential of another user are not visible in session that started without explicit credentials or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/3.0/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/3.0/Microsoft.PowerShell.Management/Remove-PSDrive.md index 626f1214e115..1bd142d20a5c 100644 --- a/reference/3.0/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/3.0/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -193,7 +193,7 @@ You can pipe a drive object, such as one from the Get-PSDrive cmdlet, to the **R ### None This cmdlet does not return any output. ## NOTES -* The **Remove-PSDrive** cmdlet is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **Remove-PSDrive** cmdlet is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md index 373697a4fcfc..791d66ee6be9 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-Command.md @@ -249,7 +249,7 @@ To detect dynamic parameters that are available only when certain other paramete To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the **ArgumentList** parameter to a path in the provider drive, such as "WSMan:", "HKLM:" or "Cert:". When the command is a Windows PowerShell provider cmdlet, enter only one path in each command; the provider cmdlets return only the dynamic parameters for the first path the value of **ArgumentList**. -For information about the provider cmdlets, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +For information about the provider cmdlets, see [about_Providers](About/about_Providers.md). ```yaml Type: Object[] diff --git a/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md b/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md index 7504ee559b8b..48e6773649a4 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/4.0/Microsoft.PowerShell.Core/Get-Help.md @@ -492,7 +492,7 @@ To see the custom cmdlet help for a provider path, go to the provider path locat You can also find custom cmdlet help online in the provider help section of the help topics. For example, you can find help for the **New-Item** cmdlet in the Wsman:\*\ClientCertificate path (http://go.microsoft.com/fwlink/?LinkID=158676). -For more information about Windows PowerShell providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +For more information about Windows PowerShell providers, see [about_Providers](About/about_Providers.md). ```yaml Type: String diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md index f68c52f161b7..505e9c9a32ed 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-Content.md @@ -373,7 +373,7 @@ You cannot pipe input to **Get-Content**. The output type depends upon the content that it gets. ## NOTES -* The **Get-Content** cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the **Get-PsProvider** cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **Get-Content** cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the **Get-PsProvider** cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * diff --git a/reference/4.0/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/4.0/Microsoft.PowerShell.Management/Get-PSDrive.md index ce4073b3e3cc..b776579bb65c 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -306,7 +306,7 @@ You cannot pipe objects to **Get-PSDrive**. **Get-PSDrive** returns objects that represent the drives in the session. ## NOTES -* The **Get-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **Get-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives that are created by using the **Persist** parameter of the New-PSDrive cmdlet are specific to a user account. Mapped network drives that you create in sessions that are started with the "Run as administrator" option or with the credentials of another user are not visible in sessions that are started without explicit credentials or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Management/New-PSDrive.md b/reference/4.0/Microsoft.PowerShell.Management/New-PSDrive.md index 64b77e48bb25..31a9648a18e4 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/New-PSDrive.md +++ b/reference/4.0/Microsoft.PowerShell.Management/New-PSDrive.md @@ -376,7 +376,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.PSDriveInfo ## NOTES -* The **New-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information about providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **New-PSDrive** cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information about providers, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives are specific to a user account. Mapped network drives that you create in sessions that are started with the "Run as administrator" option or with the credential of another user are not visible in a session that you started without explicit credentials, or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/4.0/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/4.0/Microsoft.PowerShell.Management/Remove-PSDrive.md index 9c9065eeeec0..0aa3683b0e99 100644 --- a/reference/4.0/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/4.0/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -201,7 +201,7 @@ You can pipe a drive object, such as one from the Get-PSDrive cmdlet, to the **R This cmdlet does not return any output. ## NOTES -* The **Remove-PSDrive** cmdlet is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* The **Remove-PSDrive** cmdlet is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md index 885947657a4a..f3d28f586d14 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-Command.md @@ -255,7 +255,7 @@ To detect dynamic parameters that are available only when certain other paramete To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the *ArgumentList* parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a Windows PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of *ArgumentList*. -For information about the provider cmdlets, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For information about the provider cmdlets, see [about_Providers](About/about_Providers.md). ```yaml Type: Object[] diff --git a/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md b/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md index 9d00e202db9a..c7b869056476 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/5.0/Microsoft.PowerShell.Core/Get-Help.md @@ -513,7 +513,7 @@ To see the custom cmdlet help for a provider path, go to the provider path locat You can also find custom cmdlet help online in the provider help section of the help topics. For example, you can find help for the **New-Item** cmdlet in the Wsman:\*\ClientCertificate path (http://go.microsoft.com/fwlink/?LinkID=158676). -For more information about Windows PowerShell providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For more information about Windows PowerShell providers, see [about_Providers](About/about_Providers.md). ```yaml Type: String diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md index 3c363fae179e..a60d62e83ce7 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-Content.md @@ -372,7 +372,7 @@ This cmdlet returns strings or bytes. The output type depends upon the content that it gets. ## NOTES -* This cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers(http://go.microsoft.com/fwlink/?LinkID=113250). +* This cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) * diff --git a/reference/5.0/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/5.0/Microsoft.PowerShell.Management/Get-PSDrive.md index 316fd31d18a7..ffbf081e61a7 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -313,7 +313,7 @@ You cannot pipe objects to this cmdlet. This cmdlet returns objects that represent the drives in the session. ## NOTES -* This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives that are created by using the *Persist* parameter of the New-PSDrive cmdlet are specific to a user account. Mapped network drives that you create in sessions that are started with the Run as administrator option or with the credentials of another user are not visible in sessions that are started without explicit credentials or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/5.0/Microsoft.PowerShell.Management/New-PSDrive.md b/reference/5.0/Microsoft.PowerShell.Management/New-PSDrive.md index 128108975eef..c4a1cf5882e9 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/New-PSDrive.md +++ b/reference/5.0/Microsoft.PowerShell.Management/New-PSDrive.md @@ -391,7 +391,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.PSDriveInfo ## NOTES -* **New-PSDrive** is designed to work with the data exposed by any provider. To list the providers available in your session, use **Get-PSProvider**. For more information about providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* **New-PSDrive** is designed to work with the data exposed by any provider. To list the providers available in your session, use **Get-PSProvider**. For more information about providers, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives are specific to a user account. Mapped network drives that you create in sessions that are started by using the Run as administrator option or by using the credential of another user are not visible in a session that was started without explicit credentials, or by using the credentials of the current user. ## RELATED LINKS diff --git a/reference/5.0/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/5.0/Microsoft.PowerShell.Management/Remove-PSDrive.md index 052d8763b2a6..71f832d53297 100644 --- a/reference/5.0/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/5.0/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -202,7 +202,7 @@ You can pipe a drive object, such as one from the Get-PSDrive cmdlet, to the thi This cmdlet does not return any output. ## NOTES -* **Remove-PSDrive** is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* **Remove-PSDrive** is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md index f34d0e1f36c7..d67e4cdcafb0 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md @@ -255,7 +255,7 @@ To detect dynamic parameters that are available only when certain other paramete To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the *ArgumentList* parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a Windows PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of *ArgumentList*. -For information about the provider cmdlets, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For information about the provider cmdlets, see [about_Providers](About/about_Providers.md). ```yaml Type: Object[] diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md index 5dfe0c30b82b..7288c23a4907 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Help.md @@ -513,7 +513,7 @@ To see the custom cmdlet help for a provider path, go to the provider path locat You can also find custom cmdlet help online in the provider help section of the help topics. For example, you can find help for the **New-Item** cmdlet in the Wsman:\*\ClientCertificate path (http://go.microsoft.com/fwlink/?LinkID=158676). -For more information about Windows PowerShell providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For more information about Windows PowerShell providers, see [about_Providers](About/about_Providers.md). ```yaml Type: String diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md index 3c363fae179e..a60d62e83ce7 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md @@ -372,7 +372,7 @@ This cmdlet returns strings or bytes. The output type depends upon the content that it gets. ## NOTES -* This cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers(http://go.microsoft.com/fwlink/?LinkID=113250). +* This cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) * diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md index dc537a246bb8..c9c81390aa87 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -278,7 +278,7 @@ You cannot pipe objects to this cmdlet. This cmdlet returns objects that represent the drives in the session. ## NOTES -* This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the **Get-PSProvider** cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the **Get-PSProvider** cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives that are created by using the *Persist* parameter of the New-PSDrive cmdlet are specific to a user account. Mapped network drives that you create in sessions that are started with the Run as administrator option or with the credentials of another user are not visible in sessions that are started without explicit credentials or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/New-PSDrive.md b/reference/5.1/Microsoft.PowerShell.Management/New-PSDrive.md index 128108975eef..c4a1cf5882e9 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/New-PSDrive.md +++ b/reference/5.1/Microsoft.PowerShell.Management/New-PSDrive.md @@ -391,7 +391,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.PSDriveInfo ## NOTES -* **New-PSDrive** is designed to work with the data exposed by any provider. To list the providers available in your session, use **Get-PSProvider**. For more information about providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* **New-PSDrive** is designed to work with the data exposed by any provider. To list the providers available in your session, use **Get-PSProvider**. For more information about providers, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives are specific to a user account. Mapped network drives that you create in sessions that are started by using the Run as administrator option or by using the credential of another user are not visible in a session that was started without explicit credentials, or by using the credentials of the current user. ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/5.1/Microsoft.PowerShell.Management/Remove-PSDrive.md index 052d8763b2a6..71f832d53297 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -202,7 +202,7 @@ You can pipe a drive object, such as one from the Get-PSDrive cmdlet, to the thi This cmdlet does not return any output. ## NOTES -* **Remove-PSDrive** is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* **Remove-PSDrive** is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * diff --git a/reference/6/Microsoft.PowerShell.Core/Get-Command.md b/reference/6/Microsoft.PowerShell.Core/Get-Command.md index f34d0e1f36c7..d67e4cdcafb0 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-Command.md @@ -255,7 +255,7 @@ To detect dynamic parameters that are available only when certain other paramete To detect the dynamic parameters that a provider adds to a cmdlet, set the value of the *ArgumentList* parameter to a path in the provider drive, such as WSMan:, HKLM:, or Cert:. When the command is a Windows PowerShell provider cmdlet, enter only one path in each command. The provider cmdlets return only the dynamic parameters for the first path the value of *ArgumentList*. -For information about the provider cmdlets, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For information about the provider cmdlets, see [about_Providers](About/about_Providers.md). ```yaml Type: Object[] diff --git a/reference/6/Microsoft.PowerShell.Core/Get-Help.md b/reference/6/Microsoft.PowerShell.Core/Get-Help.md index a72f63506721..f6ee740efbf4 100644 --- a/reference/6/Microsoft.PowerShell.Core/Get-Help.md +++ b/reference/6/Microsoft.PowerShell.Core/Get-Help.md @@ -507,7 +507,7 @@ To see the custom cmdlet help for a provider path, go to the provider path locat You can also find custom cmdlet help online in the provider help section of the help topics. For example, you can find help for the **New-Item** cmdlet in the Wsman:\*\ClientCertificate path (http://go.microsoft.com/fwlink/?LinkID=158676). -For more information about Windows PowerShell providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For more information about Windows PowerShell providers, see [about_Providers](About/about_Providers.md). ```yaml Type: String diff --git a/reference/6/Microsoft.PowerShell.Core/help.md b/reference/6/Microsoft.PowerShell.Core/help.md index e39ef257f13b..538caecdec98 100644 --- a/reference/6/Microsoft.PowerShell.Core/help.md +++ b/reference/6/Microsoft.PowerShell.Core/help.md @@ -510,7 +510,7 @@ To see the custom cmdlet help for a provider path, go to the provider path locat You can also find custom cmdlet help online in the provider help section of the help topics. For example, you can find help for the New-Item cmdlet in the Wsman:\*\ClientCertificate path (http://go.microsoft.com/fwlink/?LinkID=158676). -For more information about Windows PowerShell providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250) in the TechNet library. +For more information about Windows PowerShell providers, see [about_Providers](About/about_Providers.md). ```yaml Type: String diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Content.md b/reference/6/Microsoft.PowerShell.Management/Get-Content.md index a1e2150bf7b4..5fae0eb88ea1 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Content.md @@ -374,7 +374,7 @@ This cmdlet returns strings or bytes. The output type depends upon the content that it gets. ## NOTES -* This cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers(http://go.microsoft.com/fwlink/?LinkID=113250). +* This cmdlet is designed to work with the data exposed by any provider. To get the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) * diff --git a/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md index 19b35c93e94a..2514c905e2c4 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -306,7 +306,7 @@ You cannot pipe objects to this cmdlet. This cmdlet returns objects that represent the drives in the session. ## NOTES -* This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the **Get-PSProvider** cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, use the **Get-PSProvider** cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives that are created by using the *Persist* parameter of the New-PSDrive cmdlet are specific to a user account. Mapped network drives that you create in sessions that are started with the Run as administrator option or with the credentials of another user are not visible in sessions that are started without explicit credentials or with the credentials of the current user. ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Management/New-PSDrive.md b/reference/6/Microsoft.PowerShell.Management/New-PSDrive.md index 619815f569eb..0dd28f558cce 100644 --- a/reference/6/Microsoft.PowerShell.Management/New-PSDrive.md +++ b/reference/6/Microsoft.PowerShell.Management/New-PSDrive.md @@ -425,7 +425,7 @@ You cannot pipe input to this cmdlet. ### System.Management.Automation.PSDriveInfo ## NOTES -* **New-PSDrive** is designed to work with the data exposed by any provider. To list the providers available in your session, use **Get-PSProvider**. For more information about providers, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* **New-PSDrive** is designed to work with the data exposed by any provider. To list the providers available in your session, use **Get-PSProvider**. For more information about providers, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). * Mapped network drives are specific to a user account. Mapped network drives that you create in sessions that are started by using the Run as administrator option or by using the credential of another user are not visible in a session that was started without explicit credentials, or by using the credentials of the current user. ## RELATED LINKS diff --git a/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md b/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md index 3b9ce5609e23..505bc609a602 100644 --- a/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md +++ b/reference/6/Microsoft.PowerShell.Management/Remove-PSDrive.md @@ -233,7 +233,7 @@ You can pipe a drive object, such as one from the Get-PSDrive cmdlet, to the thi This cmdlet does not return any output. ## NOTES -* **Remove-PSDrive** is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see about_Providers (http://go.microsoft.com/fwlink/?LinkID=113250). +* **Remove-PSDrive** is designed to work with the data exposed by any Windows PowerShell provider. To list the providers in your session, use the Get-PSProvider cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). *