MartinGC94
MartinGC94
You can also set the console output to a stream like this: ``` $Writer = [System.IO.StreamWriter]::new("$HOME\DemoLog.txt") $Writer.AutoFlush = $true $OriginalOut = [System.Console]::Out try { [System.Console]::SetOut($Writer) [System.Console]::WriteLine("Hello") } finally { [System.Console]::SetOut($OriginalOut)...
You don't need access to the source code to set the console output. You set it in PowerShell and then you call the method in your class library and then...
This reproduces on my Surface pro 8 but not my desktop PC. Judging by the dll name you probably need a pen compatible PC to trigger this error. It also...
I'm also using the x64 MSI package.
When used inside a function or a script it will include the name of the function/script, for example: ``` function MyFunction { Write-Error -Message "Hello" } MyFunction ``` Results in...
It doesn't seem possible to fix this with parametersets without making a breaking change. If there's no default parameterset set then the parameter binding can't resolve the parameterset in scenarios...
That's not an accurate example though. `Completed` still needs to exist in the old parameter set so we don't break backwards compatibility with scripts like `Write-Progress -Activity bla -SecondsRemaining 0...
One use case could be deprecating parameters in a parameter set. For example, `Write-Progress` currently forces you to specify an `Activity`, even when it shouldn't be needed. If you update...
I can see why someone might want to hide the 11 common parameters you get with cmdletbinding in simple functions/scripts that are meant to be used by less technical users....
Sure you can, but then you miss out on pipeline support, parametersets, and mandatory parameters.