Let’s just say for argument’s sake that you wanted to create a PowerShell Cmdlet that gets all of the files in your current directory and print their names to the console. Assuming that the class which is supposed to do all of this inherits from PSCmdlet, would you put the logic into ProcessRecord or EndProcessing?
The tutorial I’ve been looking places the main code in EndProcess. I was curious to know if placing the that code in ProcessRecord would change anything.
Let’s just say for argument’s sake that you wanted to create a PowerShell Cmdlet
Share
Here a summary of methods:
In the case of your link the
cmdletlogic is inEndProcessingmethod because is doing a one-shot action.Move the logic in
ProcessRecord()don’t change the result but is not logically correct.Read here for more info.