Name Your Powershell Parameters

Shane O’Neill warns us to name our Powershell parameters:

Eh…what?

Cannot process argument because the value of argument “path” is null.

The “path” argument is NULL? And I’m back to the very root of “I:\”?

Thankfully, at this stage, I know to go back and read the help file again before I let slip any curses.

As usual, it’s a fun read and a good lesson.

Related Posts

Automating Data Importation With dbatools

Bob Pusateri shows how to keep a dataset up to date using Powershell and dbatools: Now for the magic – let’s load some data! The dbatools command that does all the heavy lifting here is called Import-DbaCsvToSql. It loads CSV files into a SQL Server table quickly and easily. As an added bonus, the entire import […]

Read More

Type Information Change In Export-CSV Cmdlet

Max Trinidad notes that a default parameter in the Export-Csv cmdlet has flipped between Powershell on Windows and Powershell Core 6: For a long time, in Windows PowerShell, we had to add the parameter “-NoTypeInformation“, so the “#TYPE …” line on the first row of the *CSV would not be included. So, in Windows PowerShell executing the command […]

Read More

Categories

September 2017
MTWTFSS
« Aug Oct »
 123
45678910
11121314151617
18192021222324
252627282930