From a474ee9959b0a7c8abb13750167e80b33ae7a954 Mon Sep 17 00:00:00 2001 From: Arie Heinrich Date: Sat, 1 Feb 2025 16:32:21 +0100 Subject: [PATCH 1/6] Markdown and PS Styles (#11757) * Markdown and PS Styles * Minor edits --------- Co-authored-by: Sean Wheeler --- .../Get-Counter.md | 9 ++- .../Get-WinEvent.md | 55 +++++++++++-------- .../Add-Content.md | 9 ++- .../Clear-Item.md | 19 ++++--- .../Clear-ItemProperty.md | 23 ++++---- .../Copy-Item.md | 24 ++++++-- .../Copy-ItemProperty.md | 37 ++++++++----- .../Debug-Process.md | 2 +- .../Get-ChildItem.md | 17 +++--- .../Get-Content.md | 16 ++++-- .../Get-HotFix.md | 9 ++- .../Get-Item.md | 6 +- .../Get-ItemPropertyValue.md | 41 +++++++------- .../Get-Service.md | 15 +++-- .../Invoke-Item.md | 5 +- .../Join-Path.md | 10 ++-- .../Microsoft.PowerShell.Management.md | 3 +- .../Move-ItemProperty.md | 51 ++++++++++------- .../New-Item.md | 13 +++-- 19 files changed, 214 insertions(+), 150 deletions(-) diff --git a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md index 341da714c7fe..51ee282b6365 100644 --- a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md +++ b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-Counter.md @@ -171,7 +171,9 @@ In this example, `Start-Job` runs a `Get-Counter` command as a background job on To view the performance counter output from the job, use the `Receive-Job` cmdlet. ```powershell -Start-Job -ScriptBlock {Get-Counter -Counter "\LogicalDisk(_Total)\% Free Space" -MaxSamples 1000} +Start-Job -ScriptBlock { + Get-Counter -Counter "\LogicalDisk(_Total)\% Free Space" -MaxSamples 1000 +} ``` ```Output @@ -262,7 +264,8 @@ The pipeline is used with the `Where-Object` cmdlet to find a subset of the path counter sets complete list of counter paths, remove the pipeline (`|`) and `Where-Object` command. The `$_` is an automatic variable for the current object in the pipeline. -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). ```powershell (Get-Counter -ListSet Memory).Paths | Where-Object { $_ -like "*Cache*" } @@ -659,4 +662,4 @@ In PowerShell 7, when using the **ListSet** parameter, `Get-Counter` can't retri [Start-Job](../Microsoft.PowerShell.Core/Start-Job.md) -[Where-Object](..//Microsoft.PowerShell.Core/Where-Object.md) +[Where-Object](../Microsoft.PowerShell.Core/Where-Object.md) diff --git a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md index 119e5cdc8cc2..cf8d9f6aa6e8 100644 --- a/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md +++ b/reference/7.5/Microsoft.PowerShell.Diagnostics/Get-WinEvent.md @@ -151,9 +151,9 @@ with the asterisk (`*`) wildcard to display each property. ### Example 3: Configure the classic Security log -This command gets an **EventLogConfiguration** object that represents the classic **Security** log. The -object is then used to configure settings for the log, such as max file size, file path, and whether the -log is enabled. +This command gets an **EventLogConfiguration** object that represents the classic **Security** log. +The object is then used to configure settings for the log, such as max file size, file path, and +whether the log is enabled. ```powershell $log = Get-WinEvent -ListLog Security @@ -196,17 +196,18 @@ ProviderLatency : 1000 ProviderControlGuid : ``` -The `Get-WinEvent` cmdlet uses the **ListLog** parameter to specify the **Security** log. The object is -saved to a variable. The **MaximumSizeInBytes** property is set to 1 gigabyte on the object. The +The `Get-WinEvent` cmdlet uses the **ListLog** parameter to specify the **Security** log. The object +is saved to a variable. The **MaximumSizeInBytes** property is set to 1 gigabyte on the object. The **SaveChanges** method is called to push the change to the system inside of a try block to handle -access violations. The `Get-WinEvent` cmdlet is called again on the **Security** log and piped to the -`Format-List` cmdlet to verify that the **MaximumSizeInBytes** property has been saved on the machine. +access violations. The `Get-WinEvent` cmdlet is called again on the **Security** log and piped to +the `Format-List` cmdlet to verify that the **MaximumSizeInBytes** property has been saved on the +machine. ### Example 4: Get event logs from a server This command only gets event logs on the local computer that contain events. It's possible for a log's **RecordCount** to be null or zero. The example uses the `$_` variable. For more information, -see [about_Automatic_Variables](../Microsoft.PowerShell.Core/about/about_automatic_variables.md). +see [about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md). ```powershell Get-WinEvent -ListLog * -ComputerName localhost | Where-Object { $_.RecordCount } @@ -233,7 +234,8 @@ is a property of the object with a non-null value. This example gets objects that represent the **Application** event logs on three computers: Server01, Server02, and Server03. The **ForEach** keyword is used because the **ComputerName** -parameter accepts only one value. For more information, see [about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md). +parameter accepts only one value. For more information, see +[about_Foreach](../Microsoft.PowerShell.Core/About/about_Foreach.md). ```powershell $S = 'Server01', 'Server02', 'Server03' @@ -345,7 +347,8 @@ This command lists the Event Ids that the **Microsoft-Windows-GroupPolicy** even along with the event description. ```powershell -(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | Format-Table Id, Description +(Get-WinEvent -ListProvider Microsoft-Windows-GroupPolicy).Events | + Format-Table Id, Description ``` ```Output @@ -505,7 +508,7 @@ is required. ```powershell Get-WinEvent -Path 'C:\Tracing\TraceLog.etl' -Oldest | - Sort-Object -Property TimeCreated -Descending | + Sort-Object -Property TimeCreated -Descending | Select-Object -First 100 ``` @@ -526,7 +529,7 @@ reading from an `.etl` file, but the **Oldest** parameter applies to each file. ```powershell Get-WinEvent -Path 'C:\Tracing\TraceLog.etl', 'C:\Test\Windows PowerShell.evtx' -Oldest | - Where-Object { $_.Id -eq '403' } + Where-Object { $_.Id -eq '403' } ``` The `Get-WinEvent` cmdlet gets log information from the archived files. The **Path** parameter uses @@ -573,8 +576,9 @@ Get-WinEvent -LogName 'Windows PowerShell' -FilterXPath $XPath This example uses the **FilterHashtable** parameter to get events from the **Application** log. The hash table uses **key/value** pairs. For more information about the **FilterHashtable** parameter, -see [Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/Creating-Get-WinEvent-queries-with-FilterHashtable). -For more information about hash tables, see [about_Hash_Tables](../Microsoft.PowerShell.Core/about/about_hash_tables.md). +see [Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/creating-get-winevent-queries-with-filterhashtable). +For more information about hash tables, see +[about_Hash_Tables](../Microsoft.PowerShell.Core/About/about_Hash_Tables.md). ```powershell $Date = (Get-Date).AddDays(-2) @@ -739,8 +743,9 @@ Help. Use an XML query to create a complex query that contains several XPath statements. The XML format also allows you to use a **Suppress XML** element that excludes events from the query. For more -information about the XML schema for event log queries, see [Query Schema](/windows/win32/wes/queryschema-schema) -and the XML Event Queries section of [Event Selection](/previous-versions/aa385231(v=vs.85)). +information about the XML schema for event log queries, see +[Query Schema](/windows/win32/wes/queryschema-schema) and the XML Event Queries section of +[Event Selection](/previous-versions/aa385231(v=vs.85)). You may also create a **Suppress** element using the **FilterHashtable** parameter. @@ -760,7 +765,8 @@ Accept wildcard characters: False Specifies an XPath query that this cmdlet select events from one or more logs. -For more information about the XPath language, see [XPath Reference](/previous-versions/dotnet/netframework-4.0/ms256115(v=vs.100)) +For more information about the XPath language, see +[XPath Reference](/previous-versions/dotnet/netframework-4.0/ms256115(v=vs.100)) and the Selection Filters section of [Event Selection](/previous-versions/aa385231(v=vs.85)). ```yaml @@ -841,8 +847,8 @@ cmdlet. > [!NOTE] > PowerShell does not limit the amount of logs you can request. However, the `Get-WinEvent` cmdlet > queries the Windows API which has a limit of 256. This can make it difficult to filter through all -> of your logs at one time. You can work around this by using a `foreach` loop to iterate through each -> log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.LogName }` +> of your logs at one time. You can work around this by using a `foreach` loop to iterate through +> each log like this: `Get-WinEvent -ListLog * | ForEach-Object{ Get-WinEvent -LogName $_.LogName }` ```yaml Type: System.String[] @@ -939,7 +945,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 @@ -980,13 +987,13 @@ Environment (Windows PE). ## RELATED LINKS -[about_Automatic_Variables](../Microsoft.PowerShell.Core/about/about_automatic_variables.md) +[about_Automatic_Variables](../Microsoft.PowerShell.Core/About/about_Automatic_Variables.md) -[about_Foreach](../Microsoft.PowerShell.Core/about/about_Foreach.md) +[about_Foreach](../Microsoft.PowerShell.Core/About/about_Foreach.md) -[about_Hash_Tables](../Microsoft.PowerShell.Core/about/about_hash_tables.md) +[about_Hash_Tables](../Microsoft.PowerShell.Core/About/about_Hash_Tables.md) -[Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/Creating-Get-WinEvent-queries-with-FilterHashtable) +[Creating Get-WinEvent queries with FilterHashtable](/powershell/scripting/samples/creating-get-winevent-queries-with-filterhashtable) [Format-Table](../Microsoft.PowerShell.Utility/Format-Table.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md b/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md index 3b4b5d5f4c4a..4510a4b416b2 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Add-Content.md @@ -159,8 +159,7 @@ set to `False`. ### Example 7: Use Filters with Add-Content You can specify a filter to the `Add-Content` cmdlet. When using filters to qualify the **Path** -parameter, you need to include a trailing asterisk (`*`) to indicate the contents of the -path. +parameter, you need to include a trailing asterisk (`*`) to indicate the contents of the path. The following command adds the word "Done" the content of all `*.txt` files in the `C:\Temp` directory. @@ -235,7 +234,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. @@ -429,8 +428,8 @@ You can use the `Add-Content` cmdlet to change the content of any alternate data block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the `Unblock-File` cmdlet. -This parameter was introduced in PowerShell 3.0. As of PowerShell 7.2, `Add-Content` can -target alternative data streams on both files and directories. +This parameter was introduced in PowerShell 3.0. As of PowerShell 7.2, `Add-Content` can target +alternative data streams on both files and directories. ```yaml Type: System.String diff --git a/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md index 3716aebfc926..c23cab9eb445 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Clear-Item.md @@ -18,15 +18,15 @@ Clears the contents of an item, but does not delete the item. ### Path (Default) ``` -Clear-Item [-Path] [-Force] [-Filter ] [-Include ] [-Exclude ] - [-Credential ] [-WhatIf] [-Confirm] [] +Clear-Item [-Path] [-Force] [-Filter ] [-Include ] + [-Exclude ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ### LiteralPath ``` -Clear-Item -LiteralPath [-Force] [-Filter ] [-Include ] [-Exclude ] - [-Credential ] [-WhatIf] [-Confirm] [] +Clear-Item -LiteralPath [-Force] [-Filter ] [-Include ] + [-Exclude ] [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -180,7 +180,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -247,10 +248,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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.Management/Clear-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Clear-ItemProperty.md index a09e71d807e5..c201f8d06ef1 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Clear-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Clear-ItemProperty.md @@ -90,11 +90,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -153,7 +155,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -253,10 +256,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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.Management/Copy-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Copy-Item.md index 4f9c356f0eca..3ffa62fab2e0 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Copy-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Copy-Item.md @@ -118,7 +118,11 @@ operation, the command changes the item name from `Get-Widget.ps1` to `Get-Widge can be safely attached to email messages. ```powershell -Copy-Item "\\Server01\Share\Get-Widget.ps1" -Destination "\\Server12\ScriptArchive\Get-Widget.ps1.txt" +$copyParams = @{ + Path = "\\Server01\Share\Get-Widget.ps1" + Destination = "\\Server12\ScriptArchive\Get-Widget.ps1.txt" +} +Copy-Item @copyParams ``` ### Example 5: Copy a file to a remote computer @@ -176,7 +180,12 @@ The `Copy-Item` cmdlet copies `scriptingexample.ps1` from the `D:\Folder004` fol ```powershell $Session = New-PSSession -ComputerName "Server04" -Credential "Contoso\User01" -Copy-Item "D:\Folder004\scriptingexample.ps1" -Destination "C:\Folder004_Copy\scriptingexample_copy.ps1" -ToSession $Session +$copyParams = @{ + Path = "D:\Folder004\scriptingexample.ps1" + Destination = "C:\Folder004_Copy\scriptingexample_copy.ps1" + ToSession = $Session +} +Copy-Item @copyParams ``` ### Example 9: Copy a remote file to the local computer @@ -221,7 +230,13 @@ copied with their file trees intact. ```powershell $Session = New-PSSession -ComputerName "Server01" -Credential "Contoso\User01" -Copy-Item "C:\MyRemoteData\scripts" -Destination "D:\MyLocalData\scripts" -FromSession $Session -Recurse +$copyParams = @{ + Path = "C:\MyRemoteData\scripts" + Destination = "D:\MyLocalData\scripts" + FromSession = $Session + Recurse = $true +} +Copy-Item @copyParams ``` ### Example 12: Recursively copy files from a folder tree into the current folder @@ -536,7 +551,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] diff --git a/reference/7.5/Microsoft.PowerShell.Management/Copy-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Copy-ItemProperty.md index 46e1732e1246..ab93449ce631 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Copy-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Copy-ItemProperty.md @@ -26,9 +26,9 @@ Copy-ItemProperty [-Path] [-Name] [-Destination] [- ### LiteralPath ``` -Copy-ItemProperty -LiteralPath [-Name] [-Destination] [-PassThru] [-Force] - [-Filter ] [-Include ] [-Exclude ] [-Credential ] - [-WhatIf] [-Confirm] [] +Copy-ItemProperty -LiteralPath [-Name] [-Destination] [-PassThru] + [-Force] [-Filter ] [-Include ] [-Exclude ] + [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -46,7 +46,12 @@ This command copies the property named "MyProperty" from the "MyApplication" reg "MyApplicationRev2" registry key. ```powershell -Copy-ItemProperty -Path "MyApplication" -Destination "HKLM:\Software\MyApplicationRev2" -Name "MyProperty" +$copyParams = @{ + Path = "MyApplication" + Destination = "HKLM:\Software\MyApplicationRev2" + Name = "MyProperty" +} +Copy-ItemProperty @copyParams ``` ## PARAMETERS @@ -108,11 +113,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -172,7 +179,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -271,10 +279,11 @@ 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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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.Management/Debug-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md index 42991a6b44c9..b10d78b6e489 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Debug-Process.md @@ -238,7 +238,7 @@ This cmdlet returns no output. This cmdlet uses the AttachDebugger method of the Windows Management Instrumentation (WMI) Win32_Process class. For more information about this method, see -[AttachDebugger method](https://go.microsoft.com/fwlink/?LinkId=143640) in the MSDN library. +[AttachDebugger method](https://go.microsoft.com/fwlink/?LinkId=143640) in Microsoft Learn. ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/7.5/Microsoft.PowerShell.Management/Get-ChildItem.md index 7ea98df8fbdd..eef880f55ba7 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -11,7 +11,6 @@ title: Get-ChildItem # Get-ChildItem ## SYNOPSIS - Gets the items and child items in one or more specified locations. ## SYNTAX @@ -124,7 +123,7 @@ as follows: - `s` (system) For more information about the mode flags, see -[about_Filesystem_Provider](../microsoft.powershell.core/about/about_filesystem_provider.md#attributes-flagsexpression). +[about_Filesystem_Provider](../Microsoft.PowerShell.Core/About/about_Filesystem_Provider.md#attributes-flagsexpression). ### Example 2: Get child item names in a directory @@ -346,8 +345,8 @@ authority. Get-ChildItem -Path Cert:\* -Recurse -CodeSigningCert ``` -For more information about the Certificate provider and the `Cert:` drive, -see [about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). +For more information about the Certificate provider and the `Cert:` drive, see +[about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). ### Example 8: Get items using the Depth parameter @@ -437,7 +436,7 @@ filesystem object returned by `Get-ChildItem` and is displayed in the default ou ```powershell PS D:\> New-Item -ItemType Junction -Name tmp -Target $env:TEMP -PS D:\> Get-ChildItem | Select-Object name,LinkTarget +PS D:\> Get-ChildItem | Select-Object name, LinkTarget Name LinkTarget ---- ---------- @@ -508,7 +507,8 @@ The **Attributes** parameter supports the following properties: - **System** - **Temporary** -For a description of these attributes, see the [FileAttributes Enumeration](/dotnet/api/system.io.fileattributes). +For a description of these attributes, see the [FileAttributes](xref:System.IO.FileAttributes) +enumeration. To combine attributes, use the following operators: @@ -863,7 +863,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell to not interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -1074,7 +1075,7 @@ providers available in your session, type `Get-PSProvider`. For more information [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) -[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md) +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md) [about_Registry_Provider](../Microsoft.PowerShell.Core/About/about_Registry_Provider.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md b/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md index 70befdee0283..ef9a7de07a09 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md @@ -50,7 +50,9 @@ This example gets the content of a file in the current directory. The `LineNumbe has 100 lines in the format, **This is Line X** and is used in several examples. ```powershell -1..100 | ForEach-Object { Add-Content -Path .\LineNumbers.txt -Value "This is line $_." } +1..100 | ForEach-Object { + Add-Content -Path .\LineNumbers.txt -Value "This is line $_." +} Get-Content -Path .\LineNumbers.txt ``` @@ -129,7 +131,8 @@ to create sample content in a file named `Stream.txt`. ```powershell Set-Content -Path .\Stream.txt -Value 'This is the content of the Stream.txt file' -# Specify a wildcard to the Stream parameter to display all streams of the recently created file. +# Specify a wildcard to the Stream parameter to display all streams of the recently +# created file. Get-Item -Path .\Stream.txt -Stream * ``` @@ -168,7 +171,8 @@ This is the content of the Stream.txt file ``` ```powershell -# Use the Stream parameter of Add-Content to create a new Stream containing sample content. +# Use the Stream parameter of Add-Content to create a new Stream containing sample +# content. $addContentSplat = @{ Path = '.\Stream.txt' Stream = 'NewStream' @@ -212,7 +216,7 @@ Added a stream named NewStream to Stream.txt ``` The **Stream** parameter is a dynamic parameter of the -[FileSystem provider](../microsoft.powershell.core/about/about_filesystem_provider.md#stream-string). +[FileSystem provider](../Microsoft.PowerShell.Core/About/about_Filesystem_Provider.md#stream-string). By default `Get-Content` only retrieves data from the default, or `:$DATA` stream. **Streams** can be used to store hidden data such as attributes, security settings, or other data. They can also be stored on directories without being child items. @@ -374,7 +378,7 @@ This parameter is available only in file system drives. 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. @@ -486,7 +490,7 @@ it in single quotation marks. Single quotation marks tell PowerShell not to inte 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.Management/Get-HotFix.md b/reference/7.5/Microsoft.PowerShell.Management/Get-HotFix.md index c5e0a4edaaf9..2f0dfe15bc2d 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-HotFix.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-HotFix.md @@ -60,7 +60,12 @@ The `Get-Hotfix` command uses parameters to get hotfixes installed on remote com are filtered by a specified description string. ```powershell -Get-HotFix -Description Security* -ComputerName Server01, Server02 -Credential Domain01\admin01 +$hotFixParams = @{ + Description = "Security*" + ComputerName = "Server01, Server02" + Credential = "Domain01\admin01" +} +Get-HotFix @hotFixParams ``` `Get-Hotfix` filters the output with the **Description** parameter and the string **Security** that @@ -216,7 +221,7 @@ The `Get-HotFix` output might vary on different operating systems. ## RELATED LINKS -[about_Arrays](/powershell/module/microsoft.powershell.core/about/about_arrays) +[about_Arrays](/powershell/module/microsoft.powershell.core/About/about_Arrays) [Add-Content](Add-Content.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Get-Item.md index 60432161f271..e483e8b1b3fb 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-Item.md @@ -170,7 +170,8 @@ In PowerShell 6.2, an alternate view was added to get hardlink information. To g information, pipe the output to `Format-Table -View childrenWithHardlink` ```powershell -Get-Item C:\Windows\System32\ntoskrnl.exe | Format-Table -view childrenWithHardLink +Get-Item C:\Windows\System32\ntoskrnl.exe | + Format-Table -View childrenWithHardLink ``` ```Output @@ -441,7 +442,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md b/reference/7.5/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md index c34c7ce53118..bf49c8478f7c 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md @@ -18,15 +18,15 @@ Gets the value for one or more properties of a specified item. ### Path (Default) ``` -Get-ItemPropertyValue [[-Path] ] [-Name] [-Filter ] [-Include ] - [-Exclude ] [-Credential ] [] +Get-ItemPropertyValue [[-Path] ] [-Name] [-Filter ] + [-Include ] [-Exclude ] [-Credential ] [] ``` ### LiteralPath ``` -Get-ItemPropertyValue -LiteralPath [-Name] [-Filter ] [-Include ] - [-Exclude ] [-Credential ] [] +Get-ItemPropertyValue -LiteralPath [-Name] [-Filter ] + [-Include ] [-Exclude ] [-Credential ] [] ``` ## DESCRIPTION @@ -39,8 +39,8 @@ parameters. ### Example 1: Get the value of the ProductID property -This command gets the value of the **ProductID** property of the "\SOFTWARE\Microsoft\Windows -NT\CurrentVersion" object in the Windows Registry provider. +This command gets the value of the **ProductID** property of the +`\SOFTWARE\Microsoft\Windows NT\CurrentVersion` object in the Windows Registry provider. ```powershell Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ProductID @@ -70,7 +70,7 @@ This command gets the values of the **LastWriteTime**, **CreationTime**, and **R a folder. The property values are returned in the order in which you specified the property names. ```powershell -Get-ItemPropertyValue -Path 'C:\Program Files\PowerShell' -Name LastWriteTime,CreationTime,Root +Get-ItemPropertyValue -Path 'C:\Program Files\PowerShell' -Name LastWriteTime, CreationTime, Root ``` ```output @@ -140,11 +140,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more +efficient than other parameters, because the provider applies them when the cmdlet gets the objects +rather than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -185,7 +187,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -234,10 +237,10 @@ Accept wildcard characters: True ### 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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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 @@ -249,8 +252,8 @@ You can pipe a string that contains a path to this cmdlet. ### System.Management.Automation.PSObject -This cmdlet returns an object for each item property value that it gets. -The object type depends on the property value that is retrieved. +This cmdlet returns an object for each item property value that it gets. The object type depends on +the property value that is retrieved. ## NOTES diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md index 5015a7184dd4..2285cb505033 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-Service.md @@ -71,8 +71,8 @@ Get-Service "wmi*" ### Example 3: Display services that include a search string This example displays services with a display name that includes the word `network`. Searching the -display name finds network-related services even when the service name doesn't include `Net`, such as -xmlprov, the Network Provisioning Service. +display name finds network-related services even when the service name doesn't include `Net`, such +as xmlprov, the Network Provisioning Service. ```powershell Get-Service -DisplayName "*network*" @@ -106,10 +106,10 @@ Status is only one property of service objects. To see all of the properties, ty This example gets services that have dependent services. ```powershell -Get-Service | - Where-Object {$_.DependentServices} | +Get-Service | Where-Object {$_.DependentServices} | Format-List -Property Name, DependentServices, @{ - Label="NoOfDependentServices"; Expression={$_.DependentServices.Count} + Label="NoOfDependentServices" + Expression={$_.DependentServices.Count} } ``` @@ -138,7 +138,7 @@ This example shows that when you sort services in ascending order by the value o property, stopped services appear before running services. This happens because the value of **Status** is an enumeration, in which `Stopped` has a value of `1`, and `Running` has a value of `4`. For more information, see -[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). +[ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). To list running services first, use the **Descending** parameter of the `Sort-Object` cmdlet. @@ -360,8 +360,7 @@ When you sort in ascending order by status value, `Stopped` services appear befo services. The **Status** property of a service is an enumerated value in which the names of the statuses represent integer values. The sort is based on the integer value, not the name. `Running` appears before `Stopped` because `Stopped` has a value of `1`, and `Running` has a value of `4`. For -more information, see -[ServiceControllerStatus](/dotnet/api/system.serviceprocess.servicecontrollerstatus). +more information, see [ServiceControllerStatus](xref:System.ServiceProcess.ServiceControllerStatus). ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Invoke-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Invoke-Item.md index d2b3a8a28a55..935d98778d14 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Invoke-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Invoke-Item.md @@ -147,7 +147,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -216,7 +217,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.5/Microsoft.PowerShell.Management/Join-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Join-Path.md index f6873c7aecad..09c325a8808e 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Join-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Join-Path.md @@ -29,7 +29,7 @@ The provider supplies the path delimiters. ### Example 1: Combine a path with a child path ```powershell -PS C:\> Join-Path -Path "path" -ChildPath "childpath" +Join-Path -Path "path" -ChildPath "childpath" ``` ```output @@ -44,7 +44,7 @@ the paths. ### Example 2: Combine paths that already contain directory separators ```powershell -PS C:\> Join-Path -Path "path\" -ChildPath "\childpath" +Join-Path -Path "path\" -ChildPath "\childpath" ``` ```output @@ -103,7 +103,7 @@ This command uses `Join-Path` to combine multiple path roots with a child path. ### Example 6: Combine the roots of a file system drive with a child path ```powershell -Get-PSDrive -PSProvider filesystem | ForEach-Object {$_.root} | Join-Path -ChildPath "Subdir" +Get-PSDrive -PSProvider filesystem | ForEach-Object {$_.Root} | Join-Path -ChildPath "Subdir" ``` ```output @@ -111,8 +111,8 @@ C:\Subdir D:\Subdir ``` -This command combines the roots of each PowerShell file system drive in the console with the `Subdir` -child path. +This command combines the roots of each PowerShell file system drive in the console with the +`Subdir` child path. The command uses the `Get-PSDrive` cmdlet to get the PowerShell drives supported by the FileSystem provider. The `ForEach-Object` statement selects only the **Root** property of the **PSDriveInfo** diff --git a/reference/7.5/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.md b/reference/7.5/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.md index 5fc6df0a4b3e..4cedaebce1e7 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.md @@ -60,7 +60,8 @@ Gets the items and child items in one or more specified locations. ### [Get-Clipboard](Get-Clipboard.md) -Gets the contents of the clipboard. [!NOTE] > On Linux, this cmdlet requires the `xclip` utility to be in the path. +Gets the contents of the clipboard. +[!NOTE] > On Linux, this cmdlet requires the `xclip` utility to be in the path. ### [Get-ComputerInfo](Get-ComputerInfo.md) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Move-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Move-ItemProperty.md index 603ded06936e..19432ea1e3c5 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Move-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Move-ItemProperty.md @@ -18,17 +18,17 @@ Moves a property from one location to another. ### Path (Default) ``` -Move-ItemProperty [-Path] [-Name] [-Destination] [-PassThru] [-Force] - [-Filter ] [-Include ] [-Exclude ] [-Credential ] - [-WhatIf] [-Confirm] [] +Move-ItemProperty [-Path] [-Name] [-Destination] [-PassThru] + [-Force] [-Filter ] [-Include ] [-Exclude ] + [-Credential ] [-WhatIf] [-Confirm] [] ``` ### LiteralPath ``` -Move-ItemProperty -LiteralPath [-Name] [-Destination] [-PassThru] [-Force] - [-Filter ] [-Include ] [-Exclude ] [-Credential ] - [-WhatIf] [-Confirm] [] +Move-ItemProperty -LiteralPath [-Name] [-Destination] [-PassThru] + [-Force] [-Filter ] [-Include ] [-Exclude ] + [-Credential ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -46,7 +46,12 @@ This command moves the Version registry value, and its data, from the "MyApp" su subkey of the `HKLM\Software\MyCompany` registry key. ```powershell -Move-ItemProperty "HKLM:\Software\MyCompany\MyApp" -Name "Version" -Destination "HKLM:\Software\MyCompany\NewApp" +$moveParams = @{ + Path = "HKLM:\Software\MyCompany\MyApp" + Name = "Version" + Destination = "HKLM:\Software\MyCompany\NewApp" +} +Move-ItemProperty @moveParams ``` ## PARAMETERS @@ -108,11 +113,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -128,9 +135,9 @@ Accept wildcard characters: True ### -Force -Forces the command to run without asking for user confirmation. -Implementation varies from provider to provider. -For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +Forces the command to run without asking for user confirmation. Implementation varies from provider +to provider. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ```yaml Type: System.Management.Automation.SwitchParameter @@ -171,7 +178,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -270,10 +278,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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 @@ -300,7 +308,8 @@ PowerShell includes the following aliases for `Move-ItemProperty`: - `mp` This cmdlet is designed to work with the data exposed by any provider. To list the providers -available in your session, type `Get-PSProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +available in your session, type `Get-PSProvider`. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md index d67d2f066969..1991cbb25341 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/New-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/New-Item.md @@ -108,7 +108,8 @@ profile path, even when the directories in the path do not exist. After you create a profile, you can enter aliases, functions, and scripts in the profile to customize your shell. -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) and [about_Profiles](../Microsoft.PowerShell.Core/About/about_Profiles.md). ```powershell @@ -218,10 +219,10 @@ Mode LastWriteTime Length Name -a---- 5/1/2020 8:03 AM 0 TestFile.txt ``` -### Example 9: Use the -Force parameter to overwrite existing files +### Example 9: Use the Force parameter to overwrite existing files -This example creates a file with a value and then recreates the file using `-Force`. This overwrites -the existing file, as you can see by the length property. +This example creates a file with a value and then recreates the file using the **Force** parameter. +This overwrites the existing file, as you can see by the length property. ```powershell PS> New-Item ./TestFile.txt -ItemType File -Value 'This is just a test file' @@ -240,9 +241,9 @@ Mode LastWriteTime Length Name ``` > [!NOTE] -> When using `New-Item` with the `-Force` switch to create registry keys, the command will behave +> When using `New-Item` with the **Force** parameter to create registry keys, the command behaves > the same as when overwriting a file. If the registry key already exists, the key and all -> properties and values will be overwritten with an empty registry key. +> properties and values are overwritten with an empty registry key. ## PARAMETERS From b88fb5435e68f8c7ecfcf58e8deba9b03609da51 Mon Sep 17 00:00:00 2001 From: Arie Heinrich Date: Sat, 1 Feb 2025 19:25:53 +0100 Subject: [PATCH 2/6] Markdown and PS Styles (#11758) * Markdown and PS Styles * Minor edits and rebase --------- Co-authored-by: Sean Wheeler --- .../Remove-Item.md | 10 ++--- .../Remove-ItemProperty.md | 32 ++++++++------- .../Rename-Computer.md | 21 ++++++---- .../Rename-Item.md | 22 +++++++---- .../Rename-ItemProperty.md | 23 ++++++----- .../Resolve-Path.md | 4 +- .../Restart-Computer.md | 23 ++++++----- .../Set-Clipboard.md | 2 +- .../Set-Item.md | 39 +++++++++++-------- .../Set-Location.md | 4 +- .../Set-Service.md | 9 +++-- .../Split-Path.md | 4 +- .../Start-Service.md | 20 +++++----- .../Stop-Process.md | 13 ++++--- .../Stop-Service.md | 18 ++++----- .../Suspend-Service.md | 30 +++++++------- .../Test-Path.md | 7 ++-- .../Wait-Process.md | 2 +- 18 files changed, 160 insertions(+), 123 deletions(-) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Remove-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Remove-Item.md index 650094f3621b..9acc67d3b4c2 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Remove-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Remove-Item.md @@ -354,7 +354,7 @@ it in single quotation marks. Single quotation marks tell PowerShell not to inte 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[] @@ -440,8 +440,8 @@ Accept wildcard characters: True Prompts you for confirmation before running the cmdlet. For more information, see the following articles: -- [about_Preference_Variables](../microsoft.powershell.core/about/about_preference_variables.md#confirmpreference) -- [about_Functions_CmdletBindingAttribute](../microsoft.powershell.core/about/about_functions_cmdletbindingattribute.md?#confirmimpact) +- [about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#confirmpreference) +- [about_Functions_CmdletBindingAttribute](../Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md#confirmimpact) ```yaml Type: System.Management.Automation.SwitchParameter @@ -533,6 +533,6 @@ design. [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) -[about_Preference_Variables](../microsoft.powershell.core/about/about_preference_variables.md#confirmpreference) +[about_Preference_Variables](../Microsoft.PowerShell.Core/About/about_Preference_Variables.md#confirmpreference) -[about_Functions_CmdletBindingAttribute](../microsoft.powershell.core/about/about_functions_cmdletbindingattribute.md?#confirmimpact) +[about_Functions_CmdletBindingAttribute](../Microsoft.PowerShell.Core/About/about_Functions_CmdletBindingAttribute.md#confirmimpact) diff --git a/reference/7.5/Microsoft.PowerShell.Management/Remove-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Remove-ItemProperty.md index ccc72b851d89..8bfb6371795a 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Remove-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Remove-ItemProperty.md @@ -18,9 +18,10 @@ Deletes the property and its value from an item. ### Path (Default) ``` -Remove-ItemProperty [-Path] [-Name] [-Force] [-Filter ] [-Include ] - [-Exclude ] [-Credential ] [-InformationAction ] - [-InformationVariable ] [-WhatIf] [-Confirm] [] +Remove-ItemProperty [-Path] [-Name] [-Force] [-Filter ] + [-Include ] [-Exclude ] [-Credential ] + [-InformationAction ] [-InformationVariable ] [-WhatIf] [-Confirm] + [] ``` ### LiteralPath @@ -55,7 +56,7 @@ path of the "SmpApplication" subkey, including the drive, `HKLM:`, and the "Soft These commands delete the "Options" registry value, and its data, from the "MyApp" subkey of "HKEY_CURRENT_USER\Software\MyCompany". -``` +```powershell PS C:\> Set-Location HKCU:\Software\MyCompany\MyApp PS HKCU:\Software\MyCompany\MyApp> Remove-ItemProperty -Path . -Name "Options" -Confirm ``` @@ -124,11 +125,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -187,7 +190,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -270,10 +274,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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.Management/Rename-Computer.md b/reference/7.5/Microsoft.PowerShell.Management/Rename-Computer.md index 5fb8e744db82..d53d9ebd3fa1 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Rename-Computer.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Rename-Computer.md @@ -17,16 +17,16 @@ Renames a computer. ``` Rename-Computer [-ComputerName ] [-PassThru] [-DomainCredential ] - [-LocalCredential ] [-NewName] [-Force] [-Restart] [-WsmanAuthentication ] - [-WhatIf] [-Confirm] [] + [-LocalCredential ] [-NewName] [-Force] [-Restart] + [-WsmanAuthentication ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION > **This cmdlet is only available on the Windows platform.** -The `Rename-Computer` cmdlet renames the local computer or a remote computer. -It renames one computer in each command. +The `Rename-Computer` cmdlet renames the local computer or a remote computer. It renames one +computer in each command. This cmdlet was introduced in Windows PowerShell 3.0. @@ -51,7 +51,13 @@ computers in the domain. The **Force** parameter suppresses the confirmation prompt. ```powershell -Rename-Computer -ComputerName "Srv01" -NewName "Server001" -DomainCredential Domain01\Admin01 -Force +$renameParams = @{ + ComputerName = "Srv01" + NewName = "Server001" + DomainCredential = "Domain01\Admin01" + Force = $true +} +Rename-Computer @renameParams ``` ## PARAMETERS @@ -215,7 +221,8 @@ WSMan protocol. The acceptable values for this parameter are: The default value is **Default**. -For more information about the values of this parameter, see [AuthenticationMechanism Enumeration](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). +For more information about the values of this parameter, see +[AuthenticationMechanism Enumeration](xref:System.Management.Automation.Runspaces.AuthenticationMechanism). > [!WARNING] > Credential Security Service Provider (CredSSP) authentication, in which the user @@ -278,7 +285,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.5/Microsoft.PowerShell.Management/Rename-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Rename-Item.md index 385180ac0ae2..27e098366c28 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Rename-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Rename-Item.md @@ -72,8 +72,8 @@ Use the `Move-Item` cmdlet, instead. ### Example 3: Rename a registry key -This example renames a registry key from **Advertising** to **Marketing**. When the command is complete, -the key is renamed, but the registry entries in the key are unchanged. +This example renames a registry key from **Advertising** to **Marketing**. When the command is +complete, the key is renamed, but the registry entries in the key are unchanged. ```powershell Rename-Item -Path "HKLM:\Software\MyCompany\Advertising" -NewName "Marketing" @@ -127,7 +127,8 @@ sensitive. > [!NOTE] > This parameter is not supported by any providers installed with PowerShell. To impersonate another -> user, or elevate your credentials when running this cmdlet, use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md). +> user, or elevate your credentials when running this cmdlet, use +> [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md). ```yaml Type: System.Management.Automation.PSCredential @@ -145,7 +146,8 @@ Accept wildcard characters: False Forces the cmdlet to rename items that can't otherwise be changed, such as hidden or read-only files or read-only aliases or variables. The cmdlet can't change constant aliases or variables. -Implementation varies from provider to provider. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +Implementation varies from provider to provider. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). Even using the **Force** parameter, the cmdlet can't override security restrictions. @@ -168,7 +170,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String @@ -190,7 +193,8 @@ To rename and move an item, use `Move-Item`. You can't use wildcard characters in the value of the **NewName** parameter. To specify a name for multiple files, use the **Replace** operator in a regular expression. For more information about the -Replace operator, see [about_Comparison_Operators](../Microsoft.PowerShell.Core/About/about_Comparison_Operators.md). +Replace operator, see +[about_Comparison_Operators](../Microsoft.PowerShell.Core/About/about_Comparison_Operators.md). ```yaml Type: System.String @@ -274,7 +278,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](https://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -302,7 +307,8 @@ PowerShell includes the following aliases for `Rename-Item`: - `rni` `Rename-Item` is designed to work with the data exposed by any provider. To list the providers -available in your session, type `Get-PsProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +available in your session, type `Get-PsProvider`. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Rename-ItemProperty.md b/reference/7.5/Microsoft.PowerShell.Management/Rename-ItemProperty.md index 20b85ba603ed..3142fe43aad0 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Rename-ItemProperty.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Rename-ItemProperty.md @@ -91,11 +91,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. +The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the +only installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -154,7 +156,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String @@ -269,10 +272,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). +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.Management/Resolve-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Resolve-Path.md index 68d0e3f73d4e..b47e969fa6e4 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Resolve-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Resolve-Path.md @@ -287,7 +287,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 @@ -316,7 +316,7 @@ The `*-Path` cmdlets work with the **FileSystem**, **Registry**, and **Certifica `Resolve-Path` is designed to work with any provider. To list the providers available in your session, type `Get-PSProvider`. For more information, see -[about_providers](../microsoft.powershell.core/about/about_providers.md). +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). `Resolve-Path` only resolves existing paths. It cannot be used to resolve a location that does not exist yet. diff --git a/reference/7.5/Microsoft.PowerShell.Management/Restart-Computer.md b/reference/7.5/Microsoft.PowerShell.Management/Restart-Computer.md index dc78bc361b55..29337ccd1cf5 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Restart-Computer.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Restart-Computer.md @@ -108,7 +108,7 @@ queries the remote computer every two seconds to determine whether it's restarte `Restart-Computer` restarts the remote computer using the **WsmanAuthentication** mechanism. Kerberos authentication determines whether the current user has permission to restart the remote computer. For more information, see -[AuthenticationMechanism](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). +[AuthenticationMechanism](xref:System.Management.Automation.Runspaces.AuthenticationMechanism). ```powershell Restart-Computer -ComputerName Server01 -WsmanAuthentication Kerberos @@ -152,12 +152,12 @@ Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCred generated by the `Get-Credential` cmdlet. If you type a user name, you're prompted to enter the password. -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 @@ -297,7 +297,7 @@ The acceptable values for this parameter are: **Basic**, **CredSSP**, **Default* **Kerberos**, and **Negotiate**. For more information, see -[AuthenticationMechanism](/dotnet/api/system.management.automation.runspaces.authenticationmechanism). +[AuthenticationMechanism](xref:System.Management.Automation.Runspaces.AuthenticationMechanism). > [!WARNING] > Credential Security Service Provider (CredSSP) authentication, in which the user credentials are @@ -355,7 +355,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 @@ -371,10 +372,12 @@ This cmdlet returns no output. ## NOTES -- In Windows, `Restart-Computer` uses the [Win32Shutdown method](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) - of the Windows Management Instrumentation (WMI) [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) - class. This method requires the **SeShutdownPrivilege** privilege be enabled for the user account - used to restart the machine. +- In Windows, `Restart-Computer` uses the + [Win32Shutdown method](/windows/desktop/CIMWin32Prov/win32shutdown-method-in-class-win32-operatingsystem) + of the Windows Management Instrumentation (WMI) + [Win32_OperatingSystem](/windows/desktop/CIMWin32Prov/win32-operatingsystem) class. This method + requires the **SeShutdownPrivilege** privilege be enabled for the user account used to restart + the machine. - On Linux and Mac OS, `Restart-Computer` uses the `/sbin/shutdown` bash tool. ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md index c63ef2653d79..6a6388c07b6a 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -68,7 +68,7 @@ $PSDefaultParameterValues['Set-Clipboard:AsOSC52'] = $env:SSH_TTY ``` For more information about `$PSDefaultParameterValues`, see -[about_Parameters_Default_Values](/powershell/module/microsoft.powershell.core/about/about_parameters_default_values). +[about_Parameters_Default_Values](../Microsoft.PowerShell.Core/About/about_Parameters_Default_Values.md). ## PARAMETERS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md index fdc05685d805..f6205deb9151 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Item.md @@ -18,8 +18,9 @@ Changes the value of an item to the value specified in the command. ### Path (Default) - All providers ``` -Set-Item [-Path] [[-Value] ] [-Force] [-PassThru] [-Filter ] [-Include ] - [-Exclude ] [-Credential ] [-WhatIf] [-Confirm] [] +Set-Item [-Path] [[-Value] ] [-Force] [-PassThru] [-Filter ] + [-Include ] [-Exclude ] [-Credential ] [-WhatIf] [-Confirm] + [] ``` ### LiteralPath - All providers @@ -90,7 +91,9 @@ Set-Item -Path env:UserRole -Value "Administrator" This command changes the prompt function so that it displays the time before the path. ```powershell -Set-Item -Path function:prompt -Value {'PS '+ (Get-Date -Format t) + " " + (Get-Location) + '> '} +Set-Item -Path function:prompt -Value { + 'PS '+ (Get-Date -Format t) + " " + (Get-Location) + '> ' +} ``` ### Example 4: Set options for your prompt function @@ -147,11 +150,13 @@ Accept wildcard characters: True ### -Filter -Specifies a filter to qualify the **Path** parameter. The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) -provider is the only installed PowerShell provider that supports the use of filters. You can find -the syntax for the **FileSystem** filter language in [about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). -Filters are more efficient than other parameters, because the provider applies them when the cmdlet -gets the objects rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. The +[FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the only +installed PowerShell provider that supports the use of filters. You can find the syntax for the +**FileSystem** filter language in +[about_Wildcards](../Microsoft.PowerShell.Core/About/about_Wildcards.md). Filters are more efficient +than other parameters, because the provider applies them when the cmdlet gets the objects rather +than having PowerShell filter the objects after they are retrieved. ```yaml Type: System.String @@ -212,7 +217,8 @@ typed. No characters are interpreted as wildcards. If the path includes escape c it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences. -For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +For more information, see +[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] @@ -398,16 +404,17 @@ PowerShell includes the following aliases for `Set-Item`: - All platforms: - `si` -- `Set-Item` is not supported by the PowerShell FileSystem provider. To change the values of items in - the file system, use the `Set-Content` cmdlet. -- In the Registry drives, `HKLM:` and `HKCU:`, `Set-Item` changes the data in the (Default) value of a - registry key. +- `Set-Item` is not supported by the PowerShell FileSystem provider. To change the values of items + in the file system, use the `Set-Content` cmdlet. +- In the Registry drives, `HKLM:` and `HKCU:`, `Set-Item` changes the data in the (Default) value of + a registry key. - To create and change the names of registry keys, use the `New-Item` and `Rename-Item` cmdlet. - - To change the names and data in registry values, use the `New-ItemProperty`, `Set-ItemProperty`, and - `Rename-ItemProperty` cmdlets. + - To change the names and data in registry values, use the `New-ItemProperty`, `Set-ItemProperty`, + and `Rename-ItemProperty` cmdlets. - `Set-Item` is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PsProvider`. - For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). + For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md index bf2f52cdf30e..202811fe9306 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Location.md @@ -108,7 +108,7 @@ specified in the command. For information about location stacks, see the [Notes] ### Example 5: Navigate location history using `+` or `-` -``` +```powershell PS C:\> Set-Location -Path $env:SystemRoot PS C:\Windows> Set-Location -Path Cert:\ PS Cert:\> Set-Location -Path HKLM:\ @@ -264,7 +264,7 @@ path-based operations using the current working directory specific to the curren The `Set-Location` cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PSProvider`. For more information, see -[about_Providers](../Microsoft.PowerShell.Core/about/about_Providers.md). +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). A stack is a last-in, first-out list in which only the most recently added item can be accessed. You add items to a stack in the order that you use them, and then retrieve them for use in the reverse diff --git a/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md index ec12f117a6f4..c93ffa71dd2f 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Set-Service.md @@ -224,18 +224,19 @@ SQLWriter Automatic ### -Credential -Specifies the account used by the service as the [Service Logon Account](/windows/desktop/ad/about-service-logon-accounts). +Specifies the account used by the service as the +[Service Logon Account](/windows/desktop/ad/about-service-logon-accounts). Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. If you type a user name, this cmdlet prompts you for a password. -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). This parameter was introduced in PowerShell 6.0. diff --git a/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md index 2b3684c39584..52aacfe25f73 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Split-Path.md @@ -299,8 +299,8 @@ Accept wildcard characters: False ### -NoQualifier Indicates that this cmdlet returns the path without the qualifier. For the FileSystem or registry -providers, the qualifier is the drive of the provider path, such as `C:` or `HKCU:`. For example, in the -path `C:\Test\Logs\Pass1.log`, it returns only `\Test\Logs\Pass1.log`. +providers, the qualifier is the drive of the provider path, such as `C:` or `HKCU:`. For example, +in the path `C:\Test\Logs\Pass1.log`, it returns only `\Test\Logs\Pass1.log`. ```yaml Type: System.Management.Automation.SwitchParameter diff --git a/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md index 91c2d93bebd4..badc9cf140c6 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Start-Service.md @@ -18,22 +18,22 @@ Starts one or more stopped services. ### InputObject (Default) ``` -Start-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] - [-WhatIf] [-Confirm] [] +Start-Service [-InputObject] [-PassThru] [-Include ] + [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Start-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Start-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] + [-Confirm] [] ``` ### DisplayName ``` -Start-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Start-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -90,9 +90,10 @@ existing file. This example shows how to start a service when the start type of the service is **Disabled**. -``` +```powershell PS> Start-Service tlntsvr -Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot start service TlntSvr on computer '.'. +Start-Service : Service 'Telnet (TlntSvr)' cannot be started due to the following error: Cannot +start service TlntSvr on computer '.'. At line:1 char:14 + Start-Service <<<< tlntsvr @@ -254,7 +255,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.Management/Stop-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md index ccb1fafc9786..c8b8e099cc3e 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Stop-Process.md @@ -30,7 +30,8 @@ Stop-Process -Name [-PassThru] [-Force] [-WhatIf] [-Confirm] [ [-PassThru] [-Force] [-WhatIf] [-Confirm] [] +Stop-Process [-InputObject] [-PassThru] [-Force] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -47,8 +48,8 @@ you are not prompted for confirmation unless you specify the **Confirm** paramet ### Example 1: Stop all instances of a process -``` -PS C:\> Stop-Process -Name "notepad" +```powershell +Stop-Process -Name "notepad" ``` This command stops all instances of the Notepad process on the computer. Each instance of Notepad @@ -59,7 +60,7 @@ list the process IDs of each instance of Notepad. ### Example 2: Stop a specific instance of a process ```powershell -PS C:\> Stop-Process -Id 3952 -Confirm -PassThru +Stop-Process -Id 3952 -Confirm -PassThru ``` ```Output @@ -130,7 +131,6 @@ Performing operation 'Stop-Process' on Target 'lsass(596)' ```powershell [ADMIN]: PS> Get-Process -Name "lsass" | Stop-Process -Force -[ADMIN]: PS> ``` These commands show the effect of using **Force** to stop a process that is not owned by the user. @@ -271,7 +271,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.Management/Stop-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md index 3b5db0685700..8acadb353920 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Stop-Service.md @@ -18,22 +18,22 @@ Stops one or more running services. ### InputObject (Default) ``` -Stop-Service [-Force] [-NoWait] [-InputObject] [-PassThru] [-Include ] - [-Exclude ] [-WhatIf] [-Confirm] [] +Stop-Service [-Force] [-NoWait] [-InputObject] [-PassThru] + [-Include ] [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Stop-Service [-Force] [-NoWait] [-Name] [-PassThru] [-Include ] [-Exclude ] - [-WhatIf] [-Confirm] [] +Stop-Service [-Force] [-NoWait] [-Name] [-PassThru] [-Include ] + [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Stop-Service [-Force] [-NoWait] [-PassThru] -DisplayName [-Include ] [-Exclude ] - [-WhatIf] [-Confirm] [] +Stop-Service [-Force] [-NoWait] [-PassThru] -DisplayName [-Include ] + [-Exclude ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -49,7 +49,7 @@ to stop. ### Example 1: Stop a service on the local computer -``` +```powershell PS C:\> Stop-Service -Name "sysmonlog" ``` @@ -57,7 +57,7 @@ This command stops the Performance Logs and Alerts (SysmonLog) service on the lo ### Example 2: Stop a service by using the display name -``` +```powershell PS C:\> Get-Service -DisplayName "telnet" | Stop-Service ``` @@ -67,7 +67,7 @@ an object that represents the Telnet service. The pipeline operator (`|`) pipes ### Example 3: Stop a service that has dependent services -``` +```powershell PS C:\> Get-Service -Name "iisadmin" | Format-List -Property Name, DependentServices PS C:\> Stop-Service -Name "iisadmin" -Force -Confirm ``` diff --git a/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md b/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md index a7637a3e7675..cc6999f30027 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Suspend-Service.md @@ -18,22 +18,22 @@ Suspends (pauses) one or more running services. ### InputObject (Default) ``` -Suspend-Service [-InputObject] [-PassThru] [-Include ] [-Exclude ] - [-WhatIf] [-Confirm] [] +Suspend-Service [-InputObject] [-PassThru] [-Include ] + [-Exclude ] [-WhatIf] [-Confirm] [] ``` ### Default ``` -Suspend-Service [-Name] [-PassThru] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] - [] +Suspend-Service [-Name] [-PassThru] [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ### DisplayName ``` -Suspend-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] [-WhatIf] - [-Confirm] [] +Suspend-Service [-PassThru] -DisplayName [-Include ] [-Exclude ] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -50,16 +50,16 @@ object that represents the services that you want to suspend. ### Example 1: Suspend a service -``` -PS C:\> Suspend-Service -DisplayName "Telnet" +```powershell +Suspend-Service -DisplayName "Telnet" ``` This command suspends the Telnet service (Tlntsvr) service on the local computer. ### Example 2: Display what would happen if you suspend services -``` -PS C:\> Suspend-Service -Name lanman* -WhatIf +```powershell +Suspend-Service -Name lanman* -WhatIf ``` This command tells what would happen if you suspended the services that have a service name that @@ -67,8 +67,8 @@ starts with lanman. To suspend the services, rerun the command without the **Wha ### Example 3: Get and suspend a service -``` -PS C:\> Get-Service schedule | Suspend-Service +```powershell +Get-Service schedule | Suspend-Service ``` This command uses the `Get-Service` cmdlet to get an object that represents the Task Scheduler @@ -77,8 +77,10 @@ This command uses the `Get-Service` cmdlet to get an object that represents the ### Example 4: Suspend all services that can be suspended -``` -PS C:\> Get-Service | Where-Object {$_.CanPauseAndContinue -eq "True"} | Suspend-Service -Confirm +```powershell +Get-Service | + Where-Object {$_.CanPauseAndContinue -eq "True"} | + Suspend-Service -Confirm ``` This command suspends all of the services on the computer that can be suspended. It uses diff --git a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md index a19f71d249ef..de7d0aa2abb7 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Test-Path.md @@ -315,8 +315,8 @@ exist. PowerShell returns false because it doesn't know which drive provider to > A breaking change in the Path APIs was introduced in .NET 2.1. Those methods no longer check for > invalid path characters. This change caused a regression in PowerShell where the **IsValid** check > no longer tests for invalid characters. The regression will be addressed in a future release. For -> more information, -> see [Breaking changes in .NET Core 2.1](/dotnet/core/compatibility/2.1#path-apis-dont-throw-an-exception-for-invalid-characters). +> more information, see +> [Breaking changes in .NET Core 2.1](/dotnet/core/compatibility/2.1#path-apis-dont-throw-an-exception-for-invalid-characters). ```yaml Type: System.Management.Automation.SwitchParameter @@ -468,7 +468,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). +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + ## INPUTS diff --git a/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md b/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md index d0022004e04c..8409d0f93180 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Wait-Process.md @@ -55,7 +55,7 @@ This example stops the **Notepad** process and then waits for the process to be continues with the next command. ```powershell -$nid = (Get-Process notepad).id +$nid = (Get-Process notepad).Id Stop-Process -Id $nid Wait-Process -Id $nid ``` From ea2936258c851a77b4ef7bdb6c926532d9ff602b Mon Sep 17 00:00:00 2001 From: Arie Heinrich Date: Sat, 1 Feb 2025 20:11:37 +0100 Subject: [PATCH 3/6] Markdown and PS Styles (#11759) * Markdown and PS Styles * Minor edits and rebase --------- Co-authored-by: Sean Wheeler --- .../About/about_Certificate_Provider.md | 8 +- .../ConvertFrom-SecureString.md | 10 ++- .../ConvertTo-SecureString.md | 13 +-- .../Get-AuthenticodeSignature.md | 22 +++-- .../Get-Credential.md | 34 +++++--- .../Get-ExecutionPolicy.md | 5 +- .../Microsoft.PowerShell.Security.md | 3 +- .../Microsoft.PowerShell.Security/Set-Acl.md | 84 ++++++++++--------- .../Set-AuthenticodeSignature.md | 15 +++- .../Set-ExecutionPolicy.md | 3 +- .../Test-FileCatalog.md | 37 +++++--- 11 files changed, 142 insertions(+), 92 deletions(-) diff --git a/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md b/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md index cdd3753508f3..b746b3a221a4 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md +++ b/reference/7.5/Microsoft.PowerShell.Security/About/about_Certificate_Provider.md @@ -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 @@ -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 @@ -597,7 +599,7 @@ Get-Help Get-ChildItem -Path cert: [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 diff --git a/reference/7.5/Microsoft.PowerShell.Security/ConvertFrom-SecureString.md b/reference/7.5/Microsoft.PowerShell.Security/ConvertFrom-SecureString.md index 7ed60ed35da4..82a49b5aa7e5 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/ConvertFrom-SecureString.md +++ b/reference/7.5/Microsoft.PowerShell.Security/ConvertFrom-SecureString.md @@ -18,7 +18,8 @@ Converts a secure string to an encrypted standard string. ### Secure (Default) ``` -ConvertFrom-SecureString [-SecureString] [[-SecureKey] ] [] +ConvertFrom-SecureString [-SecureString] [[-SecureKey] ] + [] ``` ### AsPlainText @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Security/ConvertTo-SecureString.md b/reference/7.5/Microsoft.PowerShell.Security/ConvertTo-SecureString.md index be6afd7e0368..a936dbfdc5ee 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/ConvertTo-SecureString.md +++ b/reference/7.5/Microsoft.PowerShell.Security/ConvertTo-SecureString.md @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md b/reference/7.5/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md index f60371b6153a..3e7f07557352 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-AuthenticodeSignature.md @@ -38,11 +38,9 @@ Get-AuthenticodeSignature -SourcePathOrExtension -Content [< > **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 @@ -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 @@ -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 @@ -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 diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md b/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md index 6665d81fc682..2745c9f1be0e 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-Credential.md @@ -59,7 +59,7 @@ the **Credential** parameter. ### Example 2 ```powershell -$c = Get-Credential -credential User01 +$c = Get-Credential -Credential User01 $c.Username User01 ``` @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: *************** @@ -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 @@ -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) diff --git a/reference/7.5/Microsoft.PowerShell.Security/Get-ExecutionPolicy.md b/reference/7.5/Microsoft.PowerShell.Security/Get-ExecutionPolicy.md index 3b37debddbc9..697f3dbb9c68 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Get-ExecutionPolicy.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Get-ExecutionPolicy.md @@ -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 @@ -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) diff --git a/reference/7.5/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.md b/reference/7.5/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.md index 7dd0138d3e96..bc7a2d1727a9 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.md @@ -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) diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md index 7c8f8a2bdf6b..e23d73f0e697 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.5/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] [] + [-Filter ] [-Include ] [-Exclude ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -58,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 @@ -81,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 @@ -95,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. @@ -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:sSystem.Security.AccessControl.FileSystemRights) diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-AuthenticodeSignature.md b/reference/7.5/Microsoft.PowerShell.Security/Set-AuthenticodeSignature.md index 72e53831d80f..91b034538d79 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-AuthenticodeSignature.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Set-AuthenticodeSignature.md @@ -59,7 +59,7 @@ These commands retrieve a code-signing certificate from the PowerShell certifica it to sign a PowerShell script. ```powershell -$cert=Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert +$cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert Set-AuthenticodeSignature -FilePath PsTestInternet2.ps1 -Certificate $cert ``` @@ -88,7 +88,7 @@ $cert = Get-PfxCertificate -FilePath C:\Test\Mysign.pfx Set-AuthenticodeSignature -FilePath ServerProps.ps1 -Certificate $cert ``` -The first command uses the `Get-PfxCertificate` cmdlet to load the C:\Test\MySign.pfx certificate +The first command uses the `Get-PfxCertificate` cmdlet to load the `C:\Test\MySign.pfx` certificate into the `$cert` variable. The second command uses `Set-AuthenticodeSignature` to sign the script. The **FilePath** parameter @@ -103,7 +103,13 @@ This command adds a digital signature that includes the root authority in the tr signed by a third-party timestamp server. ```powershell -Set-AuthenticodeSignature -FilePath c:\scripts\Remodel.ps1 -Certificate $cert -IncludeChain All -TimestampServer "https://timestamp.fabrikam.com/scripts/timstamper.dll" +$SignatureParams = @{ + FilePath = "c:\scripts\Remodel.ps1" + Certificate = $cert + IncludeChain = "All" + TimestampServer = "https://timestamp.fabrikam.com/scripts/timstamper.dll" +} +Set-AuthenticodeSignature @SignatureParams ``` The command uses the **FilePath** parameter to specify the script being signed and the @@ -195,7 +201,8 @@ earlier versions, the default is SHA1. Files that are signed with a different ha might not be recognized on other systems. Which algorithms are supported depends on the version of the operating system. -For a list of possible values, see [HashAlgorithmName Struct](/dotnet/api/system.security.cryptography.hashalgorithmname?view=netframework-4.7.2#properties). +For a list of possible values, see +[HashAlgorithmName](xref:System.Security.Cryptography.HashAlgorithmName#properties) struct. ```yaml Type: System.String diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md b/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md index 93332faa86ae..5134342dd36c 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Set-ExecutionPolicy.md @@ -25,7 +25,8 @@ Set-ExecutionPolicy [-ExecutionPolicy] [[-Scope] ] [-CatalogFilePath] [[-Path] ] - [-WhatIf] [-Confirm] [] +Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] + [[-Path] ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -30,7 +30,7 @@ Test-FileCatalog [-Detailed] [-FilesToSkip ] [-CatalogFilePath] Date: Sat, 1 Feb 2025 14:12:56 -0600 Subject: [PATCH 4/6] fix typo (#11760) --- reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md index e23d73f0e697..b7a0f82f74ba 100644 --- a/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md +++ b/reference/7.5/Microsoft.PowerShell.Security/Set-Acl.md @@ -438,4 +438,4 @@ can use it to change the security descriptors of files, directories, and registr [ObjectSecurity.SetAccessRuleProtection](xref:System.Security.AccessControl.ObjectSecurity.SetAccessRuleProtection%2A) -[FileSystemRights](xref:sSystem.Security.AccessControl.FileSystemRights) +[FileSystemRights](xref:System.Security.AccessControl.FileSystemRights) From b6ebc77df48789fe0612899eddc4e53a7abf4016 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Sun, 2 Feb 2025 10:39:45 -0600 Subject: [PATCH 5/6] Mention scope modifiers (#11762) --- .../Microsoft.PowerShell.Core/About/about_Scopes.md | 10 +++++----- .../Microsoft.PowerShell.Core/About/about_Scopes.md | 7 ++++--- .../Microsoft.PowerShell.Core/About/about_Scopes.md | 6 +++--- .../Microsoft.PowerShell.Core/About/about_Scopes.md | 6 +++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scopes.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scopes.md index 64660498684e..c51e63e0ee65 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Scopes.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Scopes.md @@ -1,7 +1,7 @@ --- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US -ms.date: 07/22/2024 +ms.date: 02/02/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Scopes @@ -9,6 +9,7 @@ title: about_Scopes # about_Scopes ## Short description + Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. @@ -32,8 +33,8 @@ The following are the basic rules of scope: scopes are child scopes of that parent. - An item is visible in the scope that it was created and in any child scopes, unless you explicitly make it private. -- You can declare variables, aliases, functions, and PowerShell drives for a - scope outside of the current scope. +- Using scope modifiers, you can declare variables, aliases, functions, and + PowerShell drives for a scope outside of the current scope. - An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope. - When code running in a runspace references an item, PowerShell searches the @@ -259,8 +260,7 @@ the following contexts: **ComputerName**, **HostName**, **SSHConnection** or **Session** parameters (remote session) - Background jobs, started with `Start-Job` (out-of-process session) -- Thread jobs, started via `Start-ThreadJob` or `ForEach-Object -Parallel` - (separate thread session) +- Thread jobs, started via `Start-ThreadJob` (separate thread session) Depending on the context, embedded variable values are either independent copies of the data in the caller's scope or references to it. In remote and diff --git a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scopes.md b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scopes.md index f32d7e30d3f6..46533d63340e 100644 --- a/reference/7.4/Microsoft.PowerShell.Core/About/about_Scopes.md +++ b/reference/7.4/Microsoft.PowerShell.Core/About/about_Scopes.md @@ -1,7 +1,7 @@ --- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US -ms.date: 07/22/2024 +ms.date: 02/02/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Scopes @@ -9,6 +9,7 @@ title: about_Scopes # about_Scopes ## Short description + Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. @@ -32,8 +33,8 @@ The following are the basic rules of scope: scopes are child scopes of that parent. - An item is visible in the scope that it was created and in any child scopes, unless you explicitly make it private. -- You can declare variables, aliases, functions, and PowerShell drives for a - scope outside of the current scope. +- Using scope modifiers, you can declare variables, aliases, functions, and + PowerShell drives for a scope outside of the current scope. - An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope. - When code running in a runspace references an item, PowerShell searches the diff --git a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scopes.md b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scopes.md index e146e0ccaf81..65138ec527f7 100644 --- a/reference/7.5/Microsoft.PowerShell.Core/About/about_Scopes.md +++ b/reference/7.5/Microsoft.PowerShell.Core/About/about_Scopes.md @@ -1,7 +1,7 @@ --- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US -ms.date: 07/22/2024 +ms.date: 02/02/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Scopes @@ -33,8 +33,8 @@ The following are the basic rules of scope: scopes are child scopes of that parent. - An item is visible in the scope that it was created and in any child scopes, unless you explicitly make it private. -- You can declare variables, aliases, functions, and PowerShell drives for a - scope outside of the current scope. +- Using scope modifiers, you can declare variables, aliases, functions, and + PowerShell drives for a scope outside of the current scope. - An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope. - When code running in a runspace references an item, PowerShell searches the diff --git a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scopes.md b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scopes.md index 673b010afadd..cf0561b0d0c5 100644 --- a/reference/7.6/Microsoft.PowerShell.Core/About/about_Scopes.md +++ b/reference/7.6/Microsoft.PowerShell.Core/About/about_Scopes.md @@ -1,7 +1,7 @@ --- description: Explains the concept of scope in PowerShell and shows how to set and change the scope of elements. Locale: en-US -ms.date: 07/22/2024 +ms.date: 02/02/2025 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_scopes?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 title: about_Scopes @@ -33,8 +33,8 @@ The following are the basic rules of scope: scopes are child scopes of that parent. - An item is visible in the scope that it was created and in any child scopes, unless you explicitly make it private. -- You can declare variables, aliases, functions, and PowerShell drives for a - scope outside of the current scope. +- Using scope modifiers, you can declare variables, aliases, functions, and + PowerShell drives for a scope outside of the current scope. - An item that you created within a scope can be changed only in the scope in which it was created, unless you explicitly specify a different scope. - When code running in a runspace references an item, PowerShell searches the From b9d873e1b8974ea8576fb576fe9d2ba55e06964c Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 3 Feb 2025 10:49:39 -0600 Subject: [PATCH 6/6] Update monthly stats (#11764) --- .../docs-conceptual/community/2025-updates.md | 52 +++++++++ .../community/community-update.yml | 4 +- .../docs-conceptual/community/hall-of-fame.md | 105 +++++++++--------- reference/docs-conceptual/toc.yml | 2 + 4 files changed, 111 insertions(+), 52 deletions(-) create mode 100644 reference/docs-conceptual/community/2025-updates.md diff --git a/reference/docs-conceptual/community/2025-updates.md b/reference/docs-conceptual/community/2025-updates.md new file mode 100644 index 000000000000..1c161da30577 --- /dev/null +++ b/reference/docs-conceptual/community/2025-updates.md @@ -0,0 +1,52 @@ +--- +description: List of changes to the PowerShell documentation for 2025 +ms.date: 02/03/2025 +title: What's New in PowerShell-Docs for 2025 +--- +# What's new in PowerShell Docs for 2025 + +This article lists notable changes made to docs each month and celebrates the contributions from the +community. + +Help us make the documentation better for you. Read the [Contributor's Guide][01] to learn how to +get started. + +## 2024-January + +New content + +- [about_Comments](/powershell/module/microsoft.powershell.core/about/about_comments) - thanks to + @surfingoldelephant +- Created reference content for PowerShell 7.6-preview +- [What's New in PowerShell 7.6](/powershell/scripting/whats-new/what-s-new-in-powershell-76) + +Updates + +- Updates for PowerShell 7.5.0 GA release + - [What's New in PowerShell 7.5](/powershell/scripting/whats-new/what-s-new-in-powershell-75) + - [Release history of modules and cmdlets](/powershell/scripting/whats-new/cmdlet-versions) +- Special thanks to @ArieHein for his contributions (15 PRs on 234 files) to fix typos and adherence + to style guidelines. + +### Top Community Contributors + +GitHub stats + +- 74 PRs merged (30 from Community) +- 32 issues opened (32 from Community) +- 37 issues closed (37 Community issues closed) + +The following people contributed to PowerShell docs this month by submitting pull requests or +filing issues. Thank you! + +| GitHub Id | PRs merged | Issues opened | +| ------------------ | :--------: | :-----------: | +| ArieHein | 15 | 1 | +| changeworld | 8 | | +| surfingoldelephant | 4 | 5 | +| cnotin | 1 | | +| daniel-brandenburg | 1 | | +| o-l-a-v | 2 | | + + +[01]: contributing/overview.md diff --git a/reference/docs-conceptual/community/community-update.yml b/reference/docs-conceptual/community/community-update.yml index cf54bd4d63a9..19f927b4cf7c 100644 --- a/reference/docs-conceptual/community/community-update.yml +++ b/reference/docs-conceptual/community/community-update.yml @@ -9,7 +9,7 @@ metadata: ms.topic: landing-page # Required author: sdwheeler #Required; your GitHub user alias, with correct capitalization. ms.author: sewhee #Required; microsoft alias of author; optional team alias. - ms.date: 02/02/2024 + ms.date: 02/03/2025 # linkListType: architecture | concept | deploy | download | get-started | how-to-guide | learn | # overview | quickstart | reference | tutorial | video | whats-new @@ -21,6 +21,8 @@ landingContent: linkLists: - linkListType: whats-new links: + - text: 2025 Updates + url: ./2025-updates.md - text: 2024 Updates url: ./2024-updates.md - text: 2023 Updates diff --git a/reference/docs-conceptual/community/hall-of-fame.md b/reference/docs-conceptual/community/hall-of-fame.md index 95aa5c8506e6..c6902f6886b6 100644 --- a/reference/docs-conceptual/community/hall-of-fame.md +++ b/reference/docs-conceptual/community/hall-of-fame.md @@ -15,62 +15,65 @@ These GitHub users are the All-Time Top Community Contributors. Pull Requests help us fix those issues and make the documentation better for everyone. -| PRs Merged | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | Grand Total | -| --------------- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ----------: | -| Community | 3 | 194 | 446 | 467 | 321 | 161 | 100 | 122 | 108 | 81 | 2003 | -| matt9ucci | | | 157 | 80 | 30 | 1 | 6 | | | | 274 | -| nschonni | | | | 14 | 138 | 10 | | | | | 162 | -| kiazhi | | 25 | 79 | 12 | | | | | | | 116 | -| alexandair | | 57 | 7 | 26 | 2 | 1 | | | | | 93 | -| sethvs | | | 1 | 44 | | 20 | 1 | 10 | | 6 | 82 | -| doctordns | | 5 | 32 | 20 | 7 | 9 | 5 | | 1 | | 79 | -| ehmiiz | | | | | | | | 22 | 14 | | 36 | -| yecril71pl | | | | | | 21 | 3 | 3 | | | 27 | -| Dan1el42 | | 20 | | | | | | | | | 20 | -| skycommand | | | 1 | 3 | 3 | 6 | | 1 | 4 | 1 | 19 | -| NReilingh | | 2 | | 13 | 3 | | | | | | 18 | -| it-praktyk | | | | 16 | 1 | | | | | | 17 | -| vors | | 15 | 1 | | | | | | | | 16 | -| markekraus | | | 11 | 5 | | | | | | | 16 | -| kvprasoon | | 2 | 1 | 7 | 2 | 2 | 2 | | | | 16 | -| k-takai | | | | 5 | 1 | 7 | | | | | 13 | -| purdo17 | | | | 13 | | | | | | | 13 | -| PlagueHO | | 10 | | | 1 | | | | | | 11 | -| bergmeister | | | 1 | 3 | 3 | 1 | 1 | 1 | 1 | | 11 | -| exchange12rocks | | | 7 | 3 | | | 1 | | | | 11 | +| PRs Merged | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | Grand Total | +| --------------- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ----------: | +| Community | 3 | 194 | 446 | 467 | 321 | 160 | 100 | 122 | 108 | 81 | 30 | 2032 | +| matt9ucci | | | 157 | 80 | 30 | 1 | 6 | | | | | 274 | +| nschonni | | | | 14 | 138 | 10 | | | | | | 162 | +| kiazhi | | 25 | 79 | 12 | | | | | | | | 116 | +| alexandair | | 57 | 7 | 26 | 2 | 1 | | | | | | 93 | +| sethvs | | | 1 | 44 | | 20 | 1 | 10 | | 6 | | 82 | +| doctordns | | 5 | 32 | 20 | 7 | 9 | 5 | | 1 | | | 79 | +| ehmiiz | | | | | | | | 22 | 14 | | | 36 | +| yecril71pl | | | | | | 21 | 3 | 3 | | | | 27 | +| ArieHein | | | | | 1 | | | | | 7 | 15 | 23 | +| Dan1el42 | | 20 | | | | | | | | | | 20 | +| skycommand | | | 1 | 3 | 3 | 6 | | 1 | 4 | 1 | | 19 | +| NReilingh | | 2 | | 13 | 3 | | | | | | | 18 | +| it-praktyk | | | | 16 | 1 | | | | | | | 17 | +| vors | | 15 | 1 | | | | | | | | | 16 | +| markekraus | | | 11 | 5 | | | | | | | | 16 | +| kvprasoon | | 2 | 1 | 7 | 2 | 2 | 2 | | | | | 16 | +| k-takai | | | | 5 | 1 | 7 | | | | | | 13 | +| purdo17 | | | | 13 | | | | | | | | 13 | +| changeworld | | | | | | | | 3 | | | 8 | 11 | +| exchange12rocks | | | 7 | 3 | | | 1 | | | | | 11 | +| PlagueHO | | 10 | | | 1 | | | | | | | 11 | +| bergmeister | | | 1 | 3 | 3 | 1 | 1 | 1 | 1 | | | 11 | ## GitHub issues opened GitHub issues help us identify errors and gaps in our documentation. -| Issues Opened | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | Grand Total | -| --------------- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ----------: | -| Community | 3 | 54 | 95 | 211 | 561 | 557 | 364 | 225 | 270 | 224 | 2564 | -| mklement0 | | | 19 | 60 | 56 | 61 | 28 | 8 | 20 | 24 | 276 | -| ehmiiz | | | | | | | | 20 | 14 | | 34 | -| iSazonov | | | 1 | 4 | 10 | 8 | 4 | 3 | | 1 | 31 | -| jszabo98 | | | | 2 | 15 | 6 | 1 | | 1 | 2 | 27 | -| iRon7 | | | | | | 2 | 2 | 2 | 10 | 8 | 24 | -| juvtib | | | | | | 15 | 7 | | | | 22 | -| doctordns | | | 5 | 3 | 5 | 7 | 1 | | | | 21 | -| peetrike | | | | 1 | | 4 | 2 | 6 | 4 | 3 | 20 | -| vexx32 | | | | 3 | 11 | | | 3 | | | 17 | -| JustinGrote | | | | 1 | 3 | 6 | 1 | 1 | 2 | 2 | 16 | -| KirkMunro | | | | 7 | 7 | 1 | | | | | 15 | -| alexandair | | 9 | 4 | 2 | | | | | | | 15 | -| kilasuit | | | | | 3 | 2 | 1 | 4 | 1 | 3 | 14 | -| clamb123 | | | | | | | 14 | | | | 14 | -| tabad | | | | | | | | | 11 | 2 | 13 | -| rkeithhill | | | 1 | 2 | 2 | 2 | 3 | 1 | 2 | | 13 | -| trollyanov | | | | | | | 11 | 1 | | | 12 | -| jsilverm | | | | | | 8 | | | 4 | | 12 | -| CarloToso | | | | | | | | | 11 | | 11 | -| Liturgist | | | | | 1 | 1 | 1 | 2 | 4 | 2 | 11 | -| ArmaanMcleod | | | | | | | | | 4 | 6 | 10 | -| UberKluger | | | | | | 1 | 7 | 2 | | | 10 | -| vors | 1 | 6 | 2 | 1 | | | | | | | 10 | -| matt9ucci | | | 2 | 5 | | | 2 | | 1 | | 10 | -| LaurentDardenne | | | 3 | 2 | | | | 5 | | | 10 | +| Issues Opened | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | Grand Total | +| ------------------ | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ----------: | +| Community | 3 | 54 | 95 | 211 | 561 | 557 | 363 | 225 | 270 | 223 | 26 | 2588 | +| mklement0 | | | 19 | 60 | 56 | 61 | 28 | 8 | 20 | 24 | | 276 | +| ehmiiz | | | | | | | | 20 | 14 | | | 34 | +| iSazonov | | | 1 | 4 | 10 | 8 | 4 | 3 | | 1 | | 31 | +| jszabo98 | | | | 2 | 15 | 6 | 1 | | 1 | 2 | | 27 | +| iRon7 | | | | | | 2 | 2 | 2 | 10 | 8 | 1 | 25 | +| juvtib | | | | | | 15 | 7 | | | | | 22 | +| doctordns | | | 5 | 3 | 5 | 7 | 1 | | | | | 21 | +| peetrike | | | | 1 | | 4 | 2 | 6 | 4 | 3 | | 20 | +| vexx32 | | | | 3 | 11 | | | 3 | | | | 17 | +| JustinGrote | | | | 1 | 3 | 6 | 1 | 1 | 2 | 2 | | 16 | +| KirkMunro | | | | 7 | 7 | 1 | | | | | | 15 | +| alexandair | | 9 | 4 | 2 | | | | | | | | 15 | +| kilasuit | | | | | 3 | 2 | 1 | 4 | 1 | 3 | | 14 | +| clamb123 | | | | | | | 14 | | | | | 14 | +| tabad | | | | | | | | | 11 | 2 | | 13 | +| rkeithhill | | | 1 | 2 | 2 | 2 | 3 | 1 | 2 | | | 13 | +| surfingoldelephant | | | | | | | | | | 6 | 6 | 12 | +| trollyanov | | | | | | | 11 | 1 | | | | 12 | +| jsilverm | | | | | | 8 | | | 4 | | | 12 | +| CarloToso | | | | | | | | | 11 | | | 11 | +| Liturgist | | | | | 1 | 1 | 1 | 2 | 4 | 2 | | 11 | +| ArmaanMcleod | | | | | | | | | 4 | 6 | | 10 | +| UberKluger | | | | | | 1 | 7 | 2 | | | | 10 | +| vors | 1 | 6 | 2 | 1 | | | | | | | | 10 | +| LaurentDardenne | | | 3 | 2 | | | | 5 | | | | 10 | +| matt9ucci | | | 2 | 5 | | | 2 | | 1 | | | 10 | [contrib]: contributing/overview.md diff --git a/reference/docs-conceptual/toc.yml b/reference/docs-conceptual/toc.yml index 5ec029edd8df..818ad00ffd83 100644 --- a/reference/docs-conceptual/toc.yml +++ b/reference/docs-conceptual/toc.yml @@ -363,6 +363,8 @@ items: href: community/hall-of-fame.md - name: What's new in Docs items: + - name: 2025 Updates + href: community/2025-updates.md - name: 2024 Updates href: community/2024-updates.md - name: 2023 Updates