The aim is to call the function hello by calling hello or alias helloworld.
Code:
function hello() {
param(
[string] $name
)
Write-Host "Hello $name!"
}
hello "Utrecht"
helloworld "Utreg"
Expected outcome:
Hello Utrecht!
Hello Utreg!
Set-Aliasworks, sometimes you don't want it to be global.-Scopeparameter is for.Set-Alias -Name 'HelloWorld' -Value 'Hello' -Scope Script