Execute *.ps1 arguments as scripts

This commit is contained in:
Andrew Schwartzmeyer
2015-11-04 15:09:29 -08:00
parent f8bd1243b6
commit cbcf974e57
+5 -1
View File
@@ -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);