'-Begin-----------------------------------------------------------------
'-Directives----------------------------------------------------------
Option Explicit
'-Constants-----------------------------------------------------------
Const OUTPUT_BUFFER = 2
'-Sub Main------------------------------------------------------------
Sub Main()
'-Variables-------------------------------------------------------
Dim PS, PSCode, PSVersion
Set PS = CreateObject("SAPIEN.ActiveXPoSHV3")
If IsObject(PS) Then
PS.OutputMode = OUTPUT_BUFFER
If PS.Init(vbFalse) = 0 And PS.IsPowerShellInstalled() <> 0 Then
PSCode = "Write-Host -Separator '' " + _
"$PSVersionTable.PSVersion.Major . " + _
"$PSVersionTable.PSVersion.Minor . " + _
"$PSVersionTable.PSVersion.Build . " + _
"$PSVersionTable.PSVersion.MinorRevision"
PSCode = PSCode & vbCrLf
PS.Execute(PSCode)
PSVersion = PS.OutputString()
PS.ClearOutput()
MsgBox PSVersion, vbOkOnly, "PowerShell version"
End If
Set PS = Nothing
Else
MsgBox "Can't create ActiveXPoSH", vbOkOnly, "Important hint"
End If
End Sub
'-Main----------------------------------------------------------------
Main
'-End-------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |