mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Execute *.ps1 arguments as scripts
This commit is contained in:
+5
-1
@@ -92,9 +92,13 @@ namespace Microsoft.Samples.PowerShell.Host
|
||||
|
||||
if (hasNext && arg == "--file")
|
||||
{
|
||||
initialScript = File.ReadAllText(nextArg);
|
||||
initialScript = Path.GetFullPath(nextArg);
|
||||
++i;
|
||||
}
|
||||
else if (arg.EndsWith(".ps1"))
|
||||
{
|
||||
initialScript = Path.GetFullPath(arg);
|
||||
}
|
||||
else if (hasNext && arg == "--working-dir")
|
||||
{
|
||||
Directory.SetCurrentDirectory(nextArg);
|
||||
|
||||
Reference in New Issue
Block a user