PowerShell Variablen
Variablen die von PowerShell je nach Kontext, selbst deklariert werden.
| Variable |
$PSScriptRootSystem.String$PSCommandPathSystem.String
Vollständiger Pfad zum aktuellen Skript
$PSModulePath
$MyInvocationPSScriptRoot
Der Pfad zum Ordner worin sich das aktuelle Skript befindet
InvocationInfo$MyInvocation
Enthält Infos darüber, wie das Skript aufgerufen wurde
$PSScriptRoot
System.String
$PSCommandPath
System.String
$PSScriptRoot
$MyInvocation
InvocationInfo
Enthält Infos darüber, wie das Skript aufgerufen wurde
$MyInvocation.MyCommand – Informationen und die Idendität des aktuellen Kommando-Objekts
$MyInvocation.MyCommand.CommandType
$MyInvocation.MyCommand.Path – EnhältEnthält den Pfad zum aktuellen Skript