Updates from: 06/08/2021 03:12:42
Service Microsoft Docs article Related commit history on GitHub Change details
Microsoft.PowerShell.Core About Execution Policies (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Execution_Policies.md
--- description: Describes the PowerShell execution policies and explains how to manage them. Locale: en-US Previously updated : 08/10/2020
-no-loc: [Bypass, Default, Restricted, Undefined, Process, Scope]
Last updated : 06/07/2021
+no-loc: [Bypass, Default, Restricted, Undefined, Unrestricted, Process, Scope, MachinePolicy, about_Group_Policy_Settings]
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Execution Policies
Microsoft.PowerShell.Core About Parameters (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Parameters.md
---
-description: Describes how to work with command parameters in PowerShell.
-keywords: powershell,cmdlet
+description: Describes how to work with command parameters in PowerShell.
Locale: en-US Previously updated : 02/12/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameters?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Parameters
prompts you for a value for the parameter.
#### Parameter Position
-If the `Position` setting is set to a positive integer, the parameter name is
-not required. This type of parameter is referred to as a positional parameter,
-and the number indicates the position in which the parameter must appear in
-relation to other positional parameters. A named parameter can be listed in any
-position after the cmdlet name. If you include the parameter name for a
-positional parameter, the parameter can be listed in any position after the
-cmdlet name.
+If the `Position` setting is set to a non-negative integer, the parameter name
+is not required. This type of parameter is referred to as a positional
+parameter, and the number indicates the position in which the parameter must
+appear in relation to other positional parameters. A named parameter can be
+listed in any position after the cmdlet name. If you include the parameter name
+for a positional parameter, the parameter can be listed in any position after
+the cmdlet name.
For example, the `Get-ChildItem` cmdlet has Path and Exclude parameters. The `Position` setting for **Path** is **0**, which means that it is a positional
Microsoft.PowerShell.Core About Signing (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Signing.md
---
-description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
-keywords: powershell,cmdlet
+description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
Locale: en-US Previously updated : 07/31/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Signing
To run an unsigned script, use the Unblock-File cmdlet or use the following
procedure. 1. Save the script file on your computer.
-2. Click Start, click My Computer, and locate the saved script file.
-3. Right-click the script file, and then click Properties.
-4. Click Unblock.
+1. Click Start, click My Computer, and locate the saved script file.
+1. Right-click the script file, and then click Properties.
+1. Click Unblock.
If a script that was downloaded from the internet is digitally signed, but you have not yet chosen to trust its publisher, PowerShell displays the following
topic.
## Create a self-signed certificate
-To create a self-signed certificate, use the `New-SelfSignedCertificate`
-cmdlet in the PKI module. This module is introduced in PowerShell 3.0 and is
-included in Windows 8 and Windows Server 2012. For more information, see the
-help topic for the `New-SelfSignedCertificate` cmdlet.
+To create a self-signed certificate, use the
+[New-SelfSignedCertificate](xref:pki.New-SelfSignedCertificate) cmdlet in the
+PKI module. This module is introduced in PowerShell 3.0 and is included in
+Windows 8 and Windows Server 2012. For more information, see the help topic for
+the `New-SelfSignedCertificate` cmdlet.
+
+```powershell
+$params = @{
+ Subject = 'CN=PowerShell Code Signing Cert'
+ Type = 'CodeSigning'
+ CertStoreLocation = 'Cert:\CurrentUser\My'
+ HashAlgorithm = 'sha256'
+}
+$cert = New-SelfSignedCertificate @params
+```
+
+### Using Makecert.exe
To create a self-signed certificate in earlier versions of Windows, use the Certificate Creation tool `MakeCert.exe`. This tool is included in the Microsoft .NET SDK (versions 1.1 and later) and in the Microsoft Windows SDK. For more information about the syntax and the parameter descriptions of the
-MakeCert.exe tool, see
+`MakeCert.exe` tool, see
[Certificate Creation Tool (MakeCert.exe)](/previous-versions/dotnet/netframework-2.0/bfsktky3(v=vs.80)).
-To use the MakeCert.exe tool to create a certificate, run the following
+To use the `MakeCert.exe` tool to create a certificate, run the following
commands in an SDK Command Prompt window.
-Note: The first command creates a local certification authority for your
-computer. The second command generates a personal certificate from the
-certification authority.
-
-Note: You can copy or type the commands exactly as they appear. No
-substitutions are necessary, although you can change the certificate name.
+> [!NOTE]
+> The first command creates a local certification authority for your computer.
+> The second command generates a personal certificate from the certification
+> authority. You can copy or type the commands exactly as they appear. No
+> substitutions are necessary, although you can change the certificate name.
```powershell
-makecert -n "CN=PowerShell Local Certificate Root" -a sha1 `
+makecert -n "CN=PowerShell Local Certificate Root" -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer ` -ss Root -sr localMachine
-makecert -pe -n "CN=PowerShell User" -ss MY -a sha1 `
+makecert -pe -n "CN=PowerShell User" -ss MY -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer ```
-The MakeCert.exe tool will prompt you for a private key password. The password
-ensures that no one can use or access the certificate without your consent.
-Create and enter a password that you can remember. You will use this password
-later to retrieve the certificate.
+The `MakeCert.exe` tool will prompt you for a private key password. The
+password ensures that no one can use or access the certificate without your
+consent. Create and enter a password that you can remember. You will use this
+password later to retrieve the certificate.
To verify that the certificate was generated correctly, use the following command to get the certificate in the certificate store on the computer. You
Microsoft.PowerShell.Management Get Itempropertyvalue (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 05/25/2021 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-itempropertyvalue?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-ItemPropertyValue --- # Get-ItemPropertyValue
-## SYNOPSIS
+## Synopsis
Gets the value for one or more properties of a specified item.
-## SYNTAX
+## Syntax
### Path (Default)
Get-ItemPropertyValue -LiteralPath <String[]> [-Name] <String[]> [-Filter <Strin
[-Exclude <String[]>] [-Credential <PSCredential>] [-UseTransaction] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Get-ItemPropertyValue` gets the current value for a property that you specify when you use the **Name** parameter, located in a path that you specify with either the **Path** or **LiteralPath** parameters.
-## EXAMPLES
+## Examples
### Example 1: Get the value of the ProductID property
Target : {}
LinkType : ```
-## PARAMETERS
+## Parameters
### -Credential
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).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains a path to this cmdlet.
-## OUTPUTS
+## Outputs
### System.Boolean, System.String, System.DateTime
This cmdlet returns an object for each item property value that it gets. The obj
the property value that is retrieved. For example, in a file system drive, the cmdlet might return a file or folder.
-## NOTES
+## Notes
This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, run the `Get-PSProvider` cmdlet. For more information, see about_Providers.
-## RELATED LINKS
+## Related Links
[Get-ItemProperty](Get-ItemProperty.md)
Microsoft.PowerShell.Utility Write Warning (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Utility/Write-Warning.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 10/14/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/write-warning?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Write-Warning
Title: Write-Warning
# Write-Warning
-## SYNOPSIS
+## Synopsis
Writes a warning message.
-## SYNTAX
+## Syntax
``` Write-Warning [-Message] <String> [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Write-Warning` cmdlet writes a warning message to the PowerShell host. The response to the warning depends on the value of the user's `$WarningPreference` variable and the use of the **WarningAction** common parameter.
-## EXAMPLES
+## Examples
### Example 1: Write a warning message
PS> $WarningPreference = "SilentlyContinue"
PS> Write-Warning "This is only a test warning." PS> $WarningPreference = "Stop" PS> Write-Warning "This is only a test warning."
-WARNING: This is only a test message.
+WARNING: This is only a test warning.
Write-Warning : Command execution stopped because the shell variable "WarningPreference" is set to Stop. At line:1 char:14
- + Write-Warning <<<< "This is only a test message."
+ + Write-Warning <<<< "This is only a test warning."
``` The first command displays the default value of the `$WarningPreference` variable, which is
warning.
For more information about the **WarningAction** common parameter, see [about_CommonParameters](../Microsoft.Powershell.Core/About/about_CommonParameters.md).
-## PARAMETERS
+## Parameters
### -Message+ Specifies the warning message. ```yaml
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains the warning to `Write-Warning`.
-## OUTPUTS
+## Outputs
### None `Write-Warning` writes only to the warning stream. It does not generate any other output.
-## NOTES
+## Notes
The default value for the `$WarningPreference` variable is `Continue`, which displays the warning and then continues executing the command. To determine valid values for a preference variable such as `$WarningPreference`, set it to a string of random characters, such as "abc". The resulting error message lists the valid values.
-## RELATED LINKS
+## Related Links
[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md)
Microsoft.PowerShell.Core About Execution Policies (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Execution_Policies.md
--- description: Describes the PowerShell execution policies and explains how to manage them. Locale: en-US Previously updated : 08/10/2020
-no-loc: [Bypass, Default, Restricted, Undefined, Process, Scope]
Last updated : 06/07/2021
+no-loc: [Bypass, Default, Restricted, Undefined, Unrestricted, Process, Scope, MachinePolicy, about_Group_Policy_Settings]
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Execution Policies
Microsoft.PowerShell.Core About Parameters (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Parameters.md
---
-description: Describes how to work with command parameters in PowerShell.
-keywords: powershell,cmdlet
+description: Describes how to work with command parameters in PowerShell.
Locale: en-US Previously updated : 02/12/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameters?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Parameters
prompts you for a value for the parameter.
#### Parameter Position
-If the `Position` setting is set to a positive integer, the parameter name is
-not required. This type of parameter is referred to as a positional parameter,
-and the number indicates the position in which the parameter must appear in
-relation to other positional parameters. A named parameter can be listed in any
-position after the cmdlet name. If you include the parameter name for a
-positional parameter, the parameter can be listed in any position after the
-cmdlet name.
+If the `Position` setting is set to a non-negative integer, the parameter name
+is not required. This type of parameter is referred to as a positional
+parameter, and the number indicates the position in which the parameter must
+appear in relation to other positional parameters. A named parameter can be
+listed in any position after the cmdlet name. If you include the parameter name
+for a positional parameter, the parameter can be listed in any position after
+the cmdlet name.
For example, the `Get-ChildItem` cmdlet has Path and Exclude parameters. The `Position` setting for **Path** is **0**, which means that it is a positional
Microsoft.PowerShell.Core About Signing (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Signing.md
---
-description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
-keywords: powershell,cmdlet
+description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
Locale: en-US Previously updated : 07/31/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Signing
To run an unsigned script, use the Unblock-File cmdlet or use the following
procedure. 1. Save the script file on your computer.
-2. Click Start, click My Computer, and locate the saved script file.
-3. Right-click the script file, and then click Properties.
-4. Click Unblock.
+1. Click Start, click My Computer, and locate the saved script file.
+1. Right-click the script file, and then click Properties.
+1. Click Unblock.
If a script that was downloaded from the internet is digitally signed, but you have not yet chosen to trust its publisher, PowerShell displays the following
topic.
## Create a self-signed certificate
-To create a self-signed certificate, use the `New-SelfSignedCertificate`
-cmdlet in the PKI module. This module is introduced in PowerShell 3.0 and is
-included in Windows 8 and Windows Server 2012. For more information, see the
-help topic for the `New-SelfSignedCertificate` cmdlet.
+To create a self-signed certificate, use the
+[New-SelfSignedCertificate](xref:pki.New-SelfSignedCertificate) cmdlet in the
+PKI module. This module is introduced in PowerShell 3.0 and is included in
+Windows 8 and Windows Server 2012. For more information, see the help topic for
+the `New-SelfSignedCertificate` cmdlet.
+
+```powershell
+$params = @{
+ Subject = 'CN=PowerShell Code Signing Cert'
+ Type = 'CodeSigning'
+ CertStoreLocation = 'Cert:\CurrentUser\My'
+ HashAlgorithm = 'sha256'
+}
+$cert = New-SelfSignedCertificate @params
+```
+
+### Using Makecert.exe
To create a self-signed certificate in earlier versions of Windows, use the Certificate Creation tool `MakeCert.exe`. This tool is included in the Microsoft .NET SDK (versions 1.1 and later) and in the Microsoft Windows SDK. For more information about the syntax and the parameter descriptions of the
-MakeCert.exe tool, see
+`MakeCert.exe` tool, see
[Certificate Creation Tool (MakeCert.exe)](/previous-versions/dotnet/netframework-2.0/bfsktky3(v=vs.80)).
-To use the MakeCert.exe tool to create a certificate, run the following
+To use the `MakeCert.exe` tool to create a certificate, run the following
commands in an SDK Command Prompt window.
-Note: The first command creates a local certification authority for your
-computer. The second command generates a personal certificate from the
-certification authority.
-
-Note: You can copy or type the commands exactly as they appear. No
-substitutions are necessary, although you can change the certificate name.
+> [!NOTE]
+> The first command creates a local certification authority for your computer.
+> The second command generates a personal certificate from the certification
+> authority. You can copy or type the commands exactly as they appear. No
+> substitutions are necessary, although you can change the certificate name.
```powershell
-makecert -n "CN=PowerShell Local Certificate Root" -a sha1 `
+makecert -n "CN=PowerShell Local Certificate Root" -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer ` -ss Root -sr localMachine
-makecert -pe -n "CN=PowerShell User" -ss MY -a sha1 `
+makecert -pe -n "CN=PowerShell User" -ss MY -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer ```
-The MakeCert.exe tool will prompt you for a private key password. The password
-ensures that no one can use or access the certificate without your consent.
-Create and enter a password that you can remember. You will use this password
-later to retrieve the certificate.
+The `MakeCert.exe` tool will prompt you for a private key password. The
+password ensures that no one can use or access the certificate without your
+consent. Create and enter a password that you can remember. You will use this
+password later to retrieve the certificate.
To verify that the certificate was generated correctly, use the following command to get the certificate in the certificate store on the computer. You
Microsoft.PowerShell.Management Get Itempropertyvalue (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 05/14/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-itempropertyvalue?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-ItemPropertyValue --- # Get-ItemPropertyValue
-## SYNOPSIS
+## Synopsis
Gets the value for one or more properties of a specified item.
-## SYNTAX
+## Syntax
### Path (Default)
Get-ItemPropertyValue -LiteralPath <String[]> [-Name] <String[]> [-Filter <Strin
[-Exclude <String[]>] [-Credential <PSCredential>] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Get-ItemPropertyValue` gets the current value for a property that you specify when you use the **Name** parameter, located in a path that you specify with either the **Path** or **LiteralPath** parameters.
-## EXAMPLES
+## Examples
### Example 1: Get the value of the ProductID property
Target :
LinkType : ```
-## PARAMETERS
+## Parameters
### -Credential
Accept wildcard characters: False
### -Name Specifies the name of the property or properties to retrieve.
-Wildcard characters are permitted.
```yaml Type: System.String[]
Required: True
Position: 1 Default value: None Accept pipeline input: False
-Accept wildcard characters: True
+Accept wildcard characters: False
``` ### -Path
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar
`-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains a path to this cmdlet.
-## OUTPUTS
+## Outputs
### System.Boolean, System.String, System.DateTime
This cmdlet returns an object for each item property value that it gets.
The object type depends on the property value that is retrieved. For example, in a file system drive, the cmdlet might return a file or folder.
-## NOTES
+## Notes
This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, run the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
-## RELATED LINKS
+## Related Links
[Get-ItemProperty](Get-ItemProperty.md)
Microsoft.PowerShell.Utility Write Warning (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Utility/Write-Warning.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 10/14/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/write-warning?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Write-Warning
Title: Write-Warning
# Write-Warning
-## SYNOPSIS
+## Synopsis
Writes a warning message.
-## SYNTAX
+## Syntax
``` Write-Warning [-Message] <String> [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Write-Warning` cmdlet writes a warning message to the PowerShell host. The response to the warning depends on the value of the user's `$WarningPreference` variable and the use of the **WarningAction** common parameter.
-## EXAMPLES
+## Examples
### Example 1: Write a warning message
PS> $WarningPreference = "SilentlyContinue"
PS> Write-Warning "This is only a test warning." PS> $WarningPreference = "Stop" PS> Write-Warning "This is only a test warning."
-WARNING: This is only a test message.
-Write-Warning : Command execution stopped because the shell variable "WarningPreference" is set to Stop.
-At line:1 char:14
- + Write-Warning <<<< "This is only a test message."
+WARNING: This is only a test warning.
+Write-Warning: The running command stopped because the preference variable "WarningPreference" or common parameter is set to Stop: This is only a test warning.
``` The first command displays the default value of the `$WarningPreference` variable, which is
warning.
For more information about the **WarningAction** common parameter, see [about_CommonParameters](../Microsoft.Powershell.Core/About/about_CommonParameters.md).
-## PARAMETERS
+## Parameters
### -Message Specifies the warning message.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains the warning to `Write-Warning`.
-## OUTPUTS
+## Outputs
### None `Write-Warning` writes only to the warning stream. It does not generate any other output.
-## NOTES
+## Notes
The default value for the `$WarningPreference` variable is `Continue`, which displays the warning and then continues executing the command. To determine valid values for a preference variable such as `$WarningPreference`, set it to a string of random characters, such as "abc". The resulting error message lists the valid values.
-## RELATED LINKS
+## Related Links
[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md)
Microsoft.PowerShell.Core About Execution Policies (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Execution_Policies.md
--- description: Describes the PowerShell execution policies and explains how to manage them. Locale: en-US Previously updated : 08/10/2020
-no-loc: [Bypass, Default, Restricted, Undefined, Process, Scope]
Last updated : 06/07/2021
+no-loc: [Bypass, Default, Restricted, Undefined, Unrestricted, Process, Scope, MachinePolicy, about_Group_Policy_Settings]
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Execution Policies
Microsoft.PowerShell.Core About Parameters (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Parameters.md
---
-description: Describes how to work with command parameters in PowerShell.
-keywords: powershell,cmdlet
+description: Describes how to work with command parameters in PowerShell.
Locale: en-US Previously updated : 02/12/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameters?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Parameters
prompts you for a value for the parameter.
#### Parameter Position
-If the `Position` setting is set to a positive integer, the parameter name is
-not required. This type of parameter is referred to as a positional parameter,
-and the number indicates the position in which the parameter must appear in
-relation to other positional parameters. A named parameter can be listed in any
-position after the cmdlet name. If you include the parameter name for a
-positional parameter, the parameter can be listed in any position after the
-cmdlet name.
+If the `Position` setting is set to a non-negative integer, the parameter name
+is not required. This type of parameter is referred to as a positional
+parameter, and the number indicates the position in which the parameter must
+appear in relation to other positional parameters. A named parameter can be
+listed in any position after the cmdlet name. If you include the parameter name
+for a positional parameter, the parameter can be listed in any position after
+the cmdlet name.
For example, the `Get-ChildItem` cmdlet has Path and Exclude parameters. The `Position` setting for **Path** is **0**, which means that it is a positional
information about common parameters, see [about_CommonParameters](about_CommonPa
[about_Pipelines](about_Pipelines.md) [about_Wildcards](about_Wildcards.md)-
Microsoft.PowerShell.Core About Signing (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Signing.md
---
-description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
-keywords: powershell,cmdlet
+description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
Locale: en-US Previously updated : 07/31/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Signing
To run an unsigned script, use the Unblock-File cmdlet or use the following
procedure. 1. Save the script file on your computer.
-2. Click Start, click My Computer, and locate the saved script file.
-3. Right-click the script file, and then click Properties.
-4. Click Unblock.
+1. Click Start, click My Computer, and locate the saved script file.
+1. Right-click the script file, and then click Properties.
+1. Click Unblock.
If a script that was downloaded from the internet is digitally signed, but you have not yet chosen to trust its publisher, PowerShell displays the following
topic.
## Create a self-signed certificate
-To create a self-signed certificate, use the `New-SelfSignedCertificate`
-cmdlet in the PKI module. This module is introduced in PowerShell 3.0 and is
-included in Windows 8 and Windows Server 2012. For more information, see the
-help topic for the `New-SelfSignedCertificate` cmdlet.
+To create a self-signed certificate, use the
+[New-SelfSignedCertificate](xref:pki.New-SelfSignedCertificate) cmdlet in the
+PKI module. This module is introduced in PowerShell 3.0 and is included in
+Windows 8 and Windows Server 2012. For more information, see the help topic for
+the `New-SelfSignedCertificate` cmdlet.
+
+```powershell
+$params = @{
+ Subject = 'CN=PowerShell Code Signing Cert'
+ Type = 'CodeSigning'
+ CertStoreLocation = 'Cert:\CurrentUser\My'
+ HashAlgorithm = 'sha256'
+}
+$cert = New-SelfSignedCertificate @params
+```
+
+### Using Makecert.exe
To create a self-signed certificate in earlier versions of Windows, use the Certificate Creation tool `MakeCert.exe`. This tool is included in the Microsoft .NET SDK (versions 1.1 and later) and in the Microsoft Windows SDK. For more information about the syntax and the parameter descriptions of the
-MakeCert.exe tool, see
+`MakeCert.exe` tool, see
[Certificate Creation Tool (MakeCert.exe)](/previous-versions/dotnet/netframework-2.0/bfsktky3(v=vs.80)).
-To use the MakeCert.exe tool to create a certificate, run the following
+To use the `MakeCert.exe` tool to create a certificate, run the following
commands in an SDK Command Prompt window.
-Note: The first command creates a local certification authority for your
-computer. The second command generates a personal certificate from the
-certification authority.
-
-Note: You can copy or type the commands exactly as they appear. No
-substitutions are necessary, although you can change the certificate name.
+> [!NOTE]
+> The first command creates a local certification authority for your computer.
+> The second command generates a personal certificate from the certification
+> authority. You can copy or type the commands exactly as they appear. No
+> substitutions are necessary, although you can change the certificate name.
```powershell
-makecert -n "CN=PowerShell Local Certificate Root" -a sha1 `
+makecert -n "CN=PowerShell Local Certificate Root" -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer ` -ss Root -sr localMachine
-makecert -pe -n "CN=PowerShell User" -ss MY -a sha1 `
+makecert -pe -n "CN=PowerShell User" -ss MY -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer ```
-The MakeCert.exe tool will prompt you for a private key password. The password
-ensures that no one can use or access the certificate without your consent.
-Create and enter a password that you can remember. You will use this password
-later to retrieve the certificate.
+The `MakeCert.exe` tool will prompt you for a private key password. The
+password ensures that no one can use or access the certificate without your
+consent. Create and enter a password that you can remember. You will use this
+password later to retrieve the certificate.
To verify that the certificate was generated correctly, use the following command to get the certificate in the certificate store on the computer. You
Microsoft.PowerShell.Management Get Itempropertyvalue (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 05/14/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-itempropertyvalue?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-ItemPropertyValue --- # Get-ItemPropertyValue
-## SYNOPSIS
+## Synopsis
Gets the value for one or more properties of a specified item.
-## SYNTAX
+## Syntax
### Path (Default)
Get-ItemPropertyValue -LiteralPath <String[]> [-Name] <String[]> [-Filter <Strin
[-Exclude <String[]>] [-Credential <PSCredential>] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Get-ItemPropertyValue` gets the current value for a property that you specify when you use the **Name** parameter, located in a path that you specify with either the **Path** or **LiteralPath** parameters.
-## EXAMPLES
+## Examples
### Example 1: Get the value of the ProductID property
Target :
LinkType : ```
-## PARAMETERS
+## Parameters
### -Credential
Accept wildcard characters: False
### -Name Specifies the name of the property or properties to retrieve.
-Wildcard characters are permitted.
```yaml Type: System.String[]
Required: True
Position: 1 Default value: None Accept pipeline input: False
-Accept wildcard characters: True
+Accept wildcard characters: False
``` ### -Path
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar
`-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains a path to this cmdlet.
-## OUTPUTS
+## Outputs
### System.Boolean, System.String, System.DateTime
This cmdlet returns an object for each item property value that it gets.
The object type depends on the property value that is retrieved. For example, in a file system drive, the cmdlet might return a file or folder.
-## NOTES
+## Notes
This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, run the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
-## RELATED LINKS
+## Related Links
[Get-ItemProperty](Get-ItemProperty.md)
Microsoft.PowerShell.Utility Write Warning (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Utility/Write-Warning.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml
keywords: powershell,cmdlet Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 10/14/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/write-warning?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Write-Warning
Title: Write-Warning
# Write-Warning
-## SYNOPSIS
+## Synopsis
Writes a warning message.
-## SYNTAX
+## Syntax
``` Write-Warning [-Message] <String> [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Write-Warning` cmdlet writes a warning message to the PowerShell host. The response to the warning depends on the value of the user's `$WarningPreference` variable and the use of the **WarningAction** common parameter.
-## EXAMPLES
+## Examples
### Example 1: Write a warning message
PS> $WarningPreference = "SilentlyContinue"
PS> Write-Warning "This is only a test warning." PS> $WarningPreference = "Stop" PS> Write-Warning "This is only a test warning."
-WARNING: This is only a test message.
-Write-Warning : Command execution stopped because the shell variable "WarningPreference" is set to Stop.
-At line:1 char:14
- + Write-Warning <<<< "This is only a test message."
+WARNING: This is only a test warning.
+Write-Warning: The running command stopped because the preference variable "WarningPreference" or common parameter is set to Stop: This is only a test warning.
``` The first command displays the default value of the `$WarningPreference` variable, which is
warning.
For more information about the **WarningAction** common parameter, see [about_CommonParameters](../Microsoft.Powershell.Core/About/about_CommonParameters.md).
-## PARAMETERS
+## Parameters
### -Message Specifies the warning message.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains the warning to `Write-Warning`.
-## OUTPUTS
+## Outputs
### None `Write-Warning` writes only to the warning stream. It does not generate any other output.
-## NOTES
+## Notes
The default value for the `$WarningPreference` variable is `Continue`, which displays the warning and then continues executing the command. To determine valid values for a preference variable such as `$WarningPreference`, set it to a string of random characters, such as "abc". The resulting error message lists the valid values.
-## RELATED LINKS
+## Related Links
[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md)
Microsoft.PowerShell.Core About Execution Policies (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Execution_Policies.md
--- description: Describes the PowerShell execution policies and explains how to manage them. Locale: en-US Previously updated : 08/10/2020
-no-loc: [Bypass, Default, Restricted, Undefined, Process, Scope]
Last updated : 06/07/2021
+no-loc: [Bypass, Default, Restricted, Undefined, Unrestricted, Process, Scope, MachinePolicy, about_Group_Policy_Settings]
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Execution Policies
Microsoft.PowerShell.Core About Parameters (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Parameters.md
--- description: Describes how to work with command parameters in PowerShell. Locale: en-US Previously updated : 02/12/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_parameters?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Parameters
prompts you for a value for the parameter.
#### Parameter Position
-If the `Position` setting is set to a positive integer, the parameter name is
-not required. This type of parameter is referred to as a positional parameter,
-and the number indicates the position in which the parameter must appear in
-relation to other positional parameters. A named parameter can be listed in any
-position after the cmdlet name. If you include the parameter name for a
-positional parameter, the parameter can be listed in any position after the
-cmdlet name.
+If the `Position` setting is set to a non-negative integer, the parameter name
+is not required. This type of parameter is referred to as a positional
+parameter, and the number indicates the position in which the parameter must
+appear in relation to other positional parameters. A named parameter can be
+listed in any position after the cmdlet name. If you include the parameter name
+for a positional parameter, the parameter can be listed in any position after
+the cmdlet name.
For example, the `Get-ChildItem` cmdlet has Path and Exclude parameters. The `Position` setting for **Path** is **0**, which means that it is a positional
information about common parameters, see [about_CommonParameters](about_CommonPa
[about_Pipelines](about_Pipelines.md) [about_Wildcards](about_Wildcards.md)-
Microsoft.PowerShell.Core About Signing (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Signing.md
--- description: Explains how to sign scripts so that they comply with the PowerShell execution policies. Locale: en-US Previously updated : 07/31/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about Signing
To run an unsigned script, use the Unblock-File cmdlet or use the following
procedure. 1. Save the script file on your computer.
-2. Click Start, click My Computer, and locate the saved script file.
-3. Right-click the script file, and then click Properties.
-4. Click Unblock.
+1. Click Start, click My Computer, and locate the saved script file.
+1. Right-click the script file, and then click Properties.
+1. Click Unblock.
If a script that was downloaded from the internet is digitally signed, but you have not yet chosen to trust its publisher, PowerShell displays the following
topic.
## Create a self-signed certificate
-To create a self-signed certificate, use the `New-SelfSignedCertificate`
-cmdlet in the PKI module. This module is introduced in PowerShell 3.0 and is
-included in Windows 8 and Windows Server 2012. For more information, see the
-help topic for the `New-SelfSignedCertificate` cmdlet.
+To create a self-signed certificate, use the
+[New-SelfSignedCertificate](xref:pki.New-SelfSignedCertificate) cmdlet in the
+PKI module. This module is introduced in PowerShell 3.0 and is included in
+Windows 8 and Windows Server 2012. For more information, see the help topic for
+the `New-SelfSignedCertificate` cmdlet.
+
+```powershell
+$params = @{
+ Subject = 'CN=PowerShell Code Signing Cert'
+ Type = 'CodeSigning'
+ CertStoreLocation = 'Cert:\CurrentUser\My'
+ HashAlgorithm = 'sha256'
+}
+$cert = New-SelfSignedCertificate @params
+```
+
+### Using Makecert.exe
To create a self-signed certificate in earlier versions of Windows, use the Certificate Creation tool `MakeCert.exe`. This tool is included in the Microsoft .NET SDK (versions 1.1 and later) and in the Microsoft Windows SDK. For more information about the syntax and the parameter descriptions of the
-MakeCert.exe tool, see
+`MakeCert.exe` tool, see
[Certificate Creation Tool (MakeCert.exe)](/previous-versions/dotnet/netframework-2.0/bfsktky3(v=vs.80)).
-To use the MakeCert.exe tool to create a certificate, run the following
+To use the `MakeCert.exe` tool to create a certificate, run the following
commands in an SDK Command Prompt window.
-Note: The first command creates a local certification authority for your
-computer. The second command generates a personal certificate from the
-certification authority.
-
-Note: You can copy or type the commands exactly as they appear. No
-substitutions are necessary, although you can change the certificate name.
+> [!NOTE]
+> The first command creates a local certification authority for your computer.
+> The second command generates a personal certificate from the certification
+> authority. You can copy or type the commands exactly as they appear. No
+> substitutions are necessary, although you can change the certificate name.
```powershell
-makecert -n "CN=PowerShell Local Certificate Root" -a sha1 `
+makecert -n "CN=PowerShell Local Certificate Root" -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer ` -ss Root -sr localMachine
-makecert -pe -n "CN=PowerShell User" -ss MY -a sha1 `
+makecert -pe -n "CN=PowerShell User" -ss MY -a sha256 `
-eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer ```
-The MakeCert.exe tool will prompt you for a private key password. The password
-ensures that no one can use or access the certificate without your consent.
-Create and enter a password that you can remember. You will use this password
-later to retrieve the certificate.
+The `MakeCert.exe` tool will prompt you for a private key password. The
+password ensures that no one can use or access the certificate without your
+consent. Create and enter a password that you can remember. You will use this
+password later to retrieve the certificate.
To verify that the certificate was generated correctly, use the following command to get the certificate in the certificate store on the computer. You
Microsoft.PowerShell.Management Get Itempropertyvalue (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md
external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management Previously updated : 05/14/2019 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-itempropertyvalue?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Get-ItemPropertyValue --- # Get-ItemPropertyValue
-## SYNOPSIS
+## Synopsis
Gets the value for one or more properties of a specified item.
-## SYNTAX
+## Syntax
### Path (Default)
Get-ItemPropertyValue -LiteralPath <String[]> [-Name] <String[]> [-Filter <Strin
[-Exclude <String[]>] [-Credential <PSCredential>] [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Get-ItemPropertyValue` gets the current value for a property that you specify when you use the **Name** parameter, located in a path that you specify with either the **Path** or **LiteralPath** parameters.
-## EXAMPLES
+## Examples
### Example 1: Get the value of the ProductID property
Target :
LinkType : ```
-## PARAMETERS
+## Parameters
### -Credential
Accept wildcard characters: False
### -Name Specifies the name of the property or properties to retrieve.
-Wildcard characters are permitted.
```yaml Type: System.String[]
Required: True
Position: 1 Default value: None Accept pipeline input: False
-Accept wildcard characters: True
+Accept wildcard characters: False
``` ### -Path
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVar
`-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains a path to this cmdlet.
-## OUTPUTS
+## Outputs
### System.Boolean, System.String, System.DateTime
This cmdlet returns an object for each item property value that it gets.
The object type depends on the property value that is retrieved. For example, in a file system drive, the cmdlet might return a file or folder.
-## NOTES
+## Notes
This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, run the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md).
-## RELATED LINKS
+## Related Links
[Get-ItemProperty](Get-ItemProperty.md)
Microsoft.PowerShell.Utility Write Warning (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Utility/Write-Warning.md
external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility Previously updated : 10/14/2020 Last updated : 06/07/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/write-warning?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: Write-Warning
Title: Write-Warning
# Write-Warning
-## SYNOPSIS
+## Synopsis
Writes a warning message.
-## SYNTAX
+## Syntax
``` Write-Warning [-Message] <String> [<CommonParameters>] ```
-## DESCRIPTION
+## Description
The `Write-Warning` cmdlet writes a warning message to the PowerShell host. The response to the warning depends on the value of the user's `$WarningPreference` variable and the use of the **WarningAction** common parameter.
-## EXAMPLES
+## Examples
### Example 1: Write a warning message
PS> $WarningPreference = "SilentlyContinue"
PS> Write-Warning "This is only a test warning." PS> $WarningPreference = "Stop" PS> Write-Warning "This is only a test warning."
-WARNING: This is only a test message.
-Write-Warning : Command execution stopped because the shell variable "WarningPreference" is set to Stop.
-At line:1 char:14
- + Write-Warning <<<< "This is only a test message."
+WARNING: This is only a test warning.
+Write-Warning: The running command stopped because the preference variable "WarningPreference" or common parameter is set to Stop: This is only a test warning.
``` The first command displays the default value of the `$WarningPreference` variable, which is
warning.
For more information about the **WarningAction** common parameter, see [about_CommonParameters](../Microsoft.Powershell.Core/About/about_CommonParameters.md).
-## PARAMETERS
+## Parameters
### -Message Specifies the warning message.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-## INPUTS
+## Inputs
### System.String You can pipe a string that contains the warning to `Write-Warning`.
-## OUTPUTS
+## Outputs
### None `Write-Warning` writes only to the warning stream. It does not generate any other output.
-## NOTES
+## Notes
The default value for the `$WarningPreference` variable is `Continue`, which displays the warning and then continues executing the command. To determine valid values for a preference variable such as `$WarningPreference`, set it to a string of random characters, such as "abc". The resulting error message lists the valid values.
-## RELATED LINKS
+## Related Links
[about_Output_Streams](../Microsoft.PowerShell.Core/About/about_Output_Streams.md)
developer Alias Attribute Declaration https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/developer/cmdlet/alias-attribute-declaration.md
--- Previously updated : 09/13/2016 Last updated : 06/07/2021 Title: Alias Attribute Declaration description: Alias Attribute Declaration --- # Alias Attribute Declaration
-The Alias attribute allows the user to specify different names for a cmdlet parameter. Aliases can be used to provide shortcuts for a parameter name, or they can provide different names that are appropriate for different scenarios.
+The Alias attribute allows the user to specify different names for a cmdlet or a cmdlet parameter.
+Aliases can be used to provide shortcuts for a parameter name, or they can provide different names
+that are appropriate for different scenarios.
## Syntax
The Alias attribute allows the user to specify different names for a cmdlet para
#### Parameters
-`aliasName` (String[])
+`aliasNames` (String[])
Required. Specifies a set of comma-separated alias names for the cmdlet parameter. ## Remarks -- The Alias attribute is used with the Parameter attribute when you specify a cmdlet parameter. For more information about how to declare these attributes, see [How to Declare Cmdlet Parameters](./how-to-declare-cmdlet-parameters.md).
+The Alias attribute is defined by the
+[System.Management.Automation.Aliasattribute](/dotnet/api/System.Management.Automation.AliasAttribute)
+class.
-- Each alias name must be unique within a cmdlet. Windows PowerShell does not check for duplicate alias names.
+Cmdlet aliases
-- The Alias attribute is used once for each parameter in a cmdlet.
+- The Alias attribute is used with the cmdlet declaration. For more information about how to declare
+ these attributes, see [Cmdlet Aliases](cmdlet-aliases.md).
+- Each parameter alias name must be unique. Windows PowerShell does not check for duplicate alias
+ names.
+
+Parameter aliases
-- The Alias attribute is defined by the [System.Management.Automation.Aliasattribute](/dotnet/api/System.Management.Automation.AliasAttribute) class.
+- The Alias attribute is used with the Parameter attribute when you specify a cmdlet parameter. For
+ more information about how to declare these attributes, see
+ [How to Declare Cmdlet Parameters](./how-to-declare-cmdlet-parameters.md).
+- Each parameter alias name must be unique within a cmdlet. Windows PowerShell does not check for
+ duplicate alias names.
+- The Alias attribute is used once for each parameter in a cmdlet.
## See Also
+[Cmdlet Aliases](cmdlet-aliases.md)
+ [Parameter Aliases](./parameter-aliases.md) [Writing a Windows PowerShell Cmdlet](./writing-a-windows-powershell-cmdlet.md)
developer Cmdlet Aliases https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/developer/cmdlet/cmdlet-aliases.md
--- Previously updated : 09/13/2016 Last updated : 06/07/2021 Title: Cmdlet Aliases description: Cmdlet Aliases --- # Cmdlet Aliases
-You can use cmdlet aliases to improve the cmdlet user experience. You can add aliases to frequently used cmdlets to reduce typing and to make it easier to complete tasks quickly. You can include built-in aliases in your cmdlets, or users can define their own custom aliases.
+You can use cmdlet aliases to improve the cmdlet user experience. You can add aliases to frequently
+used cmdlets to reduce typing and to make it easier to complete tasks quickly. You can include
+built-in aliases in your cmdlets, or users can define their own custom aliases.
-For example, the [Get-Command](/powershell/module/microsoft.powershell.core/get-command) cmdlet has a built-in `gcm` alias. You can also use aliases to add command names from other languages so that users do not have to learn new commands.
+For example, the [Get-Command](/powershell/module/microsoft.powershell.core/get-command) cmdlet has
+a built-in `gcm` alias. You can also use aliases to add command names from other languages so that
+users do not have to learn new commands.
## Alias Guidelines Follow these guidelines when you create built-in aliases for your cmdlets: -- Before you assign aliases, start Windows PowerShell, and then run the [Get-Alias](/powershell/module/Microsoft.PowerShell.Utility/Get-Alias) cmdlet to see the aliases that are already used.
+- Before you assign aliases, start Windows PowerShell, and then run the
+ [Get-Alias](/powershell/module/Microsoft.PowerShell.Utility/Get-Alias) cmdlet to see the aliases
+ that are already used.
-- Include an alias prefix that references the verb of the cmdlet name and an alias suffix that references the noun of the cmdlet name. For example, the alias for the `Import-Module` cmdlet is "ipmo". For a list of all the verbs and their aliases, see [Cmdlet Verbs](./approved-verbs-for-windows-powershell-commands.md).
+- Include an alias prefix that references the verb of the cmdlet name and an alias suffix that
+ references the noun of the cmdlet name. For example, the alias for the `Import-Module` cmdlet is
+ "ipmo". For a list of all the verbs and their aliases, see
+ [Cmdlet Verbs](./approved-verbs-for-windows-powershell-commands.md).
-- For cmdlets that have the same verb, include the same alias prefix. For example, the aliases for all the Windows PowerShell cmdlets that have the "Get" verb in their name use the "g" prefix.
+- For cmdlets that have the same verb, include the same alias prefix. For example, the aliases for
+ all the Windows PowerShell cmdlets that have the "Get" verb in their name use the "g" prefix.
-- For cmdlets that have the same noun, include the same alias suffix. For example, the aliases for all the Windows PowerShell cmdlets that have the "Session" noun in their name use the "sn" suffix.
+- For cmdlets that have the same noun, include the same alias suffix. For example, the aliases for
+ all the Windows PowerShell cmdlets that have the "Session" noun in their name use the "sn" suffix.
- For cmdlets that are equivalent to commands in other languages, use the name of the command. -- In general, make aliases as short as possible. Make sure the alias has at least one distinct character for the verb and one distinct character for the noun. Add more characters as needed to make the alias unique.
+- In general, make aliases as short as possible. Make sure the alias has at least one distinct
+ character for the verb and one distinct character for the noun. Add more characters as needed to
+ make the alias unique.
+
+- For cmdlet written in C# (or any other compiled .NET language), the alias can be defined using the
+ [Alias attibute](alias-attribute-declaration.md). For example:
+
+ ```csharp
+ [Cmdlet("Get", "SomeObject")]
+ [Alias("gso")]
+ public class GetSomeObjectCommand : Cmdlet
+ ```
## See Also
dsc Securemof https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/docs-conceptual/dsc/pull-server/secureMOF.md
--- Previously updated : 07/06/2020
-keywords: dsc,powershell,configuration,setup
Last updated : 06/07/2021 Title: Securing the MOF File description: This article describes how to ensure the target node has encrypted the MOF file. ---
$cert | Export-Certificate -FilePath "$env:temp\DscPublicKey.cer" -Force
Once exported, the `DscPublicKey.cer` would need to be copied to the **Authoring Node**.
-> Target Node: Windows Server 2012 R2/Windows 8.1 and earlier
-
-> [!WARNING]
-> Because the `New-SelfSignedCertificate` cmdlet on Windows Operating Systems prior to Windows 10
-> and Windows Server 2016 do not support the **Type** parameter, an alternate method of creating
-> this certificate is required on these operating systems. In this case you can use `makecert.exe`
-> or `certutil.exe` to create the certificate. This example uses the
-> [New-SelfSignedCertificateEx.ps1](https://gallery.technet.microsoft.com/scriptcenter/Self-signed-certificate-5920a7c6)
-> script from Microsoft Script Center as an alternate way to create the certificate. An updated
-> version of this script is available in the
-> [PSPKI](https://www.powershellgallery.com/packages/PSPKI/) module in the PowerShell Gallery.
-
-```powershell
-# note: These steps need to be performed in an Administrator PowerShell session
-# and in the folder that contains New-SelfSignedCertificateEx.ps1
-. .\New-SelfSignedCertificateEx.ps1
-New-SelfsignedCertificateEx `
- -Subject "CN=${ENV:ComputerName}" `
- -EKU 'Document Encryption' `
- -KeyUsage 'KeyEncipherment, DataEncipherment' `
- -SAN ${ENV:ComputerName} `
- -FriendlyName 'DSC Credential Encryption certificate' `
- -Exportable `
- -StoreLocation 'LocalMachine' `
- -KeyLength 2048 `
- -ProviderName 'Microsoft Enhanced Cryptographic Provider v1.0' `
- -AlgorithmName 'RSA' `
- -SignatureAlgorithm 'SHA256'
-# Locate the newly created certificate
-$Cert = Get-ChildItem -Path cert:\LocalMachine\My | Where-Object {
- ($_.FriendlyName -eq 'DSC Credential Encryption certificate') -and ($_.Subject -eq "CN=${ENV:ComputerName}")
- } | Select-Object -First 1
-# export the public key certificate
-$cert | Export-Certificate -FilePath "$env:temp\DscPublicKey.cer" -Force
-```
-
-Once exported, the ```DscPublicKey.cer``` would need to be copied to the **Authoring Node**.
- #### On the Authoring Node: import the cert's public key ```powershell
Import-Certificate -FilePath "$env:temp\DscPublicKey.cer" -CertStoreLocation Cer
Once exported, the `DscPrivateKey.pfx` would need to be copied to the **Target Node**.
-> Target Node: Windows Server 2012 R2/Windows 8.1 and earlier
-
-> [!WARNING]
-> Because the `New-SelfSignedCertificate` cmdlet on Windows Operating Systems prior to Windows 10
-> and Windows Server 2016 do not support the **Type** parameter, an alternate method of creating
-> this certificate is required on these operating systems. In this case you can use `makecert.exe`
-> or `certutil.exe` to create the certificate. An alternate method is to download the
-> [New-SelfSignedCertificateEx.ps1](https://gallery.technet.microsoft.com/scriptcenter/Self-signed-certificate-5920a7c6)
-> script from Microsoft Script Center and use it to create the certificate instead:
-
-```powershell
-# note: These steps need to be performed in an Administrator PowerShell session
-# and in the folder that contains New-SelfSignedCertificateEx.ps1
-. .\New-SelfSignedCertificateEx.ps1
-New-SelfsignedCertificateEx `
- -Subject "CN=${ENV:ComputerName}" `
- -EKU 'Document Encryption' `
- -KeyUsage 'KeyEncipherment, DataEncipherment' `
- -SAN ${ENV:ComputerName} `
- -FriendlyName 'DSC Credential Encryption certificate' `
- -Exportable `
- -StoreLocation 'LocalMachine' `
- -KeyLength 2048 `
- -ProviderName 'Microsoft Enhanced Cryptographic Provider v1.0' `
- -AlgorithmName 'RSA' `
- -SignatureAlgorithm 'SHA256'
-# Locate the newly created certificate
-$Cert = Get-ChildItem -Path cert:\LocalMachine\My | Where-Object {
- ($_.FriendlyName -eq 'DSC Credential Encryption certificate') -and ($_.Subject -eq "CN=${ENV:ComputerName}")
- } | Select-Object -First 1
-# export the public key certificate
-$mypwd = ConvertTo-SecureString -String "YOUR_PFX_PASSWD" -Force -AsPlainText
-$cert | Export-PfxCertificate -FilePath "$env:temp\DscPrivateKey.pfx" -Password $mypwd -Force
-# remove the private key certificate from the node but keep the public key certificate
-$cert | Export-Certificate -FilePath "$env:temp\DscPublicKey.cer" -Force
-$cert | Remove-Item -Force
-Import-Certificate -FilePath "$env:temp\DscPublicKey.cer" -CertStoreLocation Cert:\LocalMachine\My
-```
- #### On the Target Node: import the cert's private key as a trusted root ```powershell
targetNode, the path to the public key certificate file (named targetNode.cer),
for the public key. ```powershell
-$ConfigData= @{
+$ConfigData = @{
AllNodes = @(
- @{
- # The name of the node we are describing
- NodeName = "targetNode"
+ @{
+ # The name of the node we are describing
+ NodeName = "targetNode"
- # The path to the .cer file containing the
- # public key of the Encryption Certificate
- # used to encrypt credentials for this node
- CertificateFile = "C:\publicKeys\targetNode.cer"
+ # The path to the .cer file containing the
+ # public key of the Encryption Certificate
+ # used to encrypt credentials for this node
+ CertificateFile = "C:\publicKeys\targetNode.cer"
- # The thumbprint of the Encryption Certificate
- # used to decrypt the credentials on target node
- Thumbprint = "AC23EA3A9E291A75757A556D0B71CBBF8C4F6FD8"
- }
- )
- }
+ # The thumbprint of the Encryption Certificate
+ # used to decrypt the credentials on target node
+ Thumbprint = "AC23EA3A9E291A75757A556D0B71CBBF8C4F6FD8"
+ }
+ )
+}
``` ## Configuration script