Monthly Archive

Categories

Receive-Job Keep parameter

The Receive-Job Keep parameter is required if you want the data contained in the job to remain available. if you don’t use the –Keep parameter (a switch) the data will be deleted.

 

Its a pain to remember to use the Keep parameter. I’ve been working with jobs a lot just recently and the number of times I had to rerun jobs because I forgot to use Keep doesn’t bear thinking about.

 

I finally got round to adding it to the default parameter values.

This line in my profile

$PSDefaultParameterValues = @{'Install-Module:Scope'='AllUsers'; 'Update-Module:Scope'='AllUsers'; 'Receive-Job:Keep' = $true}

 

ensures I won’t forget ever again. Because Keep is a switch you have to set the value to true.

Comments are closed.