Skip to content

Markdown and PS Styles #11759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ $getChildItemSplat = @{
Eku = "*Client Authentication*"
}
Get-ChildItem @getChildItemSplat |
Where-Object {$_.SendAsTrustedIssuer -and $_.NotAfter -gt $ValidThrough }
Where-Object {
$_.SendAsTrustedIssuer -and $_.NotAfter -gt $ValidThrough
}
```

## Opening the Certificates MMC Snap-in
Expand Down Expand Up @@ -319,7 +321,7 @@ Start a remote session on the S1 computer using the `New-PSSession` cmdlet, and
specify CredSSP authentication. Saves the session in the `$s` variable.

```powershell
$s = New-PSSession S1 -Authentication CredSSP -Credential Domain01\Admin01
$s = New-PSSession S1 -Authentication CredSSP -Credential Domain01\Admin01
```

Finally, use the `Invoke-Command` cmdlet to run a `Remove-Item` command in the
Expand Down Expand Up @@ -597,7 +599,7 @@ Get-Help Get-ChildItem -Path cert:
<!-- link references -->
[01]: ../../Microsoft.PowerShell.Core/About/about_Providers.md
[02]: ../../Microsoft.PowerShell.Core/About/about_Signing.md
[03]: /powershell/module/pki/new-selfsignedcertificate
[03]: xref:PKI.New-SelfSignedCertificate
[04]: /windows-server/security/tls/what-s-new-in-tls-ssl-schannel-ssp-overview#BKMK_TrustedIssuers
[05]: xref:Microsoft.PowerShell.Core.Get-Help
[06]: xref:Microsoft.PowerShell.Management.Get-ChildItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Converts a secure string to an encrypted standard string.
### Secure (Default)

```
ConvertFrom-SecureString [-SecureString] <SecureString> [[-SecureKey] <SecureString>] [<CommonParameters>]
ConvertFrom-SecureString [-SecureString] <SecureString> [[-SecureKey] <SecureString>]
[<CommonParameters>]
```

### AsPlainText
Expand Down Expand Up @@ -47,8 +48,8 @@ key is specified, the Windows Data Protection API (DPAPI) is used to encrypt the
representation.

> [!NOTE]
> Note that per [DotNet](/dotnet/api/system.security.securestring?view=netcore-2.1#remarks), the
> contents of a SecureString are not encrypted on non-Windows systems.
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).

## EXAMPLES

Expand Down Expand Up @@ -173,7 +174,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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ specified key, that same key must be provided as the value of the **Key** or **S
of the `ConvertTo-SecureString` cmdlet.

> [!NOTE]
> Note that per [DotNet](/dotnet/api/system.security.securestring#remarks), the
> contents of a SecureString are not encrypted on non-Windows systems.
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).

## EXAMPLES

Expand Down Expand Up @@ -86,13 +86,14 @@ variable.
The fourth command displays the encrypted string in the value of the `$Encrypted` variable.

The fifth command uses the `ConvertTo-SecureString` cmdlet to convert the encrypted standard string
in the `$Encrypted` variable back into a secure string. It saves the result in the `$Secure2` variable.
The sixth command displays the value of the `$Secure2` variable. The SecureString type indicates that
the command was successful.
in the `$Encrypted` variable back into a secure string. It saves the result in the `$Secure2`
variable. The sixth command displays the value of the `$Secure2` variable. The SecureString type
indicates that the command was successful.

### Example 2: Create a secure string from an encrypted string in a file

This example shows how to create a secure string from an encrypted standard string that is saved in a file.
This example shows how to create a secure string from an encrypted standard string that is saved in
a file.

```powershell
$Secure = Read-Host -AsSecureString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ Get-AuthenticodeSignature -SourcePathOrExtension <String[]> -Content <Byte[]> [<
> **This cmdlet is only available on the Windows platform.**

The `Get-AuthenticodeSignature` cmdlet gets information about the Authenticode signature for a
file or file content as a byte array.
If the file is both embedded signed and Windows catalog signed,
the Windows catalog signature is used.
If the file is not signed, the information is retrieved, but
the fields are blank.
file or file content as a byte array. If the file is both embedded signed and Windows catalog
signed, the Windows catalog signature is used. If the file is not signed, the information is
retrieved, but the fields are blank.

## EXAMPLES

Expand All @@ -62,12 +60,14 @@ Get-AuthenticodeSignature test.ps1, test1.ps1, sign-file.ps1, makexml.ps1
```

This command gets information about the Authenticode signature for the four files listed at the
command line. In this example, the name of the **FilePath** parameter, which is optional, is omitted.
command line. In this example, the name of the **FilePath** parameter, which is optional, is
omitted.

### Example 3: Get only valid Authenticode signatures for multiple files

```powershell
Get-ChildItem $PSHOME\*.* | ForEach-object {Get-AuthenticodeSignature $_} | Where-Object {$_.status -eq "Valid"}
Get-ChildItem $PSHOME\*.* | ForEach-Object {Get-AuthenticodeSignature $_} |
Where-Object {$_.Status -eq "Valid"}
```

This command lists all of the files in the `$PSHOME` directory that have a valid Authenticode
Expand All @@ -87,7 +87,11 @@ selects only the signature objects with a status of Valid.
### Example 4: Get the Authenticode signature for a file content specified as byte array

```powershell
Get-AuthenticodeSignature -Content (Get-Content foo.ps1 -AsByteStream) -SourcePathorExtension ps1
$authenticodeSignatureParams = @{
Content = (Get-Content foo.ps1 -AsByteStream)
SourcePathorExtension = "ps1"
}
Get-AuthenticodeSignature @authenticodeSignatureParams
```

This command gets information about the Authenticode signature for the content of a file. In this
Expand Down Expand Up @@ -172,7 +176,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

Expand Down
34 changes: 22 additions & 12 deletions reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ the **Credential** parameter.
### Example 2

```powershell
$c = Get-Credential -credential User01
$c = Get-Credential -Credential User01
$c.Username
User01
```
Expand All @@ -73,7 +73,8 @@ object.
### Example 3

```powershell
$Credential = $host.ui.PromptForCredential("Need credentials", "Please enter your user name and password.", "", "NetBiosUserName")
$Credential = $host.ui.PromptForCredential(
"Need credentials", "Please enter your user name and password.", "", "NetBiosUserName")
```

This command uses the **PromptForCredential** method to prompt the user for their user name and
Expand All @@ -84,7 +85,7 @@ use **PromptForCredential**, you can specify the caption, messages, and user nam
prompt.

For more information, see the
[PromptForCredential](/dotnet/api/system.management.automation.host.pshostuserinterface.promptforcredential)
[PromptForCredential](xref:System.Management.Automation.Host.PSHostUserInterface.PromptForCredential%2A)
documentation in the SDK.

### Example 4
Expand All @@ -95,7 +96,11 @@ This example demonstrates how to create a credential object identical to the one
```powershell
$User = "Domain01\User01"
$PWord = Read-Host -Prompt 'Enter a Password' -AsSecureString
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
$credentialParams = @{
TypeName = 'System.Management.Automation.PSCredential'
ArgumentList = $User, $PWord
}
$Credential = New-Object @credentialParams
```

The first command assigns the username to the `$User` variable. Ensure the value follows
Expand All @@ -111,7 +116,11 @@ stored in the `$User` and `$PWord` variables.
### Example 5

```powershell
Get-Credential -Message "Credential are required for access to the \\Server1\Scripts file share." -User Server01\PowerUser
$credentialParams = @{
Message = "Credential are required for access to the \\Server1\Scripts file share."
UserName = "Server01\PowerUser"
}
Get-Credential @credentialParams
```

```Output
Expand All @@ -127,13 +136,14 @@ user why credentials are needed and gives them confidence that the request is le
### Example 6

```powershell
Invoke-Command -ComputerName Server01 {Get-Credential Domain01\User02}
Invoke-Command -ComputerName Server01 -ScriptBlock {Get-Credential Domain01\User02}
```

```Output
PowerShell Credential Request : PowerShell Credential Request
Warning: This credential is being requested by a script or application on the SERVER01 remote computer.
Enter your credentials only if you trust the remote computer and the application or script requesting it.
Warning: This credential is being requested by a script or application on the SERVER01 remote
computer. Enter your credentials only if you trust the remote computer and the application or script
requesting it.

Enter your credentials.
Password for user Domain01\User02: ***************
Expand Down Expand Up @@ -162,12 +172,12 @@ this parameter, you're prompted for a user name and a password.
Starting in PowerShell 3.0, if you enter a user name without a domain, `Get-Credential` no longer
inserts a backslash before the name.

Credentials are stored in a [PSCredential](/dotnet/api/system.management.automation.pscredential)
object and the password is stored as a [SecureString](/dotnet/api/system.security.securestring).
Credentials are stored in a [PSCredential](xref:System.Management.Automation.PSCredential) object
and the password is stored as a [SecureString](xref:System.Security.SecureString).

> [!NOTE]
> For more information about **SecureString** data protection, see
> [How secure is SecureString?](/dotnet/api/system.security.securestring#how-secure-is-securestring).
> [How secure is SecureString?](xref:System.Security.SecureString#how-secure-is-securestring).

```yaml
Type: System.Management.Automation.PSCredential
Expand Down Expand Up @@ -268,4 +278,4 @@ and `New-PSDrive` cmdlets.

## RELATED LINKS

[PromptForCredential](/dotnet/api/system.management.automation.host.pshostuserinterface.promptforcredential)
[PromptForCredential](xref:System.Management.Automation.Host.PSHostUserInterface.PromptForCredential%2A)
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ To display the execution policies for each scope in the order of precedence, use
The effective execution policy is determined by execution policies that are set by
`Set-ExecutionPolicy` and Group Policy settings.

For more information, see [about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md).
For more information, see
[about_Execution_Policies](../Microsoft.PowerShell.Core/About/about_Execution_Policies.md).

## EXAMPLES

Expand Down Expand Up @@ -232,7 +233,7 @@ whether scripts must be digitally signed before they are run.

## RELATED LINKS

[about_Execution_Policies](../Microsoft.PowerShell.Core/about/about_Execution_Policies.md)
[about_Execution_Policies](../Microsoft.PowerShell.Core/About/about_Execution_Policies.md)

[about_Group_Policy_Settings](../Microsoft.PowerShell.Core/About/about_Group_Policy_Settings.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ Sets the PowerShell execution policies for Windows computers.

### [Test-FileCatalog](Test-FileCatalog.md)

Validates whether the hashes contained in a catalog file (.cat) matches the hashes of the actual files in order to validate their authenticity.
Validates whether the hashes contained in a catalog file (.cat) matches the hashes of the actual
files in order to validate their authenticity.

### [Unprotect-CmsMessage](Unprotect-CmsMessage.md)

Expand Down
Loading