diff --git a/src/host/main.cs b/src/host/main.cs index 350dfec21f..23ec9cd3cd 100644 --- a/src/host/main.cs +++ b/src/host/main.cs @@ -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);