Closed Sri-Boddupalli closed 2 years ago
Could it be that you're trying to run it on Windows 7 or another old version of Windows and/or PowerShell?
Trying to Image OS with Windows 10 21H1. When I ran the same cmdlet it was working fine but during the imaging its failing like that
Maybe you're trying to run it in the WinPE environment, too early during the imaging process, rather than in the "online" FullOS?
Make sure your LSUClient step is towards the end of the task sequence, in the "State Restore" section.
Have you been able to solve your problem?
Running in Full OS and made sure doing everything correctly, Still this is a problem, I checked by just running Get-PnpDevice upfront and it did not recognize the command saying this
Error Begin: CategoryInfo : ObjectNotFound: (Get-PnpDevice:String) [], CommandNotFoundException VERBOSE: Script is running. VERBOSE: Lenovo device is detected. Continuing. VERBOSE: Lenovo modelnumber: 20L6 - Lenovo model: ThinkPad T480 VERBOSESUClient module not loaded. Continuing. VERBOSE: LSUClient module found available. Try importing and loading it. Error End:
Get-Module PnpDevice -ListAvailable -All | Format-List
show anything?Get-CimInstance -ClassName Win32_PnPEntity -Namespace 'root/CIMV2'
work?Get-PnpDevice
recognized as a command and working after the deployment has finished and you log into the computer?I'm not sure honestly, it seems there's either something off with the image you're deploying or by the time you attempt to run LSUClient some policies have already kicked in that remove or restrict things.
The PnpDevice module is a standard component of Windows 8, 10 and 11 and is always available by default.
When I run the following script as part of my task sequence, right before LSUClient:
Write-Output "--- PnpDevice Module diagnosis"
Write-Output "PSModulePath ENV Variable:"
$env:PSModulePath -split ";"
Write-Output ""
Get-Module -Name PnpDevice -ListAvailable -All | Format-List
Write-Output "---"
this is the output I get, and this is what it should be:
--- PnpDevice Module diagnosis
PSModulePath ENV Variable:
C:\Users\Administrator\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\windows\system32\WindowsPowerShell\v1.0\Modules
Name : PnpDevice
Path : C:\windows\system32\WindowsPowerShell\v1.0\Modules\PnpDevice\PnpDevice.cdxml
Description :
ModuleType : Cim
Version : 1.0
NestedModules : {}
ExportedFunctions : {Get-PnpDevice, Enable-PnpDevice, Disable-PnpDevice, Get-PnpDeviceProperty}
ExportedCmdlets :
ExportedVariables :
ExportedAliases :
Name : PnpDevice
Path : C:\windows\system32\WindowsPowerShell\v1.0\Modules\PnpDevice\PnpDevice.psd1
Description :
ModuleType : Manifest
Version : 1.0.0.0
NestedModules : {PnpDevice}
ExportedFunctions : {Get-PnpDevice, Get-PnpDeviceProperty, Enable-PnpDevice, Disable-PnpDevice}
ExportedCmdlets :
ExportedVariables :
ExportedAliases :
---
If you're running in FullOS but the PnpDevice module isn't available then I think that's something you'll have to diagnose on your end, I'm afraid I can't help much with that.
Closing because it's not an issue with LSUClient
I am getting this error while implementing this in SCCM Imaging process.
The term 'Get-PnpDevice' is not recognized as the name of a cmdlet, function, script file, or operable
tried to troubleshoot various things but couldn't find an apt solution, any ideas?
Total implementation is in here https://www.imab.dk/install-lenovo-drivers-and-bios-directly-from-lenovos-driver-catalog-during-osd-using-configuration-manager/?unapproved=12370&moderation-hash=5edf7e560aecd2c80bfd5c796ffa2ea5#comment-12370 Thanks,