Nicht nur für das ursprüngliche Plakat dieser Frage brauchen, aber für andere, die hier vielleicht die Suche nach Antworten landen Das Hilfesystem ist sehr nützlich und scheint oft übersehen zu werden.
Verwendung Befehl /? oder in PowerShell
die get-help
und get-help -full
Befehle sind alle nützlich.
Sie könnten wahrscheinlich Ihre eigene Frage beantwortet haben, indem Sie die Hilfe für den Befehl, den Sie ausführen wollten, in diesem Fall powershell
lesen.
PowerShell[.exe] [-PSConsoleFile <file> | -Version <version>]
[-NoLogo] [-NoExit] [-Sta] [-Mta] [-NoProfile] [-NonInteractive]
[-InputFormat {Text | XML}] [-OutputFormat {Text | XML}]
[-WindowStyle <style>] [-EncodedCommand <Base64EncodedCommand>]
[-File <filePath> <args>] [-ExecutionPolicy <ExecutionPolicy>]
[-Command { - | <script-block> [-args <arg-array>]
| <string> [<CommandParameters>] } ]
PowerShell[.exe] -Help | -? | /?
-NoExit
Does not exit after running startup commands.
...
-File
Runs the specified script in the local scope ("dot-sourced"), so that the
functions and variables that the script creates are available in the
current session. Enter the script file path and any parameters.
File must be the last parameter in the command, because all characters
typed after the File parameter name are interpreted
as the script file path followed by the script parameters.
-NoExit - nicht beendet nach Startbefehle ausgeführt werden.
-Datei - ... Die Datei muss der letzte Parameter in dem Befehl sein ...
'Power -noexit -Datei starten "D: \ MyToolkit \ ToolKit.ps1"' – Avshalom
Dank! Hat funktioniert! Es hat nicht funktioniert, als ich es am Ende gesagt habe, aber als ich es vorlegte - Commandit hat funktioniert – pencilCake