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

Default Parameter Values In Powershell

Chrissy LeMaire explains what $PSDefaultParameterValues is and places where she finds it useful: $PSDefaultParameterValues is a hashtable available in PowerShell that can set defaults for any command that you run. In it’s simplest form, setting a default parameter value can look like this: 1 $PSDefaultParameterValues = @{ ‘Get-DbaDatabase:Verbose’ = $true } After running the above code, Get-DbaDatabase will show […]

Read More

Power BI Administration With Powershell

Adam Saxton shares a video covering what is available in the MicrosoftPowerBIMgmt Powershell module: The Power BI PowerShell and the Admin API allow you to quickly inventory your organization and manage workspaces and access. Forget the hastle of setting up the App registration within Azure Active Directory for API access, the Power BI PowerShell cmdlets […]

Read More

Categories

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