Если я хочу использовать глобальную переменную Powershell вместе с class
и Set-StrictMode -version 2
, как мне это сделать?
Set-StrictMode -version 2
class MyClass{
[string] MyMethod(){
$x = $ErrorActionPreference
...
Powershell жалуется
$x = $ErrorActionPreference
Variable is not assigned in the method.