作成中のモジュールで単体テストを行うために Pester を使用していますが、実行空間オブジェクトを返すはずの関数の 1 つに少し問題があります。実行空間オブジェクトを作成して実行する.GetType()と、名前が LocalRunspace として表示され、System.Management.Automation.Runspaces.LocalRunspace のフルネームが表示されますが、実行すると$Runspace -is [LocalRunspace]以下$Runspace -is [System.Management.Automation.Runspaces.LocalRunspace]のエラー メッセージが表示されます
Unable to find type [System.Management.Automation.Runspaces.LocalRunspace]. Make sure that the assembly that contains this type is loaded.
At line:1 char:1
+ $ps.Runspace -is [System.Management.Automation.Runspaces.LocalRunspace]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Manageme...s.LocalRunspace:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
適切な検証チェックを作成するために、どのタイプを参照する必要があるかを理解しようとしています。の結果と比較することにフォールバックできることはわかっていますが、.GetType()実際には通常の Pester の規則を使用したいと思います。Should BeOfType