Skip to content

update SafeCommands to use Get-CimInstance if it exists, then try Get…#484

Merged
dlwyatt merged 1 commit intopester:masterfrom
JamesWTruher:master
Mar 3, 2016
Merged

update SafeCommands to use Get-CimInstance if it exists, then try Get…#484
dlwyatt merged 1 commit intopester:masterfrom
JamesWTruher:master

Conversation

@JamesWTruher
Copy link
Copy Markdown
Contributor

…-WmiObject. If neither exist, then warn the user that the test results may not have all the system information. Updated TestResult to try harder to get system information (based on whether Get-CIMInstance or Get-Wmi exists). Also, change a couple of tests to be more portable when it comes to CoreCLR because TypeId does not exist as property on Parameter.

…-WmiObject. If neither exist, then warn the user that the test results may not have all the system information. Updated TestResult to try harder to get system information (based on whether Get-CIMInstance or Get-Wmi exists). Also, change a couple of tests to be more portable when it comes to CoreCLR because TypeId does not exist as property on Parameter.
@JamesWTruher
Copy link
Copy Markdown
Contributor Author

This targets PowerShell on Nano, but is actually useful generally. Get-WMIObject is not available on Nano, but Get-CimInstance is available. Also, changes in .NET Core eliminated the TypeId property on Parameter, but an easy alternative is present.
There is an existing .NET Core bug dotnet/corefx#5437 which should address issues of Pester with regard to TESTDRIVE (which I saw in a different pull request)

@JamesWTruher JamesWTruher reopened this Mar 2, 2016
dlwyatt added a commit that referenced this pull request Mar 3, 2016
update SafeCommands to use Get-CimInstance if it exists, then try Get…
@dlwyatt dlwyatt merged commit 5f1de3f into pester:master Mar 3, 2016
@dlwyatt
Copy link
Copy Markdown
Member

dlwyatt commented Mar 3, 2016

Thanks! :)

@JamesWTruher
Copy link
Copy Markdown
Contributor Author

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants