Update to .NET Preview 6 SDK (#15452)

This commit is contained in:
Aditya Patwardhan 2021-05-25 19:24:28 -07:00 committed by GitHub
parent 2fc3826dd3
commit 7ead137407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 314 additions and 92 deletions

View File

@ -1,9 +1,9 @@
{
"sdk": {
"channel": "release/6.0.1xx-preview2",
"packageVersionPattern": "6.0.0-preview.2",
"channel": "release/6.0.1xx-preview4",
"packageVersionPattern": "6.0.0-preview.4",
"sdkImageVersion": "6.0.100",
"nextChannel": "6.0.1xx-preview2/daily"
"nextChannel": "6.0.1xx-preview4/daily"
},
"internalfeed" : {
"url": null

View File

@ -136,6 +136,7 @@
<TargetFramework>net6.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<PublishReadyToRun Condition=" '$(Configuration)' != 'Debug' ">true</PublishReadyToRun>
<PublishReadyToRunUseCrossgen2>false</PublishReadyToRunUseCrossgen2>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

View File

@ -3063,8 +3063,8 @@
<Component Id="cmp3547A55EA9D04784B4CF2FC717447E16">
<File Id="fil463DDA419769417A8D5A34C433E194F2" KeyPath="yes" Source="$(var.ProductSourcePath)\System.Speech.dll" />
</Component>
<Component Id="cmpB04D9BE0F32F4D029D3CAD90DF288929">
<File Id="fil0EBD96C46E4F4537A32B8B1210CAF9C6" KeyPath="yes" Source="$(var.ProductSourcePath)\mscordaccore_$(var.FileArchitecture)_$(var.FileArchitecture)_6.0.21.20104.dll" />
<Component Id="cmp378D79CF3DEC49979D7FA8A029141F0A">
<File Id="filC405FF3776264022973EF4C1E94C8C3B" KeyPath="yes" Source="$(var.ProductSourcePath)\mscordaccore_$(var.FileArchitecture)_$(var.FileArchitecture)_6.0.21.25307.dll" />
</Component>
</DirectoryRef>
</Fragment>
@ -4053,7 +4053,7 @@
<ComponentRef Id="cmp2BB002B115C247FFB3353C80CAAC10B3" />
<ComponentRef Id="cmp68158D010ECB439582D041355BFACCBB" />
<ComponentRef Id="cmp3547A55EA9D04784B4CF2FC717447E16" />
<ComponentRef Id="cmpB04D9BE0F32F4D029D3CAD90DF288929" />
<ComponentRef Id="cmp378D79CF3DEC49979D7FA8A029141F0A" />
</ComponentGroup>
</Fragment>
</Wix>

View File

@ -1,5 +1,5 @@
{
"sdk": {
"version": "6.0.100-preview.3.21202.5"
"version": "6.0.100-preview.4.21255.9"
}
}

View File

@ -4,6 +4,7 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Management.Automation;
using System.Windows.Documents;
@ -273,11 +274,13 @@ namespace Microsoft.Management.UI.Internal
/// <param name="propertyName">Property name.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005s
}
}
}

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Windows.Documents;
using System.Windows.Media;
@ -107,10 +108,15 @@ namespace Microsoft.Management.UI.Internal
bool newHighlighted = false;
ParagraphBuilder.MoveSpanToPosition(ref currentBoldIndex, ref currentBoldSpan, i, this.boldSpans);
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
newBold = currentBoldSpan == null ? false : currentBoldSpan.Value.Contains(i);
#pragma warning restore IDE0075
ParagraphBuilder.MoveSpanToPosition(ref currentHighlightedIndex, ref currentHighlightedSpan, i, this.highlightedSpans);
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
newHighlighted = currentHighlightedSpan == null ? false : currentHighlightedSpan.Value.Contains(i);
#pragma warning restore IDE0075
if (newBold != currentBold || newHighlighted != currentHighlighted)
{
@ -301,11 +307,13 @@ namespace Microsoft.Management.UI.Internal
/// <param name="propertyName">Property name.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.s
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}
/// <summary>

View File

