Blowfelt82
asked on
Invoke-Expression Powershell
I am using Powershell v2.0 and am trying to run a DOS command via a PS console as follows. I have tried every type of escape sequence I know of but I cannot get this command to run? I have tried running the command directly without the invoke-expression command but this does not work either? Does anyone know how I can run a command like the one below in Powershell?
Invoke-Expression "C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin\Lib -machine:IX86 -def:C:\OT\CAPABILITY\CAP. DEF -out:C:\OT\CAPABILITY\CAP. LIB"
Invoke-Expression "C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin\Lib -machine:IX86 -def:C:\OT\CAPABILITY\CAP.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
$prog = " 'C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin\Lib.exe' "
$cmd = "$prog /MACHINE:IX86 /def:C:\OT\CAPABILITY\CAP.
Invoke-expression $cmd