Quantcast
Channel: Backup – Windows and Windows Server forum
Viewing all articles
Browse latest Browse all 3323

Invoke remote diskpart with pipe results in 'C:\windows\system32\diskpart.exe}' is not recognized as an internal or external command,

$
0
0

Hi,

 I am trying to invoke commands from powershell, especially the diskpart and do some operations. I am trying to use this:

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Invoke-Command -ComputerName "machinename" -ScriptBlock {"select disk 2", "online disk" | diskpart}

but keep getting this:

'diskpart.exe}' is not recognized as an internal or external command...

I also tried with full path to diskpart but I get this:

'C:\windows\system32\diskpart.exe}' is not recognized as an internal or external command...

can you help me with that? I would use powershell directly but the system is Server 2008 R2 where storage modules are not present..

execution policy is set to unrestricted

Thank you.

Pete


sfs


Viewing all articles
Browse latest Browse all 3323

Trending Articles