Save Image from clipboard using PowerShell
问题 I am trying to save image from clipboard to the file path. I have tried below script and it is returning "clipboard does not contain image data". Add-Type -AssemblyName System.Windows.Forms if ($([System.Windows.Forms.Clipboard]::ContainsImage())) { $image = [System.Windows.Forms.Clipboard]::GetImage() $filename='e:\test\test.png' [System.Drawing.Bitmap]$image.Save($filename, [System.Drawing.Imaging.ImageFormat]::Png) Write-Output "clipboard content saved as $filename" } else { Write-Output