@ -3,6 +3,7 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls.Primitives;
@ -79,6 +80,7 @@ namespace Microsoft.Management.UI.Internal
}
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void SetFocus(UIElement element)
{
if (element.Focusable)

View File

@ -109,7 +109,7 @@ namespace Microsoft.Management.UI.Internal
/// <returns>True if a control is is pressed.</returns>
public static bool IsControlPressed()
{
if (ModifierKeys.Control == (Keyboard.Modifiers & ModifierKeys.Control))
if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
{
return true;
}

View File

@ -35,7 +35,9 @@ namespace Microsoft.Management.UI.Internal
{
get
{
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
return (this.renameButton != null) ? this.renameButton.IsChecked.Value : false;
#pragma warning restore IDE0075
}
}

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.Management.UI.Internal
{
@ -97,6 +98,8 @@ namespace Microsoft.Management.UI.Internal
#endregion IAsyncProgress
#region Private Methods
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
private void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
{
NotifyCollectionChangedEventHandler eh = this.CollectionChanged;
@ -117,6 +120,8 @@ namespace Microsoft.Management.UI.Internal
}
}
#pragma warning restore IDE1005
// forward CollectionChanged events from the base list to our listeners
private void HandleCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{

View File

@ -4,6 +4,7 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
@ -202,6 +203,7 @@ namespace Microsoft.Management.UI.Internal
return this.GetConstrainedValue(newWidth, this.MaxWidth, this.MinWidth);
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private double GetHorizontalDelta(ResizeGripLocation location, double horzDelta)
{
double realDelta;
@ -219,6 +221,7 @@ namespace Microsoft.Management.UI.Internal
return realDelta;
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private double GetConstrainedValue(double value, double max, double min)
{
return Math.Min(max, Math.Max(value, min));

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
@ -196,6 +197,7 @@ namespace Microsoft.Management.UI.Internal
#region Helpers
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool TryGetGenericParameterForComparableValueFilterRule(FilterRule rule, out Type genericParameter)
{
genericParameter = null;
@ -217,6 +219,7 @@ namespace Microsoft.Management.UI.Internal
return true;
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private object GetValueFromValidatingValue(FilterRule rule, string propertyName)
{
Debug.Assert(rule != null && !string.IsNullOrEmpty(propertyName), "rule and propertyname are not null");
@ -236,6 +239,7 @@ namespace Microsoft.Management.UI.Internal
return property.GetValue(validatingValue, null);
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void SetValueOnValidatingValue(FilterRule rule, string propertyName, object value)
{
Debug.Assert(rule != null && !string.IsNullOrEmpty(propertyName), "rule and propertyname are not null");

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.Management.UI.Internal
{
@ -173,6 +174,8 @@ namespace Microsoft.Management.UI.Internal
#region NotifyPropertyChanged
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
/// <summary>
/// Notifies listeners that a property has changed.
/// </summary>
@ -214,6 +217,8 @@ namespace Microsoft.Management.UI.Internal
}
}
#pragma warning restore IDE1005
private void FilterProvider_FilterExpressionChanged(object sender, EventArgs e)
{
// Update HasFilterExpression \\

View File

@ -2,6 +2,7 @@
// Licensed under the MIT License.
using System;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.Management.UI.Internal
{
@ -66,12 +67,14 @@ namespace Microsoft.Management.UI.Internal
/// </summary>
protected void NotifyEvaluationResultInvalidated()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
var eh = this.EvaluationResultInvalidated;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005
}
#endregion

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows.Data;
@ -214,12 +215,14 @@ namespace Microsoft.Management.UI.Internal
/// </param>
protected void NotifySelectedValueChanged(T oldValue, T newValue)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler<PropertyChangedEventArgs<T>> eh = this.SelectedValueChanged;
if (eh != null)
{
eh(this, new PropertyChangedEventArgs<T>(oldValue, newValue));
}
#pragma warning restore IDE1005
}
#endregion NotifySelectedValueChanged

View File

@ -3,6 +3,7 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace Microsoft.Management.UI.Internal
@ -190,6 +191,7 @@ namespace Microsoft.Management.UI.Internal
}
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool TryGetEnumValue(object rawValue, out T castValue)
{
Debug.Assert(rawValue != null, "rawValue not null");

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace Microsoft.Management.UI.Internal
@ -260,12 +261,14 @@ namespace Microsoft.Management.UI.Internal
/// </param>
protected void NotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler eh = this.PropertyChanged;
if (eh != null)
{
eh(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}
#endregion NotifyPropertyChanged

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Windows.Controls;
namespace Microsoft.Management.UI.Internal
@ -49,9 +50,11 @@ namespace Microsoft.Management.UI.Internal
partial void OnOkAddFilterRulesCanExecuteImplementation(System.Windows.Input.CanExecuteRoutedEventArgs e)
{
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
e.CanExecute = (this.AddFilterRulesCommand != null)
? CommandHelper.CanExecuteCommand(this.AddFilterRulesCommand, null, this.AddFilterRulesCommandTarget)
: false;
#pragma warning restore IDE0075
}
partial void OnOkAddFilterRulesExecutedImplementation(System.Windows.Input.ExecutedRoutedEventArgs e)

View File

@ -70,12 +70,14 @@ namespace Microsoft.Management.UI.Internal
/// </param>
protected void NotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler eh = this.PropertyChanged;
if (eh != null)
{
eh(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}
#endregion NotifyPropertyChanged

View File

@ -213,11 +213,13 @@ namespace Microsoft.Management.UI.Internal
/// </summary>
protected virtual void NotifyFilterExpressionChanged()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler eh = this.FilterExpressionChanged;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005
}
private void Controller_FilterExpressionChanged(object sender, EventArgs e)

View File

@ -266,11 +266,13 @@ namespace Microsoft.Management.UI.Internal
/// </summary>
protected virtual void NotifyFilterExpressionChanged()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler eh = this.FilterExpressionChanged;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005
}
#endregion Notify Filter Expression Changed

View File

@ -107,11 +107,15 @@ namespace Microsoft.Management.UI.Internal
{
Debug.Assert(!string.IsNullOrEmpty(propertyName), "not null");
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler eh = this.PropertyChanged;
if (eh != null)
{
eh(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005s
}
#endregion Public Methods

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using System.Windows.Data;
@ -69,6 +70,7 @@ namespace Microsoft.Management.UI.Internal
#region Helpers
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool IsOfTypeValidatingValue(object value)
{
Debug.Assert(value != null, "not null");
@ -92,6 +94,7 @@ namespace Microsoft.Management.UI.Internal
return value.GetType().GetGenericArguments()[0];
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private object GetBackgroundTextForType(Type inputType)
{
if (typeof(DateTime) == inputType)

View File

@ -60,11 +60,13 @@ namespace Microsoft.Management.UI.Internal
/// </summary>
protected virtual void NotifyFilterExpressionChanged()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler eh = this.FilterExpressionChanged;
if (eh != null)
{
eh(this, new EventArgs());
}
#pragma warning restore IDE1005s
}
#endregion

View File

@ -8,6 +8,7 @@ using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
using System.Windows;
@ -355,7 +356,7 @@ namespace Microsoft.Management.UI.Internal
{
base.OnKeyDown(e);
if ((Key.Left == e.Key || Key.Right == e.Key) &&
if ((e.Key == Key.Left || e.Key == Key.Right) &&
Keyboard.Modifiers == ModifierKeys.None)
{
// If pressing Left or Right on a column header, move the focus \\
@ -388,8 +389,8 @@ namespace Microsoft.Management.UI.Internal
throw new NotSupportedException(string.Format(
CultureInfo.InvariantCulture,
InvariantResources.ViewSetWithType,
typeof(GridView).Name,
typeof(InnerListGridView).Name));
nameof(GridView),
nameof(InnerListGridView)));
}
((InnerList)obj).innerGrid = innerGrid;
@ -401,12 +402,14 @@ namespace Microsoft.Management.UI.Internal
/// <returns>The exception to be thrown when using Items.</returns>
private static NotSupportedException GetItemsException()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
return new NotSupportedException(
string.Format(
CultureInfo.InvariantCulture,
InvariantResources.NotSupportAddingToItems,
typeof(InnerList).Name,
nameof(InnerList),
ItemsControl.ItemsSourceProperty.Name));
#pragma warning restore IDE1005s
}
#endregion static private methods
@ -605,6 +608,7 @@ namespace Microsoft.Management.UI.Internal
return entryText.ToString();
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void SetClipboardWithSelectedItemsText(string text)
{
if (string.IsNullOrEmpty(text))

View File

@ -6,6 +6,7 @@ using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Management.Automation;
namespace Microsoft.Management.UI.Internal
@ -88,6 +89,7 @@ namespace Microsoft.Management.UI.Internal
}
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private int CompareData(object firstValue, object secondValue, StringComparison stringComparison)
{
// If both values are null, do nothing; otherwise, if one is null promote the other \\

View File

@ -4,6 +4,7 @@
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace Microsoft.Management.UI.Internal
@ -110,6 +111,7 @@ namespace Microsoft.Management.UI.Internal
return descriptor;
}
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private bool TryGetPropertyValueInternal(PropertyDescriptor descriptor, object value, out object propertyValue)
{
propertyValue = null;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
@ -308,6 +309,7 @@ namespace Microsoft.Management.UI.Internal
#region View Manager Callbacks
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
partial void OnSaveViewCanExecuteImplementation(CanExecuteRoutedEventArgs e)
{
string viewName = (string)e.Parameter;

View File

@ -4,6 +4,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Management.Automation;
using System.Windows;
@ -344,6 +345,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// Creates a RowDefinition for MainGrid.
/// </summary>
/// <returns>Return a RowDefinition object.</returns>
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private RowDefinition CreateNewRow()
{
RowDefinition row = new RowDefinition();
@ -382,6 +384,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <param name="parameterViewModel">DataContext object.</param>
/// <param name="rowNumber">Row number.</param>
/// <returns>Return a Label control.</returns>
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private Label CreateLabel(ParameterViewModel parameterViewModel, int rowNumber)
{
Label label = new Label();

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Management.Automation;
@ -79,10 +80,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <param name="commands">Commands to show.</param>
public AllModulesViewModel(Dictionary<string, ShowCommandModuleInfo> importedModules, IEnumerable<ShowCommandCommandInfo> commands)
{
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
if (commands == null || !commands.GetEnumerator().MoveNext())
{
throw new ArgumentNullException("commands");
}
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
this.Initialization(importedModules, commands, true);
}
@ -400,11 +403,13 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// </summary>
internal void OnRefresh()
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
EventHandler<EventArgs> handler = this.Refresh;
if (handler != null)
{
handler(this, new EventArgs());
}
#pragma warning restore IDE1005s
}
#region Private Methods
@ -593,6 +598,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
this.OnSelectedCommandInSelectedModuleNeedsImportModule(e);
}
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
/// <summary>
/// Triggers SelectedCommandInSelectedModuleNeedsHelp.
/// </summary>
@ -654,6 +661,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
#pragma warning restore IDE1005s
#endregion
}
}

View File

@ -438,12 +438,12 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
builder.Append(commandName);
}
builder.Append(" ");
builder.Append(' ');
if (this.SelectedParameterSet != null)
{
builder.Append(this.SelectedParameterSet.GetScript());
builder.Append(" ");
builder.Append(' ');
}
if (this.CommonParameters != null)
@ -553,6 +553,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
return returnValue;
}
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
/// <summary>
/// Called to trigger the event fired when help is needed for the command.
/// </summary>
@ -628,6 +630,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
}
#pragma warning restore IDE1005
/// <summary>
/// Called when the PropertyChanged event is triggered on the SelectedParameterSet.
/// </summary>

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Management.Automation;
using System.Windows;
@ -76,6 +77,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
this.commands = new List<CommandViewModel>();
this.filteredCommands = new ObservableCollection<CommandViewModel>();
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
// This check looks to see if the given module name shows up in
// the set of modules that are known to be imported in the current
// session. In remote PowerShell sessions, the core cmdlet module
@ -86,6 +89,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
importedModules == null ? true : name.Length == 0 ||
importedModules.ContainsKey(name) ||
string.Equals("Microsoft.PowerShell.Core", name, StringComparison.OrdinalIgnoreCase);
#pragma warning restore IDE0075
}
#endregion
@ -372,6 +377,8 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
}
}
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
/// <summary>
/// Callled in response to a GUI event that requires the command to be run.
/// </summary>
@ -527,5 +534,7 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
#pragma warning restore IDE1005
}
}

View File

@ -369,11 +369,13 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}
/// <summary>

