Running the following VBA code opens PowerShell v1, and computes size remaining on DriveLetter C.
Sub RunPowershell()
Set wShell = CreateObject("WScript.Shell")
Set wShellResult = wShell.Exec("powershell (Get-Volume -DriveLetter C).SizeRemaining")
' Change to StdErr.ReadAll to read an error response
MsgBox wShellResult.StdOut.ReadAll
End Sub
Is there a way to make VBA open PowerShell 7.3.6.0 when it's called in VBA?
Thanks in advance
I tried specifying the version number in the vba code