Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
07b7c25
bulk removal of deprecated code (workflow cleanup)
KirkMunro Jul 24, 2019
2e90c85
CodeFactor changes
KirkMunro Jul 24, 2019
ca0433b
minor fix to previous commit
KirkMunro Jul 24, 2019
eefe902
add deprecated placeholders to pass asserts
KirkMunro Jul 25, 2019
c4e5618
foreach parameter deprecation plus test cleanup
KirkMunro Jul 25, 2019
15b6cca
fix Pester test workflow references
KirkMunro Jul 25, 2019
34d2dd7
temporarily re-add IsWorkflow as dummy property
KirkMunro Jul 25, 2019
38e5954
Merge branch 'master' into partial-removal-of-workflow-specific-code
KirkMunro Aug 4, 2019
92242d5
replace deprecated keywords; add tests
KirkMunro Aug 4, 2019
0f9155c
remove extra whitespace, add missing comment
KirkMunro Aug 4, 2019
64af1b5
remove unintentional space
KirkMunro Aug 4, 2019
7374bbe
CodeFactor cleanup
KirkMunro Aug 4, 2019
66be180
CodeFactor cleanup
KirkMunro Aug 4, 2019
435913e
Merge branch 'master' into partial-removal-of-workflow-specific-code
KirkMunro Aug 5, 2019
7034c8b
Fix debugger disable performance regression (#10269)
PaulHigin Aug 5, 2019
3ca5a1b
Don't collect process starttime as it's not being used on consolehost…
SteveL-MSFT Aug 6, 2019
9eb5587
Cleanup Docker release testing (#10310)
RDIL Aug 6, 2019
d84ebc1
Update our language on our policy applying to security issues (#10304)
SteveL-MSFT Aug 6, 2019
cf7699b
Add tests for WildcardPattern.Escape() and Unescape() (#10090)
iSazonov Aug 7, 2019
b58525e
bulk removal of deprecated code (workflow cleanup)
KirkMunro Jul 24, 2019
c56d6d8
CodeFactor changes
KirkMunro Jul 24, 2019
08ba242
minor fix to previous commit
KirkMunro Jul 24, 2019
5d83c00
add deprecated placeholders to pass asserts
KirkMunro Jul 25, 2019
da3cca5
foreach parameter deprecation plus test cleanup
KirkMunro Jul 25, 2019
441a7b1
fix Pester test workflow references
KirkMunro Jul 25, 2019
ef79b52
temporarily re-add IsWorkflow as dummy property
KirkMunro Jul 25, 2019
bf0ab87
replace deprecated keywords; add tests
KirkMunro Aug 4, 2019
225c5dc
remove extra whitespace, add missing comment
KirkMunro Aug 4, 2019
6c85f04
remove unintentional space
KirkMunro Aug 4, 2019
8c2ac0c
CodeFactor cleanup
KirkMunro Aug 4, 2019
2ab5d28
CodeFactor cleanup
KirkMunro Aug 4, 2019
520f851
Merge branch 'partial-removal-of-workflow-specific-code' of https://g…
KirkMunro Aug 7, 2019
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
7 changes: 7 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Security Vulnerabilities

Security issues are treated very seriously and will, by default,
takes precedence over other considerations including usability, performance,
etc... Best effort will be used to mitigate side effects of a security
change, but PowerShell must be secure by default.

## Reporting a security vulnerability

If you believe that there is a security vulnerability in PowerShell,
it **must** be reported to [secure@microsoft.com](https://technet.microsoft.com/security/ff852094.aspx) to allow for [Coordinated Vulnerability Disclosure](https://technet.microsoft.com/security/dn467923).
**Only** file an issue, if [secure@microsoft.com](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue?rtc=1) has confirmed filing an issue is appropriate.
11 changes: 4 additions & 7 deletions docker/InstallTarballPackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@
# Exit on errors
set -e

#
# Example use:
# ./InstallTarballPackage.sh "6.0.0-beta.9" "powershell-6.0.0-beta.9-linux-x64.tar.gz"
#

usage() {
echo "usage: $0 <powershell version> <powershell package name>"
exit 1
}

POWERSHELL_VERSION=$1
if [ ! "$POWERSHELL_VERSION" ]
then
if [ ! "$POWERSHELL_VERSION" ]; then
usage
fi

POWERSHELL_PACKAGE=$2
if [ ! "$POWERSHELL_PACKAGE" ]
then
if [ ! "$POWERSHELL_PACKAGE" ]; then
usage
fi

Expand All @@ -37,7 +34,7 @@ tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/$POWERSHELL_VERSION
# Create the symbolic link that points to powershell
ln -s /opt/microsoft/powershell/$POWERSHELL_VERSION/pwsh $POWERSHELL_LINKFILE
# Add the symbolic link path to /etc/shells
if [ ! -f /etc/shells ] ; then
if [ ! -f /etc/shells ]; then
echo $POWERSHELL_LINKFILE > /etc/shells ;
else
grep -q "^${POWERSHELL_LINKFILE}$" /etc/shells || echo $POWERSHELL_LINKFILE >> /etc/shells ;
Expand Down
2 changes: 1 addition & 1 deletion docker/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The tests must be run separately on the Windows and Linux docker daemons. You ca
Invoke-Pester
```

Note: be sure to do this using both the Windows and Linux docker daemon, as the windows.
Note: be sure to do this using both the Windows and Linux docker daemon.

## To test the productions containers

Expand Down
4 changes: 2 additions & 2 deletions docker/tests/Templates/centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV LANG en_US.UTF-8
ENV LC_ALL $LANG
RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG

RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME
RUN yum install -y $PACKAGENAME
RUN curl -L -o $PACKAGENAME $PACKAGELOCATION/$PACKAGENAME \
&& yum install -y $PACKAGENAME
RUN $TESTDOWNLOADCOMMAND
RUN pwsh$PREVIEWSUFFIX -c "Import-Module /PowerShell/build.psm1;\$dir='/usr/local/share/powershell/Modules';\$null=New-Item -Type Directory -Path \$dir -ErrorAction SilentlyContinue;Restore-PSPester -Destination \$dir;exit (Invoke-Pester $TESTLIST -PassThru).FailedCount"
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN locale-gen $LANG && update-locale

# Install PowerShell package
ADD $PACKAGELOCATION/$PACKAGENAME .
RUN mkdir -p /opt/microsoft/powershell
RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell
RUN mkdir -p /opt/microsoft/powershell \
&& tar zxf $PACKAGENAME -C /opt/microsoft/powershell

# Download and run tests
RUN $TESTDOWNLOADCOMMAND
Expand Down
4 changes: 2 additions & 2 deletions docker/tests/Templates/fxdependent-fedora28/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ RUN localedef --charmap=UTF-8 --inputfile=en_US $LANG

# Install PowerShell package
ADD $PACKAGELOCATION/$PACKAGENAME .
RUN mkdir -p /opt/microsoft/powershell
RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell
RUN mkdir -p /opt/microsoft/powershell \
&& tar zxf $PACKAGENAME -C /opt/microsoft/powershell

# Download and run tests
RUN $TESTDOWNLOADCOMMAND
Expand Down
4 changes: 2 additions & 2 deletions docker/tests/Templates/fxdependent-ubuntu16.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ RUN locale-gen $LANG && update-locale

# Install PowerShell package
ADD $PACKAGELOCATION/$PACKAGENAME .
RUN mkdir -p /opt/microsoft/powershell
RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell
RUN mkdir -p /opt/microsoft/powershell \
&& tar zxf $PACKAGENAME -C /opt/microsoft/powershell

# Download and run tests
RUN $TESTDOWNLOADCOMMAND
Expand Down
4 changes: 2 additions & 2 deletions docker/tests/Templates/fxdependent-ubuntu18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN locale-gen $LANG && update-locale

# Install PowerShell package
ADD $PACKAGELOCATION/$PACKAGENAME .
RUN mkdir -p /opt/microsoft/powershell
RUN tar zxf $PACKAGENAME -C /opt/microsoft/powershell
RUN mkdir -p /opt/microsoft/powershell \
&& tar zxf $PACKAGENAME -C /opt/microsoft/powershell

# Download and run tests
RUN $TESTDOWNLOADCOMMAND
Expand Down
3 changes: 1 addition & 2 deletions docker/tests/containerTestCommon.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function Get-LinuxContainer
Path = "$psscriptroot/../release/$os"
}
}

}

# Return a list of Windows Container Test Cases
Expand Down Expand Up @@ -130,7 +129,7 @@ function Test-SkipLinux
return $true
}
default {
throw "Unknow docker os '$os'"
throw "Unknown docker os '$os'"
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,11 +1023,12 @@ bool IHostProvidesTelemetryData.HostIsInteractive
double IHostProvidesTelemetryData.ReadyForInputTimeInMS { get { return _readyForInputTimeInMS; } }

int IHostProvidesTelemetryData.InteractiveCommandCount { get { return _interactiveCommandCount; } }
#endif

private double _profileLoadTimeInMS;
private double _readyForInputTimeInMS;
private int _interactiveCommandCount;
#endif

private double _profileLoadTimeInMS;

#endregion overrides

Expand Down Expand Up @@ -1602,8 +1603,10 @@ private void DoCreateRunspace(string initialCommand, bool skipProfiles, bool sta
PSTask.PowershellConsoleStartup, PSKeyword.UseAlwaysOperational);
}

#if LEGACYTELEMETRY
// Record how long it took from process start to runspace open for telemetry.
_readyForInputTimeInMS = (DateTime.Now - Process.GetCurrentProcess().StartTime).TotalMilliseconds;
#endif

DoRunspaceInitialization(skipProfiles, initialCommand, configurationName, initialCommandArgs);
}
Expand Down Expand Up @@ -2517,8 +2520,10 @@ e is RemoteException ||
}
}

#if LEGACYTELEMETRY
if (!inBlockMode)
s_theConsoleHost._interactiveCommandCount += 1;
#endif
}
}
// NTRAID#Windows Out Of Band Releases-915506-2005/09/09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ internal object Transform(EngineIntrinsics engineIntrinsics, object inputData, b
if (_convertTypes[i] == typeof(ActionPreference))
{
ActionPreference resultPreference = (ActionPreference)result;

if (resultPreference == ActionPreference.Suspend)
{
throw new PSInvalidCastException("InvalidActionPreference", null, ErrorPackage.UnsupportedPreferenceVariable, resultPreference);
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/System.Management.Automation/engine/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ public enum ActionPreference
Inquire,
/// <summary>Ignore the event completely (not even logging it to the target stream)</summary>
Ignore,
/// <summary>Suspend the command for further diagnosis. Supported only for workflows.</summary>
Suspend,
}
#endregion ActionPreference

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ List<CompletionResult> ExecuteGetCommandCommand(bool useModulePrefix)
}

private static readonly HashSet<string> s_keywordsToExcludeFromAddingAmpersand
= new HashSet<string>(StringComparer.OrdinalIgnoreCase) { TokenKind.InlineScript.ToString(), TokenKind.Configuration.ToString() };
= new HashSet<string>(StringComparer.OrdinalIgnoreCase) { TokenKind.Configuration.ToString() };
internal static CompletionResult GetCommandNameCompletionResult(string name, object command, bool addAmpersandIfNecessary, string quote)
{
string syntax = name, listItem = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ internal T GetEnumPreference<T>(VariablePath preferenceVariablePath, T defaultPr
if (val is ActionPreference)
{
ActionPreference preference = (ActionPreference)val;
if ((preference == ActionPreference.Ignore) || (preference == ActionPreference.Suspend))
if (preference == ActionPreference.Ignore)
{
// Reset the variable value
EngineSessionState.SetVariableValue(preferenceVariablePath.UserPath, defaultPref);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,6 @@ public static IEnumerator GetEnumerator(object obj)

/// <summary>
/// This method takes a an arbitrary object and wraps it in a PSDataCollection of PSObject.
/// This simplifies interacting with the PowerShell workflow activities.
/// </summary>
/// <param name="inputValue"></param>
/// <returns></returns>
Expand Down Expand Up @@ -1771,7 +1770,7 @@ public static object ConvertPSObjectToType(PSObject valueToConvert, Type resultT
}

/// <summary>
/// Generic convertto that simplifies working with workflow.
/// Generic conversion method.
/// </summary>
/// <typeparam name="T">The type of object to return</typeparam>
/// <param name="valueToConvert"></param>
Expand Down
15 changes: 0 additions & 15 deletions src/System.Management.Automation/engine/MshCommandRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3037,11 +3037,6 @@ internal ActionPreference WarningPreference

set
{
if (value == ActionPreference.Suspend)
{
throw PSTraceSource.NewNotSupportedException(ErrorPackage.SuspendActionPreferenceErrorActionOnly);
}

_warningPreference = value;
IsWarningActionSet = true;
}
Expand Down Expand Up @@ -3207,11 +3202,6 @@ internal ActionPreference ErrorAction

set
{
if (value == ActionPreference.Suspend)
{
throw PSTraceSource.NewNotSupportedException(ErrorPackage.SuspendActionPreferenceSupportedOnlyOnWorkflow);
}

_errorAction = value;
IsErrorActionSet = true;
}
Expand Down Expand Up @@ -3274,11 +3264,6 @@ internal ActionPreference InformationPreference

set
{
if (value == ActionPreference.Suspend)
{
throw PSTraceSource.NewNotSupportedException(ErrorPackage.SuspendActionPreferenceErrorActionOnly);
}

_informationPreference = value;
IsInformationActionSet = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ internal static class StringLiterals
internal const string PowerShellDataFileExtension = ".psd1";

/// <summary>
/// The file extension (including the dot) of an workflow dependent assembly.
/// The file extension (including the dot) of a binary module.
/// </summary>
internal const string PowerShellILAssemblyExtension = ".dll";

/// <summary>
/// The file extension (including the dot) of an workflow dependent Ngen assembly.
/// The file extension (including the dot) of a binary module Ngen assembly.
/// </summary>
internal const string PowerShellNgenAssemblyExtension = ".ni.dll";

Expand Down
Loading