GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Exclude -Comobject parameter of New-Object cmdlet on unsupported platforms by iSazonov · Pull Request #4922 · PowerShell/PowerShell Conversation
Collaborator
Fix #4897. New-Object -Comobject is not supported on
First commit reformat test file.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Ilya (iSazonov)
requested review from
James Truher (JamesWTruher),
Paul Higinbotham (PaulHigin) and
Dan Travison (dantraMSFT)
as code owners
Ilya (iSazonov)
force-pushed
the
comobject-exclude
branch
from
c94c454 to
baf780f
Compare
Dongbo Wang (daxian-dbw)
requested changes
|
| } | ||
|
|
||
| #endif | ||
| #endregion Com |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think the entire "com" region here should be under the #if !UNIX.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
50a3c63 to
84f7a6c
Compare
84f7a6c to
2af645b
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if ($IsLinux -or $IsMacOs ) { | ||
| { New-Object -ComObject "Shell.Application" } | ShouldBeErrorId "NamedParameterNotFound,Microsoft.PowerShell.Commands.NewObjectCommand" | ||
| } else { | ||
| { New-Object -ComObject "Shell.Application" } | Should Not Throw |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This will fail when running tests on NanoServer ... Maybe change it to check if New-Object has the parameter ComObject instead of creating the Shell.Application object?
$s = gcm New-Object
$s.Parameters.ContainsKey("ComObject")
True
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
-ComObject should not be exposed on systems where it is not supported
There was an error while loading. Please reload this page.