You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error that indicates that the type does not exist (in the current session).
Actual behavior
A quiet no-op. No output, $? reports $True.
Environment data
PowerShell Core v6.0.0-beta.3 on macOS 10.12.5
PowerShell Core v6.0.0-beta.3 on Ubuntu 16.04.1 LTS
PowerShell Core v6.0.0-beta.3 on Microsoft Windows 10 Pro (64-bit; v10.0.14393)
Windows PowerShell v5.1.15063.413 on Microsoft Windows 10 Pro (64-bit; v10.0.15063)
HANG ON ... This is a breaking change to the function!!!
Does -ErrorAction SilentlyContinue work, or are you now forcing everyone to wrap this in a try/catch block?
I understand the desire to have this produce an error, but we can't make existing commands throw exceptions in use cases that used to just return nothing.
You're breaking every instance of existing code that looks like this, right?
Activity
faraazahmad commentedon Jul 27, 2018
I would like to work on this
faraazahmad commentedon Jul 28, 2018
Michael Klement (@mklement0) Steve Lee (@SteveL-MSFT) What should the
ErrorCategorybe?mklement0 commentedon Jul 29, 2018
Syed Faraaz Ahmad (@faraazahmad):
Thanks for your willingness to take this on.
I'm not the best person to ask, but looking at the enumeration values at https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.errorcategory?view=powershellsdk-1.1.0, perhaps
ResourceUnavailable?SteveL-MSFT commentedon Jul 30, 2018
Syed Faraaz Ahmad (@faraazahmad) consider it yours! Thanks!
faraazahmad commentedon Jul 31, 2018
So my code now outputs this:
Is this all right? And should I just check for
$?in the test or something more?:)
Jaykul commentedon Aug 9, 2018
HANG ON ... This is a breaking change to the function!!!
Does
-ErrorAction SilentlyContinuework, or are you now forcing everyone to wrap this in a try/catch block?I understand the desire to have this produce an error, but we can't make existing commands throw exceptions in use cases that used to just return nothing.
You're breaking every instance of existing code that looks like this, right?