I am trying to get below to work under set-strictmode -version latest, it works completely fine without strict mode, unfortunately it's a requirement to have latest strictmode in my environment.
What it does: go through registry to find the entry with EEELinkAdvertisement and assign it to $findEeeLinkAd
$findEeeLinkAd = Get-ChildItem -LiteralPath 'hklm:\SYSTEM\ControlSet001\Control\Class' -Recurse -ErrorAction SilentlyContinue | `
% {Get-ItemProperty -Path $_.pspath -ErrorAction SilentlyContinue | `
? {$_.EeeLinkAdvertisement} -ErrorAction SilentlyContinue }
I receive a bunch of the following errors despite running in Administrator:
The property 'EEELinkAdvertisement' cannot be found on this object. Verify that the property exists.
At line:3 char:12
+ ? {$_.EEELinkAdvertisement} }
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
Any help would be appreciated!