Roman Kuzmin
Roman Kuzmin
> unless the module uses WMI (in which case there can be many errors with "Latest", so I limit it to -Version 2) This is interesting. Do you remember an...
@KirkMunro, thank you for interesting details and thoughts. As for the the script analyzer, I am not sure. I use strict mode in my internal scripts and I test my...
My bad, I mentioned the script analyzer but was rather thinking of recommendations and gudelines. The recommendation for enabling strict mode in modules makes sense and looks good.
Some thoughts. In theory, or in rare practical cases, a user may redefine `Write-Output` for some reasons, i.e. debugging, logging, or even accidentally. This may affect the code which uses...
Some facts (if I am not mistaken, double check would not hurt). `DefaultCommandPrefix` in PSD1 manifests was introduced in v3: > New DefaultCommandPrefix key in module manifests that avoids name...
I agree if this is about public functions. Internal non-advanced functions are up to a developer. Non-advanced functions are simpler sometimes.
@Jaykul here are some examples. Why do they need special names? Why should they have `param`? Why should `process` block be forbidden? ``` powershell filter Get-Even { if ($_ %...
And let's take it to the extreme. We can use script blocks instead of functions, sometimes they are more convenient. Should they also be only advanced?
> Always use CmdletBinding Sounds like a law :)
> They don't throw errors when you call them with common parameters (like -Verbose or -ErrorVariable), but they don't work as expected either. This is not exactly true if a...