From c0c07258dc3867cc55330c93ad64e114f8500464 Mon Sep 17 00:00:00 2001 From: Bobby Reed Date: Tue, 14 May 2019 11:36:14 -0400 Subject: [PATCH 1/7] Fixes #4189 - Rewrite all provider cmdlets for Filter/Credential clarity --- .../Add-Content.md | 197 +++++++++------- .../Clear-Content.md | 164 ++++++++----- .../Clear-Item.md | 79 ++++--- .../Clear-ItemProperty.md | 84 ++++--- .../Copy-Item.md | 154 +++++++----- .../Copy-ItemProperty.md | 70 +++--- .../Get-ChildItem.md | 223 ++++++++---------- .../Get-Content.md | 82 +++++-- .../Get-Item.md | 112 +++++---- .../Get-ItemProperty.md | 140 +++++------ .../Get-ItemPropertyValue.md | 68 ++++-- .../Get-PSDrive.md | 6 +- .../Invoke-Item.md | 64 +++-- .../Move-Item.md | 148 +++++++----- .../Move-ItemProperty.md | 64 +++-- .../New-Item.md | 19 +- .../New-ItemProperty.md | 75 +++--- .../Remove-Item.md | 140 ++++++----- .../Remove-ItemProperty.md | 78 +++--- .../Rename-Item.md | 81 ++++--- .../Rename-ItemProperty.md | 62 +++-- .../Resolve-Path.md | 8 +- .../Set-Content.md | 132 +++++++---- .../Set-Item.md | 78 +++--- .../Set-ItemProperty.md | 114 +++++---- 25 files changed, 1419 insertions(+), 1023 deletions(-) diff --git a/reference/6/Microsoft.PowerShell.Management/Add-Content.md b/reference/6/Microsoft.PowerShell.Management/Add-Content.md index f55c41c4b879..7256a1fb8984 100644 --- a/reference/6/Microsoft.PowerShell.Management/Add-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Add-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 1/28/2019 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -46,66 +46,70 @@ If you need to create files or directories for the following examples, see [New- This example appends a value to text files in the current directory but excludes files based on their file name. +The **Path** parameter to specifies all `.txt` files in the current directory, but the **Exclude** +parameter ignores file names that match the specified pattern. + +The **Value** parameter specifies the text string that is written to the files. + ```powershell Add-Content -Path .\*.txt -Exclude help* -Value 'End of file' ``` -The `Add-Content` cmdlet uses the **Path** parameter to specify all .txt files in the current -directory. The **Exclude** parameter ignores file names that match the specified pattern. The -**Value** parameter specifies the text string that is written to the files. - -Use [Get-Content](Get-Content.md) to display the contents of these files. - ### Example 2: Add a date to the end of the specified files This example appends the date to files in the current directory and displays the date in the PowerShell console. +The `Add-Content` creates two new files in the current directory. The **Value** parameter contains +the output of the `Get-Date` + +The **PassThru** parameter outputs the added contents to the pipeline. Because there is no other +cmdlets to receive the output, it is displayed in the PowerShell console. + +The `Get-Content` cmdlet displays the updated file, `DateTimeFile1.log`. + ```powershell Add-Content -Path .\DateTimeFile1.log, .\DateTimeFile2.log -Value (Get-Date) -PassThru Get-Content -Path .\DateTimeFile1.log ``` -The `Add-Content` cmdlet uses the **Path** and **Value** parameters to create two new files in the -current directory. The **Value** parameter specifies the `Get-Date` cmdlet to get the date and -passes the date to `Add-Content`. The `Add-Content` cmdlet writes the date to each file. The -**PassThru** parameter passes an object that represents the date object. Because there is no other -cmdlet to receive the passed object, it is displayed in the PowerShell console. The `Get-Content` -cmdlet displays the updated file, DateTimeFile1.log. +```Output +Tuesday, May 14, 2019 8:24:27 AM +Tuesday, May 14, 2019 8:24:27 AM +5/14/2019 8:24:27 AM +``` ### Example 3: Add the contents of a specified file to another file -This example gets the content from a file and appends that content into another file. +This example gets the content from a file and stores the content in a variable. The variable is +used to append the content into another file. ```powershell -Add-Content -Path .\CopyToFile.txt -Value (Get-Content -Path .\CopyFromFile.txt) +$From = Get-Content -Path .\CopyFromFile.txt +Add-Content -Path .\CopyToFile.txt -Value $From Get-Content -Path .\CopyToFile.txt ``` -The `Add-Content` cmdlet uses the **Path** parameter to specify the new file in the current -directory, CopyToFile.txt. The **Value** parameter uses the `Get-Content` cmdlet to get the -contents of the file, CopyFromFile.txt. The parentheses around the `Get-Content` cmdlet ensure that -the command finishes before the `Add-Content` command begins. The **Value** parameter is passed to -`Add-Content`. The `Add-Content` cmdlet appends the data to the CopyToFile.txt file. The -`Get-Content` cmdlet displays the updated file, CopyToFile.txt. +- The `Get-Content` cmdlet gets the contents of `CopyFromFile.txt` and stores the contents in the + `$From` variable. +- The `Add-Content` cmdlet updates the `CopyToFile.txt` file using the contents of the `$From` + variable. +- The `Get-Content` cmdlet displays CopyToFile.txt. -### Example 4: Use a variable to add the contents of a specified file to another file +### Example 4: Add the contents of a specified file to another file using the pipeline -This example gets the content from a file and stores the content in a variable. The variable is -used to append the content into another file. +This example gets the content from a file and pipes it to the `Add-Content` cmdlet. + +The `Get-Content` cmdlet gets the contents of `CopyFromFile.txt`. The results are piped to the +`Add-Content` cmdlet, which updates the `CopyToFile.txt`. + +The last `Get-Content` cmdlet displays `CopyToFile.txt`. ```powershell -$From = Get-Content -Path .\CopyFromFile.txt -Add-Content -Path .\CopyToFile.txt -Value $From +Get-Content -Path .\CopyFromFile.txt | Add-Content -Path .\CopyToFile.txt Get-Content -Path .\CopyToFile.txt ``` -The `Get-Content` cmdlet gets the contents of CopyFromFile.txt and stores the contents in the -`$From` variable. The `Add-Content` cmdlet uses the **Path** parameter to specify the -CopyToFile.txt file in the current directory. The **Value** parameter uses the `$From` variable and -passes the content to `Add-Content`. The `Add-Content` cmdlet updates the CopyToFile.txt file. The -`Get-Content` cmdlet displays CopyToFile.txt. - ### Example 5: Create a new file and copy content This example creates a new file and copies an existing file's content into the new file. @@ -115,16 +119,17 @@ Add-Content -Path .\NewFile.txt -Value (Get-Content -Path .\CopyFromFile.txt) Get-Content -Path .\NewFile.txt ``` -The `Add-Content` cmdlet uses the **Path** and **Value** parameters to create a new file in the -current directory. The **Value** parameter uses the `Get-Content` cmdlet to get the contents of an -existing file, CopyFromFile.txt. The parentheses around the `Get-Content` cmdlet ensure that the -command finishes before the `Add-Content` command begins. The **Value** parameter passes the -content to `Add-Content` which updates the NewFile.txt file. The `Get-Content` cmdlet displays the -contents of the new file, NewFile.txt. +- The `Add-Content` cmdlet uses the **Path** and **Value** parameters to create a new file in the + current directory. +- The `Get-Content` cmdlet gets the contents of an existing file, `CopyFromFile.txt` + and passes it to the **Value** parameter. + - The parentheses around the `Get-Content` cmdlet ensure that the command finishes before the + `Add-Content` command begins. +- The `Get-Content` cmdlet displays the contents of the new file, `NewFile.txt`. ### Example 6: Add content to a read-only file -This command adds the value to the file even if the **IsReadOnly** file attribute is set to True. +This command adds a value to the file even if the **IsReadOnly** file attribute is set to **True**. The steps to create a read-only file are included in the example. ```powershell @@ -141,17 +146,32 @@ Mode LastWriteTime Length Name -ar-- 1/28/2019 13:35 0 IsReadOnlyTextFile.txt ``` -The `New-Item` cmdlet uses the **Path** and **ItemType** parameters to create the file -IsReadOnlyTextFile.txt in the current directory. The `Set-ItemProperty` cmdlet uses the **Name** -and **Value** parameters to change the file's **IsReadOnly** property to True. The `Get-ChildItem` -cmdlet shows the file is empty (0) and has the read-only attribute (`r`). The `Add-Content` cmdlet -uses the **Path** parameter to specify the file. The **Value** parameter includes the text string -to append to the file. The **Force** parameter writes the text to the read-only file. The -`Get-Content` cmdlet uses the **Path** parameter to display the file's contents. +- The `New-Item` cmdlet uses the **Path** and **ItemType** parameters to create the file + `IsReadOnlyTextFile.txt` in the current directory. +- The `Set-ItemProperty` cmdlet uses the **Name** and **Value** parameters to change the file's + **IsReadOnly** property to True. +- The `Get-ChildItem` cmdlet shows the file is empty (0) and has the read-only attribute (`r`). +- The `Add-Content` cmdlet uses the **Path** parameter to specify the file. The **Value** parameter + includes the text string to append to the file. The **Force** parameter writes the text to the + read-only file. +- The `Get-Content` cmdlet uses the **Path** parameter to display the file's contents. To remove the read-only attribute, use the `Set-ItemProperty` command with the **Value** parameter 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. + +The following command adds the word "Done" the content of all `*.txt` files in the `C:\Temp` +directory. + +```powershell +Add-Content -Path C:\Temp\* -Filter *.txt -Value "Done" +``` + ## PARAMETERS ### -AsByteStream @@ -176,15 +196,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. The default is the current -user. - -Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCredential** object, -such as one generated by the `Get-Credential` cmdlet. If you type a user name, you will be prompted -for a password. - -> [!WARNING] -> This parameter is not supported by any providers installed with PowerShell. +> [!NOTE] +> This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -237,8 +252,15 @@ Accept wildcard characters: False ### -Exclude -Omits the specified items. The value of this parameter qualifies the **Path** parameter. Enter a -path element or pattern, such as **\*.txt**. Wildcards are permitted. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. +The value of this parameter qualifies the **Path** parameter. + +Enter a path element or pattern, such as `*.txt`. +Wildcard characters are permitted. + +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -254,11 +276,17 @@ Accept wildcard characters: False ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. **Filters** are more efficient than other parameters because the provider applies filters -when objects are retrieved. Otherwise, PowerShell processes filters after the objects are -retrieved. +Specifies a filter to qualify the **Path** parameter. When you specify a filter, the **Path** +parameter requires a trailing asterisk (`*`) to indicate the contents of the path. + +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: String @@ -292,8 +320,15 @@ Accept wildcard characters: False ### -Include -Adds only the specified items. The value of this parameter qualifies the **Path** parameter. Enter -a path element or pattern, such as **\*.txt**. Wildcards are permitted. +Specifies, as a string array, an item or items that this cmdlet includes in the operation. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as `"*.txt"`. + +Wildcard characters are permitted. + +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -309,10 +344,12 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to the items that receive the additional content. Unlike **Path**, the value of -**LiteralPath** is used exactly as it is typed. No characters are interpreted as wildcards. If the -path includes escape characters, enclose it in single quotation marks. Single quotation marks tell -PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -464,7 +501,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](https://go.microsoft.com/fwlink/?LinkID=113216). +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -481,17 +518,15 @@ represents the content. Otherwise, this cmdlet does not generate any output. ## NOTES -When you pipe an object to `Add-Content`, the object is converted to a string before it is added to -the item. The object type determines the string format, but the format might be different than the -default display of the object. To control the string format, use the formatting parameters of the -sending cmdlet. - -You can also refer to `Add-Content` by its built-in alias, `ac`. For more information, see -[about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - -The `Add-Content` cmdlet is designed to work with the data exposed by any provider. To list the -providers available in your session, type `Get-PSProvider`. For more information, see -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- When you pipe an object to `Add-Content`, the object is converted to a string before it is added to + the item. The object type determines the string format, but the format might be different than the + default display of the object. To control the string format, use the formatting parameters of the + sending cmdlet. +- You can also refer to `Add-Content` by its built-in alias, `ac`. For more information, see + [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- The `Add-Content` cmdlet is designed to work with the data exposed by any provider. To list the + providers available in your session, type `Get-PSProvider`. For more information, see + [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -507,4 +542,4 @@ providers available in your session, type `Get-PSProvider`. For more information [New-Item](New-Item.md) -[Set-Content](Set-Content.md) \ No newline at end of file +[Set-Content](Set-Content.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Clear-Content.md b/reference/6/Microsoft.PowerShell.Management/Clear-Content.md index 68901f5b1310..c780e79a609c 100644 --- a/reference/6/Microsoft.PowerShell.Management/Clear-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Clear-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -30,54 +30,88 @@ Clear-Content -LiteralPath [-Filter ] [-Include ] [ ## DESCRIPTION -The `Clear-Content` cmdlet deletes the contents of an item, such as deleting the text from a file, but it does not delete the item. -As a result, the item exists, but it is empty. -The `Clear-Content` is similar to `Clear-Item`, but it works on items with contents, instead of items with values. +The `Clear-Content` cmdlet deletes the contents of an item, such as deleting the text from a file, +but it does not delete the item. As a result, the item exists, but it is empty. +The `Clear-Content` is similar to `Clear-Item`, but it works on items with contents, instead of +items with values. ## EXAMPLES ### Example 1: Delete all content from a directory +This command deletes all of the content from the "init.txt" files in all subdirectories of the +SmpUsers directory. The files are not deleted, but they are empty. + ```powershell Clear-Content "..\SmpUsers\*\init.txt" ``` -This command deletes all of the content from the "init.txt" files in all subdirectories of the SmpUsers directory. -The files are not deleted, but they are empty. - ### Example 2: Delete content of all files with a wildcard +This command deletes the contents of all files in the current directory with the ".log" file name +extension, including files with the read-only attribute. +The asterisk (*) in the path represents all items in the current directory. +The **Force** parameter makes the command effective on read-only files. +Using a filter to restrict the command to files with the .log file name extension instead of +specifying *.log in the path makes the operation faster. + ```powershell Clear-Content -Path "*" -Filter "*.log" -Force ``` -This command deletes the contents of all files in the current directory with the ".log" file name extension, including files with the read-only attribute. -The asterisk (*) in the path represents all items in the current directory. -The **Force** parameter makes the command effective on read-only files. -Using a filter to restrict the command to files with the .log file name extension instead of specifying *.log in the path makes the operation faster. - ### Example 3: Clear all data from a stream -This example shows how the `Clear-Content` cmdlet clears the content from an alternate data stream while leaving the stream intact. +This example shows how the `Clear-Content` cmdlet clears the content from an alternate data stream +while leaving the stream intact. + +```powershell +Get-Content C:\Test\Copy-Script.ps1 -Stream Zone.Identifier +``` -The first command uses the `Get-Content` cmdlet to get the content of the Zone.Identifier stream in the Copy-Script.ps1 file, which was downloaded from the Internet. +```Output +[ZoneTransfer] +ZoneId=3 +``` -The second command uses the `Clear-Content` cmdlet to clear the content. +```powershell +Clear-Content C:\Test\Copy-Script.ps1 -Stream Zone.Identifier +``` -The third command repeats the first command. It verifies that the content is cleared, but the stream remains. If the stream were deleted, the command would generate an error. +```powershell +Get-Content C:\Test\Copy-Script.ps1 -Stream Zone.Identifier +``` -You can use a method like this one to clear the content of an alternate data stream. However, it is not the recommended way to eliminate security checks that block files that are downloaded from the Internet. If you verify that a downloaded file is safe, use the `Unblock-File` cmdlet. +```Output ``` -PS C:\> Get-Content C:\Test\Copy-Script.ps1 -Stream Zone.Identifier -[ZoneTransfer] -ZoneId=3 +The `Get-Content` cmdlet gets the content of the **Zone.Identifier** stream in +the `Copy-Script.ps1` file, which was downloaded from the Internet. + +The **ZoneId** shows that the script will be blocked by **ExecutionPolicy**. + +The `Clear-Content` cmdlet to clear the content of the **Zone.Identifier** stream. -PS C:\>Clear-Content C:\Test\Copy-Script.ps1 -Stream Zone.Identifier +The last command uses `Get-Content` to show that the **Zone.Identifier** stream has been cleared. -PS C:\>Get-Content C:\Test\Copy-Script.ps1 -Stream Zone.Identifier -PS C:\> +You can use a method like this one to clear the content of an alternate data stream. However, it is +not the recommended way to eliminate security checks that block files that are downloaded from the +Internet. If you want to verify that a downloaded file is safe, use the [Unblock-File](../Microsoft.PowerShell.Utility/Unblock-File.md) +cmdlet. + +For more about execution policies, see [about_Execution_Policies](../Microsoft.PowerShell.Core/About/about_Execution_Policies.md). + +### Example 4: Use Filters with Clear-Content + +You can specify a filter to the `Clear-Content` cmdlet. When using filters to qualify the **Path** +parameter, you need to include a trailing asterisk (`*`) to indicate the contents of the +path. + +The following command clears the content of all `*.log` files in the `C:\Temp` +directory. + +```powershell +Clear-Content -Path C:\Temp\* -Filter *.log ``` ## PARAMETERS @@ -91,10 +125,6 @@ Wildcard characters are not supported. Stream is a dynamic parameter that the FileSystem provider adds to `Clear-Content`. This parameter works only in file system drives. -You can use the `Clear-Content` cmdlet to change the content of the Zone.Identifier alternate data stream. -However, we do not recommend this as a way to eliminate security checks that block files that are downloaded from the Internet. -If you verify that a downloaded file is safe, use the `Unblock-File` cmdlet. - ```yaml Type: String Parameter Sets: (All) @@ -109,14 +139,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you will be prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -132,10 +158,15 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, strings that this cmdlet omits from the path to the content. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. + +Enter a path element or pattern, such as `*.txt`. +Wildcard characters are permitted. + +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -151,10 +182,17 @@ Accept wildcard characters: False ### -Filter -Specifies a filter in the provider's format or language. -The value of this parameter qualifies the **Path** parameter. -The syntax of the filter, including the use of wildcards, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when retrieving the objects, rather than having PowerShell filter the objects after they are retrieved. +Specifies a filter to qualify the **Path** parameter. When you specify a filter, the **Path** +parameter requires a trailing asterisk (`*`) to indicate the contents of the path. + +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: String @@ -186,10 +224,15 @@ Accept wildcard characters: False ### -Include -Specifies, as a string array, content that this cmdlet clears. +Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". -Wildcards are permitted. +Enter a path element or pattern, such as `"*.txt"`. + +Wildcard characters are permitted. + +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -205,11 +248,12 @@ Accept wildcard characters: True ### -LiteralPath -Specifies the paths to the items from which content is deleted. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell having PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -230,7 +274,7 @@ Wildcards are permitted. The paths must be paths to items, not to containers. For example, you must specify a path to one or more files, not a path to a directory. Wildcards are permitted. -This parameter is required, but the parameter name ("Path") is optional. +This parameter is required, but the parameter name **Path** is optional. ```yaml Type: String[] @@ -279,7 +323,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -295,12 +342,13 @@ This cmdlet does not return any objects. ## NOTES -You can use `Clear-Content` with the PowerShell FileSystem provider and with other providers that manipulate content. -To clear items that are not considered to be content, such as items managed by the PowerShell Certificate or Registry providers, use `Clear-Item`. - -The `Clear-Content` cmdlet is designed to work with the data exposed by any provider. -To list the providers available in your session, type `Get-PsProvider`. -For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- You can use `Clear-Content` with the PowerShell FileSystem provider and with other providers that + manipulate content. +- To clear items that are not considered to be content, such as items managed by the PowerShell + **Certificate** or **Registry** providers, use `Clear-Item`. +- The `Clear-Content` cmdlet is designed to work with the data exposed by any provider. + - To list the providers available in your session, type `Get-PsProvider`. +- For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -310,4 +358,4 @@ For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/a [Get-Item](Get-Item.md) -[Set-Content](Set-Content.md) \ No newline at end of file +[Set-Content](Set-Content.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Clear-Item.md b/reference/6/Microsoft.PowerShell.Management/Clear-Item.md index 6b113ea635fa..64cb6d411cf5 100644 --- a/reference/6/Microsoft.PowerShell.Management/Clear-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Clear-Item.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -31,8 +31,8 @@ Clear-Item -LiteralPath [-Force] [-Filter ] [-Include Clear-Item TestVar1 ### Example 2: Clear all registry entries -This command clears all registry entries in the "MyKey" subkey, but only after prompting you to confirm your intent. +This command clears all registry entries in the "MyKey" subkey, but only after prompting you to +confirm your intent. It does not delete the "MyKey" subkey or affect any other registry keys or entries. -You can use the **Include** and **Exclude** parameters to identify particular registry keys, but you cannot use them to identify registry entries. +You can use the **Include** and **Exclude** parameters to identify particular registry keys, but you +cannot use them to identify registry entries. - To delete particular registry entries, use the `Remove-ItemProperty` cmdlet. - To delete the value of a registry entry, use the `Clear-ItemPropertycmdlet`. @@ -71,14 +74,10 @@ Clear-Item HKLM:\Software\MyCompany\MyKey -Confirm ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you are prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -94,11 +93,17 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, items to exclude. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as *.txt. + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + + ```yaml Type: String[] Parameter Sets: (All) @@ -113,11 +118,9 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the **Path** parameter. - -The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +The `Clear-Item` cmdlet does not support the **Filter** parameter with any installed PowerShell +provider. In third party providers, the **Filter** parameter could be implemented to qualify the +**Path** parameter using provider specific language. ```yaml Type: String @@ -153,11 +156,16 @@ Accept wildcard characters: False ### -Include -Specifies, as a string array, items to that this cmdlet clears. +Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -172,11 +180,12 @@ Accept wildcard characters: True ### -LiteralPath -Specifies the path to the items being cleared. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -243,7 +252,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -259,9 +271,12 @@ This cmdlet does not generate any output. ## NOTES -The `Clear-Item` cmdlet is supported only by several PowerShell providers, including the Alias, Environment, Function, Registry, and Variable providers. As such, you can use `Clear-Item` to delete the content of items in the provider namespaces. To list the providers available in your session, type `Get-PsProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). - -You cannot use `Clear-Item` to delete the contents of a file, because the PowerShell FileSystem provider does not support this cmdlet. To clear files, use the `Clear-Content`. +- The `Clear-Item` cmdlet is supported only by several PowerShell providers, including the **Alias**, + **Environment**, **Function**, **Registry**, and **Variable** providers. As such, you can use + `Clear-Item` to delete the content of items in the provider namespaces. To list the providers + available in your session, type `Get-PsProvider`. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +- You cannot use `Clear-Item` to delete the contents of a file, because the PowerShell FileSystem + provider does not support this cmdlet. To clear files, use the `Clear-Content`. ## RELATED LINKS @@ -281,4 +296,4 @@ You cannot use `Clear-Item` to delete the contents of a file, because the PowerS [Set-Item](Set-Item.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Clear-ItemProperty.md b/reference/6/Microsoft.PowerShell.Management/Clear-ItemProperty.md index 319e8126115b..cca636f05b3d 100644 --- a/reference/6/Microsoft.PowerShell.Management/Clear-ItemProperty.md +++ b/reference/6/Microsoft.PowerShell.Management/Clear-ItemProperty.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -39,9 +39,11 @@ You can use this cmdlet to delete the data from a registry value. ### Example 1: Clear the value of registry key -This command clear the data in the "Options" registry value in the "MyApp" subkey of "HKEY_LOCAL_MACHINE\Software\MyCompany". +This command clear the data in the "Options" registry value in the "MyApp" subkey of +"HKEY_LOCAL_MACHINE\Software\MyCompany". -Because the command is being issued from a file system drive (`C:`), it uses the fully qualified path to the `HKLM:` drive and the "Software\MyCompany\MyApp" subkey. +Because the command is being issued from a file system drive (`C:`), it uses the fully qualified +path to the `HKLM:` drive and the "Software\MyCompany\MyApp" subkey. It uses the **Name** parameter to specify the "Options" value. ```powershell @@ -52,14 +54,10 @@ Clear-ItemProperty -Path "HKLM:\Software\MyCompany\MyApp" -Name "Options" ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you are prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -75,11 +73,16 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, an item or items that this cmdlet excludes. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -94,11 +97,10 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the **Path** parameter. - -The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +The `Clear-ItemProperty` cmdlet does not support the **Filter** parameter with any installed +PowerShell +provider. In third party providers, the **Filter** parameter could be implemented to qualify the +**Path** parameter using provider specific language. ```yaml Type: String @@ -114,8 +116,8 @@ Accept wildcard characters: True ### -Force -Indicates that this cmdlet deletes properties from items that cannot otherwise be accessed by the user. -Implementation varies from provider to provider. +Indicates that this cmdlet deletes properties from items that cannot otherwise be accessed by the +user. Implementation varies from provider to provider. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ```yaml @@ -132,10 +134,15 @@ Accept wildcard characters: False ### -Include -Specifies, as a string array, an item or items that this cmdlet clears. -The value of this parameter qualifies the *Path* parameter. -Enter a path element or pattern, such as *.txt. -Wildcards are permitted. +Specifies, as a string array, an item or items that this cmdlet includes in the operation. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as `"*.txt"`. + +Wildcard characters are permitted. + +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -151,11 +158,12 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to the property being cleared. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -255,7 +263,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -267,14 +278,17 @@ You can pipe a path string to this cmdlet. ### None or System.Management.Automation.PSCustomObject -When you use the *PassThru* parameter, `Clear-ItemProperty` generates a **PSCustomObject** object that represents the cleared item property. -Otherwise, this cmdlet does not generate any output. +When you use the **PassThru** parameter, `Clear-ItemProperty` generates a **PSCustomObject** object +that represents the cleared item property. Otherwise, this cmdlet does not generate any output. ## NOTES -You can use `Clear-ItemProperty` to delete the data in registry values without deleting the value. If the data type of the value is Binary or DWORD, clearing the data sets the value to zero. Otherwise, the value is empty. - -The `Clear-ItemProperty` cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type `Get-PSProvider`. For more information, see about_Providers. +- You can use `Clear-ItemProperty` to delete the data in registry values without deleting the value. + If the data type of the value is Binary or DWORD, clearing the data sets the value to zero. + Otherwise, the value is empty. +- The `Clear-ItemProperty` 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). ## RELATED LINKS @@ -288,4 +302,4 @@ The `Clear-ItemProperty` cmdlet is designed to work with the data exposed by any [Rename-ItemProperty](Rename-ItemProperty.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Copy-Item.md b/reference/6/Microsoft.PowerShell.Management/Copy-Item.md index b143ad93919f..064df4721d81 100644 --- a/reference/6/Microsoft.PowerShell.Management/Copy-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Copy-Item.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -36,8 +36,10 @@ The `Copy-Item` cmdlet copies an item from one location to another location in t For instance, it can copy a file to a folder, but it cannot copy a file to a certificate drive. This cmdlet does not cut or delete the items being copied. -The particular items that the cmdlet can copy depend on the PowerShell provider that exposes the item. -For instance, it can copy files and directories in a file system drive and registry keys and entries in the registry drive. +The particular items that the cmdlet can copy depend on the PowerShell provider that exposes the +item. +For instance, it can copy files and directories in a file system drive and registry keys and entries +in the registry drive. This cmdlet can copy and rename items in the same command. To rename an item, enter the new name in the value of the **Destination** parameter. @@ -47,7 +49,7 @@ To rename an item and not copy it, use the `Rename-Item` cmdlet. ### Example 1: Copy a file to the specified directory -This command copies the "mar1604.log.txt" file to the "C:\Presentation" directory. +This command copies the `mar1604.log.txt` file to the `C:\Presentation` directory. The command does not delete the original file. ```powershell @@ -57,17 +59,19 @@ Copy-Item "C:\Wabash\Logfiles\mar1604.log.txt" -Destination "C:\Presentation" ### Example 2: Copy the contents of a directory to another directory This command copies the entire contents of the "Logfiles" directory into the "Drawings" directory. -If the "LogFiles" directory contains files in subdirectories, those subdirectories are copied with their file trees intact. -The **Container** parameter is set to "true" by default. -This preserves the directory structure. ```powershell Copy-Item "C:\Logfiles\*" -Destination "C:\Drawings" -Recurse ``` +If the "LogFiles" directory contains files in subdirectories, those subdirectories are copied with +their file trees intact. The **Container** parameter is set to "true" by default. + +This preserves the directory structure. + ### Example 3: Copy the contents of a directory to another directory and create the destination directory if it does not exist -This command copies the contents of the "C:\Logfiles" directory to the "C:\Drawings\Logs" directory. +This command copies the contents of the `C:\Logfiles` directory to the `C:\Drawings\Logs` directory. It creates the "\Logs" subdirectory if it does not already exist. ```powershell @@ -76,8 +80,10 @@ Copy-Item C:\Logfiles -Destination C:\Drawings\Logs -Recurse ### Example 4: Copy a file to the specified directory and rename the file -This command uses the `Copy-Item` cmdlet to copy the "Get-Widget.ps1" script from the "\\\\Server01\Share" directory to the "\\\\Server12\ScriptArchive" directory. -As part of the copy operation, the command also changes the item name from "Get-Widget.ps1" to "Get-Widget.ps1.txt", so it can be attached to email messages. +This command uses the `Copy-Item` cmdlet to copy the `Get-Widget.ps1` script from the +`\\Server01\Share` directory to the `\\Server12\ScriptArchive` directory. +As part of the copy operation, the command also changes the item name from `Get-Widget.ps1` to +`Get-Widget.ps1.txt`, so it can be attached to email messages. ```powershell Copy-Item "\\Server01\Share\Get-Widget.ps1" -Destination "\\Server12\ScriptArchive\Get-Widget.ps1.txt" @@ -85,10 +91,12 @@ Copy-Item "\\Server01\Share\Get-Widget.ps1" -Destination "\\Server12\ScriptArchi ### Example 5: Copy a file to a remote computer -The first command creates a session to the remote computer named "Server01" with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named "Server01" with the credential of +`Contoso\PattiFu`" and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy "test.log" from the "D:\Folder001" folder to the "C:\Folder001_Copy" folder on the remote computer using the session information stored in the `$Session` variable. -This command does not delete the original file. +The second command uses the `Copy-Item` cmdlet to copy `test.log` from the `D:\Folder001` folder to +the `C:\Folder001_Copy` folder on the remote computer using the session information stored in the +`$Session` variable. This command does not delete the original file. ```powershell $Session = New-PSSession -ComputerName "Server01" -Credential "Contoso\PattiFul" @@ -97,10 +105,12 @@ Copy-Item "D:\Folder001\test.log" -Destination "C:\Folder001_Copy\" -ToSession $ ### Example 6: Copy the entire contents of a folder to a remote computer -The first command creates a session to the remote computer named "Server01" with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named "Server01" with the credential of +`Contoso\PattiFul` and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy the entire contents from the "D:\Folder002" folder to the "C:\Folder002_Copy" directory on the remote computer using the session information stored in the `$Session` variable. -The subfolders are copied with their file trees intact. +The second command uses the `Copy-Item` cmdlet to copy the entire contents from the `D:\Folder002` +folder to the `C:\Folder002_Copy` directory on the remote computer using the session information +stored in the `$Session` variable. The subfolders are copied with their file trees intact. ```powershell $Session = New-PSSession -ComputerName "Server02" -Credential "Contoso\PattiFul" @@ -109,11 +119,14 @@ Copy-Item "D:\Folder002\" -Destination "C:\Folder002_Copy\" -ToSession $Session ### Example 7: Recursively copy the entire contents of a folder to a remote computer -The first command creates a session to the remote computer named Server01 with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named Server01 with the credential of +"Contoso\PattiFul" and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy the entire contents from the "D:\Folder003" folder to the "C:\Folder003_Copy" directory on the remote computer using the session information stored in the `$Session` variable. -The subfolders are copied with their file trees intact. -Since this command uses the **Recurse** parameter, the operation creates the "Folder003_Copy" folder if it does not already exist. +The second command uses the `Copy-Item` cmdlet to copy the entire contents from the `D:\Folder003` +folder to the `C:\Folder003_Copy` directory on the remote computer using the session information +stored in the `$Session` variable. The subfolders are copied with their file trees intact. +Since this command uses the **Recurse** parameter, the operation creates the "Folder003_Copy" folder +if it does not already exist. ```powershell $Session = New-PSSession -ComputerName "Server04" -Credential "Contoso\PattiFul" @@ -122,10 +135,14 @@ Copy-Item "D:\Folder003\" -Destination "C:\Folder003_Copy\" -ToSession $Session ### Example 8: Copy a file to a remote computer and then rename the file -The first command creates a session to the remote computer named "Server01" with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named "Server01" with the credential of +"Contoso\PattiFul" and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy "scriptingexample.ps1" from the "D:\Folder004" folder to the "C:\Folder004_Copy" folder on the remote computer using the session information stored in the `$Session` variable. -As part of the copy operation, the command also changes the item name from "scriptingexample.ps1" to "scriptingexample_copy.ps1", so it can be attached to email messages. +The second command uses the `Copy-Item` cmdlet to copy `scriptingexample.ps1` from the +`D:\Folder004` folder to the "C:\Folder004_Copy" folder on the remote computer using the session +information stored in the `$Session` variable. +As part of the copy operation, the command also changes the item name from `scriptingexample.ps1` to +`scriptingexample_copy.ps1`, so it can be attached to email messages. This command does not delete the original file. ```powershell @@ -135,10 +152,12 @@ Copy-Item "D:\Folder004\scriptingexample.ps1" -Destination "C:\Folder004_Copy\sc ### Example 9: Copy a remote file to the local computer -The first command creates a session to the remote computer named "Server01" with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named "Server01" with the credential of +"Contoso\PattiFul" and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy test.log from the remote "C:\MyRemoteData\" to the local "D:\MyLocalData" folder using the session information stored in the `$Session` variable. -This command does not delete the original file. +The second command uses the `Copy-Item` cmdlet to copy test.log from the remote `C:\MyRemoteData\` +to the local `D:\MyLocalData` folder using the session information stored in the `$Session` +variable. This command does not delete the original file. ```powershell $Session = New-PSSession -ComputerName "Server01" -Credential "Contoso\PattiFul" @@ -147,10 +166,14 @@ Copy-Item "C:\MyRemoteData\test.log" -Destination "D:\MyLocalData\" -FromSession ### Example 10: Copy the entire contents of a remote folder to the local computer -The first command creates a session to the remote computer named "Server01" with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named "Server01" with the credential of +"Contoso\PattiFul" and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy the entire contents from the remote "C:\MyRemoteData\scripts" folder to the local "D:\MyLocalData" folder using the session information stored in the `$Session` variable. -If the scripts folder contains files in subfolders, those subfolders are copied with their file trees intact. +The second command uses the `Copy-Item` cmdlet to copy the entire contents from the remote +`C:\MyRemoteData\scripts` folder to the local `D:\MyLocalData` folder using the session information +stored in the `$Session` variable. +If the scripts folder contains files in subfolders, those subfolders are copied with their file +trees intact. ```powershell $Session = New-PSSession -ComputerName "Server01" -Credential "Contoso\PattiFul" @@ -159,10 +182,15 @@ Copy-Item "C:\MyRemoteData\scripts" -Destination "D:\MyLocalData\" -FromSession ### Example 11: Recursively copy the entire contents of a remote folder to the local computer -The first command creates a session to the remote computer named "Server01" with the credential of "Contoso\PattiFul" and stores the results in the variable named `$Session`. +The first command creates a session to the remote computer named "Server01" with the credential of +"Contoso\PattiFul" and stores the results in the variable named `$Session`. -The second command uses the `Copy-Item` cmdlet to copy the entire contents from the remote "C:\MyRemoteData\scripts" folder to the local "D:\MyLocalData\scripts" folder using the session information stored in the `$Session` variable. -Since this command uses the **Recurse** parameter, the operation creates the scripts folder if it does not already exist. If the scripts folder contains files in subfolders, those subfolders are copied with their file trees intact. +The second command uses the `Copy-Item` cmdlet to copy the entire contents from the remote +`C:\MyRemoteData\scripts` folder to the local `D:\MyLocalData\scripts` folder using the session +information stored in the `$Session` variable. +Since this command uses the **Recurse** parameter, the operation creates the scripts folder if it +does not already exist. If the scripts folder contains files in subfolders, those subfolders are +copied with their file trees intact. ```powershell $Session = New-PSSession -ComputerName "Server01" -Credential "Contoso\PattiFul" @@ -189,14 +217,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you are prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -231,7 +255,8 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet excludes from the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. ```yaml @@ -248,11 +273,14 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the **Path** parameter. +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). -The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +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: String @@ -268,7 +296,8 @@ Accept wildcard characters: True ### -Force -Indicates that this cmdlet copies items that cannot otherwise be changed, such as copying over a read-only file or alias. +Indicates that this cmdlet copies items that cannot otherwise be changed, such as copying over a +read-only file or alias. ```yaml Type: SwitchParameter @@ -285,7 +314,8 @@ Accept wildcard characters: False ### -FromSession Specifies the **PSSession** object from which a remote file is being copied. -When you use this parameter, the *Path* and *LiteralPath* parameters refer to the local path on the remote machine. +When you use this parameter, the *Path* and *LiteralPath* parameters refer to the local path on the +remote machine. ```yaml Type: PSSession @@ -303,9 +333,14 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -320,11 +355,12 @@ Accept wildcard characters: False ### -LiteralPath -Specifies a path to the item. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -390,7 +426,8 @@ Accept wildcard characters: False ### -ToSession Specifies the **PSSession** object to which a remote file is being copied. -When you use this parameter, the *Path* and *LiteralPath* parameters refer to the local path on the remote machine. +When you use this parameter, the *Path* and *LiteralPath* parameters refer to the local path on the +remote machine. ```yaml Type: PSSession @@ -439,7 +476,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -451,8 +491,8 @@ You can pipe a string that contains a path to this cmdlet. ### None or an object representing the copied item. -When you use the *PassThru* parameter, this cmdlet returns an object that represents the copied item. -Otherwise, this cmdlet does not generate any output. +When you use the *PassThru* parameter, this cmdlet returns an object that represents the copied +item. Otherwise, this cmdlet does not generate any output. ## NOTES @@ -480,4 +520,4 @@ For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/a [Get-PSProvider](Get-PSProvider.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Copy-ItemProperty.md b/reference/6/Microsoft.PowerShell.Management/Copy-ItemProperty.md index e62d6ba274ce..359eafa5a4d1 100644 --- a/reference/6/Microsoft.PowerShell.Management/Copy-ItemProperty.md +++ b/reference/6/Microsoft.PowerShell.Management/Copy-ItemProperty.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -32,14 +32,17 @@ Copy-ItemProperty -LiteralPath [-Name] [-Destination] [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -88,11 +87,16 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, an item or items that this cmdlet excludes. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -107,11 +111,8 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the **Path** parameter. - -The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +The `Clear-ItemProperty` cmdlet does not support the **Filter** parameter on any installed +PowerShell provider. ```yaml Type: String @@ -129,6 +130,7 @@ Accept wildcard characters: True 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 @@ -147,9 +149,14 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -164,11 +171,12 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to the current location of the property. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -266,7 +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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -278,12 +289,13 @@ You can pipe a string that contains a path to this cmdlet. ### None or System.Management.Automation.PSCustomObject -When you use the **Passthru** parameter, this cmdlet generates a **PsCustomObject** representing the copied item property. -Otherwise, this cmdlet does not generate any output. +When you use the **Passthru** parameter, this cmdlet generates a **PsCustomObject** representing the +copied item property. Otherwise, this cmdlet does not generate any output. ## NOTES -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. +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). ## RELATED LINKS @@ -301,4 +313,4 @@ This cmdlet is designed to work with the data exposed by any provider. To list t [Get-PSProvider](Get-PSProvider.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md b/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md index 3ae941fc5037..98a0ee60d06b 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-ChildItem.md @@ -1,5 +1,5 @@ --- -ms.date: 03/22/2019 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -53,15 +53,14 @@ This example gets the child items from a file system directory. The file names a names are displayed. For empty locations the command does not return any output and returns to the PowerShell prompt. -By default `Get-ChildItem` lists the mode (attributes), last write time, file size (length), and the -name of the item. The letters in the **Mode** property can be interperted as follows: `l` (link), -`d` (directory), `a` (archive), `r` (read-only), `h` (hidden), and `s` (system). For more -information about the mode flags, see -[about_Filesystem_Provider](../microsoft.powershell.core/about/about_filesystem_provider.md#attributes-flagsexpression). +The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the directory `C:\Test`. +`Get-ChildItem` displays the files and directories in the PowerShell console. +```powershell +Get-ChildItem -Path C:\Test ``` -PS> Get-ChildItem -Path C:\Test +```Output Directory: C:\Test Mode LastWriteTime Length Name @@ -73,16 +72,31 @@ d----- 2/15/2019 08:29 Logs -ar--- 2/12/2019 14:31 27 ReadOnlyFile.txt ``` -The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the directory **C:\Test**. -`Get-ChildItem` displays the files and directories in the PowerShell console. +By default `Get-ChildItem` lists the mode (**Attributes**), **LastWriteTime**, file size (**Length**), +and the **Name** of the item. The letters in the **Mode** property can be interperted as follows: + +- `l` (link) +- `d` (directory) +- `a` (archive) +- `r` (read-only) +- `h` (hidden) +- `s` (system). + +For more information about the mode flags, see +[about_Filesystem_Provider](../microsoft.powershell.core/about/about_filesystem_provider.md#attributes-flagsexpression). ### Example 2: Get child item names in a directory This command lists only the names of items in a directory. +The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the directory `C:\Test`. The +**Name** parameter returns only the file or directory names from the specified path. + +```powershell +Get-ChildItem -Path C:\Test -Name ``` -PS> Get-ChildItem -Path C:\Test -Name +```Output Logs anotherfile.txt Command.txt @@ -90,17 +104,16 @@ CreateTestFile.ps1 ReadOnlyFile.txt ``` -The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the directory **C:\Test**. The -**Name** parameter returns only the file or directory names from the specified path. - ### Example 3: Get child items in the current directory and subdirectories This example displays **.txt** files that are located in the current directory and its subdirectories. +```powershell +Get-ChildItem -Path C:\Test\*.txt -Recurse -Force ``` -PS> Get-ChildItem -Path C:\Test\*.txt -Recurse -Force +```Output Directory: C:\Test\Logs\Adirectory Mode LastWriteTime Length Name @@ -145,9 +158,21 @@ of **h**. In this example `Get-ChildItem` uses the **Include** parameter to find specific items from the directory specified by the **Path** parameter. +```powershell +# When using the -Include parameter, if you do not include an asterisk in the path +# the command returns no output. +Get-ChildItem -Path C:\Test\ -Include *.txt +``` + +```Output + +``` + +```powershell +Get-ChildItem -Path C:\Test\* -Include *.txt ``` -PS> Get-ChildItem -Path C:\Test\* -Include *.txt +```Output Directory: C:\Test Mode LastWriteTime Length Name @@ -165,21 +190,23 @@ extension **.txt**. When the **Include** parameter is used, the **Path** parameter needs a trailing asterisk (`*`) wildcard to specify the directory's contents. For example, `-Path C:\Test\*`. +If the **Recurse** parameter is added to the command, the trailing asterisk (`*`) in the **Path** +parameter is optional. The **Recurse** parameter gets items from the **Path** directory and its +subdirectories. For example, `-Path C:\Test\ -Recurse -Include *.txt` + If a trailing asterisk (`*`) is not included in the **Path** parameter, the command does not return any output and returns to the PowerShell prompt. For example, `-Path C:\Test\`. -If the **Recurse** parameter is added to the command, a trailing asterisk (`*`) in the **Path** -parameter is optional. The **Recurse** parameter gets items from the **Path** directory and its -subdirectories. - ### Example 5: Get child items using the Exclude parameter -In this example `Get-ChildItem` uses the **Exclude** parameter to exclude the output of specific -items from the directory specified by the **Path** parameter. +The example's output shows the contents of the directory **C:\Test\Logs**. The output is a reference +for the other commands that use the **Exclude** and **Recurse** parameters. +```powershell +Get-ChildItem -Path C:\Test\Logs ``` -PS> Get-ChildItem -Path C:\Test\Logs +```Output Directory: C:\Test\Logs Mode LastWriteTime Length Name @@ -190,70 +217,23 @@ d----- 2/15/2019 13:21 Backup -a---- 2/12/2019 16:16 20 Afile.txt -a---- 2/13/2019 13:26 20 LogFile1.txt -a---- 2/12/2019 16:24 23 systemlog1.log +``` +```powershell +Get-ChildItem -Path C:\Test\Logs\* -Exclude A* +``` -PS> Get-ChildItem -Path C:\Test\Logs -Exclude A* - - Directory: C:\Test\Logs - -Mode LastWriteTime Length Name ----- ------------- ------ ---- -d----- 2/15/2019 13:21 Backup --a---- 2/13/2019 13:26 20 LogFile1.txt --a---- 2/12/2019 16:24 23 systemlog1.log - - -PS> Get-ChildItem -Path C:\Test\Logs\* -Exclude A* - - Directory: C:\Test\Logs\Backup - -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 2/12/2019 15:50 20 LogFile3.txt --a---- 2/12/2019 16:24 23 systemlog1.log - - Directory: C:\Test\Logs - -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 2/13/2019 13:26 20 LogFile1.txt --a---- 2/12/2019 16:24 23 systemlog1.log - - -PS> Get-ChildItem -Path C:\Test\Logs\* -Exclude A* -Recurse - - Directory: C:\Test\Logs\Adirectory - -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 2/13/2019 13:26 20 LogFile4.txt --a---- 2/12/2019 16:24 23 systemlog1.log - +```Output Directory: C:\Test\Logs Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/15/2019 13:21 Backup - - Directory: C:\Test\Logs\Backup - -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 2/12/2019 15:50 20 LogFile3.txt --a---- 2/12/2019 16:24 23 systemlog1.log - - Directory: C:\Test\Logs - -Mode LastWriteTime Length Name ----- ------------- ------ ---- -a---- 2/13/2019 13:26 20 LogFile1.txt -a---- 2/12/2019 16:24 23 systemlog1.log ``` -The example's output shows the contents of the directory **C:\Test\Logs**. The output is a reference -for the other commands that use the **Exclude** and **Recurse** parameters. - -The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the directory **C:\Test\Logs**. +The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the directory `C:\Test\Logs`. The **Exclude** parameter uses the asterisk (`*`) wildcard to specify any files or directories that begin with **A** or **a** are excluded from the output. @@ -264,19 +244,20 @@ If a trailing asterisk (`*`) is not included in the **Path** parameter, the cont parameter are displayed. The exceptions are file names or subdirectory names that match the **Exclude** parameter's value. -If a trailing asterisk (`*`) is included in the **Path** parameter, the command recurses into the +If a trailing asterisk (`*`) is included in the **Path** parameter, the command **recurses** into the **Path** parameter's subdirectories. The exceptions are file names or subdirectory names that match the **Exclude** parameter's value. If the **Recurse** parameter is added to the command, the recursion output is the same whether or -not the **Path** parameter includes a trailing asterisk (`*`). The **Recurse** parameter does a -recursion of the directory **Adirectory** even though the directory name matches the **Exclude** -parameter's value. The files in **Adirectory** that match the **Exclude** parameter's value are -excluded from the output. +not the **Path** parameter includes a trailing asterisk (`*`). ### Example 6: Get the registry keys from a registry hive This command gets all of the registry keys from the **HKEY_LOCAL_MACHINE\HARDWARE** registry hive. + +`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The +hive's path and top level of registry keys are displayed in the PowerShell console. + For more information, see [about_Registry_Provider](../Microsoft.PowerShell.Core/About/about_Registry_Provider.md). ```powershell @@ -295,22 +276,21 @@ RESOURCEMAP UEFI ``` -`Get-ChildItem` uses the **Path** parameter to specify the registry hive **HKLM:\HARDWARE**. The -hive's path and top level of registry keys are displayed in the PowerShell console. - ### Example 7: Get all certificates with code-signing authority This command gets each certificate in the PowerShell **Cert:** drive that has code-signing -authority. For more information about the Certificate provider and the Cert: drive, -see [about_Certificate_Provider](../Microsoft.PowerShell.Security/About/about_Certificate_Provider.md). +authority. + +The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the **Cert:** provider. The +**Recurse** parameter searches the directory specified by **Path** and its subdirectories. The +**CodeSigningCert** parameter gets only certificates that have code-signing authority. ```powershell Get-ChildItem -Path Cert:\* -Recurse -CodeSigningCert ``` -The `Get-ChildItem` cmdlet uses the **Path** parameter to specify the **Cert:** provider. The -**Recurse** parameter searches the directory specified by **Path** and its subdirectories. The -**CodeSigningCert** parameter gets only certificates that have code-signing authority. +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 @@ -318,9 +298,15 @@ This command displays the items in a directory and its subdirectories. The **Dep determines the number of subdirectory levels to include in the recursion. Empty directories are excluded from the output. -``` +The `Get-ChildItem` cmdlet uses the **Path** parameter to specify **C:\Parent**. The **Depth** +parameter specifies two levels of recursion. `Get-ChildItem` displays the contents of the directory +specified by the **Path** parameter and the two levels of subdirectories. + +```powershell Get-ChildItem -Path C:\Parent -Depth 2 +``` +```Output Directory: C:\Parent Mode LastWriteTime Length Name @@ -343,13 +329,9 @@ d----- 2/14/2019 10:22 SubDir_Level3 -a---- 2/13/2019 08:55 26 file.txt ``` -The `Get-ChildItem` cmdlet uses the **Path** parameter to specify **C:\Parent**. The **Depth** -parameter specifies two levels of recursion. `Get-ChildItem` displays the contents of the directory -specified by the **Path** parameter and the two levels of subdirectories. - ### Example 9: Getting hard link information -In 6.2, an alternate view was added to get hard link information. +In PowerShell 6.2, an alternate view was added to get hard link information. ```powershell Get-ChildItem -Path C:\PathContainingHardLink | Format-Table -View childrenWithHardLink @@ -429,8 +411,9 @@ For example, `Depth 2` includes the **Path** parameter's directory, first level and second level of subdirectories. By default directory names and file names are included in the output. -On a Windows computer from PowerShell or **cmd.exe**, you can display a graphical view of a -directory structure with the **tree.com** command. +> [!NOTE] +> On a Windows computer from PowerShell or **cmd.exe**, you can display a graphical view of a +> directory structure with the **tree.com** command. ```yaml Type: UInt32 @@ -503,12 +486,14 @@ Accept wildcard characters: False ### -Filter -Specifies a filter in the format or language of the provider. The value of this parameter qualifies -the **Path** parameter. +Specifies a filter to qualify the **Path** parameter. -The syntax of the filter, including the use of wildcard characters, depends on the provider. Filters -are more efficient than other parameters, because the provider applies them when the cmdlet gets the -objects. Otherwise, PowerShell filters the objects after they are retrieved. +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: String @@ -605,7 +590,9 @@ Accept wildcard characters: True Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters -as escape sequences. For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -707,7 +694,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](https://go.microsoft.com/fwlink/?LinkID=113216). +-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -727,27 +714,13 @@ If you use the **Name** parameter, `Get-ChildItem` returns the object names as s ## NOTES -You can investigate the file names or directories that `Get-ChildItem` searches when you use the -**Include** or **Exclude** parameters. Use the `ForEach-Object` and `Split-Path` cmdlets as shown in -these examples: - -`PS> Get-ChildItem -Path C:\Test\Logs\* -Include *.txt -Recurse | ForEach-Object {Split-Path $_.FullName -Parent}` - -`PS> Get-ChildItem -Path C:\Test\Logs\* -Include *.txt -Recurse | ForEach-Object {Split-Path $_.FullName -Leaf}` - -`PS> Get-ChildItem -Path C:\Test\Logs -Exclude A* -Recurse | ForEach-Object {Split-Path $_.FullName -Parent}` - -`PS> Get-ChildItem -Path C:\Test\Logs -Exclude A* -Recurse | ForEach-Object {Split-Path $_.FullName -Leaf}` - -You can refer to `Get-ChildItem` by its built-in aliases, `ls`, `dir`, and `gci`. For more -information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). - -`Get-ChildItem` does not get hidden items by default. To get hidden items, use the **Force** -parameter. - -The `Get-ChildItem` 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). +- You can refer to `Get-ChildItem` by its built-in aliases, `ls`, `dir`, and `gci`. For more + information, see [about_Aliases](../Microsoft.PowerShell.Core/About/about_Aliases.md). +- `Get-ChildItem` does not get hidden items by default. To get hidden items, use the **Force** + parameter. +- The `Get-ChildItem` 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). ## RELATED LINKS @@ -771,4 +744,4 @@ For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/a [Get-PSProvider](Get-PSProvider.md) -[Split-Path](Split-Path.md) \ No newline at end of file +[Split-Path](Split-Path.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Content.md b/reference/6/Microsoft.PowerShell.Management/Get-Content.md index e358dc160b15..8c8ee73e2914 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Content.md @@ -1,5 +1,5 @@ --- -ms.date: 4/1/2019 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -7,7 +7,6 @@ online version: http://go.microsoft.com/fwlink/?LinkId=821583 external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml title: Get-Content --- - # Get-Content ## SYNOPSIS @@ -222,6 +221,18 @@ Raw contains 1 lines. Lines contains 100 lines. ``` +### Example 7: Use Filters with Get-Content + +You can specify a filter to the `Get-Content` cmdlet. When using filters to qualify the **Path** +parameter, you need to include a trailing asterisk (`*`) to indicate the contents of the +path. + +The following command gets the content of all `*.log` files in the `C:\Temp` directory. + +```powershell +Get-Content -Path C:\Temp\* -Filter *.log +``` + ## PARAMETERS ### -Path @@ -242,10 +253,12 @@ Accept wildcard characters: True ### -LiteralPath -Specifies the path to an item. Unlike the **Path** parameter, the value of **LiteralPath** is used -exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape -characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to -interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -319,10 +332,17 @@ Accept wildcard characters: False ### -Filter -Specifies a filter in the provider's format or language. The value of this parameter qualifies the -**Path** parameter. The syntax of the filter, including the use of wildcards, depends on the -provider. **Filters** are more efficient than other parameters because the provider applies filters -when objects are retrieved. Otherwise, PowerShell processes filters after the objects are retrieved. +Specifies a filter to qualify the **Path** parameter. When you specify a filter, the **Path** +parameter requires a trailing asterisk (`*`) to indicate the contents of the path. + +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: String @@ -338,9 +358,15 @@ Accept wildcard characters: True ### -Include -Specifies, as a string array, the item that this cmdlet includes in the operation. The value of this -parameter qualifies the **Path** parameter. Enter a path element or pattern, such as `*.txt`. -Wildcards are permitted. +Specifies, as a string array, an item or items that this cmdlet includes in the operation. +The value of this parameter qualifies the **Path** parameter. +Enter a path element or pattern, such as `"*.txt"`. + +Wildcard characters are permitted. + +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -356,9 +382,15 @@ Accept wildcard characters: True ### -Exclude -Specifies, as a string array, the item that this cmdlet omits when performing the operation. The -value of this parameter qualifies the **Path** parameter. Enter a path element or pattern, such as -`*.txt`. Wildcards are permitted. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. +The value of this parameter qualifies the **Path** parameter. + +Enter a path element or pattern, such as `*.txt`. +Wildcard characters are permitted. + +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -391,12 +423,10 @@ Accept wildcard characters: False ### -Credential -Specifies a user account that has permission to perform this action. The default is the current -user. - -Type a user name, such as **User01** or **Domain01\User01**, or enter a **PSCredential** object, -such as one generated by the `Get-Credential` cmdlet. If you type a user name, you will be prompted -for a password. +> [!NOTE] +> This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -573,7 +603,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). +`-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see +[about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -591,7 +622,8 @@ specify as input. ## NOTES The `Get-Content` cmdlet is designed to work with the data exposed by any provider. To get the -providers in your session, use the `Get-PSProvider` cmdlet. For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). +providers in your session, use the `Get-PSProvider` cmdlet. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -607,4 +639,4 @@ providers in your session, use the `Get-PSProvider` cmdlet. For more information [Get-PSProvider](Get-PSProvider.md) -[Set-Content](Set-Content.md) \ No newline at end of file +[Set-Content](Set-Content.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-Item.md b/reference/6/Microsoft.PowerShell.Management/Get-Item.md index 5b216ff7f27a..bca8073370aa 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-Item.md @@ -1,5 +1,5 @@ --- -ms.date: 03/22/2019 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -10,7 +10,6 @@ title: Get-Item # Get-Item ## SYNOPSIS - Gets the item at the specified location. ## SYNTAX @@ -32,7 +31,8 @@ Get-Item -LiteralPath [-Filter ] [-Include ] [-Excl ## DESCRIPTION The `Get-Item` cmdlet gets the item at the specified location. -It does not get the contents of the item at the location unless you use a wildcard character ('*') to request all the contents of the item. +It does not get the contents of the item at the location unless you use a wildcard character ('*') +to request all the contents of the item. This cmdlet is used by PowerShell providers to navigate through different types of data stores. @@ -89,10 +89,11 @@ Get-Item C:\ ### Example 4: Get items in the specified drive This command gets the items in the C: drive. -The wildcard character ('*') represents all the items in the container, not just the container. +The wildcard character (`*`) represents all the items in the container, not just the container. -In PowerShell, use a single asterisk ('*') to get contents, instead of the traditional "*.*". -The format is interpreted literally, so "*.*" would not retrieve directories or file names without a dot. +In PowerShell, use a single asterisk (`*`) to get contents, instead of the traditional `*.*`. +The format is interpreted literally, so `*.*` would not retrieve directories or file names without a +dot. ```powershell Get-Item C:\* @@ -100,7 +101,7 @@ Get-Item C:\* ### Example 5: Get a property in the specified directory -This command gets the **LastAccessTime** property of the "C:\Windows" directory. +This command gets the **LastAccessTime** property of the `C:\Windows` directory. **LastAccessTime** is just one property of file system directories. To see all of the properties of a directory, type `(Get-Item \) | Get-Member`. @@ -111,7 +112,8 @@ To see all of the properties of a directory, type `(Get-Item \) ### Example 6: Show the contents of a registry key This command shows the contents of the **Microsoft.PowerShell** registry key. -You can use this cmdlet with the PowerShell Registry provider to get registry keys and subkeys, but you must use the `Get-ItemProperty` cmdlet to get the registry values and data. +You can use this cmdlet with the PowerShell Registry provider to get registry keys and subkeys, +but you must use the `Get-ItemProperty` cmdlet to get the registry values and data. ```powershell Get-Item HKLM:\Software\Microsoft\Powershell\1\Shellids\Microsoft.Powershell\ @@ -119,16 +121,19 @@ Get-Item HKLM:\Software\Microsoft\Powershell\1\Shellids\Microsoft.Powershell\ ### Example 7: Get items in a directory that have an exclusion -This command gets items in the Windows directory with names that include a dot ('.'), but do not begin with "w*". -This command works only when the path includes a wildcard character ('*') to specify the contents of the item. +This command gets items in the Windows directory with names that include a dot (`.`), but do not +begin with `w*`. + +This command works only when the path includes a wildcard character (`*`) to specify the contents +of the item. ```powershell -Get-Item c:\Windows\*.* -Exclude "w*" +Get-Item C:\Windows\*.* -Exclude "w*" ``` ### Example 8: Getting hardlink information -In 6.2, an alternate view was added to get hardlink information. +In PowerShell 6.2, an alternate view was added to get hardlink information. To get the hardlink information, pipe the output to `Format-Table -View childrenWithHardlink` ```powershell @@ -139,9 +144,11 @@ Get-Item -Path C:\PathWhichIsAHardLink | Format-Table -View childrenWithHardlink ### -Stream -Gets the specified alternate NTFS file stream from the file. Enter the stream name. Wildcards are supported. To get all streams, use an asterisk (*). This parameter is not valid on folders. +Gets the specified alternate NTFS file stream from the file. Enter the stream name. Wildcards are +supported. To get all streams, use an asterisk (`*`). This parameter is not valid on folders. -Stream is a dynamic parameter that the FileSystem provider adds to the `Get-Item` cmdlet. This parameter works only in file system drives. +**Stream** is a dynamic parameter that the **FileSystem** provider adds to the `Get-Item` cmdlet. +This parameter works only in file system drives. ```yaml Type: String[] @@ -157,14 +164,10 @@ Accept wildcard characters: True ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you are prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -182,10 +185,13 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. -The **Exclude** parameter is effective only when the command includes the contents of an item, such as "C:\Windows\*", where the wildcard character specifies the contents of the "C:\Windows" directory. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -201,11 +207,17 @@ Accept wildcard characters: True ### -Filter -Specifies a filter in the format or language of the provider. -The value of this parameter qualifies the **Path** parameter. +Specifies a filter to qualify the **Path** parameter. When you specify a filter, the **Path** +parameter requires a trailing asterisk (`*`) to indicate the contents of the path. + +The [FileSystem](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md) provider is the +only installed PowerShell provider that supports the use of filters. -The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +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: String @@ -242,10 +254,13 @@ Accept wildcard characters: False Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. -The **Include** parameter is effective only when the command includes the contents of an item, such as "C:\Windows\*", where the wildcard character specifies the contents of the "C:\Windows" directory. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. ```yaml Type: String[] @@ -261,11 +276,12 @@ Accept wildcard characters: True ### -LiteralPath -Specifies a path to the item. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -284,10 +300,10 @@ Accept wildcard characters: False Specifies the path to an item. This cmdlet gets the item at the specified location. Wildcards are permitted. -This parameter is required, but the parameter name ("Path") is optional. +This parameter is required, but the parameter name **Path** is optional. -Use a dot ('.') to specify the current location. -Use the wildcard character ('*') to specify all the items in the current location. +Use a dot (`.`) to specify the current location. +Use the wildcard character (`*`) to specify all the items in the current location. ```yaml Type: String[] @@ -303,7 +319,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -320,15 +339,12 @@ The type is determined by the type of objects in the path. ## NOTES -This cmdlet does not have a **Recurse** parameter, because it gets only an item, not its contents. -To get the contents of an item recursively, use `Get-ChildItem`. - -To navigate through the registry, use this cmdlet to get registry keys and the `Get-ItemProperty` to get registry values and data. -The registry values are considered to be properties of the registry key. - -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). +- To navigate through the registry, use this cmdlet to get registry keys and the `Get-ItemProperty` to + get registry values and data. The registry values are considered to be properties of the registry + key. +- 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). ## RELATED LINKS @@ -354,4 +370,4 @@ For more information, see [about_Providers](../Microsoft.PowerShell.Core/About/a [Get-PSProvider](Get-PSProvider.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-ItemProperty.md b/reference/6/Microsoft.PowerShell.Management/Get-ItemProperty.md index 34979720621f..c379e1634504 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-ItemProperty.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-ItemProperty.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -31,14 +31,14 @@ Get-ItemProperty -LiteralPath [[-Name] ] [-Filter ] ## DESCRIPTION The `Get-ItemProperty` cmdlet gets the properties of the specified items. -For example, you can use this cmdlet to get the value of the LastAccessTime property of a file object. -You can also use this cmdlet to view registry entries and their values. +For example, you can use this cmdlet to get the value of the LastAccessTime property of a file +object. You can also use this cmdlet to view registry entries and their values. ## EXAMPLES ### Example 1: Get information about a specific directory -This command gets information about the "C:\Windows" directory. +This command gets information about the `C:\Windows` directory. ```powershell Get-ItemProperty C:\Windows @@ -46,7 +46,7 @@ Get-ItemProperty C:\Windows ### Example 2: Get the properties of a specific file -This command gets the properties of the "C:\Test\Weather.xls" file. +This command gets the properties of the `C:\Test\Weather.xls` file. The result is piped to the `Format-List` cmdlet to display the output as a list. ```powershell @@ -55,23 +55,29 @@ Get-ItemProperty C:\Test\Weather.xls | Format-List ### Example 3: Display the value name and data of registry entries in a registry subkey -This command displays the value name and data of each of the registry entries contained in the "CurrentVersion" registry subkey. -Note that the command requires that there is a PowerShell drive named `HKLM:` that is mapped to the "HKEY_LOCAL_MACHINE" hive of the registry. -A drive with that name and mapping is available in PowerShell by default. -Alternatively, the path to this registry subkey can be specified by using the following alternative path that begins with the provider name followed by two colons: - -"Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion". +This command displays the value name and data of each of the registry entries contained in the +"CurrentVersion" registry subkey. ```powershell Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion ``` -### Example 4: Get the value name and data of a registry entry in a registry subkey +> [!NOTE] +> This command requires that there is a PowerShell drive named `HKLM:` that is mapped to the +> "HKEY_LOCAL_MACHINE" hive of the registry. +> +> A drive with that name and mapping is available in PowerShell by default. +> Alternatively, the path to this registry subkey can be specified by using the following alternative +> path that begins with the provider name followed by two colons: +> +> `Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion`. -This command gets the value name and data of the "ProgramFilesDir" registry entry in the "CurrentVersion" registry subkey. -The command uses the **Path** parameter to specify the subkey and the Name parameter to specify the value name of the entry. +### Example 4: Get the value name and data of a registry entry in a registry subkey -The command uses a back tick or grave accent (\`), the PowerShell continuation character, to continue the command on the second line. +This command gets the value name and data of the "ProgramFilesDir" registry entry in the +"CurrentVersion" registry subkey. +The **Path** specifies the subkey and the **Name** parameter specifies the +value name of the entry. ```powershell Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion -Name "ProgramFilesDir" @@ -79,8 +85,8 @@ Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion -Name "Pr ### Example 5: Get the value names and data of registry entries in a registry key -This command gets the value names and data of the registry entries in the "PowerShellEngine" registry key. -The results are shown in the following sample output. +This command gets the value names and data of the registry entries in the "PowerShellEngine" +registry key. The results are shown in the following sample output. ```powershell Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine @@ -95,62 +101,14 @@ CTPVersion : 5 PSCompatibleVersion : 1.0,2.0 ``` -### Example 6: Get, format, and display the results of registry values and data - -This example shows how to format the output of a `Get-ItemProperty` command in a list to make it easy to see the registry values and data and to make it easy to interpret the results. - -The first command uses the `Get-ItemProperty` cmdlet to get the registry entries in the **Microsoft.PowerShell** subkey. -This subkey stores options for the default shell for PowerShell. -The results are shown in the following sample output. - -The output shows that there are two registry entries, "Path" and "ExecutionPolicy". -When a registry key contains fewer than five entries, by default it is displayed in a table, but it is often easier to view in a list. - -The second command uses the same `Get-ItemProperty` command. -However, this time, the command uses a pipeline operator (`|`) to send the results of the command to the `Format-List` cmdlet. -The `Format-List` command uses the Property parameter with a value of '*' (all) to display all of the properties of the objects in a list. -The results are shown in the following sample output. - -The resulting display shows the "Path" and "ExecutionPolicy" registry entries, along with several less familiar properties of the registry key object. -The other properties, prefixed with PS, are properties of PowerShell custom objects, such as the objects that represent the registry keys. - -```powershell -Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell -``` - -```output -Path ExecutionPolicy ----- --------------- -C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe RemoteSigned -``` - -```powershell -Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell | Format-List -Property * -``` - -```output -PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\ShellIds\Micro -soft.PowerShell -PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\PowerShell\1\ShellIds -PSChildName : Microsoft.PowerShell -PSDrive : HKLM -PSProvider : Microsoft.PowerShell.Core\Registry -Path : C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy : RemoteSigned -``` - ## PARAMETERS ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you are prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -166,11 +124,16 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, an item or items that this cmdlet excludes from the operation. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -189,7 +152,8 @@ Specifies a filter in the format or language of the provider. The value of this parameter qualifies the **Path** parameter. The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +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: String @@ -207,9 +171,14 @@ Accept wildcard characters: True Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -224,11 +193,12 @@ Accept wildcard characters: False ### -LiteralPath -Specifies the path to the current location of the property. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -276,7 +246,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -288,13 +261,14 @@ You can pipe a string that contains a path to `Get-ItemProperty`. ### System.Boolean, System.String, System.DateTime -`Get-ItemProperty` returns an object for each item property that it gets. -The object type depends on the object that is retrieved. -For example, in a file system drive, it might return a file or folder. +`Get-ItemProperty` returns an object for each item property that it gets. The object type depends on +the object that is retrieved. For example, in a file system drive, it might return a file or folder. ## NOTES -The `Get-ItemProperty` 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. +The `Get-ItemProperty` 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). ## RELATED LINKS @@ -312,4 +286,4 @@ The `Get-ItemProperty` cmdlet is designed to work with the data exposed by any p [Set-ItemProperty](Set-ItemProperty.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md b/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md index ce1ba03c51e9..b837921e27e2 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-ItemPropertyValue.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -30,13 +30,16 @@ Get-ItemPropertyValue -LiteralPath [-Name] [-Filter [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -117,11 +118,16 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, an item or items that this cmdlet excludes from the operation. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -140,7 +146,8 @@ Specifies a filter in the format or language of the provider. The value of this parameter qualifies the **Path** parameter. The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +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: String @@ -158,9 +165,14 @@ Accept wildcard characters: True Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -175,11 +187,12 @@ Accept wildcard characters: True ### -LiteralPath -Specifies the path to the current location of the property. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -227,7 +240,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -245,7 +261,9 @@ For example, in a file system drive, the cmdlet might return a file or folder. ## NOTES -This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, run the `Get-PSProvider` cmdlet. For more information, see about_Providers. +This cmdlet is designed to work with the data exposed by any provider. To list the providers +available in your session, run the `Get-PSProvider` cmdlet. For more information, see +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md). ## RELATED LINKS @@ -267,4 +285,4 @@ This cmdlet is designed to work with the data exposed by any provider. To list t [Set-ItemProperty](Set-ItemProperty.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md b/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md index 83b22eff3dc9..a911503bc80c 100644 --- a/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md +++ b/reference/6/Microsoft.PowerShell.Management/Get-PSDrive.md @@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml keywords: powershell,cmdlet locale: en-us Module Name: Microsoft.PowerShell.Management -ms.date: 06/09/2017 +ms.date: 5/14/2019 online version: http://go.microsoft.com/fwlink/?linkid=821591 schema: 2.0.0 title: Get-PSDrive @@ -258,7 +258,7 @@ Accept wildcard characters: False ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -283,6 +283,6 @@ This cmdlet returns objects that represent the drives in the session. [Remove-PSDrive](Remove-PSDrive.md) -[Get-WmiObject](https://msdn.microsoft.com/en-us/powershell/reference/5.1/Microsoft.PowerShell.Management/Get-WmiObject) +[Get-WmiObject](../../5.1/Microsoft.PowerShell.Management/Get-WmiObject.md) [Get-PSProvider](Get-PSProvider.md) \ No newline at end of file diff --git a/reference/6/Microsoft.PowerShell.Management/Invoke-Item.md b/reference/6/Microsoft.PowerShell.Management/Invoke-Item.md index 67a1e1e68f41..6ba14357b5d1 100644 --- a/reference/6/Microsoft.PowerShell.Management/Invoke-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Invoke-Item.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -31,8 +31,10 @@ Invoke-Item -LiteralPath [-Filter ] [-Include ] [-E ## DESCRIPTION The `Invoke-Item` cmdlet performs the default action on the specified item. -For example, it runs an executable file or opens a document file in the application associated with the document file type. -The default action depends on the type of item and is determined by the PowerShell provider that provides access to the data. +For example, it runs an executable file or opens a document file in the application associated with +the document file type. +The default action depends on the type of item and is determined by the PowerShell provider that +provides access to the data. ## EXAMPLES @@ -47,9 +49,9 @@ Invoke-Item "C:\Test\aliasApr04.doc" ### Example 2: Open all files of a specific type -This command opens all of the Microsoft Office Excel spreadsheets in the "C:\Documents and Settings\Lister\My Documents" folder. -Each spreadsheet is opened in a new instance of Excel. -In this case, opening in Excel is the default action for ".xls" files. +This command opens all of the Microsoft Office Excel spreadsheets in the `C:\Documents and +Settings\Lister\My Documents` folder. Each spreadsheet is opened in a new instance of Excel. +In this case, opening in Excel is the default action for `.xls` files. ```powershell Invoke-Item "C:\Documents and Settings\Lister\My Documents\*.xls" @@ -59,14 +61,10 @@ Invoke-Item "C:\Documents and Settings\Lister\My Documents\*.xls" ### -Credential -Specifies a user account that has permission to perform this action. -The default is the current user. - -Type a user name, such as "User01" or "Domain01\User01", or enter a **PSCredential** object, such as one generated by the `Get-Credential` cmdlet. -If you type a user name, you are prompted for a password. - -> [!WARNING] +> [!NOTE] > This parameter is not supported by any providers installed with Windows PowerShell. +> To impersonate another user, or elevate your credentials when running this cmdlet, +> use [Invoke-Command](../Microsoft.PowerShell.Core/Invoke-Command.md) ```yaml Type: PSCredential @@ -82,11 +80,16 @@ Accept wildcard characters: False ### -Exclude -Specifies, as a string array, an item or items that this cmdlet excludes from the operation. +Specifies, as a string array, an item or items that this cmdlet excludes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". + +Enter a path element or pattern, such as `*.txt`. Wildcard characters are permitted. +The **Exclude** parameter is effective only when the command includes the contents of an item, +such as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -105,7 +108,8 @@ Specifies a filter in the format or language of the provider. The value of this parameter qualifies the **Path** parameter. The syntax of the filter, including the use of wildcard characters, depends on the provider. -Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved. +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: String @@ -123,9 +127,14 @@ Accept wildcard characters: True Specifies, as a string array, an item or items that this cmdlet includes in the operation. The value of this parameter qualifies the **Path** parameter. -Enter a path element or pattern, such as "*.txt". +Enter a path element or pattern, such as `"*.txt"`. + Wildcard characters are permitted. +The **Include** parameter is effective only when the command includes the contents of an item, such +as `C:\Windows\*`, where the wildcard character specifies the contents of the `C:\Windows` +directory. + ```yaml Type: String[] Parameter Sets: (All) @@ -140,11 +149,12 @@ Accept wildcard characters: False ### -LiteralPath -Specifies a path to the item. -Unlike the **Path** parameter, the value of **LiteralPath** is used exactly as it is typed. -No characters are interpreted as wildcards. -If the path includes escape characters, enclose it in single quotation marks. -Single quotation marks tell PowerShell not to interpret any characters as escape sequences. +Specifies a path to one or more locations. The value of **LiteralPath** is used exactly as it is +typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose +it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters +as escape sequences. + +For more information, see [about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). ```yaml Type: String[] @@ -209,7 +219,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](../Microsoft.PowerShell.Core/About/about_CommonParameters.md). ## INPUTS @@ -226,7 +239,8 @@ However, output might be generated by the item that it invokes. ## NOTES -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. +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). ## RELATED LINKS @@ -246,4 +260,4 @@ This cmdlet is designed to work with the data exposed by any provider. To list t [Set-Item](Set-Item.md) -[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) \ No newline at end of file +[about_Providers](../Microsoft.PowerShell.Core/About/about_Providers.md) diff --git a/reference/6/Microsoft.PowerShell.Management/Move-Item.md b/reference/6/Microsoft.PowerShell.Management/Move-Item.md index f500a4d9f31a..f2f5bae75a78 100644 --- a/reference/6/Microsoft.PowerShell.Management/Move-Item.md +++ b/reference/6/Microsoft.PowerShell.Management/Move-Item.md @@ -1,5 +1,5 @@ --- -ms.date: 10/18/2018 +ms.date: 5/14/2019 schema: 2.0.0 locale: en-us keywords: powershell,cmdlet @@ -30,16 +30,18 @@ Move-Item -LiteralPath [[-Destination] ] [-Force] [-Filter