View File

@ -268,11 +268,13 @@ namespace Microsoft.PowerShell.Commands.ShowCommandInternal
/// <param name="propertyName">The changed property.</param>
private void OnNotifyPropertyChanged(string propertyName)
{
#pragma warning disable IDE1005 // IDE1005: Delegate invocation can be simplified.
PropertyChangedEventHandler handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
#pragma warning restore IDE1005
}
}
}

View File

@ -213,7 +213,7 @@ namespace Microsoft.Management.UI.Internal
if (this.zoomLevel < ZOOM_MAX)
{
this.zoomLevel = this.zoomLevel + ZOOM_INCREMENT;
this.zoomLevel += ZOOM_INCREMENT;
Grid g = this.gridViewWindow.Content as Grid;
if (g != null)
@ -232,7 +232,7 @@ namespace Microsoft.Management.UI.Internal
{
if (this.zoomLevel >= ZOOM_MIN)
{
this.zoomLevel = this.zoomLevel - ZOOM_INCREMENT;
this.zoomLevel -= ZOOM_INCREMENT;
Grid g = this.gridViewWindow.Content as Grid;
if (g != null)
{
@ -246,6 +246,7 @@ namespace Microsoft.Management.UI.Internal
/// </summary>
/// <param name="outputMode">Output mode of the out-gridview.</param>
/// <returns>A new ManagementList.</returns>
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private ManagementList CreateManagementList(string outputMode)
{
ManagementList newList = new ManagementList();

View File

@ -289,7 +289,7 @@ Function PSGetSerializedShowCommandInfo
}
/// <summary>
/// Finalizes an instance of the ShowCommandHelper class.
/// Finalizes an instance of the <see cref="ShowCommandHelper"/> class.
/// </summary>
~ShowCommandHelper()
{
@ -643,7 +643,9 @@ Function PSGetSerializedShowCommandInfo
ModuleViewModel moduleToSelect = returnValue.Modules.Find(
new Predicate<ModuleViewModel>((module) =>
{
return module.Name.Equals(selectedModuleNeedingImportModule, StringComparison.OrdinalIgnoreCase) ? true : false;
#pragma warning disable IDE0075 // IDE0075: Conditional expression can be simplified
return module.Name.Equals(selectedModuleNeedingImportModule, StringComparison.OrdinalIgnoreCase);
#pragma warning restore IDE0075
}));
if (moduleToSelect == null)
@ -657,7 +659,7 @@ Function PSGetSerializedShowCommandInfo
new Predicate<CommandViewModel>((command) =>
{
return command.ModuleName.Equals(parentModuleNeedingImportModule, StringComparison.OrdinalIgnoreCase) &&
command.Name.Equals(commandNeedingImportModule, StringComparison.OrdinalIgnoreCase) ? true : false;
command.Name.Equals(commandNeedingImportModule, StringComparison.OrdinalIgnoreCase);
}));
if (commandToSelect == null)
@ -750,7 +752,7 @@ Function PSGetSerializedShowCommandInfo
try
{
return property.GetValue(obj, new object[] { });
return property.GetValue(obj, Array.Empty<object>());
}
catch (ArgumentException)
{
@ -794,7 +796,7 @@ Function PSGetSerializedShowCommandInfo
try
{
property.SetValue(obj, value, new object[] { });
property.SetValue(obj, value, Array.Empty<object>());
}
catch (ArgumentException)
{
@ -1000,7 +1002,7 @@ Function PSGetSerializedShowCommandInfo
{
this.window.Dispatcher.Invoke(
new SendOrPostCallback(
delegate (object ignored)
delegate(object ignored)
{
this.allModulesViewModel = ShowCommandHelper.GetNewAllModulesViewModel(
this.allModulesViewModel,
@ -1050,7 +1052,7 @@ Function PSGetSerializedShowCommandInfo
{
this.window.Dispatcher.Invoke(
new SendOrPostCallback(
delegate (object ignored)
delegate(object ignored)
{
HelpWindow help = new HelpWindow(getHelpResults[0]);
help.Owner = this.window;
@ -1244,6 +1246,7 @@ Function PSGetSerializedShowCommandInfo
/// Showing a MessageBox when user type a invalidate command name.
/// </summary>
/// <param name="errorString">Error message.</param>
[SuppressMessage("Performance", "CA1822: Mark members as static", Justification = "Potential breaking change")]
private void ShowErrorString(string errorString)
{
if (errorString != null && errorString.Trim().Length > 0)

View File

@ -47,7 +47,7 @@
<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
</Project>

View File

@ -31,10 +31,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0-1.final" />
<PackageReference Include="System.Threading.AccessControl" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="NJsonSchema" Version="10.4.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0-3.final" />
<PackageReference Include="System.Threading.AccessControl" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="NJsonSchema" Version="10.4.3" />
</ItemGroup>
</Project>

View File

@ -8,7 +8,7 @@
<ItemGroup>
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.Diagnostics.EventLog" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Diagnostics.EventLog" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
</Project>

View File

@ -18,9 +18,9 @@
<!-- the following package(s) are from https://github.com/dotnet/fxdac -->
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.IO.Packaging" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.IO.Packaging" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0-preview.4.21253.7" />
<!-- the following package(s) are from https://github.com/dotnet/wcf -->
<PackageReference Include="System.ServiceModel.Duplex" Version="4.8.1" />
<PackageReference Include="System.ServiceModel.Http" Version="4.8.1" />
@ -30,7 +30,7 @@
<PackageReference Include="System.Private.ServiceModel" Version="4.8.1" />
<!-- the source could not be found for the following package(s) -->
<PackageReference Include="Microsoft.NETCore.Windows.ApiSets" Version="1.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@
<ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" />
<ProjectReference Include="..\Microsoft.WSMan.Runtime\Microsoft.WSMan.Runtime.csproj" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
<PropertyGroup>

View File

@ -16,16 +16,16 @@
<!-- the Application Insights package -->
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.17.0" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.DirectoryServices" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Management" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Security.Permissions" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.DirectoryServices" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Management" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Security.Permissions" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.4.21253.7" />
<!-- the following package(s) are from the powershell org -->
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="Microsoft.PowerShell.Native" Version="7.2.0-preview.1" />

View File

@ -310,8 +310,8 @@ namespace System.Management.Automation.ComInterop
private readonly GetMemberBinder _originalBinder;
internal bool _canReturnCallables;
internal ComGetMemberBinder(GetMemberBinder originalBinder, bool canReturnCallables) :
base(originalBinder.Name, originalBinder.IgnoreCase)
internal ComGetMemberBinder(GetMemberBinder originalBinder, bool canReturnCallables)
: base(originalBinder.Name, originalBinder.IgnoreCase)
{
_originalBinder = originalBinder;
_canReturnCallables = canReturnCallables;
@ -343,8 +343,8 @@ namespace System.Management.Automation.ComInterop
private readonly InvokeMemberBinder _originalBinder;
internal bool IsPropertySet;
internal ComInvokeMemberBinder(InvokeMemberBinder originalBinder, bool isPropertySet) :
base(originalBinder.Name, originalBinder.IgnoreCase, originalBinder.CallInfo)
internal ComInvokeMemberBinder(InvokeMemberBinder originalBinder, bool isPropertySet)
: base(originalBinder.Name, originalBinder.IgnoreCase, originalBinder.CallInfo)
{
_originalBinder = originalBinder;
this.IsPropertySet = isPropertySet;

View File

@ -95,7 +95,9 @@ namespace System.Management.Automation.ComInterop
}
internal int ParamCount { get; }
public Type ReturnType { get; set; }
public Type InputType { get; set; }
public ParameterInformation[] ParameterInformation

View File

@ -296,8 +296,15 @@ namespace System.Management.Automation.ComInterop
{
#region public members
public static unsafe IntPtr ConvertInt32ByrefToPtr(ref int value) { return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value); }
public static unsafe IntPtr ConvertVariantByrefToPtr(ref Variant value) { return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value); }
public static unsafe IntPtr ConvertInt32ByrefToPtr(ref int value)
{
return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value);
}
public static unsafe IntPtr ConvertVariantByrefToPtr(ref Variant value)
{
return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value);
}
internal static Variant GetVariantForObject(object obj)
{
@ -365,8 +372,7 @@ namespace System.Management.Automation.ComInterop
fixed (ExcepInfo* pExcepInfo = &excepInfo)
fixed (uint* pArgErr = &argErr)
{
var pfnIDispatchInvoke = (delegate* unmanaged<IntPtr, int, Guid*, int, ushort, ComTypes.DISPPARAMS*, Variant*, ExcepInfo*, uint*, int>)
(*(*(void***)dispatchPointer + 6 /* IDispatch.Invoke slot */));
var pfnIDispatchInvoke = (delegate* unmanaged<IntPtr, int, Guid*, int, ushort, ComTypes.DISPPARAMS*, Variant*, ExcepInfo*, uint*, int>)(*(*(void***)dispatchPointer + 6 /* IDispatch.Invoke slot */));
int hresult = pfnIDispatchInvoke(dispatchPointer,
memberDispId, &IID_NULL, 0, (ushort)flags, pDispParams, pResult, pExcepInfo, pArgErr);

View File

@ -24,8 +24,7 @@ namespace System.Management.Automation.ComInterop
return Activator.CreateInstance(Type.GetTypeFromCLSID(Guid));
}
internal ComTypeClassDesc(ComTypes.ITypeInfo typeInfo, ComTypeLibDesc typeLibDesc) :
base(typeInfo, typeLibDesc)
internal ComTypeClassDesc(ComTypes.ITypeInfo typeInfo, ComTypeLibDesc typeLibDesc) : base(typeInfo, typeLibDesc)
{
ComTypes.TYPEATTR typeAttr = ComRuntimeHelpers.GetTypeAttrForTypeInfo(typeInfo);
Guid = typeAttr.guid;

View File

@ -118,6 +118,7 @@ namespace System.Management.Automation.ComInterop
method = null;
return false;
}
internal void AddPutRef(string name, ComMethodDesc method)
{
name = name.ToUpper(System.Globalization.CultureInfo.InvariantCulture);

View File

@ -20,8 +20,7 @@ namespace System.Management.Automation.ComInterop
return string.Format(CultureInfo.CurrentCulture, "<enum '{0}'>", TypeName);
}
internal ComTypeEnumDesc(ComTypes.ITypeInfo typeInfo, ComTypeLibDesc typeLibDesc) :
base(typeInfo, typeLibDesc)
internal ComTypeEnumDesc(ComTypes.ITypeInfo typeInfo, ComTypeLibDesc typeLibDesc) : base(typeInfo, typeLibDesc)
{
ComTypes.TYPEATTR typeAttr = ComRuntimeHelpers.GetTypeAttrForTypeInfo(typeInfo);
string[] memberNames = new string[typeAttr.cVars];

View File

@ -343,6 +343,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_I1);
return _typeUnion._unionTypes._i1;
}
set
{
Debug.Assert(IsEmpty);
@ -360,6 +361,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_I2);
return _typeUnion._unionTypes._i2;
}
set
{
Debug.Assert(IsEmpty);
@ -377,6 +379,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_I4);
return _typeUnion._unionTypes._i4;
}
set
{
Debug.Assert(IsEmpty);
@ -394,6 +397,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_I8);
return _typeUnion._unionTypes._i8;
}
set
{
Debug.Assert(IsEmpty);
@ -411,6 +415,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_UI1);
return _typeUnion._unionTypes._ui1;
}
set
{
Debug.Assert(IsEmpty);
@ -428,6 +433,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_UI2);
return _typeUnion._unionTypes._ui2;
}
set
{
Debug.Assert(IsEmpty);
@ -445,6 +451,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_UI4);
return _typeUnion._unionTypes._ui4;
}
set
{
Debug.Assert(IsEmpty);
@ -462,6 +469,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_UI8);
return _typeUnion._unionTypes._ui8;
}
set
{
Debug.Assert(IsEmpty);
@ -479,6 +487,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_INT);
return _typeUnion._unionTypes._int;
}
set
{
Debug.Assert(IsEmpty);
@ -496,6 +505,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_UINT);
return _typeUnion._unionTypes._uint;
}
set
{
Debug.Assert(IsEmpty);
@ -513,6 +523,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_BOOL);
return _typeUnion._unionTypes._bool != 0;
}
set
{
Debug.Assert(IsEmpty);
@ -532,6 +543,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_ERROR);
return _typeUnion._unionTypes._error;
}
set
{
Debug.Assert(IsEmpty);
@ -549,6 +561,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_R4);
return _typeUnion._unionTypes._r4;
}
set
{
Debug.Assert(IsEmpty);
@ -566,6 +579,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_R8);
return _typeUnion._unionTypes._r8;
}
set
{
Debug.Assert(IsEmpty);
@ -586,6 +600,7 @@ namespace System.Management.Automation.InteropServices
v._typeUnion._vt = 0;
return v._decimal;
}
set
{
Debug.Assert(IsEmpty);
@ -605,6 +620,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_CY);
return decimal.FromOACurrency(_typeUnion._unionTypes._cy);
}
set
{
Debug.Assert(IsEmpty);
@ -622,6 +638,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_DATE);
return DateTime.FromOADate(_typeUnion._unionTypes._date);
}
set
{
Debug.Assert(IsEmpty);
@ -639,6 +656,7 @@ namespace System.Management.Automation.InteropServices
Debug.Assert(VariantType == VarEnum.VT_BSTR);
return (string)Marshal.PtrToStringBSTR(this._typeUnion._unionTypes._bstr);
}
set
{
Debug.Assert(IsEmpty);
@ -660,6 +678,7 @@ namespace System.Management.Automation.InteropServices
}
return Marshal.GetObjectForIUnknown(_typeUnion._unionTypes._unknown);
}
set
{
Debug.Assert(IsEmpty);
@ -688,6 +707,7 @@ namespace System.Management.Automation.InteropServices
}
return Marshal.GetObjectForIUnknown(_typeUnion._unionTypes._dispatch);
}
set
{
Debug.Assert(IsEmpty);

View File

@ -24,6 +24,7 @@ namespace System.Management.Automation.ComInterop
}
public delegate object InvokeDelegate(object[] args);
internal object Invoke(object[] args)
{
Debug.Assert(args != null);

View File

@ -38,6 +38,7 @@ namespace System.Management.Automation.ComInterop
}
return false;
}
//CONFORMING
internal static bool AreAssignable(Type dest, Type src)
{

View File

@ -16,6 +16,7 @@ namespace System.Management.Automation.ComInterop
private MemberExpression _variant;
private readonly ArgBuilder _argBuilder;
private readonly VarEnum _targetComType;
internal ParameterExpression TempVariable { get; private set; }
internal VariantBuilder(VarEnum targetComType, ArgBuilder builder)

View File

@ -92,7 +92,10 @@ namespace Microsoft.PowerShell.Commands
ParameterSetName = ConnectPSSessionCommand.ComputerNameGuidParameterSet)]
public string ApplicationName
{
get { return _appName; }
get
{
return _appName;
}
set
{
@ -117,7 +120,10 @@ namespace Microsoft.PowerShell.Commands
ParameterSetName = ConnectPSSessionCommand.ConnectionUriGuidParameterSet)]
public string ConfigurationName
{
get { return _shell; }
get
{
return _shell;
}
set
{
@ -202,7 +208,10 @@ namespace Microsoft.PowerShell.Commands
[Credential()]
public PSCredential Credential
{
get { return _psCredential; }
get
{
return _psCredential;
}
set
{
@ -223,7 +232,10 @@ namespace Microsoft.PowerShell.Commands
[Parameter(ParameterSetName = ConnectPSSessionCommand.ConnectionUriGuidParameterSet)]
public AuthenticationMechanism Authentication
{
get { return _authentication; }
get
{
return _authentication;
}
set
{
@ -245,7 +257,10 @@ namespace Microsoft.PowerShell.Commands
[Parameter(ParameterSetName = ConnectPSSessionCommand.ConnectionUriGuidParameterSet)]
public string CertificateThumbprint
{
get { return _thumbprint; }
get
{
return _thumbprint;
}
set
{

View File

@ -1962,7 +1962,10 @@ else
[Parameter(Position = 1, Mandatory = true, ParameterSetName = PSSessionConfigurationCommandBase.AssemblyNameParameterSetName)]
public string AssemblyName
{
get { return assemblyName; }
get
{
return assemblyName;
}
set
{
@ -1984,7 +1987,10 @@ else
[Parameter(ParameterSetName = AssemblyNameParameterSetName)]
public string ApplicationBase
{
get { return applicationBase; }
get
{
return applicationBase;
}
set
{
@ -2004,7 +2010,10 @@ else
[Parameter(Position = 2, Mandatory = true, ParameterSetName = PSSessionConfigurationCommandBase.AssemblyNameParameterSetName)]
public string ConfigurationTypeName
{
get { return configurationTypeName; }
get
{
return configurationTypeName;
}
set
{
@ -2053,7 +2062,10 @@ else
return ApartmentState.Unknown;
}
set { threadAptState = value; }
set
{
threadAptState = value;
}
}
internal ApartmentState? threadAptState;
@ -2074,7 +2086,10 @@ else
return PSThreadOptions.UseCurrentThread;
}
set { threadOptions = value; }
set
{
threadOptions = value;
}
}
internal PSThreadOptions? threadOptions;
@ -2085,7 +2100,10 @@ else
[Parameter]
public PSSessionConfigurationAccessMode AccessMode
{
get { return _accessMode; }
get
{
return _accessMode;
}
set
{
@ -2124,7 +2142,10 @@ else
[Parameter()]
public string StartupScript
{
get { return configurationScript; }
get
{
return configurationScript;
}
set
{
@ -2144,7 +2165,10 @@ else
[AllowNull]
public double? MaximumReceivedDataSizePerCommandMB
{
get { return maxCommandSizeMB; }
get
{
return maxCommandSizeMB;
}
set
{
@ -2171,7 +2195,10 @@ else
[AllowNull]
public double? MaximumReceivedObjectSizeMB
{
get { return maxObjectSizeMB; }
get
{
return maxObjectSizeMB;
}
set
{
@ -2198,7 +2225,10 @@ else
[Parameter()]
public string SecurityDescriptorSddl
{
get { return sddl; }
get
{
return sddl;
}
set
{
@ -2228,7 +2258,10 @@ else
[Parameter()]
public SwitchParameter ShowSecurityDescriptorUI
{
get { return _showUI; }
get
{
return _showUI;
}
set
{
@ -2280,7 +2313,10 @@ else
[ValidateNotNullOrEmpty]
public Version PSVersion
{
get { return psVersion; }
get
{
return psVersion;
}
set
{

View File

@ -140,7 +140,10 @@ namespace Microsoft.PowerShell.Commands
RunspaceConnectionInfo.DefaultOpenTimeout;
}
set { _openTimeout = value; }
set
{
_openTimeout = value;
}
}
private int? _openTimeout;
@ -165,7 +168,10 @@ namespace Microsoft.PowerShell.Commands
BaseTransportManager.ClientCloseTimeoutMs;
}
set { _cancelTimeout = value; }
set
{
_cancelTimeout = value;
}
}
private int? _cancelTimeout;
@ -187,7 +193,10 @@ namespace Microsoft.PowerShell.Commands
: RunspaceConnectionInfo.DefaultIdleTimeout;
}
set { _idleTimeout = value; }
set
{
_idleTimeout = value;
}
}
private int? _idleTimeout;
@ -294,7 +303,10 @@ namespace Microsoft.PowerShell.Commands
BaseTransportManager.ClientDefaultOperationTimeoutMs);
}
set { _operationtimeout = value; }
set
{
_operationtimeout = value;
}
}
private int? _operationtimeout;
@ -308,7 +320,10 @@ namespace Microsoft.PowerShell.Commands
[Parameter]
public SwitchParameter NoEncryption
{
get { return _noencryption; }
get
{
return _noencryption;
}
set
{
@ -327,7 +342,10 @@ namespace Microsoft.PowerShell.Commands
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "UTF")]
public SwitchParameter UseUTF16
{
get { return _useutf16; }
get
{
return _useutf16;
}
set
{

View File

@ -125,7 +125,10 @@ namespace Microsoft.PowerShell.Commands
ParameterSetName = ReceivePSSessionCommand.ComputerInstanceIdParameterSet)]
public string ApplicationName
{
get { return _appName; }
get
{
return _appName;
}
set
{
@ -150,7 +153,10 @@ namespace Microsoft.PowerShell.Commands
ParameterSetName = ReceivePSSessionCommand.ConnectionUriInstanceIdParameterSet)]
public string ConfigurationName
{
get { return _shell; }
get
{
return _shell;
}
set
{
@ -257,7 +263,10 @@ namespace Microsoft.PowerShell.Commands
[Credential()]
public PSCredential Credential
{
get { return _psCredential; }
get
{
return _psCredential;
}
set
{
@ -278,7 +287,10 @@ namespace Microsoft.PowerShell.Commands
[Parameter(ParameterSetName = ReceivePSSessionCommand.ConnectionUriInstanceIdParameterSet)]
public AuthenticationMechanism Authentication
{
get { return _authentication; }
get
{
return _authentication;
}
set
{
@ -300,7 +312,10 @@ namespace Microsoft.PowerShell.Commands
[Parameter(ParameterSetName = ReceivePSSessionCommand.ConnectionUriInstanceIdParameterSet)]
public string CertificateThumbprint
{
get { return _thumbprint; }
get
{
return _thumbprint;
}
set
{

View File

@ -470,10 +470,11 @@ namespace Microsoft.PowerShell.Commands
// The placeholder mode management APIs Rtl(Set|Query)(Process|Thread)PlaceholderCompatibilityMode
// are only supported starting with Windows 10 version 1803 (build 17134)
Version minBuildForPlaceHolderAPIs = new Version(10, 0, 17134, 0);
if (Environment.OSVersion.Version >= minBuildForPlaceHolderAPIs)
{
// let's be safe, don't change the PlaceHolderCompatibilityMode if the current one is not what we expect
if (NativeMethods.PHCM_DISGUISE_PLACEHOLDER == NativeMethods.RtlQueryProcessPlaceholderCompatibilityMode())
if (NativeMethods.RtlQueryProcessPlaceholderCompatibilityMode() == NativeMethods.PHCM_DISGUISE_PLACEHOLDER)
{
NativeMethods.RtlSetProcessPlaceholderCompatibilityMode(NativeMethods.PHCM_EXPOSE_PLACEHOLDERS);
}
@ -8387,9 +8388,11 @@ namespace Microsoft.PowerShell.Commands
}
inodeData = (0, 0);
return false;
}
#endif
internal static bool IsHardLink(ref IntPtr handle)
{
#if UNIX

View File

@ -1189,7 +1189,7 @@ namespace System.Management.Automation.Tracing
PSKeyword.UseAlwaysAnalytic,
className, methodName, workflowId.ToString(),
parameters == null ? message : StringUtil.Format(message, parameters),
sb.ToString(),// Job
sb.ToString(), // Job
string.Empty, // Activity name
string.Empty, // Activity GUID
string.Empty);

View File

@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
</Project>

View File

@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-preview.3.21201.13" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-preview.4.21253.5" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
<ItemGroup>

View File

@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="Microsoft.PowerShell.MarkdownRender" Version="7.2.0-preview.2" />
</ItemGroup>
</Project>

View File

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Security.Principal.Windows" Version="6.0.0-preview.3.21201.4" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.4.21253.7" />
<PackageReference Include="System.Security.Principal.Windows" Version="6.0.0-preview.4.21253.7" />
</ItemGroup>
</Project>