Commit 24150dd
authored
Use $PSVersionTable.PSVersion for PowerShell Version (#372)
Currently, we use $Host.runspace.version for PowerShell version. It is the PowerShell engine version, and should be same as the $psversiontable.psversion, but runspace will be null in some cases for example when developers directly use PowerShell SDK as below.
```
# $sp = [runspaceFactory]::CreateRunspace() # Create an space with default host
# $ps = [powershell]::create() # create an powershell object
# $ps.Runspace = $sp
# $sp.Open()
# $ps.AddScript{Get-host}.Invoke() # runspace is null for such an case
```1 parent f458acf commit 24150dd
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
1068 | | - | |
| 1068 | + | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| |||
0 commit comments