Steps To Creating A PS Script Flashcards
How to type multi line comment?
<#words#>
How do you sign a script?
Must sign with a code signing certificate
What are the two types of certificates?
Public cert, self-signed cert
What are functions?
The building block of PS scripts, allowing you to construct your code into logical reusable components.
What are the differences between arguments and parameters?
Arguments
Are not specific within a function
Are populated by passing values as part of the execution
- is PS script is Test.ps1 you’d call it as test.ps1 ‘space’ and anything in the spaces are the arguments
Values are retrieved by using ID or offset
Parameters
Variable defined in a function
Value is populated when calling the function
- load test PS1 then call a function that may say ‘newmsg’ with a property that has a value
Have properties
Can be mandatory or optional