Joel Bennett
Joel Bennett
OK, changed it to the best thing, which is `#!/usr/bin/env powershell` ... which would use the first `powershell` on the path. But FreeBSD is a pain (and thus, OS X)...
Just ... stop using carriage returns. It's 2016. 🎱 says YAGNI
Other than notepad.exe, it's always a setting.
OMG. I just remembered the other reason I despise ISE.
I guess if you're using PowerShell on other OS's, you're going to outgrow ISE and start using VS Code anyway. Also, if don't need the shebang functionality (i.e. running PowerShell...
Or, you know ... `perl -i -pe's/\r$//;' .\yourscript.ps1` Or `powershell '&{param($f)sc $f ((gc $f -raw)-replace''\r'') -Enc utf8}' .\yourscript.ps1` If you set the encoding at the same time, you could use...
It's worth pointing out that this same advice applies whenever you're interacting with a hashtable -- even when you're calling `$hashtable.Add(` or getting or setting via dot notation or indexing....
I strongly dislike strict mode, and wouldn't ever recommend people use it. writing things like: ``` posh if(Test-Path variable:local:Foo) { ... } if($HashTable.ContainsKey("Property") -and $HashTable.Property) { ... } ``` Instead...
### The real question is, should we even care? The style guide rules focus on _readability_, to which StrictMode is tangential at best, detrimental at worst. The best practices focus...
@dlwyatt Your lack of imagination is not my problem ;-) There are plenty of commands like `Invoke-WebRequest` and `Invoke-RestMethod` which take a variable _name_ and initialize it rather than taking...