From dccdc1b5022af8ca37ed8bccb680ccd77f9aa86f Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 15 Jun 2026 16:11:11 -0500 Subject: [PATCH 1/3] Sync changes from PR#13059 - part 2 --- .../Protect-CmsMessage.md | 11 ++-- .../Microsoft.PowerShell.Security/Set-Acl.md | 61 +++++++++--------- .../Set-ExecutionPolicy.md | 7 ++- .../Test-FileCatalog.md | 37 +++++++---- .../Unprotect-CmsMessage.md | 4 +- .../Microsoft.PowerShell.Utility/Add-Type.md | 2 +- .../Clear-Variable.md | 12 ++-- .../ConvertFrom-Csv.md | 3 +- .../ConvertFrom-Json.md | 2 +- .../ConvertFrom-SddlString.md | 34 +++++++--- .../ConvertTo-Csv.md | 5 +- .../ConvertTo-Html.md | 9 +-- .../ConvertTo-Json.md | 4 +- .../ConvertTo-Xml.md | 4 +- .../Disable-PSBreakpoint.md | 8 ++- .../Disable-RunspaceDebug.md | 3 +- .../Enable-PSBreakpoint.md | 7 ++- .../Enable-RunspaceDebug.md | 3 +- .../Export-Alias.md | 42 ++++++------- .../Export-Clixml.md | 8 +-- .../Export-Csv.md | 18 +++--- .../Export-FormatData.md | 18 +++--- .../Export-PSSession.md | 39 ++++++++++-- .../Format-Custom.md | 6 +- .../Format-Hex.md | 3 +- .../Format-List.md | 6 +- .../Format-Wide.md | 6 +- .../Microsoft.PowerShell.Utility/Get-Alias.md | 12 ++-- .../Microsoft.PowerShell.Utility/Get-Date.md | 12 ++-- .../Get-FormatData.md | 3 +- .../Microsoft.PowerShell.Utility/Get-Host.md | 3 +- .../Get-RunspaceDebug.md | 3 +- .../Get-TraceSource.md | 3 +- .../Get-TypeData.md | 6 +- .../Get-Variable.md | 9 +-- .../Import-Alias.md | 45 +++++++++----- .../Import-Clixml.md | 4 +- .../Import-Csv.md | 8 +-- .../Measure-Object.md | 9 +-- .../Get-PfxCertificate.md | 9 ++- .../Protect-CmsMessage.md | 11 ++-- .../Microsoft.PowerShell.Security/Set-Acl.md | 62 ++++++++++--------- .../Set-ExecutionPolicy.md | 4 +- .../Test-FileCatalog.md | 37 +++++++---- .../Unprotect-CmsMessage.md | 4 +- .../Microsoft.PowerShell.Utility/Add-Type.md | 27 ++++---- .../Clear-Variable.md | 12 ++-- .../ConvertFrom-Csv.md | 4 +- .../ConvertFrom-Json.md | 12 ++-- .../ConvertFrom-Markdown.md | 7 +-- .../ConvertFrom-SddlString.md | 28 ++++++--- .../ConvertTo-Csv.md | 9 +-- .../ConvertTo-Html.md | 10 +-- .../ConvertTo-Json.md | 18 +++--- .../ConvertTo-Xml.md | 8 +-- .../Debug-Runspace.md | 3 +- .../Disable-PSBreakpoint.md | 6 +- .../Disable-RunspaceDebug.md | 4 +- .../Enable-PSBreakpoint.md | 4 +- .../Enable-RunspaceDebug.md | 3 +- .../Export-Alias.md | 38 ++++++------ .../Export-Clixml.md | 14 ++--- .../Export-Csv.md | 30 ++++----- .../Export-FormatData.md | 8 +-- .../Export-PSSession.md | 10 +-- .../Format-Custom.md | 6 +- .../Format-Hex.md | 16 ++--- .../Format-List.md | 4 +- .../Format-Table.md | 10 +-- .../Format-Wide.md | 6 +- .../Microsoft.PowerShell.Utility/Get-Alias.md | 12 ++-- .../Microsoft.PowerShell.Utility/Get-Date.md | 24 +++---- .../Microsoft.PowerShell.Utility/Get-Error.md | 4 +- .../Get-FormatData.md | 3 +- .../Microsoft.PowerShell.Utility/Get-Host.md | 3 +- .../Get-PSBreakpoint.md | 9 ++- .../Get-Random.md | 3 +- .../Get-RunspaceDebug.md | 4 +- .../Get-SecureRandom.md | 7 ++- .../Get-TraceSource.md | 3 +- .../Get-TypeData.md | 6 +- .../Get-Variable.md | 9 +-- .../Import-Alias.md | 45 +++++++++----- .../Import-Clixml.md | 4 +- .../Import-Csv.md | 9 ++- .../Measure-Object.md | 12 ++-- .../Get-PfxCertificate.md | 8 +-- .../Protect-CmsMessage.md | 11 ++-- .../Microsoft.PowerShell.Security/Set-Acl.md | 32 +++++----- .../Set-ExecutionPolicy.md | 4 +- .../Unprotect-CmsMessage.md | 4 +- .../ConvertFrom-Csv.md | 4 +- .../ConvertFrom-SddlString.md | 15 +++-- .../ConvertTo-Csv.md | 1 - .../ConvertTo-Json.md | 18 +++--- .../Export-Alias.md | 26 ++++---- .../Export-Csv.md | 14 +++-- .../Export-PSSession.md | 4 +- .../Format-Hex.md | 2 +- .../Format-List.md | 4 +- .../Format-Table.md | 10 +-- .../Format-Wide.md | 6 +- .../Get-FormatData.md | 4 +- .../Get-Random.md | 3 +- .../Get-RunspaceDebug.md | 3 +- .../Get-SecureRandom.md | 7 ++- .../Get-TraceSource.md | 3 +- .../Get-TypeData.md | 6 +- .../Get-Variable.md | 7 ++- .../Import-Alias.md | 45 +++++++++----- .../Import-Clixml.md | 4 +- .../Import-Csv.md | 9 ++- .../Measure-Object.md | 12 ++-- .../Get-PfxCertificate.md | 8 +-- .../Protect-CmsMessage.md | 11 ++-- .../Microsoft.PowerShell.Security/Set-Acl.md | 60 ++++++++++-------- .../Set-ExecutionPolicy.md | 4 +- .../Test-FileCatalog.md | 37 +++++++---- .../Unprotect-CmsMessage.md | 4 +- .../Start-ThreadJob.md | 14 +++-- .../Microsoft.PowerShell.Utility/Add-Type.md | 27 ++++---- .../Clear-Variable.md | 12 ++-- .../ConvertFrom-Csv.md | 4 +- .../ConvertFrom-Json.md | 13 ++-- .../ConvertFrom-Markdown.md | 6 +- .../ConvertFrom-SddlString.md | 28 ++++++--- .../ConvertTo-Csv.md | 9 +-- .../ConvertTo-Html.md | 10 +-- .../ConvertTo-Json.md | 18 +++--- .../ConvertTo-Xml.md | 8 +-- .../Debug-Runspace.md | 3 +- .../Disable-PSBreakpoint.md | 6 +- .../Disable-RunspaceDebug.md | 3 +- .../Enable-PSBreakpoint.md | 4 +- .../Enable-RunspaceDebug.md | 3 +- .../Export-Alias.md | 38 ++++++------ .../Export-Clixml.md | 14 ++--- .../Export-Csv.md | 53 +++++++++------- .../Export-FormatData.md | 8 +-- .../Export-PSSession.md | 10 +-- .../Format-Custom.md | 6 +- .../Format-Hex.md | 16 ++--- .../Format-Table.md | 10 +-- .../Format-Wide.md | 6 +- .../Microsoft.PowerShell.Utility/Get-Alias.md | 12 ++-- .../Microsoft.PowerShell.Utility/Get-Date.md | 24 +++---- .../Microsoft.PowerShell.Utility/Get-Error.md | 4 +- .../Get-FormatData.md | 3 +- .../Microsoft.PowerShell.Utility/Get-Host.md | 3 +- .../Get-PSBreakpoint.md | 9 ++- .../Get-Random.md | 3 +- .../Get-RunspaceDebug.md | 3 +- .../Get-SecureRandom.md | 7 ++- .../Get-TraceSource.md | 3 +- .../Get-TypeData.md | 6 +- .../Get-Variable.md | 7 ++- .../Import-Alias.md | 45 +++++++++----- .../Import-Clixml.md | 4 +- .../Import-Csv.md | 9 ++- .../Measure-Object.md | 12 ++-- .../Microsoft.PowerShell.Security/Set-Acl.md | 46 +++++++------- .../Test-FileCatalog.md | 26 ++++++-- .../Microsoft.PowerShell.Utility/Add-Type.md | 8 +-- .../Clear-Variable.md | 2 +- .../ConvertFrom-Json.md | 9 ++- .../ConvertFrom-Markdown.md | 3 +- .../ConvertFrom-SddlString.md | 25 +++++--- .../ConvertTo-Csv.md | 3 +- .../ConvertTo-Json.md | 10 ++- .../ConvertTo-Xml.md | 4 +- .../Disable-PSBreakpoint.md | 2 +- .../Export-Alias.md | 26 ++++---- .../Export-Clixml.md | 6 +- .../Export-Csv.md | 11 ++-- .../Format-Hex.md | 7 ++- 175 files changed, 1212 insertions(+), 909 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 301b101234fa..9a4ef5030368 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -17,21 +17,22 @@ Encrypts content by using the Cryptographic Message Syntax format. ### ByContent (Default) ``` -Protect-CmsMessage [-To] [-Content] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-Content] + [[-OutFile] ] [] ``` ### ByPath ``` -Protect-CmsMessage [-To] [-Path] [[-OutFile] ] [] +Protect-CmsMessage [-To] [-Path] [[-OutFile] ] + [] ``` ### ByLiteralPath ``` -Protect-CmsMessage [-To] [-LiteralPath] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-LiteralPath] + [[-OutFile] ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md index 9a45ea7c4586..0d43cde608a8 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md @@ -18,24 +18,25 @@ Changes the security descriptor of a specified item, such as a file or a registr ### ByPath (Default) ``` -Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] [-ClearCentralAccessPolicy] - [-PassThru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [-UseTransaction] [] +Set-Acl [-Path] [-AclObject] [[-CentralAccessPolicy] ] + [-ClearCentralAccessPolicy] [-PassThru] [-Filter ] [-Include ] + [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ### ByInputObject ``` -Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter ] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] +Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter ] + [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] + [] ``` ### ByLiteralPath ``` Set-Acl -LiteralPath [-AclObject] [[-CentralAccessPolicy] ] - [-ClearCentralAccessPolicy] [-PassThru] [-Filter ] [-Include ] [-Exclude ] - [-WhatIf] [-Confirm] [-UseTransaction] [] + [-ClearCentralAccessPolicy] [-PassThru] [-Filter ] [-Include ] + [-Exclude ] [-WhatIf] [-Confirm] [-UseTransaction] [] ``` ## DESCRIPTION @@ -129,20 +130,20 @@ Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl These commands disable access inheritance from parent folders, while still preserving the existing inherited access rules. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to `$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see -[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection). +[set access rule protection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A). Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the ACLs of the Dog.txt that were inherited from the Pets folder will be applied directly -to Dog.txt, and new access policies added to Pets will not change the access to Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly +to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. ### Example 5: Grant Administrators Full Control of the file @@ -154,29 +155,33 @@ $fileSystemRights = "FullControl" $type = "Allow" # Create new rule $fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type -$fileSystemAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fileSystemAccessRuleArgumentList +$newParams = @{ + TypeName = 'System.Security.AccessControl.FileSystemAccessRule' + ArgumentList = $fileSystemAccessRuleArgumentList +} +$fileSystemAccessRule = New-Object @newParams # Apply new rule $NewAcl.SetAccessRule($fileSystemAccessRule) Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ``` -This command will grant the **BUILTIN\Administrators** group Full control of the Dog.txt file. +This command will grant the **BUILTIN\Administrators** group Full control of the `Dog.txt` file. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. -Next variables are created to grant the **BUILTIN\Administrators** group full control of the Dog.txt -file. The `$identity` variable set to the name of a -[user account](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor). The +Next variables are created to grant the **BUILTIN\Administrators** group full control of the +`Dog.txt` file. The `$identity` variable set to the name of a +[user account](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A). The `$fileSystemRights` variable set to FullControl, and can be any one of the -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) values that specifies -the type of operation associated with the access rule. The `$type` variable set to "Allow" to -specifies whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable -is an argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) values that specifies the +type of operation associated with the access rule. The `$type` variable set to "Allow" to specifies +whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable is an +argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new **FileSystemAccessRule** object is created, and the **FileSystemAccessRule** object is passed to the **SetAccessRule()** method, adds the new access rule. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the **BUILTIN\Administrators** group will have full control of the Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the **BUILTIN\Administrators** group will have full control of the `Dog.txt`. ## PARAMETERS @@ -364,7 +369,7 @@ Changes the security descriptor of the specified item. Enter the path to an item 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 +**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. @@ -467,8 +472,8 @@ can use it to change the security descriptors of files, directories, and registr [Get-Acl](Get-Acl.md) -[FileSystemAccessRule](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor) +[FileSystemAccessRule](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A) -[ObjectSecurity.SetAccessRuleProtection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection) +[ObjectSecurity.SetAccessRuleProtection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A) -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) diff --git a/reference/5.1/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md b/reference/5.1/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md index ccdb1928542f..8913f001cc66 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md @@ -18,14 +18,15 @@ Sets the PowerShell execution policies for Windows computers. ### All ``` -Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] [-Force] - [-WhatIf] [-Confirm] [] +Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] + [-Force] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION The `Set-ExecutionPolicy` cmdlet changes PowerShell execution policies for Windows computers. For -more information, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). +more information, see +[about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md). An execution policy is part of the PowerShell security strategy. Execution policies determine whether you can load configuration files, such as your PowerShell profile, or run scripts. And, diff --git a/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md index e1729fe342fa..ba237db5bcef 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -19,8 +19,8 @@ This cmdlet is only supported on Windows. ## SYNTAX ``` -Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [[-Path] ] - [-WhatIf] [-Confirm] [] +Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] + [[-Path] ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -28,7 +28,7 @@ Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [[-To] ] [-IncludeC ### ByLiteralPath ``` -Unprotect-CmsMessage [-LiteralPath] [[-To] ] [-IncludeContext] - [] +Unprotect-CmsMessage [-LiteralPath] [[-To] ] + [-IncludeContext] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md b/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md index 8a5ad59a88c4..eb9ff24ae810 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md @@ -731,7 +731,7 @@ Otherwise, the command fails. The **CodeDomProvider** class for some languages, such as IronPython and J#, doesn't generate output. As a result, types written in these languages can't be used with `Add-Type`. -This cmdlet is based on the Microsoft .NET Framework [CodeDomProvider Class](/dotnet/api/system.codedom.compiler.codedomprovider). +This cmdlet is based on the Microsoft .NET Framework [CodeDomProvider Class](xref:System.CodeDom.Compiler.CodeDomProvider). ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Clear-Variable.md b/reference/5.1/Microsoft.PowerShell.Utility/Clear-Variable.md index 48614fe925d9..0a7f358990ad 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Clear-Variable.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Clear-Variable.md @@ -18,8 +18,8 @@ Deletes the value of a variable. ## SYNTAX ``` -Clear-Variable [-Name] [-Include ] [-Exclude ] [-Force] [-PassThru] - [-Scope ] [-WhatIf] [-Confirm] [] +Clear-Variable [-Name] [-Include ] [-Exclude ] [-Force] + [-PassThru] [-Scope ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -165,7 +165,8 @@ The acceptable values for this parameter are: - `Script` You can also use a number relative to the current scope (0 through the number of scopes, where 0 is -the current scope and 1 is its parent). Local is the default. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +the current scope and 1 is its parent). Local is the default. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -215,7 +216,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -236,7 +238,7 @@ the cleared variable. ## NOTES -Windows PowerShell includes the following aliases for `Clear-Variable`: +PowerShell includes the following aliases for `Clear-Variable`: - `clv` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 440cd3aaa960..5f1edb60ddf9 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -26,7 +26,8 @@ ConvertFrom-Csv [-InputObject] [[-Delimiter] ] [-Header -UseCulture [-Header ] [] +ConvertFrom-Csv [-InputObject] -UseCulture [-Header ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index f99a4fbb8cd1..6cded243bdd5 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -147,7 +147,7 @@ You can pipe a JSON string to `ConvertFrom-Json`. ## NOTES The `ConvertFrom-Json` cmdlet is implemented using the -[JavaScriptSerializer class](/dotnet/api/system.web.script.serialization.javascriptserializer). +[JavaScriptSerializer class](xref:System.Web.Script.Serialization.JavaScriptSerializer). The **PSObject** type maintains the order of the properties as presented in the JSON string. While the key-value pairs are added to the **Hashtable** in the order presented in the JSON string, diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md index 4d1a7be92321..ffc7923a0871 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md @@ -53,7 +53,7 @@ ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the -HKLM:\SOFTWARE\Microsoft\ key and saves it in the variable. +`HKLM:\SOFTWARE\Microsoft\` key and saves it in the variable. The second command uses the `ConvertFrom-SddlString` cmdlet to get the text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. @@ -64,18 +64,29 @@ It uses the `-Type` parameter to specify that SDDL string represents a registry ```powershell $acl = Get-Acl -Path HKLM:\SOFTWARE\Microsoft\ +ConvertFrom-SddlString -Sddl $acl.Sddl | + ForEach-Object {$_.DiscretionaryAcl[0]} +``` -ConvertFrom-SddlString -Sddl $acl.Sddl | ForEach-Object {$_.DiscretionaryAcl[0]} - -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +```Output +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, +FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, +TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +``` -ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | ForEach-Object {$_.DiscretionaryAcl[0]} +```powershell +ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | + ForEach-Object {$_.DiscretionaryAcl[0]} +``` -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, ReadPermissions, SetValue, TakeOwnership, WriteKey) +```Output +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, +EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, +ReadPermissions, SetValue, TakeOwnership, WriteKey) ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the -HKLM:\SOFTWARE\Microsoft\ key and saves it in the variable. +`HKLM:\SOFTWARE\Microsoft\` key and saves it in the variable. The second command uses the `ConvertFrom-SddlString` cmdlet to get the text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. @@ -92,11 +103,14 @@ $user = [adsi]"LDAP://CN=username,CN=Users,DC=domain,DC=com" ConvertFrom-SddlString $user.psbase.ObjectSecurity.Sddl -Type ActiveDirectoryRights ``` -The first command uses Active Directory Service Interfaces (ADSI) to get the user object and saves it in the variable. +The first command uses Active Directory Service Interfaces (ADSI) to get the user object and saves +it in the variable. -The second command uses the `ConvertFrom-SddlString` cmdlet to get text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. +The second command uses the `ConvertFrom-SddlString` cmdlet to get text representation of the SDDL +string, contained in the Sddl property of the object representing the security descriptor. -It uses the `-Type` parameter to specify that SDDL string represents an Active Directory security descriptor. +It uses the `-Type` parameter to specify that SDDL string represents an Active Directory security +descriptor. ## PARAMETERS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 943f69636dfa..5d80be967428 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -26,7 +26,8 @@ ConvertTo-Csv [-InputObject] [[-Delimiter] ] [-NoTypeInformatio ### UseCulture ``` -ConvertTo-Csv [-InputObject] [-UseCulture] [-NoTypeInformation] [] +ConvertTo-Csv [-InputObject] [-UseCulture] [-NoTypeInformation] + [] ``` ## DESCRIPTION @@ -147,7 +148,7 @@ Accept wildcard characters: False ### -NoTypeInformation -Removes the **#TYPE** information header from the output. This parameter became the default in +Removes the `#TYPE` information header from the output. This parameter became the default in PowerShell 6.0 and is included for backwards compatibility. ```yaml diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md index 70901fcb7c64..3c65d6637fc6 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -18,15 +18,16 @@ Converts .NET objects into HTML that can be displayed in a Web browser. ``` ConvertTo-Html [-InputObject ] [[-Property] ] [[-Body] ] - [[-Head] ] [[-Title] ] [-As ] [-CssUri ] [-PostContent ] - [-PreContent ] [] + [[-Head] ] [[-Title] ] [-As ] [-CssUri ] + [-PostContent ] [-PreContent ] [] ``` ### Fragment ``` -ConvertTo-Html [-InputObject ] [[-Property] ] [-As ] [-Fragment] - [-PostContent ] [-PreContent ] [] +ConvertTo-Html [-InputObject ] [[-Property] ] [-As ] + [-Fragment] [-PostContent ] [-PreContent ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Json.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Json.md index 6093e0916dd5..48e3990f08ba 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Json.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Json.md @@ -206,7 +206,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -223,7 +223,7 @@ This cmdlet returns a string representing the input object converted to a JSON s ## NOTES The `ConvertTo-Json` cmdlet is implemented using the -[JavaScriptSerializer class](/dotnet/api/system.web.script.serialization.javascriptserializer). +[JavaScriptSerializer class](xref:System.Web.Script.Serialization.JavaScriptSerializer). ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index 05456e82f406..c8e617fdd6b2 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -16,8 +16,8 @@ Creates an XML-based representation of an object. ## SYNTAX ``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/5.1/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index e60928f1028e..6da48e1090f5 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -20,13 +20,15 @@ Disables the breakpoints in the current console. ### Breakpoint (Default) ``` -Disable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confirm] [] +Disable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confirm] + [] ``` ### Id ``` -Disable-PSBreakpoint [-PassThru] [-Id] [-WhatIf] [-Confirm] [] +Disable-PSBreakpoint [-PassThru] [-Id] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -42,7 +44,7 @@ when you create them using the `Set-PSBreakpoint` cmdlet. A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. `Disable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts. For more information about the PowerShell debugger, see -[about_Debuggers](../microsoft.powershell.core/about/about_debuggers.md). +[about_Debuggers](../Microsoft.PowerShell.Core/About/about_Debuggers.md). ## EXAMPLES diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md b/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md index 2e57befc4dab..0bc2c360a527 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md @@ -41,7 +41,8 @@ Disable-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Disable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Disable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/5.1/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index a3803f0d2155..192d595ac59a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -20,14 +20,15 @@ Enables the breakpoints in the current console. ### Id (Default) ``` -Enable-PSBreakpoint [-PassThru] [-Id] [-WhatIf] [-Confirm] [] +Enable-PSBreakpoint [-PassThru] [-Id] [-WhatIf] [-Confirm] + [] ``` ### Breakpoint ``` -Enable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confirm] - [] +Enable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md b/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md index 330b736b74cf..96b6b3ddb102 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md @@ -41,7 +41,8 @@ Enable-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Enable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Enable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md index ebf255ddcdbc..5b831ab6dacd 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Alias.md @@ -20,17 +20,17 @@ Exports information about currently defined aliases to a file. ### ByPath (Default) ``` -Export-Alias [-Path] [[-Name] ] [-PassThru] [-As ] [-Append] - [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] [-Confirm] - [] +Export-Alias [-Path] [[-Name] ] [-PassThru] [-As ] + [-Append] [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] + [-Confirm] [] ``` ### ByLiteralPath ``` -Export-Alias -LiteralPath [[-Name] ] [-PassThru] [-As ] - [-Append] [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] [-Confirm] - [] +Export-Alias -LiteralPath [[-Name] ] [-PassThru] + [-As ] [-Append] [-Force] [-NoClobber] [-Description ] + [-Scope ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -47,52 +47,52 @@ profile. ### Example 1: Export an alias ```powershell -Export-Alias -Path "alias.csv" +Export-Alias -Path Alias.csv ``` -This command exports current alias information to a file named Alias.csv in the current directory. +This command exports current alias information to a file named `Alias.csv` in the current directory. ### Example 2: Export an alias unless the export file already exists ```powershell -Export-Alias -Path "alias.csv" -NoClobber +Export-Alias -Path Alias.csv -NoClobber ``` -This command exports the aliases in the current session to an Alias.csv file. +This command exports the aliases in the current session to an `Alias.csv` file. -Because the **NoClobber** parameter is specified, the command will fail if an Alias.csv file already +Because the **NoClobber** parameter is specified, the command will fail if an `Alias.csv` file already exists in the current directory. ### Example 3: Append aliases to a file ```powershell -Export-Alias -Path "alias.csv" -Append -Description "Appended Aliases" -Force +Export-Alias -Path Alias.csv -Append -Description "Appended Aliases" -Force ``` -This command appends the aliases in the current session to the Alias.csv file. +This command appends the aliases in the current session to the `Alias.csv` file. The command uses the **Description** parameter to add a description to the comments at the top of the file. -The command also uses the **Force** parameter to overwrite any existing Alias.csv files, even if +The command also uses the **Force** parameter to overwrite any existing `Alias.csv` files, even if they have the read-only attribute. ### Example 4: Export aliases as a script ```powershell -Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) +Export-Alias -Path Alias.ps1 -As Script +Add-Content -Path $PROFILE -Value (Get-Content Alias.ps1) $S = New-PSSession -ComputerName Server01 -Invoke-Command -Session $S -FilePath .\alias.ps1 +Invoke-Command -Session $S -FilePath .\Alias.ps1 ``` This example shows how to use the script file format that `Export-Alias` generates. -The first command exports the aliases in the session to the Alias.ps1 file. It uses the **As** +The first command exports the aliases in the session to the `Alias.ps1` file. It uses the **As** parameter with a value of Script to generate a file that contains a Set-Alias command for each alias. -The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. +The second command adds the aliases in the `Alias.ps1` file to the CurrentUser-CurrentHost profile. The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see @@ -196,7 +196,7 @@ to interpret any characters as escape sequences. ```yaml Type: System.String Parameter Sets: ByLiteralPath -Aliases: PSPath +Aliases: PSPath, LP Required: True Position: Named @@ -365,7 +365,7 @@ the alias. ## NOTES -Windows PowerShell includes the following aliases for `Export-Alias`: +PowerShell includes the following aliases for `Export-Alias`: - `epal` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md index 125d17dd3732..a2d57de0af15 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -18,15 +18,15 @@ Creates an XML-based representation of an object or objects and stores it in a f ### ByPath (Default) ``` -Export-Clixml [-Path] -InputObject [-Depth ] [-Force] [-NoClobber] - [-Encoding ] [-WhatIf] [-Confirm] [] +Export-Clixml [-Path] -InputObject [-Depth ] [-Force] + [-NoClobber] [-Encoding ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath ``` -Export-Clixml -LiteralPath -InputObject [-Depth ] [-Force] [-NoClobber] - [-Encoding ] [-WhatIf] [-Confirm] [] +Export-Clixml -LiteralPath -InputObject [-Depth ] [-Force] + [-NoClobber] [-Encoding ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md index 29cdca820654..6748a978cb97 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-Csv.md @@ -22,17 +22,17 @@ file. ### Delimiter (Default) ``` -Export-Csv [[-Path] ] [[-Delimiter] ] -InputObject [-LiteralPath ] - [-Force] [-NoClobber] [-Encoding ] [-Append] [-NoTypeInformation] [-WhatIf] [-Confirm] - [] +Export-Csv [[-Path] ] [[-Delimiter] ] -InputObject + [-LiteralPath ] [-Force] [-NoClobber] [-Encoding ] [-Append] + [-NoTypeInformation] [-WhatIf] [-Confirm] [] ``` ### UseCulture ``` -Export-Csv [[-Path] ] -InputObject [-LiteralPath ] [-Force] [-NoClobber] - [-Encoding ] [-Append] [-UseCulture] [-NoTypeInformation] [-WhatIf] [-Confirm] - [] +Export-Csv [[-Path] ] -InputObject [-LiteralPath ] [-Force] + [-NoClobber] [-Encoding ] [-Append] [-UseCulture] [-NoTypeInformation] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -178,13 +178,13 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = Get-Service -DisplayName *Application* | +$AppService = Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = Get-Service -DisplayName *Windows* | +$WinService = Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append @@ -226,7 +226,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\DateTime.csv -NoTypeInformation - + Get-Content -Path .\DateTime.csv ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-FormatData.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-FormatData.md index bfca8c8976ac..0d083107644a 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-FormatData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-FormatData.md @@ -17,26 +17,26 @@ Saves formatting data from the current session in a formatting file. ### ByPath (Default) ``` -Export-FormatData -InputObject -Path [-Force] [-NoClobber] - [-IncludeScriptBlock] [] +Export-FormatData -InputObject -Path [-Force] + [-NoClobber] [-IncludeScriptBlock] [] ``` ### ByLiteralPath ``` -Export-FormatData -InputObject -LiteralPath [-Force] [-NoClobber] - [-IncludeScriptBlock] [] +Export-FormatData -InputObject -LiteralPath [-Force] + [-NoClobber] [-IncludeScriptBlock] [] ``` ## DESCRIPTION -The `Export-FormatData` cmdlet creates Windows PowerShell formatting files (`format.ps1xml`) from -the formatting objects in the current session. It takes the **ExtendedTypeDefinition** objects that +The `Export-FormatData` cmdlet creates PowerShell formatting files (`format.ps1xml`) from the +formatting objects in the current session. It takes the **ExtendedTypeDefinition** objects that `Get-FormatData` returns and saves them in a file in XML format. -Windows PowerShell uses the data in formatting files (`format.ps1xml`) to generate the default -display of Microsoft .NET Framework objects in the session. You can view and edit the formatting -files and use the Update-FormatData cmdlet to add the formatting data to a session. +PowerShell uses the data in formatting files (`format.ps1xml`) to generate the default display of +Microsoft .NET Framework objects in the session. You can view and edit the formatting files and +use the Update-FormatData cmdlet to add the formatting data to a session. For more information about formatting files in PowerShell, see [about_Format.ps1xml](../Microsoft.PowerShell.Core/About/about_Format.ps1xml.md). diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md index c7a3532417e4..7bb34edcefba 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -68,8 +68,23 @@ formatting data into the Server01 module. This example exports all of the `Get` and `Set` commands from a server. ```powershell -$S = New-PSSession -ConnectionUri https://exchange.microsoft.com/mailbox -Credential exchangeadmin01@hotmail.com -Authentication Negotiate -Export-PSSession -Session $S -Module exch* -CommandName Get-*, Set-* -FormatTypeName * -OutputModule $PSHOME\Modules\Exchange -Encoding ascii +$newSession = @{ + ConnectionUri = 'https://exchange.microsoft.com/mailbox' + Credential = 'exchangeadmin01@hotmail.com' + Authentication = 'Negotiate' +} +$S = New-PSSession @newSession + +$exportSession = @{ + Session = $S + Module = 'exch*' + CommandName = 'Get-*', 'Set-*' + FormatTypeName = '*' + OutputModule = "$PSHOME\Modules\Exchange" + Encoding = 'ascii' +} + +Export-PSSession @exportSession ``` These commands export the `Get` and `Set` commands from a Microsoft Exchange Server snap-in on a @@ -84,8 +99,21 @@ the local computer. The cmdlets from the module are added to the current session be used. ```powershell -$S = New-PSSession -ComputerName Server01 -Credential Server01\User01 -Export-PSSession -Session $S -OutputModule TestCmdlets -Type Cmdlet -CommandName *test* -FormatTypeName * +$newSession = @{ + ComputerName = 'Server01' + Credential = 'Server01\User01' +} +$S = New-PSSession @newSession + +$exportSession = @{ + Session = $S + OutputModule = 'TestCmdlets' + Type = 'Cmdlet' + CommandName = '*test*' + FormatTypeName = '*' +} +Export-PSSession @exportSession + Remove-PSSession $S Import-Module TestCmdlets Get-Help Test* @@ -263,7 +291,8 @@ The acceptable values for this parameter are as follows: (`$Env:PATH`). - `Filter` and `Function`: All PowerShell functions. - `Script` Script files accessible in the current session. -- `Workflow` A PowerShell workflow. For more information, see [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). +- `Workflow` A PowerShell workflow. For more information, see + [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). These values are defined as a flag-based enumeration. You can combine multiple values together to set multiple flags using this parameter. The values can be passed to the **CommandType** parameter diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md index c9e0bf97e42a..c93e0c1f9f16 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Custom.md @@ -17,9 +17,9 @@ Uses a customized view to format the output. ## SYNTAX ``` -Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md index 8f59e4bbf2b3..823ed3524c02 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Hex.md @@ -33,7 +33,8 @@ Format-Hex -LiteralPath [] ### ByInputObject ``` -Format-Hex -InputObject [-Encoding ] [-Raw] [] +Format-Hex -InputObject [-Encoding ] [-Raw] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md index 32437f1eb754..2089f7d95ed9 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-List.md @@ -17,9 +17,9 @@ Formats the output as a list of properties in which each property appears on a n ## SYNTAX ``` -Format-List [[-Property] ] [-GroupBy ] [-View ] [-ShowError] - [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-List [[-Property] ] [-GroupBy ] [-View ] + [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md index be4d57767783..f9ef96e53332 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Format-Wide.md @@ -17,9 +17,9 @@ Formats objects as a wide table that displays only one property of each object. ## SYNTAX ``` -Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md index 6962d479e50d..94a93258777b 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Alias.md @@ -20,13 +20,15 @@ Gets the aliases for the current session. ### Default (Default) ``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition ``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -182,7 +184,8 @@ are: - A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) -`Local` is the default. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +`Local` is the default. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -200,7 +203,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md index 9ca2132c9729..d49ea4ac30d0 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Date.md @@ -18,17 +18,17 @@ Gets the current date and time. ### net (Default) ``` -Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - [-Format ] [] +Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] [-Format ] [] ``` ### UFormat ``` -Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - [-UFormat ] [] +Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] [-UFormat ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md index a63782e20385..598a0b6f2840 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -16,7 +16,8 @@ Gets the formatting data in the current session. ## SYNTAX ``` -Get-FormatData [[-TypeName] ] [-PowerShellVersion ] [] +Get-FormatData [[-TypeName] ] [-PowerShellVersion ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md index 8a49d29cacc1..c8f11471abea 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Host.md @@ -255,7 +255,8 @@ in the same way. Similarly, the `$PSCulture` and `$PSUICulture` automatic variab objects that the CurrentCulture and CurrentUICulture properties of the host object contain. You can use these features interchangeably. -For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). +For more information, see +[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ## RELATED LINKS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index 23f33a2b4340..d6e428ea0a54 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -41,7 +41,8 @@ Get-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-TraceSource.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-TraceSource.md index b52969ed0f82..adece32cb705 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-TraceSource.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-TraceSource.md @@ -69,7 +69,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-TypeData.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-TypeData.md index ea821162b01e..56c7946f4de5 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-TypeData.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-TypeData.md @@ -99,9 +99,9 @@ else { The command uses the `Get-TypeData` cmdlet to get the extended type data for the **System.DataTime** type. The command gets the **Members** property of the **TypeData** object. -The **Members** property contains a hash table of properties and methods that are defined by extended -type data. Each key in the Members hash table is a property or method name and each value is the -definition of the property or method value. +The **Members** property contains a hash table of properties and methods that are defined by +extended type data. Each key in the Members hash table is a property or method name and each value +is the definition of the property or method value. The command gets the **DateTime** key in **Members** and its **GetScriptBlock** property value. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Get-Variable.md b/reference/5.1/Microsoft.PowerShell.Utility/Get-Variable.md index 7b891f692e9b..f5a3368c3de2 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Get-Variable.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Get-Variable.md @@ -18,8 +18,8 @@ Gets the variables in the current console. ## SYNTAX ``` -Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] [-Scope ] - [] +Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] + [-Scope ] [] ``` ## DESCRIPTION @@ -168,7 +168,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -180,7 +181,7 @@ You can pipe a string that contains the variable name to this cmdlet. ### System.Management.Automation.PSVariable -By default, this cmdlet returns a **AutomationPSVariable** object for each variable that it gets. +By default, this cmdlet returns an **AutomationPSVariable** object for each variable that it gets. The object type depends on the variable. ### System.Object[] diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Alias.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Alias.md index e5126c5c94dd..3aeda8a03d74 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Alias.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Alias.md @@ -20,22 +20,24 @@ Imports an alias list from a file. ### ByPath (Default) ``` -Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] [] +Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] + [] ``` ### ByLiteralPath ``` -Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] - [] +Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION The `Import-Alias` cmdlet imports an alias list from a file. -Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite existing aliases by default. -To overwrite an existing alias, after assuring that the contents of the alias file is safe, use the **Force** parameter. +Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite +existing aliases by default. To overwrite an existing alias, after assuring that the contents of the +alias file is safe, use the **Force** parameter. ## EXAMPLES @@ -47,16 +49,22 @@ Import-Alias test.txt This command imports alias information from a file named test.txt. +### Example 2: Get a list of defined aliases and their options + +Use the following command to display information about the currently-defined aliases: + +```powershell +Get-Alias | Select-Object Name, Options +``` + +If the corresponding alias is read-only, it will be displayed in the value of the **Options** +property. + ## PARAMETERS ### -Force Allows the cmdlet to import an alias that is already defined or is read only. -You can use the following command to display information about the currently-defined aliases: - -`Get-Alias | Select-Object Name, Options` - -If the corresponding alias is read-only, it will be displayed in the value of the **Options** property. ```yaml Type: System.Management.Automation.SwitchParameter @@ -72,11 +80,10 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to a file that includes exported alias information. -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 PowerShell not to interpret any characters as escape sequences. +Specifies the path to a file that includes exported alias information. 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 PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String @@ -132,7 +139,8 @@ The acceptable values for this parameter are: - Global - Local - Script -- A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) +- A number relative to the current scope (0 through the number of scopes, where 0 is the current + scope and 1 is its parent) The default is Local. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). @@ -184,7 +192,10 @@ 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](https://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](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md index 6a8c3d546976..0be1cf133fe3 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -25,8 +25,8 @@ Import-Clixml [-Path] [-IncludeTotalCount] [-Skip ] [-First < ### ByLiteralPath ``` -Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] [-First ] - [] +Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] + [-First ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md index 55dfdfaf5ac7..c165d15edd77 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-Csv.md @@ -21,15 +21,15 @@ Creates table-like custom objects from the items in a character-separated value ### Delimiter (Default) ``` -Import-Csv [[-Path] ] [[-Delimiter] ] [-LiteralPath ] [-Header ] - [-Encoding ] [] +Import-Csv [[-Path] ] [[-Delimiter] ] [-LiteralPath ] + [-Header ] [-Encoding ] [] ``` ### UseCulture ``` -Import-Csv [[-Path] ] -UseCulture [-LiteralPath ] [-Header ] - [-Encoding ] [] +Import-Csv [[-Path] ] -UseCulture [-LiteralPath ] + [-Header ] [-Encoding ] [] ``` ## DESCRIPTION diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Measure-Object.md b/reference/5.1/Microsoft.PowerShell.Utility/Measure-Object.md index 2e2b57c977ce..1e1d5516c8f8 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Measure-Object.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Measure-Object.md @@ -217,7 +217,7 @@ Accept wildcard characters: False Indicates that the cmdlet counts the number of characters in the input objects. > [!NOTE] -> The **Word**, **Char** and **Line** switches count *inside* each input object, as well as *across* +> The **Word**, **Char** and **Line** switches count _inside_ each input object, as well as _across_ > input objects. See Example 7. ```yaml @@ -277,7 +277,7 @@ Accept wildcard characters: False Indicates that the cmdlet counts the number of lines in the input objects. > [!NOTE] -> The **Word**, **Char** and **Line** switches count *inside* each input object, as well as *across* +> The **Word**, **Char** and **Line** switches count _inside_ each input object, as well as _across_ > input objects. See Example 7. ```yaml @@ -362,7 +362,7 @@ Accept wildcard characters: False Indicates that the cmdlet counts the number of words in the input objects. > [!NOTE] -> The **Word**, **Char** and **Line** switches count *inside* each input object, as well as *across* +> The **Word**, **Char** and **Line** switches count _inside_ each input object, as well as _across_ > input objects. See Example 7. ```yaml @@ -381,7 +381,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Security/Get-PfxCertificate.md b/reference/7.4/Microsoft.PowerShell.Security/Get-PfxCertificate.md index 796d6e7338db..0cc561c73f84 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Get-PfxCertificate.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Get-PfxCertificate.md @@ -17,15 +17,15 @@ Gets information about PFX certificate files on the computer. ### ByPath (Default) ``` -Get-PfxCertificate [-FilePath] [-Password ] [-NoPromptForPassword] - [] +Get-PfxCertificate [-FilePath] [-Password ] + [-NoPromptForPassword] [] ``` ### ByLiteralPath ``` -Get-PfxCertificate -LiteralPath [-Password ] [-NoPromptForPassword] - [] +Get-PfxCertificate -LiteralPath [-Password ] + [-NoPromptForPassword] [] ``` ## DESCRIPTION @@ -169,4 +169,3 @@ certificate file is not password protected, the value of the **Authentication** [Get-AuthenticodeSignature](Get-AuthenticodeSignature.md) [Set-AuthenticodeSignature](Set-AuthenticodeSignature.md) - diff --git a/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md index afe9398310f8..e504e19947b6 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -17,21 +17,22 @@ Encrypts content by using the Cryptographic Message Syntax format. ### ByContent (Default) ``` -Protect-CmsMessage [-To] [-Content] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-Content] + [[-OutFile] ] [] ``` ### ByPath ``` -Protect-CmsMessage [-To] [-Path] [[-OutFile] ] [] +Protect-CmsMessage [-To] [-Path] [[-OutFile] ] + [] ``` ### ByLiteralPath ``` -Protect-CmsMessage [-To] [-LiteralPath] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-LiteralPath] + [[-OutFile] ] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md index e40a99d123a1..ed40bc36f4d3 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Set-Acl.md @@ -18,22 +18,24 @@ Changes the security descriptor of a specified item, such as a file or a registr ### ByPath (Default) ``` -Set-Acl [-Path] [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] [-Filter ] - [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] +Set-Acl [-Path] [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] + [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] + [] ``` ### ByInputObject ``` -Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter ] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter ] + [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath ``` -Set-Acl -LiteralPath [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] - [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] +Set-Acl -LiteralPath [-AclObject] [-ClearCentralAccessPolicy] + [-PassThru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -129,20 +131,20 @@ Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl These commands disable access inheritance from parent folders, while still preserving the existing inherited access rules. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to `$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see -[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection). +[set access rule protection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A). Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the ACLs of the Dog.txt that were inherited from the Pets folder will be applied directly -to Dog.txt, and new access policies added to Pets will not change the access to Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly +to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. ### Example 5: Grant Administrators Full Control of the file @@ -154,29 +156,33 @@ $fileSystemRights = "FullControl" $type = "Allow" # Create new rule $fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type -$fileSystemAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fileSystemAccessRuleArgumentList +$newParams = @{ + TypeName = 'System.Security.AccessControl.FileSystemAccessRule' + ArgumentList = $fileSystemAccessRuleArgumentList +} +$fileSystemAccessRule = New-Object @newParams # Apply new rule $NewAcl.SetAccessRule($fileSystemAccessRule) Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ``` -This command will grant the **BUILTIN\Administrators** group Full control of the Dog.txt file. +This command will grant the **BUILTIN\Administrators** group Full control of the `Dog.txt` file. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. -Next variables are created to grant the **BUILTIN\Administrators** group full control of the Dog.txt -file. The `$identity` variable set to the name of a -[user account](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor). The +Next variables are created to grant the **BUILTIN\Administrators** group full control of the +`Dog.txt` file. The `$identity` variable set to the name of a +[user account](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A). The `$fileSystemRights` variable set to FullControl, and can be any one of the -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) values that specifies -the type of operation associated with the access rule. The `$type` variable set to "Allow" to -specifies whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable -is an argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) values that specifies the +type of operation associated with the access rule. The `$type` variable set to "Allow" to specifies +whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable is an +argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new **FileSystemAccessRule** object is created, and the **FileSystemAccessRule** object is passed to the **SetAccessRule()** method, adds the new access rule. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the **BUILTIN\Administrators** group will have full control of the Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the **BUILTIN\Administrators** group will have full control of the `Dog.txt`. ## PARAMETERS @@ -213,7 +219,7 @@ This parameter was introduced in Windows PowerShell 3.0. ```yaml Type: System.Management.Automation.SwitchParameter Parameter Sets: ByPath, ByLiteralPath -Aliases: +Aliases: PSPath, LP Required: False Position: Named @@ -341,7 +347,7 @@ Changes the security descriptor of the specified item. Enter the path to an item 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 +**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. @@ -428,8 +434,8 @@ can use it to change the security descriptors of files, directories, and registr [Get-Acl](Get-Acl.md) -[FileSystemAccessRule](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor) +[FileSystemAccessRule](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A) -[ObjectSecurity.SetAccessRuleProtection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection) +[ObjectSecurity.SetAccessRuleProtection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A) -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) diff --git a/reference/7.4/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md b/reference/7.4/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md index 4a9295aa98a1..250a7bae5638 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md @@ -18,8 +18,8 @@ Sets the PowerShell execution policies for Windows computers. ### All ``` -Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] [-Force] - [-WhatIf] [-Confirm] [] +Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] + [-Force] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md index ae270c4d906d..5b8d2152c1d6 100644 --- a/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/7.4/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -19,8 +19,8 @@ This cmdlet is only supported on Windows. ## SYNTAX ``` -Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [[-Path] ] - [-WhatIf] [-Confirm] [] +Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] + [[-Path] ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -30,7 +30,7 @@ Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [[-To] ] [-IncludeC ### ByLiteralPath ``` -Unprotect-CmsMessage [-LiteralPath] [[-To] ] [-IncludeContext] - [] +Unprotect-CmsMessage [-LiteralPath] [[-To] ] + [-IncludeContext] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md b/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md index 3ed96b08c374..7d7a1da13ca6 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Add-Type.md @@ -18,8 +18,9 @@ Adds a Microsoft .NET class to a PowerShell session. ### FromSource (Default) ``` -Add-Type [-TypeDefinition] [-Language ] [-ReferencedAssemblies ] - [-OutputAssembly ] [-OutputType ] [-PassThru] [-IgnoreWarnings] +Add-Type [-TypeDefinition] [-Language ] + [-ReferencedAssemblies ] [-OutputAssembly ] + [-OutputType ] [-PassThru] [-IgnoreWarnings] [-CompilerOptions ] [] ``` @@ -28,24 +29,24 @@ Add-Type [-TypeDefinition] [-Language ] [-ReferencedAssemblie ``` Add-Type [-Name] [-MemberDefinition] [-Namespace ] [-UsingNamespace ] [-Language ] [-ReferencedAssemblies ] - [-OutputAssembly ] [-OutputType ] [-PassThru] [-IgnoreWarnings] - [-CompilerOptions ] [] + [-OutputAssembly ] [-OutputType ] [-PassThru] + [-IgnoreWarnings] [-CompilerOptions ] [] ``` ### FromPath ``` Add-Type [-Path] [-ReferencedAssemblies ] [-OutputAssembly ] - [-OutputType ] [-PassThru] [-IgnoreWarnings] [-CompilerOptions ] - [] + [-OutputType ] [-PassThru] [-IgnoreWarnings] + [-CompilerOptions ] [] ``` ### FromLiteralPath ``` -Add-Type -LiteralPath [-ReferencedAssemblies ] [-OutputAssembly ] - [-OutputType ] [-PassThru] [-IgnoreWarnings] [-CompilerOptions ] - [] +Add-Type -LiteralPath [-ReferencedAssemblies ] + [-OutputAssembly ] [-OutputType ] [-PassThru] + [-IgnoreWarnings] [-CompilerOptions ] [] ``` ### FromAssemblyName @@ -451,7 +452,7 @@ Accept wildcard characters: True Specifies the output type of the output assembly. By default, no output type is specified. This parameter is valid only when an output assembly is specified in the command. For more information about the values, see -[OutputAssemblyType Enumeration](/dotnet/api/microsoft.powershell.commands.outputassemblytype). +[OutputAssemblyType Enumeration](xref:Microsoft.PowerShell.Commands.OutputAssemblyType). The acceptable values for this parameter are as follows: @@ -541,7 +542,7 @@ Accept wildcard characters: False Specifies the source code that contains the type definitions. Enter the source code in a string or here-string, or enter a variable that contains the source code. For more information about -here-strings, see [about_Quoting_Rules](../Microsoft.PowerShell.Core/about/about_Quoting_Rules.md). +here-strings, see [about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). Include a namespace declaration in your type definition. If you omit the namespace declaration, your type might have the same name as another type or the shortcut for another type, causing an @@ -628,7 +629,7 @@ arbitrary path requires `Add-Type`, since those assemblies can't be loaded autom ## RELATED LINKS -[about_Profiles](../Microsoft.PowerShell.Core/About/about_profiles.md) +[about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md) [about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md) @@ -636,7 +637,7 @@ arbitrary path requires `Add-Type`, since those assemblies can't be loaded autom [New-Object](New-Object.md) -[OutputAssemblyType](/dotnet/api/microsoft.powershell.commands.outputassemblytype) +[OutputAssemblyType](xref:Microsoft.PowerShell.Commands.OutputAssemblyType) [Platform Invoke (P/Invoke)](/dotnet/standard/native-interop/pinvoke) diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Clear-Variable.md b/reference/7.4/Microsoft.PowerShell.Utility/Clear-Variable.md index 08996af36508..bfc0b51cf21e 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Clear-Variable.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Clear-Variable.md @@ -18,8 +18,8 @@ Deletes the value of a variable. ## SYNTAX ``` -Clear-Variable [-Name] [-Include ] [-Exclude ] [-Force] [-PassThru] - [-Scope ] [-WhatIf] [-Confirm] [] +Clear-Variable [-Name] [-Include ] [-Exclude ] [-Force] + [-PassThru] [-Scope ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -41,7 +41,7 @@ This command removes the value of global variables that have names that begin wi ### Example 2: Clear a variable in a child scope but not the parent scope ```powershell -$a=3 +$a = 3 &{ Clear-Variable a } $a ``` @@ -165,7 +165,8 @@ The acceptable values for this parameter are: - `Script` You can also use a number relative to the current scope (0 through the number of scopes, where 0 is -the current scope and 1 is its parent). Local is the default. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +the current scope and 1 is its parent). Local is the default. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -215,7 +216,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 7032af9335ce..1f7d49329a9a 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -10,7 +10,6 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS - Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -26,7 +25,8 @@ ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header [-Header ] [] +ConvertFrom-Csv -UseCulture [-InputObject] [-Header ] + [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index 506a4577598f..97a56d73954e 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -16,7 +16,8 @@ Converts a JSON-formatted string to a custom object or a hash table. ## SYNTAX ``` -ConvertFrom-Json [-InputObject] [-AsHashtable] [-Depth ] [-NoEnumerate] [] +ConvertFrom-Json [-InputObject] [-AsHashtable] [-Depth ] [-NoEnumerate] + [] ``` ## DESCRIPTION @@ -84,7 +85,8 @@ that can be managed in PowerShell. ```powershell # Ensures that Invoke-WebRequest uses TLS 1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -$j = Invoke-WebRequest 'https://api.github.com/repos/PowerShell/PowerShell/issues' | ConvertFrom-Json +$j = Invoke-WebRequest 'https://api.github.com/repos/PowerShell/PowerShell/issues' | + ConvertFrom-Json ``` You can also use the `Invoke-RestMethod` cmdlet, which automatically converts JSON content to @@ -121,8 +123,10 @@ This command shows an example where the `-NoEnumerate` switch is used to round-t JSON array. ```powershell -Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | ConvertTo-Json -Compress)" -Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | ConvertTo-Json -Compress)" +Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | + ConvertTo-Json -Compress)" +Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | + ConvertTo-Json -Compress)" ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md index 3769926562bc..6a8e200e9d84 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md @@ -11,8 +11,7 @@ title: ConvertFrom-Markdown # ConvertFrom-Markdown ## SYNOPSIS -Convert the contents of a string or a file to a **MarkdownInfo** -object. +Convert the contents of a string or a file to a **MarkdownInfo** object. ## SYNTAX @@ -161,7 +160,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -178,4 +178,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Markdown Parser](https://github.com/lunet-io/markdig) [ANSI escape code](https://wikipedia.org/wiki/ANSI_escape_code) - diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md index 639d59620f6e..b86ae2c3ed83 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md @@ -18,7 +18,8 @@ Converts a SDDL string to a custom object. ### All ``` -ConvertFrom-SddlString [-Sddl] [-Type ] [] +ConvertFrom-SddlString [-Sddl] [-Type ] + [] ``` ## DESCRIPTION @@ -57,7 +58,7 @@ ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the -HKLM:\SOFTWARE\Microsoft\ key and saves it in the variable. +`HKLM:\SOFTWARE\Microsoft\` key and saves it in the variable. The second command uses the `ConvertFrom-SddlString` cmdlet to get the text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. @@ -68,18 +69,29 @@ It uses the `-Type` parameter to specify that SDDL string represents a registry ```powershell $acl = Get-Acl -Path HKLM:\SOFTWARE\Microsoft\ +ConvertFrom-SddlString -Sddl $acl.Sddl | + ForEach-Object {$_.DiscretionaryAcl[0]} +``` -ConvertFrom-SddlString -Sddl $acl.Sddl | ForEach-Object {$_.DiscretionaryAcl[0]} - -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +```Output +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, +FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, +TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +``` -ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | ForEach-Object {$_.DiscretionaryAcl[0]} +```powershell +ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | + ForEach-Object {$_.DiscretionaryAcl[0]} +``` -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, ReadPermissions, SetValue, TakeOwnership, WriteKey) +```Output +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, +EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, +ReadPermissions, SetValue, TakeOwnership, WriteKey) ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the -HKLM:\SOFTWARE\Microsoft\ key and saves it in the variable. +`HKLM:\SOFTWARE\Microsoft\` key and saves it in the variable. The second command uses the `ConvertFrom-SddlString` cmdlet to get the text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 08c91d2de45a..695e5ea6cfc1 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -11,7 +11,6 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS - Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -27,8 +26,9 @@ ConvertTo-Csv [-InputObject] [[-Delimiter] ] [-IncludeTypeInfor ### UseCulture ``` -ConvertTo-Csv [-InputObject] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation] - [-QuoteFields ] [-UseQuotes ] [-NoHeader] [] +ConvertTo-Csv [-InputObject] [-UseCulture] [-IncludeTypeInformation] + [-NoTypeInformation] [-QuoteFields ] [-UseQuotes ] [-NoHeader] + [] ``` ## DESCRIPTION @@ -90,7 +90,8 @@ This example converts the Windows event log for PowerShell to a series of CSV st ```powershell (Get-Culture).TextInfo.ListSeparator -Get-WinEvent -LogName 'PowerShellCore/Operational' | ConvertTo-Csv -UseCulture -NoTypeInformation +Get-WinEvent -LogName 'PowerShellCore/Operational' | + ConvertTo-Csv -UseCulture -NoTypeInformation ``` ```Output diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Html.md index 98f808d24710..b8f959aad317 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -18,16 +18,16 @@ Converts .NET objects into HTML that can be displayed in a Web browser. ``` ConvertTo-Html [-InputObject ] [[-Property] ] [[-Body] ] - [[-Head] ] [[-Title] ] [-As ] [-CssUri ] [-PostContent ] - [-PreContent ] [-Meta ] [-Charset ] [-Transitional] - [] + [[-Head] ] [[-Title] ] [-As ] [-CssUri ] + [-PostContent ] [-PreContent ] [-Meta ] + [-Charset ] [-Transitional] [] ``` ### Fragment ``` -ConvertTo-Html [-InputObject ] [[-Property] ] [-As ] [-Fragment] - [-PostContent ] [-PreContent ] [] +ConvertTo-Html [-InputObject ] [[-Property] ] [-As ] + [-Fragment] [-PostContent ] [-PreContent ] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Json.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Json.md index 769dc423c26d..dd3de392d953 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Json.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Json.md @@ -31,14 +31,14 @@ property values, and the methods are removed. > As of PowerShell 7.2, Extended Type System properties of **DateTime** and **String** objects are > no longer serialized and only the simple object is converted to JSON format -You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON object, -which is easily managed in PowerShell. +You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON +object, which is easily managed in PowerShell. Many web sites use JSON instead of XML to serialize data for communication between servers and web-based apps. -As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds the -depth specified for the command. This prevents unwanted data loss when converting objects. +As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds +the depth specified for the command. This prevents unwanted data loss when converting objects. As of PowerShell 7.5, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON numbers. @@ -207,8 +207,8 @@ Accept wildcard characters: False ### -Depth Specifies how many levels of contained objects are included in the JSON representation. The value -can be any number from `0` to `100`. The default value is `2`. `ConvertTo-Json` emits a warning if -the number of levels in an input object exceeds this number. +can be any number from `0` to `100`. The default value is `2`. `ConvertTo-Json` emits a +warning if the number of levels in an input object exceeds this number. ```yaml Type: System.Int32 @@ -246,9 +246,9 @@ characters (like newline) are escaped. Acceptable values are: -- `Default` - Only control characters are escaped. -- `EscapeNonAscii` - All non-ASCII and control characters are escaped. -- `EscapeHtml` - HTML (`<`, `>`, `&`, `'`, `"`) and control characters are escaped. +- Default - Only control characters are escaped. +- EscapeNonAscii - All non-ASCII and control characters are escaped. +- EscapeHtml - HTML (`<`, `>`, `&`, `'`, `"`) and control characters are escaped. This parameter was introduced in PowerShell 6.2. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index d9795836b619..6d8c7505ff12 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -16,8 +16,8 @@ Creates an XML-based representation of an object. ## SYNTAX ``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION @@ -30,10 +30,10 @@ When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** par multiple objects, `ConvertTo-Xml` returns a single, in-memory XML document that includes representations of all the objects. -This cmdlet is similar to [Export-Clixml](./Export-Clixml.md) except that `Export-Clixml` stores the +This cmdlet is similar to [Export-Clixml](Export-Clixml.md) except that `Export-Clixml` stores the resulting XML in a [Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/) -file that can be reimported as objects with [Import-Clixml](./Import-Clixml.md). `ConvertTo-Xml` +file that can be reimported as objects with [Import-Clixml](Import-Clixml.md). `ConvertTo-Xml` returns an in-memory representation of an XML document, so you can continue to process it in PowerShell. `ConvertTo-Xml` doesn't have an option to convert objects to CLI XML. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Debug-Runspace.md b/reference/7.4/Microsoft.PowerShell.Utility/Debug-Runspace.md index 6ee1e3f36069..220f29aab98a 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Debug-Runspace.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Debug-Runspace.md @@ -18,7 +18,8 @@ Starts an interactive debugging session with a runspace. ### RunspaceParameterSet (Default) ``` -Debug-Runspace [-Runspace] [-BreakAll] [-WhatIf] [-Confirm] [] +Debug-Runspace [-Runspace] [-BreakAll] [-WhatIf] [-Confirm] + [] ``` ### NameParameterSet diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index a8c96bf11d42..56557b2172f0 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -27,8 +27,8 @@ Disable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confir ### Id ``` -Disable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] [-Confirm] - [] +Disable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -44,7 +44,7 @@ when you create them using the `Set-PSBreakpoint` cmdlet. A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. `Disable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts. For more information about the PowerShell debugger, see -[about_Debuggers](../microsoft.powershell.core/about/about_debuggers.md). +[about_Debuggers](../Microsoft.PowerShell.Core/About/about_Debuggers.md). ## EXAMPLES diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md b/reference/7.4/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md index 43d267760079..b275a10300e1 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md @@ -41,7 +41,8 @@ Disable-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Disable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Disable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION @@ -180,4 +181,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Enable-RunspaceDebug](Enable-RunspaceDebug.md) [Get-RunspaceDebug](Get-RunspaceDebug.md) - diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index 53126b72fbed..d613b34ee5d8 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -27,8 +27,8 @@ Enable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confirm ### Id ``` -Enable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] [-Confirm] - [] +Enable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md b/reference/7.4/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md index c5bc1d438492..c80ecb27b8a1 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md @@ -41,7 +41,8 @@ Enable-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Enable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Enable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md index f97163d1cc71..9c4a33dda3fd 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Alias.md @@ -20,17 +20,17 @@ Exports information about currently defined aliases to a file. ### ByPath (Default) ``` -Export-Alias [-Path] [[-Name] ] [-PassThru] [-As ] [-Append] - [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] [-Confirm] - [] +Export-Alias [-Path] [[-Name] ] [-PassThru] [-As ] + [-Append] [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] + [-Confirm] [] ``` ### ByLiteralPath ``` -Export-Alias -LiteralPath [[-Name] ] [-PassThru] [-As ] - [-Append] [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] [-Confirm] - [] +Export-Alias -LiteralPath [[-Name] ] [-PassThru] + [-As ] [-Append] [-Force] [-NoClobber] [-Description ] + [-Scope ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -47,52 +47,52 @@ profile. ### Example 1: Export an alias ```powershell -Export-Alias -Path "alias.csv" +Export-Alias -Path Alias.csv ``` -This command exports current alias information to a file named Alias.csv in the current directory. +This command exports current alias information to a file named `Alias.csv` in the current directory. ### Example 2: Export an alias unless the export file already exists ```powershell -Export-Alias -Path "alias.csv" -NoClobber +Export-Alias -Path Alias.csv -NoClobber ``` -This command exports the aliases in the current session to an Alias.csv file. +This command exports the aliases in the current session to an `Alias.csv` file. -Because the **NoClobber** parameter is specified, the command will fail if an Alias.csv file already +Because the **NoClobber** parameter is specified, the command will fail if an `Alias.csv` file already exists in the current directory. ### Example 3: Append aliases to a file ```powershell -Export-Alias -Path "alias.csv" -Append -Description "Appended Aliases" -Force +Export-Alias -Path Alias.csv -Append -Description "Appended Aliases" -Force ``` -This command appends the aliases in the current session to the Alias.csv file. +This command appends the aliases in the current session to the `Alias.csv` file. The command uses the **Description** parameter to add a description to the comments at the top of the file. -The command also uses the **Force** parameter to overwrite any existing Alias.csv files, even if +The command also uses the **Force** parameter to overwrite any existing `Alias.csv` files, even if they have the read-only attribute. ### Example 4: Export aliases as a script ```powershell -Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) +Export-Alias -Path Alias.ps1 -As Script +Add-Content -Path $PROFILE -Value (Get-Content Alias.ps1) $S = New-PSSession -ComputerName Server01 -Invoke-Command -Session $S -FilePath .\alias.ps1 +Invoke-Command -Session $S -FilePath .\Alias.ps1 ``` This example shows how to use the script file format that `Export-Alias` generates. -The first command exports the aliases in the session to the Alias.ps1 file. It uses the **As** +The first command exports the aliases in the session to the `Alias.ps1` file. It uses the **As** parameter with a value of Script to generate a file that contains a Set-Alias command for each alias. -The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. +The second command adds the aliases in the `Alias.ps1` file to the CurrentUser-CurrentHost profile. The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md index 6694dca768c8..36c1bae55ea0 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -18,21 +18,21 @@ Creates an XML-based representation of an object or objects and stores it in a f ### ByPath (Default) ``` -Export-Clixml [-Depth ] [-Path] -InputObject [-Force] [-NoClobber] - [-Encoding ] [-WhatIf] [-Confirm] [] +Export-Clixml [-Depth ] [-Path] -InputObject [-Force] + [-NoClobber] [-Encoding ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath ``` -Export-Clixml [-Depth ] -LiteralPath -InputObject [-Force] [-NoClobber] - [-Encoding ] [-WhatIf] [-Confirm] [] +Export-Clixml [-Depth ] -LiteralPath -InputObject [-Force] + [-NoClobber] [-Encoding ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The `Export-Clixml` cmdlet serialized an object into a Common Language Infrastructure (CLI) -XML-based representation stores it in a file. You can then use the `Import-Clixml` cmdlet to +The `Export-Clixml` cmdlet serializes an object into a Common Language Infrastructure (CLI) +XML-based representation and stores it in a file. You can then use the `Import-Clixml` cmdlet to recreate the saved object based on the contents of that file. For more information about CLI, see [Language independence](/dotnet/standard/language-independence). @@ -192,7 +192,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md index d102d002f31c..80b15444aee0 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-Csv.md @@ -22,19 +22,19 @@ file. ### Delimiter (Default) ``` -Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] [-NoClobber] - [-Encoding ] [-Append] [[-Delimiter] ] [-IncludeTypeInformation] - [-NoTypeInformation] [-QuoteFields ] [-UseQuotes ] [-NoHeader] [-WhatIf] - [-Confirm] [] +Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] + [-NoClobber] [-Encoding ] [-Append] [[-Delimiter] ] + [-IncludeTypeInformation] [-NoTypeInformation] [-QuoteFields ] + [-UseQuotes ] [-NoHeader] [-WhatIf] [-Confirm] [] ``` ### UseCulture ``` -Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] [-NoClobber] - [-Encoding ] [-Append] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation] - [-QuoteFields ] [-UseQuotes ] [-NoHeader] [-WhatIf] [-Confirm] - [] +Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] + [-NoClobber] [-Encoding ] [-Append] [-UseCulture] [-IncludeTypeInformation] + [-NoTypeInformation] [-QuoteFields ] [-UseQuotes ] [-NoHeader] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -56,7 +56,7 @@ file. ```powershell Get-Process -Name WmiPrvSE | - Select-Object -Property BasePriority,Id,SessionId,WorkingSet | + Select-Object -Property BasePriority, Id, SessionId, WorkingSet | Export-Csv -Path .\WmiData.csv -NoTypeInformation Import-Csv -Path .\WmiData.csv ``` @@ -181,13 +181,13 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = Get-Service -DisplayName *Application* | +$AppService = Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = Get-Service -DisplayName *Windows* | +$WinService = Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append @@ -366,7 +366,7 @@ the file located in the current directory. This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv +Get-Date | Export-Csv -QuoteFields "DateTime", "Date" -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` @@ -380,7 +380,7 @@ DateTime,"Thursday, August 22, 2019 11:27:34 AM","8/22/2019 12:00:00 AM",22,Thur This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv +Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` @@ -402,7 +402,7 @@ $person1 = @{ $person2 = @{ Name = 'Jane Smith' - Number = 1 + Number = 2 } $allPeople = $person1, $person2 @@ -504,7 +504,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-FormatData.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-FormatData.md index bb993a216028..5fded4c4b4b4 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-FormatData.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-FormatData.md @@ -17,15 +17,15 @@ Saves formatting data from the current session in a formatting file. ### ByPath (Default) ``` -Export-FormatData -InputObject -Path [-Force] [-NoClobber] - [-IncludeScriptBlock] [] +Export-FormatData -InputObject -Path [-Force] + [-NoClobber] [-IncludeScriptBlock] [] ``` ### ByLiteralPath ``` -Export-FormatData -InputObject -LiteralPath [-Force] [-NoClobber] - [-IncludeScriptBlock] [] +Export-FormatData -InputObject -LiteralPath [-Force] + [-NoClobber] [-IncludeScriptBlock] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/7.4/Microsoft.PowerShell.Utility/Export-PSSession.md index 59895b8cd4c0..d5d1a1b54404 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -12,7 +12,6 @@ title: Export-PSSession # Export-PSSession ## SYNOPSIS - Exports commands from another session and saves them in a PowerShell module. ## SYNTAX @@ -22,9 +21,9 @@ Exports commands from another session and saves them in a PowerShell module. ``` Export-PSSession [-OutputModule] [-Force] [-Encoding ] [[-CommandName] ] [-AllowClobber] [-ArgumentList ] - [-CommandType ] [-Module ] [-FullyQualifiedModule ] - [[-FormatTypeName] ] [-Certificate ] [-Session] - [] + [-CommandType ] [-Module ] + [-FullyQualifiedModule ] [[-FormatTypeName] ] + [-Certificate ] [-Session] [] ``` ## DESCRIPTION @@ -293,7 +292,8 @@ The acceptable values for this parameter are as follows: (`$Env:PATH`). - `Filter` and `Function`: All PowerShell functions. - `Script` Script files accessible in the current session. -- `Workflow` A PowerShell workflow. For more information, see [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). +- `Workflow` A PowerShell workflow. For more information, see + [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). These values are defined as a flag-based enumeration. You can combine multiple values together to set multiple flags using this parameter. The values can be passed to the **CommandType** parameter diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/7.4/Microsoft.PowerShell.Utility/Format-Custom.md index 2315eccb962d..3d8d546d368d 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Format-Custom.md @@ -17,9 +17,9 @@ Uses a customized view to format the output. ## SYNTAX ``` -Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/7.4/Microsoft.PowerShell.Utility/Format-Hex.md index eac4f382e81a..78ffcbdf4cc9 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Format-Hex.md @@ -13,7 +13,6 @@ title: Format-Hex # Format-Hex ## SYNOPSIS - Displays a file or other input as hexadecimal. ## SYNTAX @@ -33,8 +32,8 @@ Format-Hex -LiteralPath [-Count ] [-Offset ] [ [-Encoding ] [-Count ] [-Offset ] [-Raw] - [] +Format-Hex -InputObject [-Encoding ] [-Count ] + [-Offset ] [-Raw] [] ``` ## DESCRIPTION @@ -109,7 +108,8 @@ It will pass each object through the Pipeline and process individually. However, data, and the adjacent object is also numeric, it will group them into a single output block. ```powershell -'Hello world!', 1, 1138, 'foo', 'bar', 0xdeadbeef, 1gb, 0b1101011100 , $true, $false | Format-Hex +'Hello world!', 1, 1138, 'foo', 'bar', 0xdeadbeef, 1gb, 0b1101011100 , $true, $false | + Format-Hex ``` ```Output @@ -199,7 +199,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. @@ -261,7 +261,8 @@ Specifies the complete path to a file. The value of **LiteralPath** is used exac This parameter does not accept wildcard characters. To specify multiple paths to files, separate the paths with a comma. If the **LiteralPath** parameter includes escape characters, enclose the path in single quotation marks. PowerShell does not interpret any characters in a single quoted string as -escape sequences. For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +escape sequences. For more information, see +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -332,7 +333,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md index a02b1e02588d..f8d788ee5cf9 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Format-List.md @@ -17,8 +17,8 @@ Formats the output as a list of properties in which each property appears on a n ## SYNTAX ``` -Format-List [[-Property] ] [-GroupBy ] [-View ] [-ShowError] - [-DisplayError] [-Force] [-Expand ] [-InputObject ] +Format-List [[-Property] ] [-GroupBy ] [-View ] + [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] [] ``` diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Format-Table.md b/reference/7.4/Microsoft.PowerShell.Utility/Format-Table.md index 2228a0e4dc01..8cb34e3af63b 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Format-Table.md @@ -278,12 +278,12 @@ Accept wildcard characters: False Specifies the format of the collection object and the objects in the collection. This parameter is designed to format objects that support the [ICollection](xref:System.Collections.ICollection)([System.Collections](xref:System.Collections)) -interface. The default value is **EnumOnly**. -The acceptable values for this parameter are as follows: +interface. The default value is **EnumOnly**. The acceptable values for this parameter are as +follows: -- **EnumOnly**: Displays the properties of the objects in the collection. -- **CoreOnly**: Displays the properties of the collection object. -- **Both**: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.4/Microsoft.PowerShell.Utility/Format-Wide.md index 294b3ded8e26..5319a4e704ad 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Format-Wide.md @@ -17,9 +17,9 @@ Formats objects as a wide table that displays only one property of each object. ## SYNTAX ``` -Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Alias.md index f5094a9cccc3..4204c9d0bfc9 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Alias.md @@ -20,13 +20,15 @@ Gets the aliases for the current session. ### Default (Default) ``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition ``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -182,7 +184,8 @@ are: - A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) -`Local` is the default. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +`Local` is the default. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -200,7 +203,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md index 262127591202..8e57d208d5d0 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Date.md @@ -18,33 +18,33 @@ Gets the current date and time. ### DateAndFormat (Default) ``` -Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - [-Format ] [-AsUTC] [] +Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] [-Format ] [-AsUTC] [] ``` ### DateAndUFormat ``` -Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - -UFormat [] +Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] -UFormat [] ``` ### UnixTimeSecondsAndFormat ``` -Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - [-Format ] [-AsUTC] [] +Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] [-Format ] [-AsUTC] [] ``` ### UnixTimeSecondsAndUFormat ``` -Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - -UFormat [] +Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] -UFormat [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md index f73943cdc95f..c8767ae049ab 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Error.md @@ -13,7 +13,6 @@ title: Get-Error # Get-Error ## SYNOPSIS - Gets and displays the most recent error messages from the current session. ## SYNTAX @@ -157,7 +156,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-FormatData.md index 1110538fb9df..a32201b3f066 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -16,7 +16,8 @@ Gets the formatting data in the current session. ## SYNTAX ``` -Get-FormatData [[-TypeName] ] [-PowerShellVersion ] [] +Get-FormatData [[-TypeName] ] [-PowerShellVersion ] + [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Host.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Host.md index f1d1622aeb96..4b5e3e3d99e7 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Host.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Host.md @@ -234,7 +234,8 @@ use these features interchangeably. > variable. For more information, see > [about_ANSI_Terminals](../Microsoft.PowerShell.Core/About/about_ANSI_Terminals.md). -For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). +For more information, see +[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ## RELATED LINKS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md index 86b35e74f7db..db1974b9359d 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md @@ -26,19 +26,22 @@ Get-PSBreakpoint [[-Script] ] [-Runspace ] [] -Command [-Runspace ] [] +Get-PSBreakpoint [[-Script] ] -Command [-Runspace ] + [] ``` ### Variable ``` -Get-PSBreakpoint [[-Script] ] -Variable [-Runspace ] [] +Get-PSBreakpoint [[-Script] ] -Variable [-Runspace ] + [] ``` ### Type ``` -Get-PSBreakpoint [[-Script] ] [-Type] [-Runspace ] [] +Get-PSBreakpoint [[-Script] ] [-Type] [-Runspace ] + [] ``` ### Id diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Random.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Random.md index 8eafcff7ba78..9a567446d224 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Random.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Random.md @@ -25,7 +25,8 @@ Get-Random [-SetSeed ] [[-Maximum] ] [-Minimum ] [-Count ### RandomListItemParameterSet ``` -Get-Random [-SetSeed ] [-InputObject] [-Count ] [] +Get-Random [-SetSeed ] [-InputObject] [-Count ] + [] ``` ### ShuffleParameterSet diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index 66ec317931bc..f56f97b9d14a 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -41,7 +41,8 @@ Get-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION @@ -178,4 +179,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable [Disable-RunspaceDebug](Disable-RunspaceDebug.md) [Enable-RunspaceDebug](Enable-RunspaceDebug.md) - diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-SecureRandom.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-SecureRandom.md index 81f4bdcbbc2e..dceaeb056bd2 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-SecureRandom.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-SecureRandom.md @@ -18,7 +18,8 @@ Gets a random number, or selects objects randomly from a collection. ### RandomNumberParameterSet (Default) ``` -Get-SecureRandom [[-Maximum] ] [-Minimum ] [-Count ] [] +Get-SecureRandom [[-Maximum] ] [-Minimum ] [-Count ] + [] ``` ### RandomListItemParameterSet @@ -205,8 +206,8 @@ In this example, the **InputObject** parameter specifies an array that contains Get-SecureRandom -InputObject @('a','',$null) ``` -`Get-SecureRandom` returns either `a`, empty string, or `$null`. The empty string displays as a blank -line and `$null` returns to a PowerShell prompt. +`Get-SecureRandom` returns either `a`, empty string, or `$null`. The empty string displays as a +blank line and `$null` returns to a PowerShell prompt. ## PARAMETERS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-TraceSource.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-TraceSource.md index e7d87f760aba..fa419def0405 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-TraceSource.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-TraceSource.md @@ -69,7 +69,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-TypeData.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-TypeData.md index 14c0a3ce492c..253e0fd1a4e3 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-TypeData.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-TypeData.md @@ -99,9 +99,9 @@ else { The command uses the `Get-TypeData` cmdlet to get the extended type data for the **System.DataTime** type. The command gets the **Members** property of the **TypeData** object. -The **Members** property contains a hash table of properties and methods that are defined by extended -type data. Each key in the Members hash table is a property or method name and each value is the -definition of the property or method value. +The **Members** property contains a hash table of properties and methods that are defined by +extended type data. Each key in the Members hash table is a property or method name and each value +is the definition of the property or method value. The command gets the **DateTime** key in **Members** and its **GetScriptBlock** property value. diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Get-Variable.md b/reference/7.4/Microsoft.PowerShell.Utility/Get-Variable.md index a9b5a6a14451..0c4127067ac6 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Get-Variable.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Get-Variable.md @@ -18,8 +18,8 @@ Gets the variables in the current console. ## SYNTAX ``` -Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] [-Scope ] - [] +Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] + [-Scope ] [] ``` ## DESCRIPTION @@ -168,7 +168,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -180,7 +181,7 @@ You can pipe a string that contains the variable name to this cmdlet. ### System.Management.Automation.PSVariable -By default, this cmdlet returns a **AutomationPSVariable** object for each variable that it gets. +By default, this cmdlet returns an **AutomationPSVariable** object for each variable that it gets. The object type depends on the variable. ### System.Object[] diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Alias.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Alias.md index 618534055f94..e80aa22f6403 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Alias.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Alias.md @@ -20,22 +20,24 @@ Imports an alias list from a file. ### ByPath (Default) ``` -Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] [] +Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] + [] ``` ### ByLiteralPath ``` -Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] - [] +Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION The `Import-Alias` cmdlet imports an alias list from a file. -Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite existing aliases by default. -To overwrite an existing alias, after assuring that the contents of the alias file is safe, use the **Force** parameter. +Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite +existing aliases by default. To overwrite an existing alias, after assuring that the contents of the +alias file is safe, use the **Force** parameter. ## EXAMPLES @@ -47,16 +49,22 @@ Import-Alias test.txt This command imports alias information from a file named test.txt. +### Example 2: Get a list of defined aliases and their options + +Use the following command to display information about the currently-defined aliases: + +```powershell +Get-Alias | Select-Object Name, Options +``` + +If the corresponding alias is read-only, it will be displayed in the value of the **Options** +property. + ## PARAMETERS ### -Force Allows the cmdlet to import an alias that is already defined or is read only. -You can use the following command to display information about the currently-defined aliases: - -`Get-Alias | Select-Object Name, Options` - -If the corresponding alias is read-only, it will be displayed in the value of the **Options** property. ```yaml Type: System.Management.Automation.SwitchParameter @@ -72,11 +80,10 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to a file that includes exported alias information. -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 PowerShell not to interpret any characters as escape sequences. +Specifies the path to a file that includes exported alias information. 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 PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String @@ -132,7 +139,8 @@ The acceptable values for this parameter are: - Global - Local - Script -- A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) +- A number relative to the current scope (0 through the number of scopes, where 0 is the current + scope and 1 is its parent) The default is Local. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). @@ -184,7 +192,10 @@ 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](https://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](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md index 27e453b057be..64527c7dc568 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -25,8 +25,8 @@ Import-Clixml [-Path] [-IncludeTotalCount] [-Skip ] [-First < ### ByLiteralPath ``` -Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] [-First ] - [] +Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] + [-First ] [] ``` ## DESCRIPTION diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md index 451f034bf86d..5adb926b79af 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Import-Csv.md @@ -13,7 +13,6 @@ title: Import-Csv # Import-Csv ## SYNOPSIS - Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -21,15 +20,15 @@ Creates table-like custom objects from the items in a character-separated value ### DelimiterPath (Default) ``` -Import-Csv [[-Delimiter] ] [-Path] [-Header ] [-Encoding ] - [] +Import-Csv [[-Delimiter] ] [-Path] [-Header ] + [-Encoding ] [] ``` ### DelimiterLiteralPath ``` -Import-Csv [[-Delimiter] ] -LiteralPath [-Header ] [-Encoding ] - [] +Import-Csv [[-Delimiter] ] -LiteralPath [-Header ] + [-Encoding ] [] ``` ### CulturePath diff --git a/reference/7.4/Microsoft.PowerShell.Utility/Measure-Object.md b/reference/7.4/Microsoft.PowerShell.Utility/Measure-Object.md index 6df37ec537da..f39f347ff590 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/Measure-Object.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/Measure-Object.md @@ -20,15 +20,16 @@ objects, such as files of text. ### GenericMeasure (Default) ``` -Measure-Object [[-Property] ] [-InputObject ] [-StandardDeviation] - [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum] [] +Measure-Object [[-Property] ] [-InputObject ] + [-StandardDeviation] [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum] + [] ``` ### TextMeasure ``` -Measure-Object [[-Property] ] [-InputObject ] [-Line] [-Word] - [-Character] [-IgnoreWhiteSpace] [] +Measure-Object [[-Property] ] [-InputObject ] [-Line] + [-Word] [-Character] [-IgnoreWhiteSpace] [] ``` ## DESCRIPTION @@ -529,7 +530,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-PfxCertificate.md b/reference/7.5/Microsoft.PowerShell.Security/Get-PfxCertificate.md index 3daf8ff0f2ea..7a529f6e5273 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-PfxCertificate.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-PfxCertificate.md @@ -17,15 +17,15 @@ Gets information about PFX certificate files on the computer. ### ByPath (Default) ``` -Get-PfxCertificate [-FilePath] [-Password ] [-NoPromptForPassword] - [] +Get-PfxCertificate [-FilePath] [-Password ] + [-NoPromptForPassword] [] ``` ### ByLiteralPath ``` -Get-PfxCertificate -LiteralPath [-Password ] [-NoPromptForPassword] - [] +Get-PfxCertificate -LiteralPath [-Password ] + [-NoPromptForPassword] [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 1258d512fdef..aa7143834bc6 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -17,21 +17,22 @@ Encrypts content by using the Cryptographic Message Syntax format. ### ByContent (Default) ``` -Protect-CmsMessage [-To] [-Content] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-Content] + [[-OutFile] ] [] ``` ### ByPath ``` -Protect-CmsMessage [-To] [-Path] [[-OutFile] ] [] +Protect-CmsMessage [-To] [-Path] [[-OutFile] ] + [] ``` ### ByLiteralPath ``` -Protect-CmsMessage [-To] [-LiteralPath] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-LiteralPath] + [[-OutFile] ] [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md index 0711203c981a..5cb6c6f0e87c 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md @@ -33,9 +33,9 @@ Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] - [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Set-Acl -LiteralPath [-AclObject] [-ClearCentralAccessPolicy] + [-PassThru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -60,18 +60,18 @@ $DogACL = Get-Acl -Path "C:\Dog.txt" 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 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. +parameter is the model ACL, in this case, the ACL of Dog.txt as saved in the `$DogACL` variable. ### Example 2: Use the pipeline operator to pass a descriptor @@ -83,12 +83,12 @@ This command is almost the same as the command in the previous example, except t pipeline operator (`|`) to send the security descriptor from a `Get-Acl` command 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 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 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. +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 @@ -97,8 +97,8 @@ $NewAcl = Get-Acl File0.txt 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. +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. diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md b/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md index cde2e45a986e..2b95abddc811 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md @@ -18,8 +18,8 @@ Sets the PowerShell execution policies for Windows computers. ### All ``` -Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] [-Force] - [-WhatIf] [-Confirm] [] +Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] + [-Force] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md b/reference/7.5/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md index 65053de5dd1f..33f8193f2dea 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Unprotect-CmsMessage.md @@ -39,8 +39,8 @@ Unprotect-CmsMessage [-Path] [[-To] ] [-IncludeC ### ByLiteralPath ``` -Unprotect-CmsMessage [-LiteralPath] [[-To] ] [-IncludeContext] - [] +Unprotect-CmsMessage [-LiteralPath] [[-To] ] + [-IncludeContext] [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index 82bab5b3cbb0..193ac995a85e 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -10,7 +10,6 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS - Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -26,7 +25,8 @@ ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header [-Header ] [] +ConvertFrom-Csv -UseCulture [-InputObject] [-Header ] + [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md index c5367d927206..2e88f04131bb 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md @@ -69,20 +69,25 @@ It uses the `-Type` parameter to specify that SDDL string represents a registry ```powershell $acl = Get-Acl -Path HKLM:\SOFTWARE\Microsoft\ - -ConvertFrom-SddlString -Sddl $acl.Sddl | ForEach-Object {$_.DiscretionaryAcl[0]} +ConvertFrom-SddlString -Sddl $acl.Sddl | + ForEach-Object {$_.DiscretionaryAcl[0]} ``` ```Output -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, +FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, +TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) ``` ```powershell -ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | ForEach-Object {$_.DiscretionaryAcl[0]} +ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | + ForEach-Object {$_.DiscretionaryAcl[0]} ``` ```Output -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, ReadPermissions, SetValue, TakeOwnership, WriteKey) +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, +EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, +ReadPermissions, SetValue, TakeOwnership, WriteKey) ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 6680c935b611..7b80d8f9e701 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -11,7 +11,6 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS - Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Json.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Json.md index 696db12d2d08..9429577b3ece 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Json.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertTo-Json.md @@ -31,14 +31,14 @@ property values, and the methods are removed. > As of PowerShell 7.2, Extended Type System properties of **DateTime** and **String** objects are > no longer serialized and only the simple object is converted to JSON format -You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON object, -which is easily managed in PowerShell. +You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON +object, which is easily managed in PowerShell. Many web sites use JSON instead of XML to serialize data for communication between servers and web-based apps. -As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds the -depth specified for the command. This prevents unwanted data loss when converting objects. +As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds +the depth specified for the command. This prevents unwanted data loss when converting objects. As of PowerShell 7.5, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON numbers. @@ -207,8 +207,8 @@ Accept wildcard characters: False ### -Depth Specifies how many levels of contained objects are included in the JSON representation. The value -can be any number from `0` to `100`. The default value is `2`. `ConvertTo-Json` emits a warning if -the number of levels in an input object exceeds this number. +can be any number from `0` to `100`. The default value is `2`. `ConvertTo-Json` emits a +warning if the number of levels in an input object exceeds this number. ```yaml Type: System.Int32 @@ -246,9 +246,9 @@ characters (like newline) are escaped. Acceptable values are: -- `Default` - Only control characters are escaped. -- `EscapeNonAscii` - All non-ASCII and control characters are escaped. -- `EscapeHtml` - HTML (`<`, `>`, `&`, `'`, `"`) and control characters are escaped. +- Default - Only control characters are escaped. +- EscapeNonAscii - All non-ASCII and control characters are escaped. +- EscapeHtml - HTML (`<`, `>`, `&`, `'`, `"`) and control characters are escaped. This parameter was introduced in PowerShell 6.2. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md index 97ba2f71846f..c374925bcda4 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-Alias.md @@ -47,52 +47,52 @@ profile. ### Example 1: Export an alias ```powershell -Export-Alias -Path "Alias.csv" +Export-Alias -Path Alias.csv ``` -This command exports current alias information to a file named Alias.csv in the current directory. +This command exports current alias information to a file named `Alias.csv` in the current directory. ### Example 2: Export an alias unless the export file already exists ```powershell -Export-Alias -Path "Alias.csv" -NoClobber +Export-Alias -Path Alias.csv -NoClobber ``` -This command exports the aliases in the current session to an Alias.csv file. +This command exports the aliases in the current session to an `Alias.csv` file. -Because the **NoClobber** parameter is specified, the command will fail if an Alias.csv file already +Because the **NoClobber** parameter is specified, the command will fail if an `Alias.csv` file already exists in the current directory. ### Example 3: Append aliases to a file ```powershell -Export-Alias -Path "Alias.csv" -Append -Description "Appended Aliases" -Force +Export-Alias -Path Alias.csv -Append -Description "Appended Aliases" -Force ``` -This command appends the aliases in the current session to the Alias.csv file. +This command appends the aliases in the current session to the `Alias.csv` file. The command uses the **Description** parameter to add a description to the comments at the top of the file. -The command also uses the **Force** parameter to overwrite any existing Alias.csv files, even if +The command also uses the **Force** parameter to overwrite any existing `Alias.csv` files, even if they have the read-only attribute. ### Example 4: Export aliases as a script ```powershell -Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) +Export-Alias -Path Alias.ps1 -As Script +Add-Content -Path $PROFILE -Value (Get-Content Alias.ps1) $S = New-PSSession -ComputerName Server01 -Invoke-Command -Session $S -FilePath .\alias.ps1 +Invoke-Command -Session $S -FilePath .\Alias.ps1 ``` This example shows how to use the script file format that `Export-Alias` generates. -The first command exports the aliases in the session to the Alias.ps1 file. It uses the **As** +The first command exports the aliases in the session to the `Alias.ps1` file. It uses the **As** parameter with a value of Script to generate a file that contains a Set-Alias command for each alias. -The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. +The second command adds the aliases in the `Alias.ps1` file to the CurrentUser-CurrentHost profile. The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md index 9482644e2f3f..000e39cdd8ee 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-Csv.md @@ -181,13 +181,15 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = (Get-Service -DisplayName *Application* | - Select-Object -Property DisplayName, Status) +$AppService = Get-Service -DisplayName *Application* | + Select-Object -Property DisplayName, Status + $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = (Get-Service -DisplayName *Windows* | - Select-Object -Property DisplayName, Status) +$WinService = Get-Service -DisplayName *Windows* | + Select-Object -Property DisplayName, Status + $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append Get-Content -Path .\Services.Csv ``` @@ -227,6 +229,7 @@ unexpected output is received, troubleshoot the pipeline syntax. ```powershell Get-Date | Select-Object -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\DateTime.csv -NoTypeInformation + Get-Content -Path .\DateTime.csv ``` @@ -238,6 +241,7 @@ Get-Content -Path .\DateTime.csv ```powershell Get-Date | Format-Table -Property DateTime, Day, DayOfWeek, DayOfYear | Export-Csv -Path .\FTDateTime.csv -NoTypeInformation + Get-Content -Path .\FTDateTime.csv ``` @@ -362,7 +366,7 @@ the file located in the current directory. This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv +Get-Date | Export-Csv -QuoteFields "DateTime", "Date" -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/7.5/Microsoft.PowerShell.Utility/Export-PSSession.md index dd220d0add72..74001c70de5d 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -12,7 +12,6 @@ title: Export-PSSession # Export-PSSession ## SYNOPSIS - Exports commands from another session and saves them in a PowerShell module. ## SYNTAX @@ -293,7 +292,8 @@ The acceptable values for this parameter are as follows: (`$Env:PATH`). - `Filter` and `Function`: All PowerShell functions. - `Script` Script files accessible in the current session. -- `Workflow` A PowerShell workflow. For more information, see [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). +- `Workflow` A PowerShell workflow. For more information, see + [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). These values are defined as a flag-based enumeration. You can combine multiple values together to set multiple flags using this parameter. The values can be passed to the **CommandType** parameter diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/7.5/Microsoft.PowerShell.Utility/Format-Hex.md index 0d9366e655a1..0e894aa29ed7 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Format-Hex.md @@ -262,7 +262,7 @@ This parameter does not accept wildcard characters. To specify multiple paths to paths with a comma. If the **LiteralPath** parameter includes escape characters, enclose the path in single quotation marks. PowerShell does not interpret any characters in a single quoted string as escape sequences. For more information, see -[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md b/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md index a0019e5b86d1..773c12bc40f8 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Format-List.md @@ -17,8 +17,8 @@ Formats the output as a list of properties in which each property appears on a n ## SYNTAX ``` -Format-List [[-Property] ] [-GroupBy ] [-View ] [-ShowError] - [-DisplayError] [-Force] [-Expand ] [-InputObject ] +Format-List [[-Property] ] [-GroupBy ] [-View ] + [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] [] ``` diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Format-Table.md b/reference/7.5/Microsoft.PowerShell.Utility/Format-Table.md index 4573e1cafb7d..682d7d3ae378 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Format-Table.md @@ -278,12 +278,12 @@ Accept wildcard characters: False Specifies the format of the collection object and the objects in the collection. This parameter is designed to format objects that support the [ICollection](xref:System.Collections.ICollection)([System.Collections](xref:System.Collections)) -interface. The default value is **EnumOnly**. -The acceptable values for this parameter are as follows: +interface. The default value is **EnumOnly**. The acceptable values for this parameter are as +follows: -- **EnumOnly**: Displays the properties of the objects in the collection. -- **CoreOnly**: Displays the properties of the collection object. -- **Both**: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.5/Microsoft.PowerShell.Utility/Format-Wide.md index 0e23cdd72ef3..a4231fa83caf 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Format-Wide.md @@ -17,9 +17,9 @@ Formats objects as a wide table that displays only one property of each object. ## SYNTAX ``` -Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-FormatData.md index 01849909e199..d49b27358b5a 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -157,8 +157,8 @@ TypeNames FormatViewDefinition Specify the version of PowerShell this cmdlet gets for the formatting data. Enter a two digit number separated by a period. -This parameter was added in PowerShell 5.1 to improve compatibility when remoting to computers -running older versions of PowerShell. +This parameter was added in PowerShell 5.1 to improve compatibility when remoting computers running +older versions of PowerShell. ```yaml Type: System.Version diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Random.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Random.md index f9ed30770452..509e92962d48 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Random.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Random.md @@ -25,7 +25,8 @@ Get-Random [-SetSeed ] [[-Maximum] ] [-Minimum ] [-Count ### RandomListItemParameterSet ``` -Get-Random [-SetSeed ] [-InputObject] [-Count ] [] +Get-Random [-SetSeed ] [-InputObject] [-Count ] + [] ``` ### ShuffleParameterSet diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index 9126576bed9a..cebbac09a363 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -41,7 +41,8 @@ Get-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-SecureRandom.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-SecureRandom.md index 2ddf6b3a23c8..73403438a9b4 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-SecureRandom.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-SecureRandom.md @@ -18,7 +18,8 @@ Gets a random number, or selects objects randomly from a collection. ### RandomNumberParameterSet (Default) ``` -Get-SecureRandom [[-Maximum] ] [-Minimum ] [-Count ] [] +Get-SecureRandom [[-Maximum] ] [-Minimum ] [-Count ] + [] ``` ### RandomListItemParameterSet @@ -205,8 +206,8 @@ In this example, the **InputObject** parameter specifies an array that contains Get-SecureRandom -InputObject @('a','',$null) ``` -`Get-SecureRandom` returns either `a`, empty string, or `$null`. The empty string displays as a blank -line and `$null` returns to a PowerShell prompt. +`Get-SecureRandom` returns either `a`, empty string, or `$null`. The empty string displays as a +blank line and `$null` returns to a PowerShell prompt. ## PARAMETERS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-TraceSource.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-TraceSource.md index 186f9a43d76a..fe825035585e 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-TraceSource.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-TraceSource.md @@ -69,7 +69,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-TypeData.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-TypeData.md index b4794def81bc..2dd03abb14e4 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-TypeData.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-TypeData.md @@ -99,9 +99,9 @@ else { The command uses the `Get-TypeData` cmdlet to get the extended type data for the **System.DataTime** type. The command gets the **Members** property of the **TypeData** object. -The **Members** property contains a hash table of properties and methods that are defined by extended -type data. Each key in the Members hash table is a property or method name and each value is the -definition of the property or method value. +The **Members** property contains a hash table of properties and methods that are defined by +extended type data. Each key in the Members hash table is a property or method name and each value +is the definition of the property or method value. The command gets the **DateTime** key in **Members** and its **GetScriptBlock** property value. diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Get-Variable.md b/reference/7.5/Microsoft.PowerShell.Utility/Get-Variable.md index c901d86544ee..ca06cebf3eed 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Get-Variable.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Get-Variable.md @@ -18,8 +18,8 @@ Gets the variables in the current console. ## SYNTAX ``` -Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] [-Scope ] - [] +Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] + [-Scope ] [] ``` ## DESCRIPTION @@ -168,7 +168,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Alias.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Alias.md index 7b1d2f48054e..b780e45acdab 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Alias.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Alias.md @@ -20,22 +20,24 @@ Imports an alias list from a file. ### ByPath (Default) ``` -Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] [] +Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] + [] ``` ### ByLiteralPath ``` -Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] - [] +Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION The `Import-Alias` cmdlet imports an alias list from a file. -Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite existing aliases by default. -To overwrite an existing alias, after assuring that the contents of the alias file is safe, use the **Force** parameter. +Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite +existing aliases by default. To overwrite an existing alias, after assuring that the contents of the +alias file is safe, use the **Force** parameter. ## EXAMPLES @@ -47,16 +49,22 @@ Import-Alias test.txt This command imports alias information from a file named test.txt. +### Example 2: Get a list of defined aliases and their options + +Use the following command to display information about the currently-defined aliases: + +```powershell +Get-Alias | Select-Object Name, Options +``` + +If the corresponding alias is read-only, it will be displayed in the value of the **Options** +property. + ## PARAMETERS ### -Force Allows the cmdlet to import an alias that is already defined or is read only. -You can use the following command to display information about the currently-defined aliases: - -`Get-Alias | Select-Object Name, Options` - -If the corresponding alias is read-only, it will be displayed in the value of the **Options** property. ```yaml Type: System.Management.Automation.SwitchParameter @@ -72,11 +80,10 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to a file that includes exported alias information. -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 PowerShell not to interpret any characters as escape sequences. +Specifies the path to a file that includes exported alias information. 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 PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String @@ -132,7 +139,8 @@ The acceptable values for this parameter are: - Global - Local - Script -- A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) +- A number relative to the current scope (0 through the number of scopes, where 0 is the current + scope and 1 is its parent) The default is Local. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). @@ -184,7 +192,10 @@ 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](https://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](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md index 73260a2ab3e2..975cc3b55df5 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -25,8 +25,8 @@ Import-Clixml [-Path] [-IncludeTotalCount] [-Skip ] [-First < ### ByLiteralPath ``` -Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] [-First ] - [] +Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] + [-First ] [] ``` ## DESCRIPTION diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md index 5d2e0f19caee..10a514887709 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Import-Csv.md @@ -13,7 +13,6 @@ title: Import-Csv # Import-Csv ## SYNOPSIS - Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -21,15 +20,15 @@ Creates table-like custom objects from the items in a character-separated value ### DelimiterPath (Default) ``` -Import-Csv [[-Delimiter] ] [-Path] [-Header ] [-Encoding ] - [] +Import-Csv [[-Delimiter] ] [-Path] [-Header ] + [-Encoding ] [] ``` ### DelimiterLiteralPath ``` -Import-Csv [[-Delimiter] ] -LiteralPath [-Header ] [-Encoding ] - [] +Import-Csv [[-Delimiter] ] -LiteralPath [-Header ] + [-Encoding ] [] ``` ### CulturePath diff --git a/reference/7.5/Microsoft.PowerShell.Utility/Measure-Object.md b/reference/7.5/Microsoft.PowerShell.Utility/Measure-Object.md index f2dbf3460d60..70689f5f945c 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/Measure-Object.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/Measure-Object.md @@ -20,15 +20,16 @@ objects, such as files of text. ### GenericMeasure (Default) ``` -Measure-Object [[-Property] ] [-InputObject ] [-StandardDeviation] - [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum] [] +Measure-Object [[-Property] ] [-InputObject ] + [-StandardDeviation] [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum] + [] ``` ### TextMeasure ``` -Measure-Object [[-Property] ] [-InputObject ] [-Line] [-Word] - [-Character] [-IgnoreWhiteSpace] [] +Measure-Object [[-Property] ] [-InputObject ] [-Line] + [-Word] [-Character] [-IgnoreWhiteSpace] [] ``` ## DESCRIPTION @@ -529,7 +530,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Security/Get-PfxCertificate.md b/reference/7.6/Microsoft.PowerShell.Security/Get-PfxCertificate.md index d1e1c91cf7b6..0891c02a677d 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Get-PfxCertificate.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Get-PfxCertificate.md @@ -17,15 +17,15 @@ Gets information about PFX certificate files on the computer. ### ByPath (Default) ``` -Get-PfxCertificate [-FilePath] [-Password ] [-NoPromptForPassword] - [] +Get-PfxCertificate [-FilePath] [-Password ] + [-NoPromptForPassword] [] ``` ### ByLiteralPath ``` -Get-PfxCertificate -LiteralPath [-Password ] [-NoPromptForPassword] - [] +Get-PfxCertificate -LiteralPath [-Password ] + [-NoPromptForPassword] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md b/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md index 3ad2abecaee5..2d7044b95a1b 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Protect-CmsMessage.md @@ -17,21 +17,22 @@ Encrypts content by using the Cryptographic Message Syntax format. ### ByContent (Default) ``` -Protect-CmsMessage [-To] [-Content] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-Content] + [[-OutFile] ] [] ``` ### ByPath ``` -Protect-CmsMessage [-To] [-Path] [[-OutFile] ] [] +Protect-CmsMessage [-To] [-Path] [[-OutFile] ] + [] ``` ### ByLiteralPath ``` -Protect-CmsMessage [-To] [-LiteralPath] [[-OutFile] ] - [] +Protect-CmsMessage [-To] [-LiteralPath] + [[-OutFile] ] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md index 1e772507df5f..e860e62931c7 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md @@ -18,22 +18,24 @@ Changes the security descriptor of a specified item, such as a file or a registr ### ByPath (Default) ``` -Set-Acl [-Path] [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] [-Filter ] - [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] +Set-Acl [-Path] [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] + [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] + [] ``` ### ByInputObject ``` -Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter ] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Set-Acl [-InputObject] [-AclObject] [-PassThru] [-Filter ] + [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath ``` -Set-Acl -LiteralPath [-AclObject] [-ClearCentralAccessPolicy] [-PassThru] - [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] +Set-Acl -LiteralPath [-AclObject] [-ClearCentralAccessPolicy] + [-PassThru] [-Filter ] [-Include ] [-Exclude ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -129,20 +131,20 @@ Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl These commands disable access inheritance from parent folders, while still preserving the existing inherited access rules. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to `$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see -[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection). +[set access rule protection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A). Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the ACLs of the Dog.txt that were inherited from the Pets folder will be applied directly -to Dog.txt, and new access policies added to Pets will not change the access to Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly +to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. ### Example 5: Grant Administrators Full Control of the file @@ -154,29 +156,33 @@ $fileSystemRights = "FullControl" $type = "Allow" # Create new rule $fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type -$fileSystemAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fileSystemAccessRuleArgumentList +$newParams = @{ + TypeName = 'System.Security.AccessControl.FileSystemAccessRule' + ArgumentList = $fileSystemAccessRuleArgumentList +} +$fileSystemAccessRule = New-Object @newParams # Apply new rule $NewAcl.SetAccessRule($fileSystemAccessRule) Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ``` -This command will grant the **BUILTIN\Administrators** group Full control of the Dog.txt file. +This command will grant the **BUILTIN\Administrators** group Full control of the `Dog.txt` file. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. -Next variables are created to grant the **BUILTIN\Administrators** group full control of the Dog.txt -file. The `$identity` variable set to the name of a -[user account](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor). The +Next variables are created to grant the **BUILTIN\Administrators** group full control of the +`Dog.txt` file. The `$identity` variable set to the name of a +[user account](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A). The `$fileSystemRights` variable set to FullControl, and can be any one of the -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) values that specifies -the type of operation associated with the access rule. The `$type` variable set to "Allow" to -specifies whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable -is an argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) values that specifies the +type of operation associated with the access rule. The `$type` variable set to "Allow" to specifies +whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable is an +argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new **FileSystemAccessRule** object is created, and the **FileSystemAccessRule** object is passed to the **SetAccessRule()** method, adds the new access rule. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the **BUILTIN\Administrators** group will have full control of the Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the **BUILTIN\Administrators** group will have full control of the `Dog.txt`. ## PARAMETERS @@ -341,7 +347,7 @@ Changes the security descriptor of the specified item. Enter the path to an item 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 +**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. @@ -428,8 +434,8 @@ can use it to change the security descriptors of files, directories, and registr [Get-Acl](Get-Acl.md) -[FileSystemAccessRule](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor) +[FileSystemAccessRule](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A) -[ObjectSecurity.SetAccessRuleProtection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection) +[ObjectSecurity.SetAccessRuleProtection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A) -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) diff --git a/reference/7.6/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md b/reference/7.6/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md index 5d381021ec86..feac30e9b331 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md @@ -18,8 +18,8 @@ Sets the PowerShell execution policies for Windows computers. ### All ``` -Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] [-Force] - [-WhatIf] [-Confirm] [] +Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] + [-Force] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md index 92b0c6cea5a0..277909f856bb 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -19,8 +19,8 @@ This cmdlet is only supported on Windows. ## SYNTAX ``` -Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [[-Path] ] - [-WhatIf] [-Confirm] [] +Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] + [[-Path] ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -30,7 +30,7 @@ Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [[-To] ] [-IncludeC ### ByLiteralPath ``` -Unprotect-CmsMessage [-LiteralPath] [[-To] ] [-IncludeContext] - [] +Unprotect-CmsMessage [-LiteralPath] [[-To] ] + [-IncludeContext] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.ThreadJob/Start-ThreadJob.md b/reference/7.6/Microsoft.PowerShell.ThreadJob/Start-ThreadJob.md index 3aeb7095b3bd..f30aa18c1a6c 100644 --- a/reference/7.6/Microsoft.PowerShell.ThreadJob/Start-ThreadJob.md +++ b/reference/7.6/Microsoft.PowerShell.ThreadJob/Start-ThreadJob.md @@ -17,17 +17,19 @@ Creates background jobs similar to the `Start-Job` cmdlet. ### ScriptBlock ``` -Start-ThreadJob [-ScriptBlock] [-Name ] [-InitializationScript ] - [-InputObject ] [-ArgumentList ] [-ThrottleLimit ] - [-StreamingHost ] [] +Start-ThreadJob [-ScriptBlock] [-Name ] + [-InitializationScript ] [-InputObject ] + [-ArgumentList ] [-ThrottleLimit ] [-StreamingHost ] + [] ``` ### FilePath ``` -Start-ThreadJob [-FilePath] [-Name ] [-InitializationScript ] - [-InputObject ] [-ArgumentList ] [-ThrottleLimit ] - [-StreamingHost ] [] +Start-ThreadJob [-FilePath] [-Name ] + [-InitializationScript ] [-InputObject ] + [-ArgumentList ] [-ThrottleLimit ] [-StreamingHost ] + [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md b/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md index 7c1a204cf266..5b21be7609a8 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Add-Type.md @@ -18,8 +18,9 @@ Adds a Microsoft .NET class to a PowerShell session. ### FromSource (Default) ``` -Add-Type [-TypeDefinition] [-Language ] [-ReferencedAssemblies ] - [-OutputAssembly ] [-OutputType ] [-PassThru] [-IgnoreWarnings] +Add-Type [-TypeDefinition] [-Language ] + [-ReferencedAssemblies ] [-OutputAssembly ] + [-OutputType ] [-PassThru] [-IgnoreWarnings] [-CompilerOptions ] [] ``` @@ -28,24 +29,24 @@ Add-Type [-TypeDefinition] [-Language ] [-ReferencedAssemblie ``` Add-Type [-Name] [-MemberDefinition] [-Namespace ] [-UsingNamespace ] [-Language ] [-ReferencedAssemblies ] - [-OutputAssembly ] [-OutputType ] [-PassThru] [-IgnoreWarnings] - [-CompilerOptions ] [] + [-OutputAssembly ] [-OutputType ] [-PassThru] + [-IgnoreWarnings] [-CompilerOptions ] [] ``` ### FromPath ``` Add-Type [-Path] [-ReferencedAssemblies ] [-OutputAssembly ] - [-OutputType ] [-PassThru] [-IgnoreWarnings] [-CompilerOptions ] - [] + [-OutputType ] [-PassThru] [-IgnoreWarnings] + [-CompilerOptions ] [] ``` ### FromLiteralPath ``` -Add-Type -LiteralPath [-ReferencedAssemblies ] [-OutputAssembly ] - [-OutputType ] [-PassThru] [-IgnoreWarnings] [-CompilerOptions ] - [] +Add-Type -LiteralPath [-ReferencedAssemblies ] + [-OutputAssembly ] [-OutputType ] [-PassThru] + [-IgnoreWarnings] [-CompilerOptions ] [] ``` ### FromAssemblyName @@ -451,7 +452,7 @@ Accept wildcard characters: True Specifies the output type of the output assembly. By default, no output type is specified. This parameter is valid only when an output assembly is specified in the command. For more information about the values, see -[OutputAssemblyType Enumeration](/dotnet/api/microsoft.powershell.commands.outputassemblytype). +[OutputAssemblyType Enumeration](xref:Microsoft.PowerShell.Commands.OutputAssemblyType). The acceptable values for this parameter are as follows: @@ -541,7 +542,7 @@ Accept wildcard characters: False Specifies the source code that contains the type definitions. Enter the source code in a string or here-string, or enter a variable that contains the source code. For more information about -here-strings, see [about_Quoting_Rules](../Microsoft.PowerShell.Core/about/about_Quoting_Rules.md). +here-strings, see [about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). Include a namespace declaration in your type definition. If you omit the namespace declaration, your type might have the same name as another type or the shortcut for another type, causing an @@ -628,7 +629,7 @@ arbitrary path requires `Add-Type`, since those assemblies can't be loaded autom ## RELATED LINKS -[about_Profiles](../Microsoft.PowerShell.Core/About/about_profiles.md) +[about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md) [about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md) @@ -636,7 +637,7 @@ arbitrary path requires `Add-Type`, since those assemblies can't be loaded autom [New-Object](New-Object.md) -[OutputAssemblyType](/dotnet/api/microsoft.powershell.commands.outputassemblytype) +[OutputAssemblyType](xref:Microsoft.PowerShell.Commands.OutputAssemblyType) [Platform Invoke (P/Invoke)](/dotnet/standard/native-interop/pinvoke) diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Clear-Variable.md b/reference/7.6/Microsoft.PowerShell.Utility/Clear-Variable.md index ca33a80cfe6d..eb72ab30f816 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Clear-Variable.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Clear-Variable.md @@ -18,8 +18,8 @@ Deletes the value of a variable. ## SYNTAX ``` -Clear-Variable [-Name] [-Include ] [-Exclude ] [-Force] [-PassThru] - [-Scope ] [-WhatIf] [-Confirm] [] +Clear-Variable [-Name] [-Include ] [-Exclude ] [-Force] + [-PassThru] [-Scope ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -41,7 +41,7 @@ This command removes the value of global variables that have names that begin wi ### Example 2: Clear a variable in a child scope but not the parent scope ```powershell -$a=3 +$a = 3 &{ Clear-Variable a } $a ``` @@ -165,7 +165,8 @@ The acceptable values for this parameter are: - `Script` You can also use a number relative to the current scope (0 through the number of scopes, where 0 is -the current scope and 1 is its parent). Local is the default. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +the current scope and 1 is its parent). Local is the default. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -215,7 +216,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md index fcb9eee839bd..65e7be3ca5d3 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Csv.md @@ -10,7 +10,6 @@ title: ConvertFrom-Csv # ConvertFrom-Csv ## SYNOPSIS - Converts object properties in character-separated value (CSV) format into CSV versions of the original objects. @@ -26,7 +25,8 @@ ConvertFrom-Csv [[-Delimiter] ] [-InputObject] [-Header [-Header ] [] +ConvertFrom-Csv -UseCulture [-InputObject] [-Header ] + [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index e14f9223967d..e13d33284bec 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -16,8 +16,8 @@ Converts a JSON-formatted string to a custom object or a hash table. ## SYNTAX ``` -ConvertFrom-Json [-InputObject] [-AsHashtable] [-DateKind ] [-Depth ] - [-NoEnumerate] [] +ConvertFrom-Json [-InputObject] [-AsHashtable] [-DateKind ] + [-Depth ] [-NoEnumerate] [] ``` ## DESCRIPTION @@ -91,7 +91,8 @@ that can be managed in PowerShell. ```powershell # Ensures that Invoke-WebRequest uses TLS 1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -$j = Invoke-WebRequest 'https://api.github.com/repos/PowerShell/PowerShell/issues' | ConvertFrom-Json +$j = Invoke-WebRequest 'https://api.github.com/repos/PowerShell/PowerShell/issues' | + ConvertFrom-Json ``` You can also use the `Invoke-RestMethod` cmdlet, which automatically converts JSON content to @@ -128,8 +129,10 @@ This command shows an example where the `-NoEnumerate` switch is used to round-t JSON array. ```powershell -Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | ConvertTo-Json -Compress)" -Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | ConvertTo-Json -Compress)" +Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | + ConvertTo-Json -Compress)" +Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | + ConvertTo-Json -Compress)" ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md index 741f4883cbb9..ab3b78e63b33 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Markdown.md @@ -11,8 +11,7 @@ title: ConvertFrom-Markdown # ConvertFrom-Markdown ## SYNOPSIS -Convert the contents of a string or a file to a **MarkdownInfo** -object. +Convert the contents of a string or a file to a **MarkdownInfo** object. ## SYNTAX @@ -161,7 +160,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md index 86c55f19f977..8135132f1928 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-SddlString.md @@ -18,7 +18,8 @@ Converts a SDDL string to a custom object. ### All ``` -ConvertFrom-SddlString [-Sddl] [-Type ] [] +ConvertFrom-SddlString [-Sddl] [-Type ] + [] ``` ## DESCRIPTION @@ -57,7 +58,7 @@ ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the -HKLM:\SOFTWARE\Microsoft\ key and saves it in the variable. +`HKLM:\SOFTWARE\Microsoft\` key and saves it in the variable. The second command uses the `ConvertFrom-SddlString` cmdlet to get the text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. @@ -68,18 +69,29 @@ It uses the `-Type` parameter to specify that SDDL string represents a registry ```powershell $acl = Get-Acl -Path HKLM:\SOFTWARE\Microsoft\ +ConvertFrom-SddlString -Sddl $acl.Sddl | + ForEach-Object {$_.DiscretionaryAcl[0]} +``` -ConvertFrom-SddlString -Sddl $acl.Sddl | ForEach-Object {$_.DiscretionaryAcl[0]} - -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +```Output +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateDirectories, Delete, ExecuteKey, +FullControl, GenericExecute, GenericWrite, ListDirectory, ReadExtendedAttributes, ReadPermissions, +TakeOwnership, Traverse, WriteData, WriteExtendedAttributes, WriteKey) +``` -ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | ForEach-Object {$_.DiscretionaryAcl[0]} +```powershell +ConvertFrom-SddlString -Sddl $acl.Sddl -Type RegistryRights | + ForEach-Object {$_.DiscretionaryAcl[0]} +``` -BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, ReadPermissions, SetValue, TakeOwnership, WriteKey) +```Output +BUILTIN\Administrators: AccessAllowed (ChangePermissions, CreateLink, CreateSubKey, Delete, +EnumerateSubKeys, ExecuteKey, FullControl, GenericExecute, GenericWrite, Notify, QueryValues, +ReadPermissions, SetValue, TakeOwnership, WriteKey) ``` The first command uses the `Get-Acl` cmdlet to get the security descriptor for the -HKLM:\SOFTWARE\Microsoft\ key and saves it in the variable. +`HKLM:\SOFTWARE\Microsoft\` key and saves it in the variable. The second command uses the `ConvertFrom-SddlString` cmdlet to get the text representation of the SDDL string, contained in the Sddl property of the object representing the security descriptor. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md index 4521d66a274c..22989a202423 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Csv.md @@ -11,7 +11,6 @@ title: ConvertTo-Csv # ConvertTo-Csv ## SYNOPSIS - Converts .NET objects into a series of character-separated value (CSV) strings. ## SYNTAX @@ -27,8 +26,9 @@ ConvertTo-Csv [-InputObject] [[-Delimiter] ] [-IncludeTypeInfor ### UseCulture ``` -ConvertTo-Csv [-InputObject] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation] - [-QuoteFields ] [-UseQuotes ] [-NoHeader] [] +ConvertTo-Csv [-InputObject] [-UseCulture] [-IncludeTypeInformation] + [-NoTypeInformation] [-QuoteFields ] [-UseQuotes ] [-NoHeader] + [] ``` ## DESCRIPTION @@ -90,7 +90,8 @@ This example converts the Windows event log for PowerShell to a series of CSV st ```powershell (Get-Culture).TextInfo.ListSeparator -Get-WinEvent -LogName 'PowerShellCore/Operational' | ConvertTo-Csv -UseCulture -NoTypeInformation +Get-WinEvent -LogName 'PowerShellCore/Operational' | + ConvertTo-Csv -UseCulture -NoTypeInformation ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Html.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Html.md index 9b32fd85a20c..f02d929620a0 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Html.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Html.md @@ -18,16 +18,16 @@ Converts .NET objects into HTML that can be displayed in a Web browser. ``` ConvertTo-Html [-InputObject ] [[-Property] ] [[-Body] ] - [[-Head] ] [[-Title] ] [-As ] [-CssUri ] [-PostContent ] - [-PreContent ] [-Meta ] [-Charset ] [-Transitional] - [] + [[-Head] ] [[-Title] ] [-As ] [-CssUri ] + [-PostContent ] [-PreContent ] [-Meta ] + [-Charset ] [-Transitional] [] ``` ### Fragment ``` -ConvertTo-Html [-InputObject ] [[-Property] ] [-As ] [-Fragment] - [-PostContent ] [-PreContent ] [] +ConvertTo-Html [-InputObject ] [[-Property] ] [-As ] + [-Fragment] [-PostContent ] [-PreContent ] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Json.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Json.md index e57b24d4970f..aba1e8cb580a 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Json.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Json.md @@ -31,14 +31,14 @@ property values, and the methods are removed. > As of PowerShell 7.2, Extended Type System properties of **DateTime** and **String** objects are > no longer serialized and only the simple object is converted to JSON format -You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON object, -which is easily managed in PowerShell. +You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON +object, which is easily managed in PowerShell. Many web sites use JSON instead of XML to serialize data for communication between servers and web-based apps. -As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds the -depth specified for the command. This prevents unwanted data loss when converting objects. +As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds +the depth specified for the command. This prevents unwanted data loss when converting objects. As of PowerShell 7.5, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON numbers. @@ -207,8 +207,8 @@ Accept wildcard characters: False ### -Depth Specifies how many levels of contained objects are included in the JSON representation. The value -can be any number from `0` to `100`. The default value is `2`. `ConvertTo-Json` emits a warning if -the number of levels in an input object exceeds this number. +can be any number from `0` to `100`. The default value is `2`. `ConvertTo-Json` emits a +warning if the number of levels in an input object exceeds this number. ```yaml Type: System.Int32 @@ -246,9 +246,9 @@ characters (like newline) are escaped. Acceptable values are: -- `Default` - Only control characters are escaped. -- `EscapeNonAscii` - All non-ASCII and control characters are escaped. -- `EscapeHtml` - HTML (`<`, `>`, `&`, `'`, `"`) and control characters are escaped. +- Default - Only control characters are escaped. +- EscapeNonAscii - All non-ASCII and control characters are escaped. +- EscapeHtml - HTML (`<`, `>`, `&`, `'`, `"`) and control characters are escaped. This parameter was introduced in PowerShell 6.2. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index a3c2939270f3..2aea152ad340 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -16,8 +16,8 @@ Creates an XML-based representation of an object. ## SYNTAX ``` -ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] [-As ] - [] +ConvertTo-Xml [-Depth ] [-InputObject] [-NoTypeInformation] + [-As ] [] ``` ## DESCRIPTION @@ -30,10 +30,10 @@ When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** par multiple objects, `ConvertTo-Xml` returns a single, in-memory XML document that includes representations of all the objects. -This cmdlet is similar to [Export-Clixml](./Export-Clixml.md) except that `Export-Clixml` stores the +This cmdlet is similar to [Export-Clixml](Export-Clixml.md) except that `Export-Clixml` stores the resulting XML in a [Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/) -file that can be reimported as objects with [Import-Clixml](./Import-Clixml.md). `ConvertTo-Xml` +file that can be reimported as objects with [Import-Clixml](Import-Clixml.md). `ConvertTo-Xml` returns an in-memory representation of an XML document, so you can continue to process it in PowerShell. `ConvertTo-Xml` doesn't have an option to convert objects to CLI XML. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Debug-Runspace.md b/reference/7.6/Microsoft.PowerShell.Utility/Debug-Runspace.md index 12119195bd0d..39e3a51c99b3 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Debug-Runspace.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Debug-Runspace.md @@ -18,7 +18,8 @@ Starts an interactive debugging session with a runspace. ### RunspaceParameterSet (Default) ``` -Debug-Runspace [-Runspace] [-BreakAll] [-WhatIf] [-Confirm] [] +Debug-Runspace [-Runspace] [-BreakAll] [-WhatIf] [-Confirm] + [] ``` ### NameParameterSet diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index b3f283a96180..2ccbd704bc5b 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -27,8 +27,8 @@ Disable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confir ### Id ``` -Disable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] [-Confirm] - [] +Disable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION @@ -44,7 +44,7 @@ when you create them using the `Set-PSBreakpoint` cmdlet. A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. `Disable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts. For more information about the PowerShell debugger, see -[about_Debuggers](../microsoft.powershell.core/about/about_debuggers.md). +[about_Debuggers](../Microsoft.PowerShell.Core/About/about_Debuggers.md). ## EXAMPLES diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md b/reference/7.6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md index d9ae2a52a362..96f2efa81a8e 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Disable-RunspaceDebug.md @@ -41,7 +41,8 @@ Disable-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Disable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Disable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md b/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md index adba380e4a6c..d7212dd28834 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Enable-PSBreakpoint.md @@ -27,8 +27,8 @@ Enable-PSBreakpoint [-PassThru] [-Breakpoint] [-WhatIf] [-Confirm ### Id ``` -Enable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] [-Confirm] - [] +Enable-PSBreakpoint [-PassThru] [-Id] [-Runspace ] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md b/reference/7.6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md index 124e2bfb978a..6fefb72fca29 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Enable-RunspaceDebug.md @@ -41,7 +41,8 @@ Enable-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Enable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Enable-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md index ab231951efd9..61e047e9b564 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Alias.md @@ -20,17 +20,17 @@ Exports information about currently defined aliases to a file. ### ByPath (Default) ``` -Export-Alias [-Path] [[-Name] ] [-PassThru] [-As ] [-Append] - [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] [-Confirm] - [] +Export-Alias [-Path] [[-Name] ] [-PassThru] [-As ] + [-Append] [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] + [-Confirm] [] ``` ### ByLiteralPath ``` -Export-Alias -LiteralPath [[-Name] ] [-PassThru] [-As ] - [-Append] [-Force] [-NoClobber] [-Description ] [-Scope ] [-WhatIf] [-Confirm] - [] +Export-Alias -LiteralPath [[-Name] ] [-PassThru] + [-As ] [-Append] [-Force] [-NoClobber] [-Description ] + [-Scope ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -47,52 +47,52 @@ profile. ### Example 1: Export an alias ```powershell -Export-Alias -Path "alias.csv" +Export-Alias -Path Alias.csv ``` -This command exports current alias information to a file named Alias.csv in the current directory. +This command exports current alias information to a file named `Alias.csv` in the current directory. ### Example 2: Export an alias unless the export file already exists ```powershell -Export-Alias -Path "alias.csv" -NoClobber +Export-Alias -Path Alias.csv -NoClobber ``` -This command exports the aliases in the current session to an Alias.csv file. +This command exports the aliases in the current session to an `Alias.csv` file. -Because the **NoClobber** parameter is specified, the command will fail if an Alias.csv file already +Because the **NoClobber** parameter is specified, the command will fail if an `Alias.csv` file already exists in the current directory. ### Example 3: Append aliases to a file ```powershell -Export-Alias -Path "alias.csv" -Append -Description "Appended Aliases" -Force +Export-Alias -Path Alias.csv -Append -Description "Appended Aliases" -Force ``` -This command appends the aliases in the current session to the Alias.csv file. +This command appends the aliases in the current session to the `Alias.csv` file. The command uses the **Description** parameter to add a description to the comments at the top of the file. -The command also uses the **Force** parameter to overwrite any existing Alias.csv files, even if +The command also uses the **Force** parameter to overwrite any existing `Alias.csv` files, even if they have the read-only attribute. ### Example 4: Export aliases as a script ```powershell -Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) +Export-Alias -Path Alias.ps1 -As Script +Add-Content -Path $PROFILE -Value (Get-Content Alias.ps1) $S = New-PSSession -ComputerName Server01 -Invoke-Command -Session $S -FilePath .\alias.ps1 +Invoke-Command -Session $S -FilePath .\Alias.ps1 ``` This example shows how to use the script file format that `Export-Alias` generates. -The first command exports the aliases in the session to the Alias.ps1 file. It uses the **As** +The first command exports the aliases in the session to the `Alias.ps1` file. It uses the **As** parameter with a value of Script to generate a file that contains a Set-Alias command for each alias. -The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. +The second command adds the aliases in the `Alias.ps1` file to the CurrentUser-CurrentHost profile. The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md index 546c5aececaf..f3d26fd3175b 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -18,21 +18,21 @@ Creates an XML-based representation of an object or objects and stores it in a f ### ByPath (Default) ``` -Export-Clixml [-Depth ] [-Path] -InputObject [-Force] [-NoClobber] - [-Encoding ] [-WhatIf] [-Confirm] [] +Export-Clixml [-Depth ] [-Path] -InputObject [-Force] + [-NoClobber] [-Encoding ] [-WhatIf] [-Confirm] [] ``` ### ByLiteralPath ``` -Export-Clixml [-Depth ] -LiteralPath -InputObject [-Force] [-NoClobber] - [-Encoding ] [-WhatIf] [-Confirm] [] +Export-Clixml [-Depth ] -LiteralPath -InputObject [-Force] + [-NoClobber] [-Encoding ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION -The `Export-Clixml` cmdlet serialized an object into a Common Language Infrastructure (CLI) -XML-based representation stores it in a file. You can then use the `Import-Clixml` cmdlet to +The `Export-Clixml` cmdlet serializes an object into a Common Language Infrastructure (CLI) +XML-based representation and stores it in a file. You can then use the `Import-Clixml` cmdlet to recreate the saved object based on the contents of that file. For more information about CLI, see [Language independence](/dotnet/standard/language-independence). @@ -192,7 +192,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md index f6aed2d3ddf1..a4a2ad381f58 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-Csv.md @@ -22,19 +22,19 @@ file. ### Delimiter (Default) ``` -Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] [-NoClobber] - [-Encoding ] [-Append] [[-Delimiter] ] [-IncludeTypeInformation] - [-NoTypeInformation] [-QuoteFields ] [-UseQuotes ] [-NoHeader] [-WhatIf] - [-Confirm] [] +Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] + [-NoClobber] [-Encoding ] [-Append] [[-Delimiter] ] + [-IncludeTypeInformation] [-NoTypeInformation] [-QuoteFields ] + [-UseQuotes ] [-NoHeader] [-WhatIf] [-Confirm] [] ``` ### UseCulture ``` -Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] [-NoClobber] - [-Encoding ] [-Append] [-UseCulture] [-IncludeTypeInformation] [-NoTypeInformation] - [-QuoteFields ] [-UseQuotes ] [-NoHeader] [-WhatIf] [-Confirm] - [] +Export-Csv -InputObject [[-Path] ] [-LiteralPath ] [-Force] + [-NoClobber] [-Encoding ] [-Append] [-UseCulture] [-IncludeTypeInformation] + [-NoTypeInformation] [-QuoteFields ] [-UseQuotes ] [-NoHeader] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -56,7 +56,7 @@ file. ```powershell Get-Process -Name WmiPrvSE | - Select-Object -Property BasePriority,Id,SessionId,WorkingSet | + Select-Object -Property BasePriority, Id, SessionId, WorkingSet | Export-Csv -Path .\WmiData.csv -NoTypeInformation Import-Csv -Path .\WmiData.csv ``` @@ -145,11 +145,12 @@ Get-Content -Path .\Processes.csv The `Get-Culture` cmdlet uses the nested properties **TextInfo** and **ListSeparator** and displays the current culture's default list separator. The `Get-Process` cmdlet gets **Process** objects. The process objects are sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts the -process objects to a series of CSV strings. The **Path** parameter specifies that the `Processes.csv` -file is saved in the current directory. The **UseCulture** parameter uses the current culture's -default list separator as the delimiter. The **NoTypeInformation** parameter removes the **#TYPE** -information header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet -uses the **Path** parameter to display the file located in the current directory. +process objects to a series of CSV strings. The **Path** parameter specifies that the +`Processes.csv` file is saved in the current directory. The **UseCulture** parameter uses the +current culture's default list separator as the delimiter. The **NoTypeInformation** parameter +removes the **#TYPE** information header from the CSV output and is not required in PowerShell 6. +The `Get-Content` cmdlet uses the **Path** parameter to display the file located in the current +directory. ### Example 5: Export processes with type information @@ -180,13 +181,13 @@ This example describes how to export objects to a CSV file and use the **Append* objects to an existing file. ```powershell -$AppService = Get-Service -DisplayName *Application* | +$AppService = Get-Service -DisplayName *Application* | Select-Object -Property DisplayName, Status $AppService | Export-Csv -Path .\Services.Csv -NoTypeInformation Get-Content -Path .\Services.Csv -$WinService = Get-Service -DisplayName *Windows* | +$WinService = Get-Service -DisplayName *Windows* | Select-Object -Property DisplayName, Status $WinService | Export-Csv -Path .\Services.csv -NoTypeInformation -Append @@ -256,10 +257,10 @@ Get-Content -Path .\FTDateTime.csv The `Get-Date` cmdlet gets the **DateTime** object. The object is sent down the pipeline to the `Select-Object` cmdlet. `Select-Object` uses the **Property** parameter to select a subset of object properties. The object is sent down the pipeline to the `Export-Csv` cmdlet. `Export-Csv` converts -the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved in -the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information header -from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the **Path** -parameter to display the CSV file located in the current directory. +the object to a CSV format. The **Path** parameter specifies that the `DateTime.csv` file is saved +in the current directory. The **NoTypeInformation** parameter removes the **#TYPE** information +header from the CSV output and is not required in PowerShell 6. The `Get-Content` cmdlet uses the +**Path** parameter to display the CSV file located in the current directory. When the `Format-Table` cmdlet is used within the pipeline to select properties unexpected results are received. `Format-Table` sends table format objects down the pipeline to the `Export-Csv` cmdlet @@ -365,7 +366,7 @@ the file located in the current directory. This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv +Get-Date | Export-Csv -QuoteFields "DateTime", "Date" -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` @@ -379,7 +380,7 @@ DateTime,"Thursday, August 22, 2019 11:27:34 AM","8/22/2019 12:00:00 AM",22,Thur This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv +Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` @@ -401,7 +402,7 @@ $person1 = @{ $person2 = @{ Name = 'Jane Smith' - Number = 1 + Number = 2 } $allPeople = $person1, $person2 @@ -450,6 +451,10 @@ this parameter, `Export-Csv` replaces the file contents without warning. This parameter was introduced in Windows PowerShell 3.0. +Beginning with PowerShell 7.7, using the **Append** parameter with the **NoHeader** parameter throws +an error message instead of accepting the invalid combination and creating a headerless CSV file +that causes subsequent append operations to fail. + ```yaml Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) @@ -503,7 +508,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-FormatData.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-FormatData.md index 940f8235bd52..39a515c1eb55 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-FormatData.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-FormatData.md @@ -17,15 +17,15 @@ Saves formatting data from the current session in a formatting file. ### ByPath (Default) ``` -Export-FormatData -InputObject -Path [-Force] [-NoClobber] - [-IncludeScriptBlock] [] +Export-FormatData -InputObject -Path [-Force] + [-NoClobber] [-IncludeScriptBlock] [] ``` ### ByLiteralPath ``` -Export-FormatData -InputObject -LiteralPath [-Force] [-NoClobber] - [-IncludeScriptBlock] [] +Export-FormatData -InputObject -LiteralPath [-Force] + [-NoClobber] [-IncludeScriptBlock] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/7.6/Microsoft.PowerShell.Utility/Export-PSSession.md index 84c8bafb44d6..5f1392b30cab 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -12,7 +12,6 @@ title: Export-PSSession # Export-PSSession ## SYNOPSIS - Exports commands from another session and saves them in a PowerShell module. ## SYNTAX @@ -22,9 +21,9 @@ Exports commands from another session and saves them in a PowerShell module. ``` Export-PSSession [-OutputModule] [-Force] [-Encoding ] [[-CommandName] ] [-AllowClobber] [-ArgumentList ] - [-CommandType ] [-Module ] [-FullyQualifiedModule ] - [[-FormatTypeName] ] [-Certificate ] [-Session] - [] + [-CommandType ] [-Module ] + [-FullyQualifiedModule ] [[-FormatTypeName] ] + [-Certificate ] [-Session] [] ``` ## DESCRIPTION @@ -293,7 +292,8 @@ The acceptable values for this parameter are as follows: (`$Env:PATH`). - `Filter` and `Function`: All PowerShell functions. - `Script` Script files accessible in the current session. -- `Workflow` A PowerShell workflow. For more information, see [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). +- `Workflow` A PowerShell workflow. For more information, see + [about_Workflows](/powershell/module/PSWorkflow/About/about_Workflows). These values are defined as a flag-based enumeration. You can combine multiple values together to set multiple flags using this parameter. The values can be passed to the **CommandType** parameter diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Format-Custom.md b/reference/7.6/Microsoft.PowerShell.Utility/Format-Custom.md index d2b12c54da1a..7421e590af74 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Format-Custom.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Format-Custom.md @@ -17,9 +17,9 @@ Uses a customized view to format the output. ## SYNTAX ``` -Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Custom [[-Property] ] [-Depth ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/7.6/Microsoft.PowerShell.Utility/Format-Hex.md index 75e568b85fd3..8e9e441f408e 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Format-Hex.md @@ -13,7 +13,6 @@ title: Format-Hex # Format-Hex ## SYNOPSIS - Displays a file or other input as hexadecimal. ## SYNTAX @@ -33,8 +32,8 @@ Format-Hex -LiteralPath [-Count ] [-Offset ] [ [-Encoding ] [-Count ] [-Offset ] [-Raw] - [] +Format-Hex -InputObject [-Encoding ] [-Count ] + [-Offset ] [-Raw] [] ``` ## DESCRIPTION @@ -109,7 +108,8 @@ It will pass each object through the Pipeline and process individually. However, data, and the adjacent object is also numeric, it will group them into a single output block. ```powershell -'Hello world!', 1, 1138, 'foo', 'bar', 0xdeadbeef, 1gb, 0b1101011100 , $true, $false | Format-Hex +'Hello world!', 1, 1138, 'foo', 'bar', 0xdeadbeef, 1gb, 0b1101011100 , $true, $false | + Format-Hex ``` ```Output @@ -199,7 +199,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. @@ -261,7 +261,8 @@ Specifies the complete path to a file. The value of **LiteralPath** is used exac This parameter does not accept wildcard characters. To specify multiple paths to files, separate the paths with a comma. If the **LiteralPath** parameter includes escape characters, enclose the path in single quotation marks. PowerShell does not interpret any characters in a single quoted string as -escape sequences. For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +escape sequences. For more information, see +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -332,7 +333,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Format-Table.md b/reference/7.6/Microsoft.PowerShell.Utility/Format-Table.md index 5c515eb274c5..4ddbcc1c3bd2 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Format-Table.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Format-Table.md @@ -278,12 +278,12 @@ Accept wildcard characters: False Specifies the format of the collection object and the objects in the collection. This parameter is designed to format objects that support the [ICollection](xref:System.Collections.ICollection)([System.Collections](xref:System.Collections)) -interface. The default value is **EnumOnly**. -The acceptable values for this parameter are as follows: +interface. The default value is **EnumOnly**. The acceptable values for this parameter are as +follows: -- **EnumOnly**: Displays the properties of the objects in the collection. -- **CoreOnly**: Displays the properties of the collection object. -- **Both**: Displays the properties of the collection object and the properties of objects in the +- `EnumOnly`: Displays the properties of the objects in the collection. +- `CoreOnly`: Displays the properties of the collection object. +- `Both`: Displays the properties of the collection object and the properties of objects in the collection. ```yaml diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Format-Wide.md b/reference/7.6/Microsoft.PowerShell.Utility/Format-Wide.md index 6926e1618f12..f83bc47f86b9 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Format-Wide.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Format-Wide.md @@ -17,9 +17,9 @@ Formats objects as a wide table that displays only one property of each object. ## SYNTAX ``` -Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] [-View ] - [-ShowError] [-DisplayError] [-Force] [-Expand ] [-InputObject ] - [] +Format-Wide [[-Property] ] [-AutoSize] [-Column ] [-GroupBy ] + [-View ] [-ShowError] [-DisplayError] [-Force] [-Expand ] + [-InputObject ] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Alias.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Alias.md index 542ca7cf8491..6b0f12d2a659 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Alias.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Alias.md @@ -20,13 +20,15 @@ Gets the aliases for the current session. ### Default (Default) ``` -Get-Alias [[-Name] ] [-Exclude ] [-Scope ] [] +Get-Alias [[-Name] ] [-Exclude ] [-Scope ] + [] ``` ### Definition ``` -Get-Alias [-Exclude ] [-Scope ] [-Definition ] [] +Get-Alias [-Exclude ] [-Scope ] [-Definition ] + [] ``` ## DESCRIPTION @@ -182,7 +184,8 @@ are: - A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) -`Local` is the default. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). +`Local` is the default. For more information, see +[about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). ```yaml Type: System.String @@ -200,7 +203,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md index 537955d0d986..26c8f59d0119 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Date.md @@ -18,33 +18,33 @@ Gets the current date and time. ### DateAndFormat (Default) ``` -Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - [-Format ] [-AsUTC] [] +Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] [-Format ] [-AsUTC] [] ``` ### DateAndUFormat ``` -Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - -UFormat [] +Get-Date [[-Date] ] [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] -UFormat [] ``` ### UnixTimeSecondsAndFormat ``` -Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - [-Format ] [-AsUTC] [] +Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] [-Format ] [-AsUTC] [] ``` ### UnixTimeSecondsAndUFormat ``` -Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] [-Hour ] - [-Minute ] [-Second ] [-Millisecond ] [-DisplayHint ] - -UFormat [] +Get-Date -UnixTimeSeconds [-Year ] [-Month ] [-Day ] + [-Hour ] [-Minute ] [-Second ] [-Millisecond ] + [-DisplayHint ] -UFormat [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md index 9ab22f846943..58d4247385f6 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Error.md @@ -13,7 +13,6 @@ title: Get-Error # Get-Error ## SYNOPSIS - Gets and displays the most recent error messages from the current session. ## SYNTAX @@ -157,7 +156,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-FormatData.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-FormatData.md index 9bce9d947785..397f2fc344ba 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-FormatData.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-FormatData.md @@ -16,7 +16,8 @@ Gets the formatting data in the current session. ## SYNTAX ``` -Get-FormatData [[-TypeName] ] [-PowerShellVersion ] [] +Get-FormatData [[-TypeName] ] [-PowerShellVersion ] + [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Host.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Host.md index cd2f2c251248..933c45418e99 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Host.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Host.md @@ -234,7 +234,8 @@ use these features interchangeably. > variable. For more information, see > [about_ANSI_Terminals](../Microsoft.PowerShell.Core/About/about_ANSI_Terminals.md). -For more information, see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). +For more information, see +[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ## RELATED LINKS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md index 8cc359a69a2b..e44c4fcd7cdb 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-PSBreakpoint.md @@ -26,19 +26,22 @@ Get-PSBreakpoint [[-Script] ] [-Runspace ] [] -Command [-Runspace ] [] +Get-PSBreakpoint [[-Script] ] -Command [-Runspace ] + [] ``` ### Variable ``` -Get-PSBreakpoint [[-Script] ] -Variable [-Runspace ] [] +Get-PSBreakpoint [[-Script] ] -Variable [-Runspace ] + [] ``` ### Type ``` -Get-PSBreakpoint [[-Script] ] [-Type] [-Runspace ] [] +Get-PSBreakpoint [[-Script] ] [-Type] [-Runspace ] + [] ``` ### Id diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Random.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Random.md index 4d38170744e4..824b6e2a219d 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Random.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Random.md @@ -25,7 +25,8 @@ Get-Random [-SetSeed ] [[-Maximum] ] [-Minimum ] [-Count ### RandomListItemParameterSet ``` -Get-Random [-SetSeed ] [-InputObject] [-Count ] [] +Get-Random [-SetSeed ] [-InputObject] [-Count ] + [] ``` ### ShuffleParameterSet diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md index dc587d588461..86b89b495650 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-RunspaceDebug.md @@ -41,7 +41,8 @@ Get-RunspaceDebug [-RunspaceInstanceId] [] ### ProcessNameParameterSet ``` -Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] [] +Get-RunspaceDebug [[-ProcessName] ] [[-AppDomainName] ] + [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-SecureRandom.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-SecureRandom.md index d0c8cf404658..8bb83f6c9419 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-SecureRandom.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-SecureRandom.md @@ -18,7 +18,8 @@ Gets a random number, or selects objects randomly from a collection. ### RandomNumberParameterSet (Default) ``` -Get-SecureRandom [[-Maximum] ] [-Minimum ] [-Count ] [] +Get-SecureRandom [[-Maximum] ] [-Minimum ] [-Count ] + [] ``` ### RandomListItemParameterSet @@ -205,8 +206,8 @@ In this example, the **InputObject** parameter specifies an array that contains Get-SecureRandom -InputObject @('a','',$null) ``` -`Get-SecureRandom` returns either `a`, empty string, or `$null`. The empty string displays as a blank -line and `$null` returns to a PowerShell prompt. +`Get-SecureRandom` returns either `a`, empty string, or `$null`. The empty string displays as a +blank line and `$null` returns to a PowerShell prompt. ## PARAMETERS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-TraceSource.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-TraceSource.md index b280edde6462..80ecf011f0e5 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-TraceSource.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-TraceSource.md @@ -69,7 +69,8 @@ Accept wildcard characters: True This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-TypeData.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-TypeData.md index c0790ef1d7b9..82de4381c542 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-TypeData.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-TypeData.md @@ -99,9 +99,9 @@ else { The command uses the `Get-TypeData` cmdlet to get the extended type data for the **System.DataTime** type. The command gets the **Members** property of the **TypeData** object. -The **Members** property contains a hash table of properties and methods that are defined by extended -type data. Each key in the Members hash table is a property or method name and each value is the -definition of the property or method value. +The **Members** property contains a hash table of properties and methods that are defined by +extended type data. Each key in the Members hash table is a property or method name and each value +is the definition of the property or method value. The command gets the **DateTime** key in **Members** and its **GetScriptBlock** property value. diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Get-Variable.md b/reference/7.6/Microsoft.PowerShell.Utility/Get-Variable.md index f2e9c96b2491..325b355685fe 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Get-Variable.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Get-Variable.md @@ -18,8 +18,8 @@ Gets the variables in the current console. ## SYNTAX ``` -Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] [-Scope ] - [] +Get-Variable [[-Name] ] [-ValueOnly] [-Include ] [-Exclude ] + [-Scope ] [] ``` ## DESCRIPTION @@ -168,7 +168,8 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, --WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Alias.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Alias.md index 4e909bf8371e..8b86bd32af55 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Alias.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Alias.md @@ -20,22 +20,24 @@ Imports an alias list from a file. ### ByPath (Default) ``` -Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] [] +Import-Alias [-Path] [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] + [] ``` ### ByLiteralPath ``` -Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] [-Confirm] - [] +Import-Alias -LiteralPath [-Scope ] [-PassThru] [-Force] [-WhatIf] + [-Confirm] [] ``` ## DESCRIPTION The `Import-Alias` cmdlet imports an alias list from a file. -Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite existing aliases by default. -To overwrite an existing alias, after assuring that the contents of the alias file is safe, use the **Force** parameter. +Beginning in Windows PowerShell 3.0, as a security feature, `Import-Alias` does not overwrite +existing aliases by default. To overwrite an existing alias, after assuring that the contents of the +alias file is safe, use the **Force** parameter. ## EXAMPLES @@ -47,16 +49,22 @@ Import-Alias test.txt This command imports alias information from a file named test.txt. +### Example 2: Get a list of defined aliases and their options + +Use the following command to display information about the currently-defined aliases: + +```powershell +Get-Alias | Select-Object Name, Options +``` + +If the corresponding alias is read-only, it will be displayed in the value of the **Options** +property. + ## PARAMETERS ### -Force Allows the cmdlet to import an alias that is already defined or is read only. -You can use the following command to display information about the currently-defined aliases: - -`Get-Alias | Select-Object Name, Options` - -If the corresponding alias is read-only, it will be displayed in the value of the **Options** property. ```yaml Type: System.Management.Automation.SwitchParameter @@ -72,11 +80,10 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to a file that includes exported alias information. -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 PowerShell not to interpret any characters as escape sequences. +Specifies the path to a file that includes exported alias information. 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 PowerShell not to interpret any characters as escape sequences. ```yaml Type: System.String @@ -132,7 +139,8 @@ The acceptable values for this parameter are: - Global - Local - Script -- A number relative to the current scope (0 through the number of scopes, where 0 is the current scope and 1 is its parent) +- A number relative to the current scope (0 through the number of scopes, where 0 is the current + scope and 1 is its parent) The default is Local. For more information, see [about_Scopes](../Microsoft.PowerShell.Core/About/about_Scopes.md). @@ -184,7 +192,10 @@ 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](https://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](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md index 4cf7b7eb5c76..f55ab2d9ef60 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Clixml.md @@ -25,8 +25,8 @@ Import-Clixml [-Path] [-IncludeTotalCount] [-Skip ] [-First < ### ByLiteralPath ``` -Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] [-First ] - [] +Import-Clixml -LiteralPath [-IncludeTotalCount] [-Skip ] + [-First ] [] ``` ## DESCRIPTION diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md b/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md index 794c152f7b4c..b7eb8b4edbde 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Import-Csv.md @@ -13,7 +13,6 @@ title: Import-Csv # Import-Csv ## SYNOPSIS - Creates table-like custom objects from the items in a character-separated value (CSV) file. ## SYNTAX @@ -21,15 +20,15 @@ Creates table-like custom objects from the items in a character-separated value ### DelimiterPath (Default) ``` -Import-Csv [[-Delimiter] ] [-Path] [-Header ] [-Encoding ] - [] +Import-Csv [[-Delimiter] ] [-Path] [-Header ] + [-Encoding ] [] ``` ### DelimiterLiteralPath ``` -Import-Csv [[-Delimiter] ] -LiteralPath [-Header ] [-Encoding ] - [] +Import-Csv [[-Delimiter] ] -LiteralPath [-Header ] + [-Encoding ] [] ``` ### CulturePath diff --git a/reference/7.6/Microsoft.PowerShell.Utility/Measure-Object.md b/reference/7.6/Microsoft.PowerShell.Utility/Measure-Object.md index 57d881f75947..560bb4cb71de 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/Measure-Object.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/Measure-Object.md @@ -20,15 +20,16 @@ objects, such as files of text. ### GenericMeasure (Default) ``` -Measure-Object [[-Property] ] [-InputObject ] [-StandardDeviation] - [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum] [] +Measure-Object [[-Property] ] [-InputObject ] + [-StandardDeviation] [-Sum] [-AllStats] [-Average] [-Maximum] [-Minimum] + [] ``` ### TextMeasure ``` -Measure-Object [[-Property] ] [-InputObject ] [-Line] [-Word] - [-Character] [-IgnoreWhiteSpace] [] +Measure-Object [[-Property] ] [-InputObject ] [-Line] + [-Word] [-Character] [-IgnoreWhiteSpace] [] ``` ## DESCRIPTION @@ -529,7 +530,8 @@ 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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md index dd74eef72592..65be84255286 100644 --- a/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md @@ -131,20 +131,20 @@ Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl These commands disable access inheritance from parent folders, while still preserving the existing inherited access rules. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. Next, variables are created to convert the inherited access rules to explicit access rules. To protect the access rules associated with this from inheritance, set the `$isProtected` variable to `$true`. To allow inheritance, set `$isProtected` to `$false`. For more information, see -[set access rule protection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection). +[set access rule protection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A). Set the `$preserveInheritance` variable to `$true` to preserve inherited access rules or `$false` to remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the ACLs of the Dog.txt that were inherited from the Pets folder will be applied directly -to Dog.txt, and new access policies added to Pets will not change the access to Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly +to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. ### Example 5: Grant Administrators Full Control of the file @@ -156,29 +156,33 @@ $fileSystemRights = "FullControl" $type = "Allow" # Create new rule $fileSystemAccessRuleArgumentList = $identity, $fileSystemRights, $type -$fileSystemAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $fileSystemAccessRuleArgumentList +$newParams = @{ + TypeName = 'System.Security.AccessControl.FileSystemAccessRule' + ArgumentList = $fileSystemAccessRuleArgumentList +} +$fileSystemAccessRule = New-Object @newParams # Apply new rule $NewAcl.SetAccessRule($fileSystemAccessRule) Set-Acl -Path "C:\Pets\Dog.txt" -AclObject $NewAcl ``` -This command will grant the **BUILTIN\Administrators** group Full control of the Dog.txt file. +This command will grant the **BUILTIN\Administrators** group Full control of the `Dog.txt` file. -The first command uses the `Get-Acl` cmdlet to get the security descriptor of the Dog.txt file. +The first command uses the `Get-Acl` cmdlet to get the security descriptor of the `Dog.txt` file. -Next variables are created to grant the **BUILTIN\Administrators** group full control of the Dog.txt -file. The `$identity` variable set to the name of a -[user account](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor). The +Next variables are created to grant the **BUILTIN\Administrators** group full control of the +`Dog.txt` file. The `$identity` variable set to the name of a +[user account](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A). The `$fileSystemRights` variable set to FullControl, and can be any one of the -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) values that specifies -the type of operation associated with the access rule. The `$type` variable set to "Allow" to -specifies whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable -is an argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) values that specifies the +type of operation associated with the access rule. The `$type` variable set to "Allow" to specifies +whether to allow or deny the operation. The `$fileSystemAccessRuleArgumentList` variable is an +argument list is to be passed when making the new **FileSystemAccessRule** object. Then a new **FileSystemAccessRule** object is created, and the **FileSystemAccessRule** object is passed to the **SetAccessRule()** method, adds the new access rule. -The last command uses `Set-Acl` to apply the security descriptor of to Dog.txt. When the command -completes, the **BUILTIN\Administrators** group will have full control of the Dog.txt. +The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +completes, the **BUILTIN\Administrators** group will have full control of the `Dog.txt`. ## PARAMETERS @@ -343,7 +347,7 @@ Changes the security descriptor of the specified item. Enter the path to an item 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 +**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. @@ -430,8 +434,8 @@ can use it to change the security descriptors of files, directories, and registr [Get-Acl](Get-Acl.md) -[FileSystemAccessRule](/dotnet/api/system.security.accesscontrol.filesystemaccessrule.-ctor) +[FileSystemAccessRule](xref:System.Security.AccessControl.FileSystemAccessRule.%23ctor%2A) -[ObjectSecurity.SetAccessRuleProtection](/dotnet/api/system.security.accesscontrol.objectsecurity.setaccessruleprotection) +[ObjectSecurity.SetAccessRuleProtection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A) -[FileSystemRights](/dotnet/api/system.security.accesscontrol.filesystemrights) +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) diff --git a/reference/7.7/Microsoft.PowerShell.Security/Test-FileCatalog.md b/reference/7.7/Microsoft.PowerShell.Security/Test-FileCatalog.md index 33ea3a2ac2c8..2f49151a77b4 100644 --- a/reference/7.7/Microsoft.PowerShell.Security/Test-FileCatalog.md +++ b/reference/7.7/Microsoft.PowerShell.Security/Test-FileCatalog.md @@ -30,7 +30,7 @@ Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] [!NOTE] -> As of PowerShell 7.2, Extended Type System properties of **DateTime** and -> **String** objects are no longer serialized and only the simple object is -> converted to JSON format +> As of PowerShell 7.2, Extended Type System properties of **DateTime** and **String** objects are +> no longer serialized and only the simple object is converted to JSON format You can then use the `ConvertFrom-Json` cmdlet to convert a JSON-formatted string to a JSON object, which is easily managed in PowerShell. @@ -41,8 +40,7 @@ web-based apps. As of PowerShell 7.1, `ConvertTo-Json` emits a warning if the depth of the input object exceeds the depth specified for the command. This prevents unwanted data loss when converting objects. -As of PowerShell 7.5-preview.3, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON -numbers. +As of PowerShell 7.5, `ConvertTo-Json` can serialize **BigInteger** values as raw JSON numbers. This cmdlet was introduced in Windows PowerShell 3.0. @@ -293,7 +291,7 @@ Accept wildcard characters: False This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see -[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/reference/7.7/Microsoft.PowerShell.Utility/ConvertTo-Xml.md b/reference/7.7/Microsoft.PowerShell.Utility/ConvertTo-Xml.md index db1eb6ae1048..9194c36bca85 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/ConvertTo-Xml.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/ConvertTo-Xml.md @@ -30,10 +30,10 @@ When you pipe multiple objects to `ConvertTo-Xml` or use the **InputObject** par multiple objects, `ConvertTo-Xml` returns a single, in-memory XML document that includes representations of all the objects. -This cmdlet is similar to [Export-Clixml](./Export-Clixml.md) except that `Export-Clixml` stores the +This cmdlet is similar to [Export-Clixml](Export-Clixml.md) except that `Export-Clixml` stores the resulting XML in a [Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/) -file that can be reimported as objects with [Import-Clixml](./Import-Clixml.md). `ConvertTo-Xml` +file that can be reimported as objects with [Import-Clixml](Import-Clixml.md). `ConvertTo-Xml` returns an in-memory representation of an XML document, so you can continue to process it in PowerShell. `ConvertTo-Xml` doesn't have an option to convert objects to CLI XML. diff --git a/reference/7.7/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md b/reference/7.7/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md index 455a02578b54..b57c151e2dc3 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/Disable-PSBreakpoint.md @@ -44,7 +44,7 @@ when you create them using the `Set-PSBreakpoint` cmdlet. A breakpoint is a point in a script where execution stops temporarily so that you can examine the instructions in the script. `Disable-PSBreakpoint` is one of several cmdlets designed for debugging PowerShell scripts. For more information about the PowerShell debugger, see -[about_Debuggers](../microsoft.powershell.core/about/about_debuggers.md). +[about_Debuggers](../Microsoft.PowerShell.Core/About/about_Debuggers.md). ## EXAMPLES diff --git a/reference/7.7/Microsoft.PowerShell.Utility/Export-Alias.md b/reference/7.7/Microsoft.PowerShell.Utility/Export-Alias.md index d9c83978b6ac..9ce709e18ebc 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/Export-Alias.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/Export-Alias.md @@ -47,52 +47,52 @@ profile. ### Example 1: Export an alias ```powershell -Export-Alias -Path "alias.csv" +Export-Alias -Path Alias.csv ``` -This command exports current alias information to a file named Alias.csv in the current directory. +This command exports current alias information to a file named `Alias.csv` in the current directory. ### Example 2: Export an alias unless the export file already exists ```powershell -Export-Alias -Path "alias.csv" -NoClobber +Export-Alias -Path Alias.csv -NoClobber ``` -This command exports the aliases in the current session to an Alias.csv file. +This command exports the aliases in the current session to an `Alias.csv` file. -Because the **NoClobber** parameter is specified, the command will fail if an Alias.csv file already +Because the **NoClobber** parameter is specified, the command will fail if an `Alias.csv` file already exists in the current directory. ### Example 3: Append aliases to a file ```powershell -Export-Alias -Path "alias.csv" -Append -Description "Appended Aliases" -Force +Export-Alias -Path Alias.csv -Append -Description "Appended Aliases" -Force ``` -This command appends the aliases in the current session to the Alias.csv file. +This command appends the aliases in the current session to the `Alias.csv` file. The command uses the **Description** parameter to add a description to the comments at the top of the file. -The command also uses the **Force** parameter to overwrite any existing Alias.csv files, even if +The command also uses the **Force** parameter to overwrite any existing `Alias.csv` files, even if they have the read-only attribute. ### Example 4: Export aliases as a script ```powershell -Export-Alias -Path "alias.ps1" -As Script -Add-Content -Path $PROFILE -Value (Get-Content alias.ps1) +Export-Alias -Path Alias.ps1 -As Script +Add-Content -Path $PROFILE -Value (Get-Content Alias.ps1) $S = New-PSSession -ComputerName Server01 -Invoke-Command -Session $S -FilePath .\alias.ps1 +Invoke-Command -Session $S -FilePath .\Alias.ps1 ``` This example shows how to use the script file format that `Export-Alias` generates. -The first command exports the aliases in the session to the Alias.ps1 file. It uses the **As** +The first command exports the aliases in the session to the `Alias.ps1` file. It uses the **As** parameter with a value of Script to generate a file that contains a Set-Alias command for each alias. -The second command adds the aliases in the Alias.ps1 file to the CurrentUser-CurrentHost profile. +The second command adds the aliases in the `Alias.ps1` file to the CurrentUser-CurrentHost profile. The path to the profile is saved in the `$PROFILE` variable. The command uses the `Get-Content` cmdlet to get the aliases from the Alias.ps1 file and the `Add-Content` cmdlet to add them to the profile. For more information, see diff --git a/reference/7.7/Microsoft.PowerShell.Utility/Export-Clixml.md b/reference/7.7/Microsoft.PowerShell.Utility/Export-Clixml.md index 452ceb831708..6aae230370a1 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/Export-Clixml.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/Export-Clixml.md @@ -31,8 +31,8 @@ Export-Clixml [-Depth ] -LiteralPath -InputObject [-F ## DESCRIPTION -The `Export-Clixml` cmdlet serialized an object into a Common Language Infrastructure (CLI) -XML-based representation stores it in a file. You can then use the `Import-Clixml` cmdlet to +The `Export-Clixml` cmdlet serializes an object into a Common Language Infrastructure (CLI) +XML-based representation and stores it in a file. You can then use the `Import-Clixml` cmdlet to recreate the saved object based on the contents of that file. For more information about CLI, see [Language independence](/dotnet/standard/language-independence). @@ -192,7 +192,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. diff --git a/reference/7.7/Microsoft.PowerShell.Utility/Export-Csv.md b/reference/7.7/Microsoft.PowerShell.Utility/Export-Csv.md index 6f2be0a446a1..e39cc65faea6 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/Export-Csv.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/Export-Csv.md @@ -13,6 +13,7 @@ title: Export-Csv # Export-Csv ## SYNOPSIS + Converts objects into a series of character-separated value (CSV) strings and saves the strings to a file. @@ -55,7 +56,7 @@ file. ```powershell Get-Process -Name WmiPrvSE | - Select-Object -Property BasePriority,Id,SessionId,WorkingSet | + Select-Object -Property BasePriority, Id, SessionId, WorkingSet | Export-Csv -Path .\WmiData.csv -NoTypeInformation Import-Csv -Path .\WmiData.csv ``` @@ -365,7 +366,7 @@ the file located in the current directory. This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -QuoteFields "DateTime","Date" -Path .\FTDateTime.csv +Get-Date | Export-Csv -QuoteFields "DateTime", "Date" -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` @@ -379,7 +380,7 @@ DateTime,"Thursday, August 22, 2019 11:27:34 AM","8/22/2019 12:00:00 AM",22,Thur This example converts a **DateTime** object to a CSV string. ```powershell -Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv +Get-Date | Export-Csv -UseQuotes AsNeeded -Path .\FTDateTime.csv Get-Content -Path .\FTDateTime.csv ``` @@ -401,7 +402,7 @@ $person1 = @{ $person2 = @{ Name = 'Jane Smith' - Number = 1 + Number = 2 } $allPeople = $person1, $person2 @@ -507,7 +508,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. diff --git a/reference/7.7/Microsoft.PowerShell.Utility/Format-Hex.md b/reference/7.7/Microsoft.PowerShell.Utility/Format-Hex.md index 352abfecff6d..2f7784db5b94 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/Format-Hex.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/Format-Hex.md @@ -108,7 +108,8 @@ It will pass each object through the Pipeline and process individually. However, data, and the adjacent object is also numeric, it will group them into a single output block. ```powershell -'Hello world!', 1, 1138, 'foo', 'bar', 0xdeadbeef, 1gb, 0b1101011100 , $true, $false | Format-Hex +'Hello world!', 1, 1138, 'foo', 'bar', 0xdeadbeef, 1gb, 0b1101011100 , $true, $false | + Format-Hex ``` ```Output @@ -198,7 +199,7 @@ The acceptable values for this parameter are as follows: Beginning with PowerShell 6.2, the **Encoding** parameter also allows numeric IDs of registered code pages (like `-Encoding 1251`) or string names of registered code pages (like `-Encoding "windows-1251"`). For more information, see the .NET documentation for -[Encoding.CodePage](/dotnet/api/system.text.encoding.codepage?view=netcore-2.2). +[Encoding.CodePage](xref:System.Text.Encoding.CodePage%2A). Starting with PowerShell 7.4, you can use the `Ansi` value for the **Encoding** parameter to pass the numeric ID for the current culture's ANSI code page without having to specify it manually. @@ -261,7 +262,7 @@ This parameter does not accept wildcard characters. To specify multiple paths to paths with a comma. If the **LiteralPath** parameter includes escape characters, enclose the path in single quotation marks. PowerShell does not interpret any characters in a single quoted string as escape sequences. For more information, see -[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] From cec619dc4a3075870844ff78bafbba30a80ea6e0 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 15 Jun 2026 16:40:53 -0500 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md | 2 +- .../5.1/Microsoft.PowerShell.Utility/Export-PSSession.md | 8 +++++--- reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md | 2 +- reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md index 0d43cde608a8..fcdc168103af 100644 --- a/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md @@ -141,7 +141,7 @@ Set the `$preserveInheritance` variable to `$true` to preserve inherited access remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +The last command uses `Set-Acl` to apply the security descriptor to `Dog.txt`. When the command completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md index 7bb34edcefba..bdcbb8acd22f 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -68,9 +68,10 @@ formatting data into the Server01 module. This example exports all of the `Get` and `Set` commands from a server. ```powershell +$credential = Get-Credential -UserName 'exchangeadmin01@contoso.com' -Message 'Enter Exchange credentials' $newSession = @{ - ConnectionUri = 'https://exchange.microsoft.com/mailbox' - Credential = 'exchangeadmin01@hotmail.com' + ConnectionUri = 'https://exchange.microsoft.com/mailbox' + Credential = $credential Authentication = 'Negotiate' } $S = New-PSSession @newSession @@ -99,9 +100,10 @@ the local computer. The cmdlets from the module are added to the current session be used. ```powershell +$credential = Get-Credential -UserName 'Server01\User01' -Message 'Enter credentials for Server01' $newSession = @{ ComputerName = 'Server01' - Credential = 'Server01\User01' + Credential = $credential } $S = New-PSSession @newSession diff --git a/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md index e860e62931c7..94760f7608ff 100644 --- a/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.6/Microsoft.PowerShell.Security/Set-Acl.md @@ -142,7 +142,7 @@ Set the `$preserveInheritance` variable to `$true` to preserve inherited access remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +The last command uses `Set-Acl` to apply the security descriptor to `Dog.txt`. When the command completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. diff --git a/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md index 65be84255286..6bbf18d3ec67 100644 --- a/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.7/Microsoft.PowerShell.Security/Set-Acl.md @@ -142,7 +142,7 @@ Set the `$preserveInheritance` variable to `$true` to preserve inherited access remove inherited access rules. Then the access rule protection is updated using the **SetAccessRuleProtection()** method. -The last command uses `Set-Acl` to apply the security descriptor of to `Dog.txt`. When the command +The last command uses `Set-Acl` to apply the security descriptor to `Dog.txt`. When the command completes, the ACLs of the `Dog.txt` that were inherited from the Pets folder will be applied directly to `Dog.txt`, and new access policies added to Pets will not change the access to `Dog.txt`. From 863849f0df32100887c87eb9ab44e00df1334d35 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 15 Jun 2026 16:45:19 -0500 Subject: [PATCH 3/3] Fix example format --- .../5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md | 3 ++- .../7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md | 6 ++---- .../7.5/Microsoft.PowerShell.Utility/ConvertFrom-Json.md | 6 ++---- .../7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md | 6 ++---- .../7.7/Microsoft.PowerShell.Utility/ConvertFrom-Json.md | 6 ++---- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index 6cded243bdd5..64418205ac9f 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -84,7 +84,8 @@ that can be managed in PowerShell. ```powershell # Ensures that Invoke-WebRequest uses TLS 1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -$j = Invoke-WebRequest 'https://api.github.com/repos/PowerShell/PowerShell/issues' | ConvertFrom-Json +$j = Invoke-WebRequest 'https://api.github.com/repos/PowerShell/PowerShell/issues' | + ConvertFrom-Json ``` You can also use the `Invoke-RestMethod` cmdlet, which automatically converts JSON content to diff --git a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index 97a56d73954e..fda2acad3771 100644 --- a/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/7.4/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -123,10 +123,8 @@ This command shows an example where the `-NoEnumerate` switch is used to round-t JSON array. ```powershell -Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | - ConvertTo-Json -Compress)" -Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | - ConvertTo-Json -Compress)" +Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | ConvertTo-Json -Compress)" +Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | ConvertTo-Json -Compress)" ``` ```Output diff --git a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index 1f35df5063a1..ec45f38fa75c 100644 --- a/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/7.5/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -129,10 +129,8 @@ This command shows an example where the `-NoEnumerate` switch is used to round-t JSON array. ```powershell -Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | - ConvertTo-Json -Compress)" -Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | - ConvertTo-Json -Compress)" +Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | ConvertTo-Json -Compress)" +Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | ConvertTo-Json -Compress)" ``` ```Output diff --git a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index e13d33284bec..372bd5e21b8a 100644 --- a/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/7.6/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -129,10 +129,8 @@ This command shows an example where the `-NoEnumerate` switch is used to round-t JSON array. ```powershell -Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | - ConvertTo-Json -Compress)" -Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | - ConvertTo-Json -Compress)" +Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | ConvertTo-Json -Compress)" +Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | ConvertTo-Json -Compress)" ``` ```Output diff --git a/reference/7.7/Microsoft.PowerShell.Utility/ConvertFrom-Json.md b/reference/7.7/Microsoft.PowerShell.Utility/ConvertFrom-Json.md index b7a2ac676b71..8c92dbb9f5a6 100644 --- a/reference/7.7/Microsoft.PowerShell.Utility/ConvertFrom-Json.md +++ b/reference/7.7/Microsoft.PowerShell.Utility/ConvertFrom-Json.md @@ -129,10 +129,8 @@ This command shows an example where the `-NoEnumerate` switch is used to round-t JSON array. ```powershell -Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | - ConvertTo-Json -Compress)" -Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | - ConvertTo-Json -Compress)" +Write-Output "With -NoEnumerate: $('[1]' | ConvertFrom-Json -NoEnumerate | ConvertTo-Json -Compress)" +Write-Output "Without -NoEnumerate: $('[1]' | ConvertFrom-Json | ConvertTo-Json -Compress)" ``` ```Output