powershell.exe
is started, it determines the required environment and loads the correct CLR (Common Language Runtime) and (managed) PowerShell host (Microsoft.PowerShell.ConsoleHost.dll
) (See this link for more information). cmd.exe
batch file: @powershell -command "" ^ ^ $i = 1; ^ ^ while ($i -le 10) { ^ write-output $i; ^ $i++; ^ } ^ ^ ""
^
) which is the line continuation character in cmd.exe
;
because the caret does not pass a new line
""
) -f
or --file
command line option. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths
.