powershell-4.0

Powershell New-WebServiceProxy - how to call WCF service

丶灬走出姿态 提交于 2021-01-29 07:04:47
问题 I'm trying to call a WCF service from PowerShell. This is what I have so far based on a few misc example I found on the web: # Create the WebSvcURL variable and pass the WSDL URL $WebSvcURL= “http://localhost/DEMO/SetPassKey/SetPassKey_Logic_SetPassKeyWebService_SetPassKeyWCF.svc?wsdl“ #Create the Web Service Proxy Object #$serviceProxy = New-WebServiceProxy -Uri $WebSvcURL -Namespace "http://Sample.SetPassKey.Logic" -Class Program -UseDefaultCredential $serviceProxy = New-WebServiceProxy

Create CSV file in each subdirectory of target directory

孤街醉人 提交于 2021-01-27 15:08:36
问题 I have folder with files as below: D:\TESzz\Background\BG_Flash-Zootopia-HD-Desktop-Wallpapers.jpg D:\TESzz\Background\BG_NimmHBD.jpg D:\TESzz\Background\BG_Note5.jpg D:\TESzz\Icons\150x150.jpg D:\TESzz\Icons\Bathroom-gender-sign.png D:\TESzz\Icons\brocoli.png D:\TESzz\Icons\Carrot_Clipart_PNG_Image.png D:\TESzz\Icons\File.txt D:\TESzz\Icons\garlic.png D:\TESzz\Icons\ICONS.txt D:\TESzz\Icons\NoppNimm-1.jpg D:\TESzz\Icons\NoppNimmIcon.jpg D:\TESzz\Icons\NoppNimmIcon.png D:\TESzz\Icons

Refreshing Excel Sheets using powershell

不问归期 提交于 2021-01-27 15:01:29
问题 I have 10 excel different excel sheet in one folder named test. I want to refresh the data connection and data in the pivot table using windows power shell script. The process is using for each loop open each file and then in the file choose powerpivot menu refresh all data there which will refresh the OLEDB and OLAP query and then close that page and go to the data tab and click on the refresh all button and after refreshing work book in each excel sheets there are 5 sheets in 4 out of 5

Refreshing Excel Sheets using powershell

旧巷老猫 提交于 2021-01-27 14:39:46
问题 I have 10 excel different excel sheet in one folder named test. I want to refresh the data connection and data in the pivot table using windows power shell script. The process is using for each loop open each file and then in the file choose powerpivot menu refresh all data there which will refresh the OLEDB and OLAP query and then close that page and go to the data tab and click on the refresh all button and after refreshing work book in each excel sheets there are 5 sheets in 4 out of 5

Error with PowerShell command for copying file to remote server with credential

吃可爱长大的小学妹 提交于 2021-01-27 11:25:03
问题 PS C:\Windows\system32> Copy-Item -ToSession $s C:\Programs\temp\test.txt -Destination C:\Programs\temp\test.txt Copy-Item : A parameter cannot be found that matches parameter name 'ToSession'. At line:1 char:11 Copy-Item -ToSession $s C:\Programs\temp\test.txt -Destination C:\Programs\temp\ ... ~~~~~~~~~~ CategoryInfo : InvalidArgument: (:) [Copy-Item], ParameterBindingException FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.CopyItemCommand 回答1: As it is noted

Error with PowerShell command for copying file to remote server with credential

此生再无相见时 提交于 2021-01-27 11:24:22
问题 PS C:\Windows\system32> Copy-Item -ToSession $s C:\Programs\temp\test.txt -Destination C:\Programs\temp\test.txt Copy-Item : A parameter cannot be found that matches parameter name 'ToSession'. At line:1 char:11 Copy-Item -ToSession $s C:\Programs\temp\test.txt -Destination C:\Programs\temp\ ... ~~~~~~~~~~ CategoryInfo : InvalidArgument: (:) [Copy-Item], ParameterBindingException FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.CopyItemCommand 回答1: As it is noted

Save Image from clipboard using PowerShell

你说的曾经没有我的故事 提交于 2020-12-11 12:58:17
问题 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