Вы можете использовать что-то вроде следующего. Он читает раздел реестра для PowerShell. Если чтение прошло успешно (код возврата 0) или нет, вы получите соответствующее окно сообщения, которое вы можете отключить для другой логики, которую вам нужно выполнить, например, установить PowerShell, если он не обнаружен. Для получения дополнительной информации см. Ссылки на источники ниже.
Option Explicit
Dim oShell
Dim value
'If the key isn't there when we try to read it, an error will be generated
'that we will later test for, so we want to automatically resume execution.
On Error Resume Next
'#Try reading the registry value
Set oShell = CreateObject("WScript.Shell")
value = oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\")
'Catch the error
If Err.Number = 0 Then
'Error code 0 indicates success
MsgBox(Err.Number & "PowerShell is installed.")
Else
'Any other error code indicates failure
MsgBox(Err.Number & "PowerShell is NOT installed.")
End If
VBScript для проверки реестра приложения (например, .NET): https://stackoverflow.com/questions/4394607/vbscript-to-check-if-net-2-0-is-installed
Ключи реестра для проверки PowerShell: http://blogs.msdn.com/b/powershell/archive/2009/06/25/detection-logic-poweshell-installation.aspx