![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | New-Object -ComObject x -Strict - A very good idea I just noticed the -Strict SwitchParameter added to the ComObject parameter set for New-Object. I like. It's nice to get a warning when PowerShell runs into .NET wrapping behavior that might cause problems for scripters. ![]() |
My System Specs![]() |
| | #2 (permalink) |
| | Re: New-Object -ComObject x -Strict - A very good idea Yes, That is exactly the reason why we created the strict switch. We found it hard to determine when we are getting COM object and .Net object. Often times, script fails in a location Using this switch, you will get COM object. if you get RCW class, new-object will fail. This makes it easy to identify the issue earlier in the script than later. -- Arul Kumaravel [MSFT] Development Manager, Windows PowerShell, Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights "Alex K. Angelopoulos [MVP]" <a k a @ m v p s . o r g> wrote in message news:OlQZqlNkGHA.1264@TK2MSFTNGP05.phx.gbl... >I just noticed the -Strict SwitchParameter added to the ComObject parameter >set for New-Object. I like. It's nice to get a warning when PowerShell runs >into .NET wrapping behavior that might cause problems for scripters. ![]() > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Is It A Good Idea To Get An OS When It's New? | Vista General | |||
| Multiple readyboost. Is that a good idea? | Vista installation & setup | |||
| Autologon not such a good idea. | Vista performance & maintenance | |||
| new-object -comobject "CAPICOM.Signed" failing on Win2k3? | PowerShell | |||
| Can I use the uuid with new-object -comobject | PowerShell | |||