From c60f5f2073deeaa7b02a219cbe117cae913a981b Mon Sep 17 00:00:00 2001 From: jantari Date: Mon, 31 Jul 2023 19:53:47 +0200 Subject: [PATCH] switch from wmisearcher to full type so module can be imported on Linux again moving the [wmisearcher] accelerator from Get-LSUpdate to LSUClient.psm1 caused the class-not-found error during module import already rather than only when attempting to run Get-LSUpdate. Allowing the module to be imported on Linux is useful to generate the PlatyPS docs in CICD. --- LSUClient.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LSUClient.psm1 b/LSUClient.psm1 index a7037af..ac34777 100644 --- a/LSUClient.psm1 +++ b/LSUClient.psm1 @@ -350,7 +350,7 @@ class MachineCharacteristics { if ($Overrides.ContainsKey('_CPUAddressWidth')) { $this._CPUAddressWidth = $Overrides['_CPUAddressWidth'] } else { - $this._CPUAddressWidth = [wmisearcher]::new('SELECT AddressWidth FROM Win32_Processor').Get().AddressWidth + $this._CPUAddressWidth = [System.Management.ManagementObjectSearcher]::new('SELECT AddressWidth FROM Win32_Processor').Get().AddressWidth } if ($Overrides.ContainsKey('_Bios')) {