Johan Ljunggren

Results 1292 comments of Johan Ljunggren

You could try running a script using SqlScript resource.

@copilot there are more scenarios that need to be documented: 1. There is an exception to not use `throw , the exception is when a `[ValidateScript()]` on a parameter in...

@copilot In the example shows how a state-changing command is using `$PSCmdlet.ThrowTerminatingError()`, is there a possible solution for where a user does not need to pass `-ErrorAction 'Stop'` when calling...

@copilot You say to use Write-Error for public commands unless the command is specifically designed to always fail on errors like assert-style commands. But let say we have this scenarion:...

@copilot But the line `Set-Property: After Assert-ElevatedUser (should NOT show if assertion failed)` was output even when it should have?

@copilot You found that "The -ErrorAction 'Stop' parameter on the Assert call alone is insufficient because ThrowTerminatingError doesn't propagate as a script-terminating error to the caller.", have we documented that...

@copilot Let say we have this scenarion: 1. We invoke Set-Property (without using ErrorAction parameter) 2. Set-Property internally invokes `Assert-ElevatedUser -ErrorAction 'Stop'` 3. Assert-ElevatedUser uses `Write-Error -Message 'Not elevated' -ErrorAction...

@copilot Igonre if there would be breaking changes

@copilot I want you to verify that this scenarion actually works - stops execution with terminating error, take note where and how `ErrorAction` parameter is used. If it works see...

@copilot I want you to verify that this scenarion actually works - stops execution with terminating error, take note where and how `ErrorAction` parameter is used. If it works see...