![]() ![]() In code, this is where you are setting up all requirements or dependencies before actually doing the work. This may include taking a shower, brushing your teeth, and driving to work. Just like a typical work day you will only prepare to go to work once. The BEGIN block is optional and is NOT needed if you are just wanting to use either the PROCESS or END blocksĮverything in the BEGIN block will only run once per call of your function. The BEGIN block in a PowerShell function is the appropriate place to set these types of items. In a PowerShell function, you may want to setup your function by specifying variables and arrays to be used throughout your function. Invoke-Driving -From Home -To Work -ErrorAction Stop Start-BrushingTeeth | Wait-Time -Minutes 2 | Stop-BrushingTeeth Open-ShowerDoor | Invoke-Shower | Select-Soap Start-Alarm -ErrorAction Silentl圜ontinue | Exit-Sleep -Force [CmdletBinding(DefaultParameterSetName='Parameter Set 1',
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |