Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,10 @@ public override void WriteWarningLine(string message)
internal class CommandLineParameterParser
{
internal static string[] validParameters = {
"psconsoleFile",
"version",
"nologo",
"noexit",
#if !CORECLR
#if STAMODE
"sta",
"mta",
#endif
Expand Down Expand Up @@ -251,14 +250,6 @@ internal bool NoExit
}
}

internal bool ImportSystemModules
{
get
{
return _importSystemModules;
}
}

internal bool SkipProfiles
{
get
Expand Down Expand Up @@ -416,6 +407,7 @@ private void DisplayBanner()
}
}

#if STAMODE
internal bool StaMode
{
get
Expand All @@ -426,17 +418,14 @@ internal bool StaMode
}
else
{
#if CORECLR
// Nano doesn't support STA COM apartment, so on Nano powershell has to use MTA as the default.
return false;
#else
// return false;
// Win8: 182409 PowerShell 3.0 should run in STA mode by default
return true;
#endif
}
}
}

#endif

/// <summary>
///
Expand Down Expand Up @@ -554,10 +543,6 @@ private void ParseHelper(string[] args)
_noExit = true;
noexitSeen = true;
}
else if (MatchSwitch(switchKey, "importsystemmodules", "imp"))
{
_importSystemModules = true;
}
else if (MatchSwitch(switchKey, "noprofile", "nop"))
{
_skipUserInit = true;
Expand Down Expand Up @@ -728,7 +713,8 @@ private void ParseHelper(string[] args)
break;
}
}
#if !CORECLR // explicit setting of the ApartmentState Not supported on NanoServer
#if STAMODE
// explicit setting of the ApartmentState Not supported on NanoServer
else if (MatchSwitch(switchKey, "sta", "s"))
{
if (_staMode.HasValue)
Expand Down Expand Up @@ -1184,13 +1170,15 @@ private bool CollectArgs(string[] args, ref int i)
private string _helpText;
private bool _abortStartup;
private bool _skipUserInit;
#if STAMODE
// Win8: 182409 PowerShell 3.0 should run in STA mode by default
// -sta and -mta are mutually exclusive..so tracking them using nullable boolean
// if true, then sta is specified on the command line.
// if false, then mta is specified on the command line.
// if null, then none is specified on the command line..use default in this case
// default is sta.
private bool? _staMode = null;
#endif
private bool _noExit = true;
private bool _explicitReadCommandsFromStdin;
private bool _noPrompt;
Expand All @@ -1203,7 +1191,6 @@ private bool CollectArgs(string[] args, ref int i)
private Collection<CommandParameter> _collectedArgs = new Collection<CommandParameter>();
private string _file;
private string _executionPolicy;
private bool _importSystemModules = false;
}
} // namespace

Loading