From 2a3ccf3ce770bfe537328c4eaf0097ea3847e476 Mon Sep 17 00:00:00 2001 From: Matt Gucci Date: Wed, 8 Nov 2017 02:42:13 +0900 Subject: [PATCH 01/81] 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 02/81] 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 03/81] 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 04/81] 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 05/81] 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 06/81] 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 07/81] 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 08/81] 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 09/81] 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 10/81] 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 11/81] 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 12/81] 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 13/81] 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 14/81] 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 15/81] 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 16/81] 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 17/81] 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 18/81] 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 \