Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1. You check `$LastExitCode`, similar to `$?`. You can also catch exceptions when dealing with real Powershell commands.

2. Try piping your output through `| Format-List -Property *`. This isn't very discoverable really.

3. Try selecting the properties you want: `| select Name, ID, Etc`

4. This is the fault of the module developer, not Powershell. You can also write bad software in C.



`$?` works and is more reliable. Git notoriously gives non-zero exit codes for success conditions




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: