From 797cc902abc48709b030744e585dbe72cb1b5e51 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Fri, 9 Aug 2019 22:48:08 -0700 Subject: [PATCH 1/6] Add back content for clipboard cmdlets --- .../Get-Clipboard.md | 148 +++++++++++++ .../Set-Clipboard.md | 203 ++++++++++++++++++ 2 files changed, 351 insertions(+) create mode 100644 reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md create mode 100644 reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md diff --git a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md new file mode 100644 index 000000000000..d630747a1bdc --- /dev/null +++ b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md @@ -0,0 +1,148 @@ +--- +external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml +keywords: powershell,cmdlet +locale: en-us +Module Name: Microsoft.PowerShell.Management +ms.date: 08/09/2019 +online version: https://go.microsoft.com/fwlink/?linkid=526219 +schema: 2.0.0 +title: Get-Clipboard +--- +# Get-Clipboard + +## SYNOPSIS +Gets the contents of the clipboard. + +## SYNTAX + +``` +Get-Clipboard [-Format ] [-TextFormatType ] [-Raw] [] +``` + +## DESCRIPTION + +The `Get-Clipboard` cmdlet gets the contents of the clipboard. + +## EXAMPLES + +### Example 1: Get the content of the clipboard and display it to the command-line + +In this example we have copied the text "hello" into the clipboard. + +```powershell +Get-Clipboard +``` + +```Output +hello +``` + +### Example 2: Get the content of the clipboard in a specific format + +In this example we copied files to the clipboard in Windows Explorer by selecting them and pressing +Ctrl-C. Using the following command, you can access the contents of the clipboard as a +list of files: + +```powershell +Get-Clipboard -Format FileDropList +``` + +```Output + Directory: C:\Git\PS-Docs\PowerShell-Docs\wmf + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 5/7/2019 1:11 PM 10010 TOC.yml +-a---- 11/18/2016 10:10 AM 53 md.style +-a---- 5/6/2019 9:32 AM 4177 overview.md +-a---- 6/28/2018 2:28 PM 345 README.md +``` + +>[!NOTE] This example is only supported on Windows + +## PARAMETERS + +### -Format + +Specifies the type, or format, of the clipboard. The acceptable values for this parameter +on Windows are: + +- Text +- FileDropList +- Image +- Audio + +>[!NOTE] On Linux and macOS, only the 'Text' format is supported. + +```yaml +Type: ClipboardFormat +Parameter Sets: (All) +Aliases: +Accepted values: Text, FileDropList, Image, Audio + +Required: False +Position: Named +Default value: Text +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Raw + +Indicates that this cmdlet ignores newline characters and gets the entire contents of the clipboard. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TextFormatType + +Specifies the text data format type of the clipboard. The acceptable values for this parameter +on Windows are: + +- Text +- UnicodeText +- Rtf +- Html +- CommaSeparatedValue + +>[!NOTE] On Linux and macOS, only the 'UnicodeText' format type is supported. + +```yaml +Type: TextDataFormat +Parameter Sets: (All) +Aliases: +Accepted values: Text, UnicodeText, Rtf, Html, CommaSeparatedValue + +Required: False +Position: Named +Default value: UnicodeText +Accept pipeline input: False +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### System.String, System.IO.FileInfo, System.IO.Stream, System.Drawing.Image + +## NOTES + +## RELATED LINKS + +[Set-Clipboard](Set-Clipboard.md) diff --git a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md new file mode 100644 index 000000000000..296ff0e3ec44 --- /dev/null +++ b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -0,0 +1,203 @@ +--- +external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml +keywords: powershell,cmdlet +locale: en-us +Module Name: Microsoft.PowerShell.Management +ms.date: 08/09/2019 +online version: https://go.microsoft.com/fwlink/?linkid=526220 +schema: 2.0.0 +title: Set-Clipboard +--- +# Set-Clipboard + +## SYNOPSIS +Sets the contents of the clipboard. + +## SYNTAX + +### String (Default) + +``` +Set-Clipboard [-Append] [-AsHtml] [-WhatIf] [-Confirm] [] +``` + +### Value + +``` +Set-Clipboard [-Value] [-Append] [-AsHtml] [-WhatIf] [-Confirm] [] +``` + +### Path + +``` +Set-Clipboard [-Append] -Path [-AsHtml] [-WhatIf] [-Confirm] [] +``` + +### LiteralPath + +``` +Set-Clipboard [-Append] -LiteralPath [-AsHtml] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION + +The `Set-Clipboard` cmdlet sets the contents of the clipboard. + +## EXAMPLES + +### Example 1: Copy text to the clipboard + +```powershell +Set-Clipboard -Value "This is a test string" +``` + +### Example 2: Copy the contents of a directory to the clipboard + +This command copies the content of the specified folder to the clipboard. + +```powershell +Set-Clipboard -Path "C:\Staging\" +``` + +>[!NOTE] Types other than text are only supported on Windows. + +## PARAMETERS + +### -Append + +Indicates that the cmdlet does not clear the clipboard and appends content to it. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsHtml + +Indicates that the cmdlet renders the content as HTML to the clipboard. + +>[!NOTE] This switch is only supported on Windows. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LiteralPath + +Specifies the path to the item that is copied to the clipboard. 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 +Windows PowerShell not to interpret any characters as escape sequences. + +>[!NOTE] This switch is only supported on Windows. + +```yaml +Type: String[] +Parameter Sets: LiteralPath +Aliases: PSPath + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Path + +Specifies the path to the item that is copied to the clipboard. Wildcard characters are permitted. + +>[!NOTE] This switch is only supported on Windows. + +```yaml +Type: String[] +Parameter Sets: Path +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -Value + +Specifies, as a string array, the content to copy to the clipboard. + +```yaml +Type: String[] +Parameter Sets: Value +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Confirm + +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf + +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +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](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Get-Clipboard](Get-Clipboard.md) From 14cc7172606e35d84be7636a6518514bf28176a8 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 12 Aug 2019 07:19:59 -0700 Subject: [PATCH 2/6] Fixed note --- reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md index d630747a1bdc..489d384bbca3 100644 --- a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md +++ b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md @@ -58,7 +58,8 @@ Mode LastWriteTime Length Name -a---- 6/28/2018 2:28 PM 345 README.md ``` ->[!NOTE] This example is only supported on Windows +> [!NOTE] +> This example is only supported on Windows. ## PARAMETERS From e36ae4edf77402a84c1c2c2847af0c300a39603b Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 12 Aug 2019 07:20:33 -0700 Subject: [PATCH 3/6] Fixed note --- reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md index 296ff0e3ec44..35a39283b5c4 100644 --- a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -59,7 +59,8 @@ This command copies the content of the specified folder to the clipboard. Set-Clipboard -Path "C:\Staging\" ``` ->[!NOTE] Types other than text are only supported on Windows. +> [!NOTE] +> Types other than text are only supported on Windows. ## PARAMETERS From 8e1b1d1fac0975730bd24a5a47d84628c815813a Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 12 Aug 2019 07:31:45 -0700 Subject: [PATCH 4/6] Update Get-Clipboard.md --- .../7/Microsoft.PowerShell.Management/Get-Clipboard.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md index 489d384bbca3..b9c2150dcdc7 100644 --- a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md +++ b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md @@ -73,7 +73,8 @@ on Windows are: - Image - Audio ->[!NOTE] On Linux and macOS, only the 'Text' format is supported. +> [!NOTE] +> On Linux and macOS, only the 'Text' format is supported. ```yaml Type: ClipboardFormat @@ -115,7 +116,8 @@ on Windows are: - Html - CommaSeparatedValue ->[!NOTE] On Linux and macOS, only the 'UnicodeText' format type is supported. +> [!NOTE] +> On Linux and macOS, only the 'UnicodeText' format type is supported. ```yaml Type: TextDataFormat From d170def54c9db48e99f81096db0e65f309092c61 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 12 Aug 2019 07:32:37 -0700 Subject: [PATCH 5/6] Update Set-Clipboard.md --- .../7/Microsoft.PowerShell.Management/Set-Clipboard.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md index 35a39283b5c4..59f02a40c61a 100644 --- a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -84,7 +84,8 @@ Accept wildcard characters: False Indicates that the cmdlet renders the content as HTML to the clipboard. ->[!NOTE] This switch is only supported on Windows. +> [!NOTE] +> This switch is only supported on Windows. ```yaml Type: SwitchParameter @@ -105,7 +106,8 @@ Specifies the path to the item that is copied to the clipboard. Unlike **Path**, path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. ->[!NOTE] This switch is only supported on Windows. +> [!NOTE] +> This switch is only supported on Windows. ```yaml Type: String[] @@ -123,7 +125,8 @@ Accept wildcard characters: False Specifies the path to the item that is copied to the clipboard. Wildcard characters are permitted. ->[!NOTE] This switch is only supported on Windows. +> [!NOTE] +> This switch is only supported on Windows. ```yaml Type: String[] From b26bff16800b533476953a11339c64933614c299 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 4 Nov 2019 13:08:49 -0800 Subject: [PATCH 6/6] updated to match code --- .../Get-Clipboard.md | 86 +------------- .../Set-Clipboard.md | 112 +----------------- 2 files changed, 10 insertions(+), 188 deletions(-) diff --git a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md index b9c2150dcdc7..3b05de53ae7f 100644 --- a/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md +++ b/reference/7/Microsoft.PowerShell.Management/Get-Clipboard.md @@ -13,15 +13,18 @@ title: Get-Clipboard ## SYNOPSIS Gets the contents of the clipboard. +[!NOTE] +> On Linux, this cmdlet requires the `xclip` utility to be in the path. + ## SYNTAX ``` -Get-Clipboard [-Format ] [-TextFormatType ] [-Raw] [] +Get-Clipboard [-Raw] [] ``` ## DESCRIPTION -The `Get-Clipboard` cmdlet gets the contents of the clipboard. +The `Get-Clipboard` cmdlet gets the contents of the clipboard as text. ## EXAMPLES @@ -37,58 +40,8 @@ Get-Clipboard hello ``` -### Example 2: Get the content of the clipboard in a specific format - -In this example we copied files to the clipboard in Windows Explorer by selecting them and pressing -Ctrl-C. Using the following command, you can access the contents of the clipboard as a -list of files: - -```powershell -Get-Clipboard -Format FileDropList -``` - -```Output - Directory: C:\Git\PS-Docs\PowerShell-Docs\wmf - -Mode LastWriteTime Length Name ----- ------------- ------ ---- --a---- 5/7/2019 1:11 PM 10010 TOC.yml --a---- 11/18/2016 10:10 AM 53 md.style --a---- 5/6/2019 9:32 AM 4177 overview.md --a---- 6/28/2018 2:28 PM 345 README.md -``` - -> [!NOTE] -> This example is only supported on Windows. - ## PARAMETERS -### -Format - -Specifies the type, or format, of the clipboard. The acceptable values for this parameter -on Windows are: - -- Text -- FileDropList -- Image -- Audio - -> [!NOTE] -> On Linux and macOS, only the 'Text' format is supported. - -```yaml -Type: ClipboardFormat -Parameter Sets: (All) -Aliases: -Accepted values: Text, FileDropList, Image, Audio - -Required: False -Position: Named -Default value: Text -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -Raw Indicates that this cmdlet ignores newline characters and gets the entire contents of the clipboard. @@ -105,33 +58,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -TextFormatType - -Specifies the text data format type of the clipboard. The acceptable values for this parameter -on Windows are: - -- Text -- UnicodeText -- Rtf -- Html -- CommaSeparatedValue - -> [!NOTE] -> On Linux and macOS, only the 'UnicodeText' format type is supported. - -```yaml -Type: TextDataFormat -Parameter Sets: (All) -Aliases: -Accepted values: Text, UnicodeText, Rtf, Html, CommaSeparatedValue - -Required: False -Position: Named -Default value: UnicodeText -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, @@ -142,7 +68,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## OUTPUTS -### System.String, System.IO.FileInfo, System.IO.Stream, System.Drawing.Image +### System.String ## NOTES diff --git a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md index 59f02a40c61a..785dfa18ce3c 100644 --- a/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md +++ b/reference/7/Microsoft.PowerShell.Management/Set-Clipboard.md @@ -15,34 +15,17 @@ Sets the contents of the clipboard. ## SYNTAX -### String (Default) - -``` -Set-Clipboard [-Append] [-AsHtml] [-WhatIf] [-Confirm] [] -``` - -### Value - -``` -Set-Clipboard [-Value] [-Append] [-AsHtml] [-WhatIf] [-Confirm] [] -``` - -### Path - -``` -Set-Clipboard [-Append] -Path [-AsHtml] [-WhatIf] [-Confirm] [] -``` - -### LiteralPath - ``` -Set-Clipboard [-Append] -LiteralPath [-AsHtml] [-WhatIf] [-Confirm] [] +Set-Clipboard [-Value] [-Append] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION The `Set-Clipboard` cmdlet sets the contents of the clipboard. +[!NOTE] +> On Linux, this cmdlet requires the `xclip` utility to be in the path. + ## EXAMPLES ### Example 1: Copy text to the clipboard @@ -51,17 +34,6 @@ The `Set-Clipboard` cmdlet sets the contents of the clipboard. Set-Clipboard -Value "This is a test string" ``` -### Example 2: Copy the contents of a directory to the clipboard - -This command copies the content of the specified folder to the clipboard. - -```powershell -Set-Clipboard -Path "C:\Staging\" -``` - -> [!NOTE] -> Types other than text are only supported on Windows. - ## PARAMETERS ### -Append @@ -80,82 +52,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -AsHtml - -Indicates that the cmdlet renders the content as HTML to the clipboard. - -> [!NOTE] -> This switch is only supported on Windows. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -LiteralPath - -Specifies the path to the item that is copied to the clipboard. 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 -Windows PowerShell not to interpret any characters as escape sequences. - -> [!NOTE] -> This switch is only supported on Windows. - -```yaml -Type: String[] -Parameter Sets: LiteralPath -Aliases: PSPath - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Path - -Specifies the path to the item that is copied to the clipboard. Wildcard characters are permitted. - -> [!NOTE] -> This switch is only supported on Windows. - -```yaml -Type: String[] -Parameter Sets: Path -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: True -``` - -### -Value - -Specifies, as a string array, the content to copy to the clipboard. - -```yaml -Type: String[] -Parameter Sets: Value -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - ### -Confirm Prompts you for confirmation before running the cmdlet.