mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Convert tab indentations to spaces in *.cs files (#3551)
Prepare to pass meta test.
This commit is contained in:
@@ -121,7 +121,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
/// prompt message
|
||||
/// </summary>
|
||||
public string Message
|
||||
{
|
||||
{
|
||||
get
|
||||
{
|
||||
return message;
|
||||
|
||||
@@ -5,248 +5,248 @@ using Microsoft.PowerShell.CoreClr.Stubs;
|
||||
|
||||
namespace System.Diagnostics
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether the performance counter category can have multiple instances.
|
||||
/// </summary>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
public enum PerformanceCounterCategoryType
|
||||
{
|
||||
/// <summary>
|
||||
/// The instance functionality for the performance counter category is unknown.
|
||||
/// </summary>
|
||||
Unknown = -1,
|
||||
/// <summary>
|
||||
/// Indicates whether the performance counter category can have multiple instances.
|
||||
/// </summary>
|
||||
/// <filterpriority>1</filterpriority>
|
||||
public enum PerformanceCounterCategoryType
|
||||
{
|
||||
/// <summary>
|
||||
/// The instance functionality for the performance counter category is unknown.
|
||||
/// </summary>
|
||||
Unknown = -1,
|
||||
|
||||
/// <summary>
|
||||
/// The performance counter category can have only a single instance.
|
||||
/// </summary>
|
||||
SingleInstance,
|
||||
/// <summary>
|
||||
/// The performance counter category can have only a single instance.
|
||||
/// </summary>
|
||||
SingleInstance,
|
||||
|
||||
/// <summary>
|
||||
/// The performance counter category can have multiple instances.
|
||||
/// </summary>
|
||||
MultiInstance
|
||||
}
|
||||
/// <summary>
|
||||
/// The performance counter category can have multiple instances.
|
||||
/// </summary>
|
||||
MultiInstance
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the formula used to calculate the <see cref="M:System.Diagnostics.PerformanceCounter.NextValue" />
|
||||
/// method for a <see cref="T:System.Diagnostics.PerformanceCounter" /> instance.
|
||||
/// </summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
public enum PerformanceCounterType
|
||||
{
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value.
|
||||
/// Used, for example, to maintain a simple count of items or operations.
|
||||
/// </summary>
|
||||
NumberOfItems32 = 65536,
|
||||
/// <summary>
|
||||
/// Specifies the formula used to calculate the <see cref="M:System.Diagnostics.PerformanceCounter.NextValue" />
|
||||
/// method for a <see cref="T:System.Diagnostics.PerformanceCounter" /> instance.
|
||||
/// </summary>
|
||||
/// <filterpriority>2</filterpriority>
|
||||
public enum PerformanceCounterType
|
||||
{
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value.
|
||||
/// Used, for example, to maintain a simple count of items or operations.
|
||||
/// </summary>
|
||||
NumberOfItems32 = 65536,
|
||||
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value.
|
||||
/// Used, for example, to maintain a simple count of a very large number
|
||||
/// of items or operations. It is the same as NumberOfItems32 except that
|
||||
/// it uses larger fields to accommodate larger values.
|
||||
/// </summary>
|
||||
NumberOfItems64 = 65792,
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value.
|
||||
/// Used, for example, to maintain a simple count of a very large number
|
||||
/// of items or operations. It is the same as NumberOfItems32 except that
|
||||
/// it uses larger fields to accommodate larger values.
|
||||
/// </summary>
|
||||
NumberOfItems64 = 65792,
|
||||
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value
|
||||
/// in hexadecimal format. Used, for example, to maintain a simple count
|
||||
/// of items or operations.</summary>
|
||||
NumberOfItemsHEX32 = 0,
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value
|
||||
/// in hexadecimal format. Used, for example, to maintain a simple count
|
||||
/// of items or operations.</summary>
|
||||
NumberOfItemsHEX32 = 0,
|
||||
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value.
|
||||
/// Used, for example, to maintain a simple count of a very large number
|
||||
/// of items or operations. It is the same as NumberOfItemsHEX32 except
|
||||
/// that it uses larger fields to accommodate larger values.
|
||||
/// </summary>
|
||||
NumberOfItemsHEX64 = 256,
|
||||
/// <summary>
|
||||
/// An instantaneous counter that shows the most recently observed value.
|
||||
/// Used, for example, to maintain a simple count of a very large number
|
||||
/// of items or operations. It is the same as NumberOfItemsHEX32 except
|
||||
/// that it uses larger fields to accommodate larger values.
|
||||
/// </summary>
|
||||
NumberOfItemsHEX64 = 256,
|
||||
|
||||
/// <summary>
|
||||
/// A difference counter that shows the average number of operations completed
|
||||
/// during each second of the sample interval. Counters of this type measure
|
||||
/// time in ticks of the system clock.</summary>
|
||||
RateOfCountsPerSecond32 = 272696320,
|
||||
/// <summary>
|
||||
/// A difference counter that shows the average number of operations completed
|
||||
/// during each second of the sample interval. Counters of this type measure
|
||||
/// time in ticks of the system clock.</summary>
|
||||
RateOfCountsPerSecond32 = 272696320,
|
||||
|
||||
/// <summary>
|
||||
/// A difference counter that shows the average number of operations completed
|
||||
/// during each second of the sample interval. Counters of this type measure
|
||||
/// time in ticks of the system clock. This counter type is the same as the
|
||||
/// RateOfCountsPerSecond32 type, but it uses larger fields to accommodate
|
||||
/// larger values to track a high-volume number of items or operations per
|
||||
/// second, such as a byte-transmission rate.
|
||||
/// </summary>
|
||||
RateOfCountsPerSecond64 = 272696576,
|
||||
/// <summary>
|
||||
/// A difference counter that shows the average number of operations completed
|
||||
/// during each second of the sample interval. Counters of this type measure
|
||||
/// time in ticks of the system clock. This counter type is the same as the
|
||||
/// RateOfCountsPerSecond32 type, but it uses larger fields to accommodate
|
||||
/// larger values to track a high-volume number of items or operations per
|
||||
/// second, such as a byte-transmission rate.
|
||||
/// </summary>
|
||||
RateOfCountsPerSecond64 = 272696576,
|
||||
|
||||
/// <summary>
|
||||
/// An average counter designed to monitor the average length of a queue
|
||||
/// to a resource over time. It shows the difference between the queue
|
||||
/// lengths observed during the last two sample intervals divided by the
|
||||
/// duration of the interval. This type of counter is typically used to
|
||||
/// track the number of items that are queued or waiting.
|
||||
/// </summary>
|
||||
CountPerTimeInterval32 = 4523008,
|
||||
/// <summary>
|
||||
/// An average counter designed to monitor the average length of a queue
|
||||
/// to a resource over time. It shows the difference between the queue
|
||||
/// lengths observed during the last two sample intervals divided by the
|
||||
/// duration of the interval. This type of counter is typically used to
|
||||
/// track the number of items that are queued or waiting.
|
||||
/// </summary>
|
||||
CountPerTimeInterval32 = 4523008,
|
||||
|
||||
/// <summary>
|
||||
/// An average counter that monitors the average length of a queue to a
|
||||
/// resource over time. Counters of this type display the difference
|
||||
/// between the queue lengths observed during the last two sample intervals,
|
||||
/// divided by the duration of the interval. This counter type is the same
|
||||
/// as CountPerTimeInterval32 except that it uses larger fields to
|
||||
/// accommodate larger values. This type of counter is typically used
|
||||
/// to track a high-volume or very large number of items that are queued or waiting.
|
||||
/// </summary>
|
||||
CountPerTimeInterval64 = 4523264,
|
||||
/// <summary>
|
||||
/// An average counter that monitors the average length of a queue to a
|
||||
/// resource over time. Counters of this type display the difference
|
||||
/// between the queue lengths observed during the last two sample intervals,
|
||||
/// divided by the duration of the interval. This counter type is the same
|
||||
/// as CountPerTimeInterval32 except that it uses larger fields to
|
||||
/// accommodate larger values. This type of counter is typically used
|
||||
/// to track a high-volume or very large number of items that are queued or waiting.
|
||||
/// </summary>
|
||||
CountPerTimeInterval64 = 4523264,
|
||||
|
||||
/// <summary>
|
||||
/// An instantaneous percentage counter that shows the ratio of a subset
|
||||
/// to its set as a percentage. For example, it compares the number of bytes
|
||||
/// in use on a disk to the total number of bytes on the disk.
|
||||
/// Counters of this type display the current percentage only, not an average
|
||||
/// over time.
|
||||
/// </summary>
|
||||
RawFraction = 537003008,
|
||||
/// <summary>
|
||||
/// An instantaneous percentage counter that shows the ratio of a subset
|
||||
/// to its set as a percentage. For example, it compares the number of bytes
|
||||
/// in use on a disk to the total number of bytes on the disk.
|
||||
/// Counters of this type display the current percentage only, not an average
|
||||
/// over time.
|
||||
/// </summary>
|
||||
RawFraction = 537003008,
|
||||
|
||||
/// <summary>
|
||||
/// A base counter that stores the denominator of a counter that presents a
|
||||
/// general arithmetic fraction. Check that this value is greater than zero
|
||||
/// before using it as the denominator in a RawFraction value calculation.
|
||||
/// </summary>
|
||||
RawBase = 1073939459,
|
||||
/// <summary>
|
||||
/// A base counter that stores the denominator of a counter that presents a
|
||||
/// general arithmetic fraction. Check that this value is greater than zero
|
||||
/// before using it as the denominator in a RawFraction value calculation.
|
||||
/// </summary>
|
||||
RawBase = 1073939459,
|
||||
|
||||
/// <summary>
|
||||
/// An average counter that measures the time it takes, on average, to
|
||||
/// complete a process or operation. Counters of this type display a
|
||||
/// ratio of the total elapsed time of the sample interval to the number
|
||||
/// of processes or operations completed during that time. This counter
|
||||
/// type measures time in ticks of the system clock.
|
||||
/// </summary>
|
||||
AverageTimer32 = 805438464,
|
||||
/// <summary>
|
||||
/// An average counter that measures the time it takes, on average, to
|
||||
/// complete a process or operation. Counters of this type display a
|
||||
/// ratio of the total elapsed time of the sample interval to the number
|
||||
/// of processes or operations completed during that time. This counter
|
||||
/// type measures time in ticks of the system clock.
|
||||
/// </summary>
|
||||
AverageTimer32 = 805438464,
|
||||
|
||||
/// <summary>
|
||||
/// A base counter that is used in the calculation of time or count averages,
|
||||
/// such as AverageTimer32 and AverageCount64. Stores the denominator for
|
||||
/// calculating a counter to present "time per operation" or "count per operation".
|
||||
/// </summary>
|
||||
AverageBase = 1073939458,
|
||||
/// <summary>
|
||||
/// A base counter that is used in the calculation of time or count averages,
|
||||
/// such as AverageTimer32 and AverageCount64. Stores the denominator for
|
||||
/// calculating a counter to present "time per operation" or "count per operation".
|
||||
/// </summary>
|
||||
AverageBase = 1073939458,
|
||||
|
||||
/// <summary>
|
||||
/// An average counter that shows how many items are processed, on average,
|
||||
/// during an operation. Counters of this type display a ratio of the items
|
||||
/// processed to the number of operations completed. The ratio is calculated
|
||||
/// by comparing the number of items processed during the last interval to
|
||||
/// the number of operations completed during the last interval.
|
||||
/// </summary>
|
||||
AverageCount64 = 1073874176,
|
||||
/// <summary>
|
||||
/// An average counter that shows how many items are processed, on average,
|
||||
/// during an operation. Counters of this type display a ratio of the items
|
||||
/// processed to the number of operations completed. The ratio is calculated
|
||||
/// by comparing the number of items processed during the last interval to
|
||||
/// the number of operations completed during the last interval.
|
||||
/// </summary>
|
||||
AverageCount64 = 1073874176,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the average ratio of hits to all
|
||||
/// operations during the last two sample intervals.
|
||||
/// </summary>
|
||||
SampleFraction = 549585920,
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the average ratio of hits to all
|
||||
/// operations during the last two sample intervals.
|
||||
/// </summary>
|
||||
SampleFraction = 549585920,
|
||||
|
||||
/// <summary>
|
||||
/// An average counter that shows the average number of operations completed
|
||||
/// in one second. When a counter of this type samples the data, each sampling
|
||||
/// interrupt returns one or zero. The counter data is the number of ones that
|
||||
/// were sampled. It measures time in units of ticks of the system performance timer.
|
||||
/// </summary>
|
||||
SampleCounter = 4260864,
|
||||
/// <summary>
|
||||
/// An average counter that shows the average number of operations completed
|
||||
/// in one second. When a counter of this type samples the data, each sampling
|
||||
/// interrupt returns one or zero. The counter data is the number of ones that
|
||||
/// were sampled. It measures time in units of ticks of the system performance timer.
|
||||
/// </summary>
|
||||
SampleCounter = 4260864,
|
||||
|
||||
/// <summary>
|
||||
/// A base counter that stores the number of sampling interrupts taken
|
||||
/// and is used as a denominator in the sampling fraction. The sampling
|
||||
/// fraction is the number of samples that were 1 (or true) for a sample
|
||||
/// interrupt. Check that this value is greater than zero before using
|
||||
/// it as the denominator in a calculation of SampleFraction.
|
||||
/// </summary>
|
||||
SampleBase = 1073939457,
|
||||
/// <summary>
|
||||
/// A base counter that stores the number of sampling interrupts taken
|
||||
/// and is used as a denominator in the sampling fraction. The sampling
|
||||
/// fraction is the number of samples that were 1 (or true) for a sample
|
||||
/// interrupt. Check that this value is greater than zero before using
|
||||
/// it as the denominator in a calculation of SampleFraction.
|
||||
/// </summary>
|
||||
SampleBase = 1073939457,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the average time that a component is
|
||||
/// active as a percentage of the total sample time.
|
||||
/// </summary>
|
||||
CounterTimer = 541132032,
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the average time that a component is
|
||||
/// active as a percentage of the total sample time.
|
||||
/// </summary>
|
||||
CounterTimer = 541132032,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that displays the average percentage of active
|
||||
/// time observed during sample interval. The value of these counters is
|
||||
/// calculated by monitoring the percentage of time that the service was
|
||||
/// inactive and then subtracting that value from 100 percent.
|
||||
/// </summary>
|
||||
CounterTimerInverse = 557909248,
|
||||
/// <summary>
|
||||
/// A percentage counter that displays the average percentage of active
|
||||
/// time observed during sample interval. The value of these counters is
|
||||
/// calculated by monitoring the percentage of time that the service was
|
||||
/// inactive and then subtracting that value from 100 percent.
|
||||
/// </summary>
|
||||
CounterTimerInverse = 557909248,
|
||||
|
||||
/// <summary>A percentage counter that shows the active time of a component
|
||||
/// as a percentage of the total elapsed time of the sample interval.
|
||||
/// It measures time in units of 100 nanoseconds (ns). Counters of this
|
||||
/// type are designed to measure the activity of one component at a time.
|
||||
/// </summary>
|
||||
Timer100Ns = 542180608,
|
||||
/// <summary>A percentage counter that shows the active time of a component
|
||||
/// as a percentage of the total elapsed time of the sample interval.
|
||||
/// It measures time in units of 100 nanoseconds (ns). Counters of this
|
||||
/// type are designed to measure the activity of one component at a time.
|
||||
/// </summary>
|
||||
Timer100Ns = 542180608,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the average percentage of active time
|
||||
/// observed during the sample interval.
|
||||
/// </summary>
|
||||
Timer100NsInverse = 558957824,
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the average percentage of active time
|
||||
/// observed during the sample interval.
|
||||
/// </summary>
|
||||
Timer100NsInverse = 558957824,
|
||||
|
||||
/// <summary>
|
||||
/// A difference timer that shows the total time between when the component
|
||||
/// or process started and the time when this value is calculated.
|
||||
/// </summary>
|
||||
ElapsedTime = 807666944,
|
||||
/// <summary>
|
||||
/// A difference timer that shows the total time between when the component
|
||||
/// or process started and the time when this value is calculated.
|
||||
/// </summary>
|
||||
ElapsedTime = 807666944,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that displays the active time of one or more
|
||||
/// components as a percentage of the total time of the sample interval.
|
||||
/// Because the numerator records the active time of components operating
|
||||
/// simultaneously, the resulting percentage can exceed 100 percent.
|
||||
/// </summary>
|
||||
CounterMultiTimer = 574686464,
|
||||
/// <summary>
|
||||
/// A percentage counter that displays the active time of one or more
|
||||
/// components as a percentage of the total time of the sample interval.
|
||||
/// Because the numerator records the active time of components operating
|
||||
/// simultaneously, the resulting percentage can exceed 100 percent.
|
||||
/// </summary>
|
||||
CounterMultiTimer = 574686464,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the active time of one or more components
|
||||
/// as a percentage of the total time of the sample interval. It derives
|
||||
/// the active time by measuring the time that the components were not
|
||||
/// active and subtracting the result from 100 percent by the number of
|
||||
/// objects monitored.
|
||||
/// </summary>
|
||||
CounterMultiTimerInverse = 591463680,
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the active time of one or more components
|
||||
/// as a percentage of the total time of the sample interval. It derives
|
||||
/// the active time by measuring the time that the components were not
|
||||
/// active and subtracting the result from 100 percent by the number of
|
||||
/// objects monitored.
|
||||
/// </summary>
|
||||
CounterMultiTimerInverse = 591463680,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the active time of one or more components
|
||||
/// as a percentage of the total time of the sample interval. It measures
|
||||
/// time in 100 nanosecond (ns) units.</summary>
|
||||
CounterMultiTimer100Ns = 575735040,
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the active time of one or more components
|
||||
/// as a percentage of the total time of the sample interval. It measures
|
||||
/// time in 100 nanosecond (ns) units.</summary>
|
||||
CounterMultiTimer100Ns = 575735040,
|
||||
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the active time of one or more components
|
||||
/// as a percentage of the total time of the sample interval. Counters of
|
||||
/// this type measure time in 100 nanosecond (ns) units. They derive the
|
||||
/// active time by measuring the time that the components were not active
|
||||
/// and subtracting the result from multiplying 100 percent by the number
|
||||
/// of objects monitored.</summary>
|
||||
CounterMultiTimer100NsInverse = 592512256,
|
||||
/// <summary>
|
||||
/// A percentage counter that shows the active time of one or more components
|
||||
/// as a percentage of the total time of the sample interval. Counters of
|
||||
/// this type measure time in 100 nanosecond (ns) units. They derive the
|
||||
/// active time by measuring the time that the components were not active
|
||||
/// and subtracting the result from multiplying 100 percent by the number
|
||||
/// of objects monitored.</summary>
|
||||
CounterMultiTimer100NsInverse = 592512256,
|
||||
|
||||
/// <summary>
|
||||
/// A base counter that indicates the number of items sampled. It is used
|
||||
/// as the denominator in the calculations to get an average among the
|
||||
/// items sampled when taking timings of multiple, but similar items.
|
||||
/// Used with CounterMultiTimer, CounterMultiTimerInverse, CounterMultiTimer100Ns,
|
||||
/// and CounterMultiTimer100NsInverse.</summary>
|
||||
CounterMultiBase = 1107494144,
|
||||
/// <summary>
|
||||
/// A base counter that indicates the number of items sampled. It is used
|
||||
/// as the denominator in the calculations to get an average among the
|
||||
/// items sampled when taking timings of multiple, but similar items.
|
||||
/// Used with CounterMultiTimer, CounterMultiTimerInverse, CounterMultiTimer100Ns,
|
||||
/// and CounterMultiTimer100NsInverse.</summary>
|
||||
CounterMultiBase = 1107494144,
|
||||
|
||||
/// <summary>
|
||||
/// A difference counter that shows the change in the measured attribute
|
||||
/// between the two most recent sample intervals.
|
||||
/// </summary>
|
||||
CounterDelta32 = 4195328,
|
||||
/// <summary>
|
||||
/// A difference counter that shows the change in the measured attribute
|
||||
/// between the two most recent sample intervals.
|
||||
/// </summary>
|
||||
CounterDelta32 = 4195328,
|
||||
|
||||
/// <summary>
|
||||
/// A difference counter that shows the change in the measured attribute
|
||||
/// between the two most recent sample intervals. It is the same as the
|
||||
/// CounterDelta32 counter type except that is uses larger fields to
|
||||
/// accomodate larger values.</summary>
|
||||
CounterDelta64 = 4195584
|
||||
}
|
||||
/// <summary>
|
||||
/// A difference counter that shows the change in the measured attribute
|
||||
/// between the two most recent sample intervals. It is the same as the
|
||||
/// CounterDelta32 counter type except that is uses larger fields to
|
||||
/// accomodate larger values.</summary>
|
||||
CounterDelta64 = 4195584
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -291,7 +291,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (ShouldProcess(setClipboardShouldProcessTarget, "Set-Clipboard"))
|
||||
{
|
||||
// Set file list formats to clipboard.
|
||||
// Set file list formats to clipboard.
|
||||
Clipboard.Clear();
|
||||
StringCollection fileDropList = new StringCollection();
|
||||
fileDropList.AddRange(dropFiles.ToArray());
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
///
|
||||
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
|
||||
///
|
||||
/// PART_Picker - A required template part which must be of type PickerBase. This control provides basic functionality for Picker-like controls.
|
||||
/// PART_Picker - A required template part which must be of type PickerBase. This control provides basic functionality for Picker-like controls.
|
||||
///
|
||||
/// </remarks>
|
||||
[TemplatePart(Name="PART_Picker", Type=typeof(PickerBase))]
|
||||
|
||||
+4
-4
@@ -31,10 +31,10 @@ namespace Microsoft.Management.UI.Internal
|
||||
///
|
||||
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
|
||||
///
|
||||
/// PART_DeleteButton - A required template part which must be of type Button. Button which keeps track of whether the row should be deleted.
|
||||
/// PART_EditBox - A required template part which must be of type TextBox. Displays the text content in an editable manner.
|
||||
/// PART_LinkButton - A required template part which must be of type Button. Displays the text content in a read-only manner and allows single click selection.
|
||||
/// PART_RenameButton - A required template part which must be of type ToggleButton. Button which allows for editing the name of the item.
|
||||
/// PART_DeleteButton - A required template part which must be of type Button. Button which keeps track of whether the row should be deleted.
|
||||
/// PART_EditBox - A required template part which must be of type TextBox. Displays the text content in an editable manner.
|
||||
/// PART_LinkButton - A required template part which must be of type Button. Displays the text content in a read-only manner and allows single click selection.
|
||||
/// PART_RenameButton - A required template part which must be of type ToggleButton. Button which allows for editing the name of the item.
|
||||
///
|
||||
/// </remarks>
|
||||
[TemplatePart(Name="PART_DeleteButton", Type=typeof(Button))]
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ namespace Microsoft.Management.UI.Internal
|
||||
///
|
||||
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
|
||||
///
|
||||
/// PART_DropDown - A required template part which must be of type DismissiblePopup. The dropdown which hosts the picker.
|
||||
/// PART_DropDownButton - A required template part which must be of type ToggleButton. The ToggleButton which controls whether the dropdown is open.
|
||||
/// PART_DropDown - A required template part which must be of type DismissiblePopup. The dropdown which hosts the picker.
|
||||
/// PART_DropDownButton - A required template part which must be of type ToggleButton. The ToggleButton which controls whether the dropdown is open.
|
||||
///
|
||||
/// </remarks>
|
||||
[TemplatePart(Name="PART_DropDown", Type=typeof(DismissiblePopup))]
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ namespace Microsoft.Management.UI.Internal
|
||||
///
|
||||
/// If a custom template is provided for this control, then the template MUST provide the following template parts:
|
||||
///
|
||||
/// PART_LeftGrip - A required template part which must be of type Thumb. The grip on the left.
|
||||
/// PART_RightGrip - A required template part which must be of type Thumb. The grip on the right.
|
||||
/// PART_LeftGrip - A required template part which must be of type Thumb. The grip on the left.
|
||||
/// PART_RightGrip - A required template part which must be of type Thumb. The grip on the right.
|
||||
///
|
||||
/// </remarks>
|
||||
[TemplatePart(Name="PART_LeftGrip", Type=typeof(Thumb))]
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ namespace Microsoft.Management.UI.Internal
|
||||
return LanguagePrimitives.Compare(firstValue, secondValue);
|
||||
}
|
||||
|
||||
// otherwise compare them as strings
|
||||
// otherwise compare them as strings
|
||||
return string.Compare(firstValue.ToString(), secondValue.ToString(), stringComparison);
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -232,13 +232,13 @@ namespace Microsoft.PowerShell.Workflow
|
||||
{
|
||||
if (_powerShellActivitiesAreAllowed == null)
|
||||
{
|
||||
lock (_syncObject) {
|
||||
if (_powerShellActivitiesAreAllowed == null)
|
||||
{
|
||||
bool allowed = (AllowedActivity ?? new string[0]).Any(a => string.Equals(a, PSDefaultActivities, StringComparison.OrdinalIgnoreCase));
|
||||
_powerShellActivitiesAreAllowed = allowed;
|
||||
}
|
||||
}
|
||||
lock (_syncObject) {
|
||||
if (_powerShellActivitiesAreAllowed == null)
|
||||
{
|
||||
bool allowed = (AllowedActivity ?? new string[0]).Any(a => string.Equals(a, PSDefaultActivities, StringComparison.OrdinalIgnoreCase));
|
||||
_powerShellActivitiesAreAllowed = allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _powerShellActivitiesAreAllowed.Value;
|
||||
}
|
||||
|
||||
+3
-3
@@ -539,8 +539,8 @@ namespace Microsoft.PowerShell.Commands
|
||||
if (activityProcessIdleTimeoutSec != PSWorkflowConfigurationProvider.DefaultActivityProcessIdleTimeoutSec)
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenActivityProcessIdleTimeoutSec, activityProcessIdleTimeoutSec));
|
||||
|
||||
if (workflowApplicationPersistUnloadTimeoutSec != PSWorkflowConfigurationProvider.DefaultWorkflowApplicationPersistUnloadTimeoutSec)
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenWorkflowApplicationPersistUnloadTimeoutSec, workflowApplicationPersistUnloadTimeoutSec));
|
||||
if (workflowApplicationPersistUnloadTimeoutSec != PSWorkflowConfigurationProvider.DefaultWorkflowApplicationPersistUnloadTimeoutSec)
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenWorkflowApplicationPersistUnloadTimeoutSec, workflowApplicationPersistUnloadTimeoutSec));
|
||||
|
||||
if (wsmanPluginReportCompletionOnZeroActiveSessionsWaitIntervalMSec != PSWorkflowConfigurationProvider.DefaultWSManPluginReportCompletionOnZeroActiveSessionsWaitIntervalMSec)
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenWSManPluginReportCompletionOnZeroActiveSessionsWaitIntervalMSec, wsmanPluginReportCompletionOnZeroActiveSessionsWaitIntervalMSec));
|
||||
@@ -549,7 +549,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenActivitiesCacheCleanupIntervalMSec, activitiesCacheCleanupIntervalMSec));
|
||||
|
||||
if (remoteNodeSessionIdleTimeoutSec != PSWorkflowConfigurationProvider.DefaultRemoteNodeSessionIdleTimeoutSec)
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenRemoteNodeSessionIdleTimeoutSec, remoteNodeSessionIdleTimeoutSec));
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenRemoteNodeSessionIdleTimeoutSec, remoteNodeSessionIdleTimeoutSec));
|
||||
|
||||
if (sessionThrottleLimit != PSWorkflowConfigurationProvider.DefaultSessionThrottleLimit)
|
||||
privateDataParams.Append(string.Format(CultureInfo.InvariantCulture, ParamToken, PSWorkflowConfigurationProvider.TokenSessionThrottleLimit, sessionThrottleLimit));
|
||||
|
||||
+1
-1
@@ -3886,7 +3886,7 @@ namespace Microsoft.PowerShell.Activities
|
||||
if (!sessionSet)
|
||||
{
|
||||
if (cimActivityImplementationContext == null)
|
||||
throw new ArgumentException(Resources.InvalidImplementationContext);
|
||||
throw new ArgumentException(Resources.InvalidImplementationContext);
|
||||
|
||||
bool useSsl = false;
|
||||
if (cimActivityImplementationContext.PSUseSsl.HasValue)
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
private RunspaceProvider _localRunspaceProvider;
|
||||
private RunspaceProvider _unboundedLocalRunspaceProvider;
|
||||
|
||||
private static readonly Tracer _tracer = new Tracer();
|
||||
private static readonly Tracer _tracer = new Tracer();
|
||||
private static readonly PSPerfCountersMgr _psPerfCountersMgrInst = PSPerfCountersMgr.Instance;
|
||||
private readonly PSWorkflowConfigurationProvider _configuration;
|
||||
private readonly object _syncObject = new object();
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.Workflow
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Management.Automation.Tracing;
|
||||
using Microsoft.PowerShell.Activities;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace ConsoleApplication
|
||||
{
|
||||
// we are assuming resgen is run with 'dotnet run'
|
||||
// so we can use relative paths
|
||||
foreach (string folder in Directory.EnumerateDirectories(".."))
|
||||
foreach (string folder in Directory.EnumerateDirectories(".."))
|
||||
{
|
||||
string moduleName = Path.GetFileName(folder);
|
||||
string resourcePath = Path.Combine(folder, "resources");
|
||||
|
||||
+35
-35
@@ -828,11 +828,11 @@ namespace System.Management.Automation.Runspaces
|
||||
.AddHeader(label: "Time(ms)", width: 9)
|
||||
.StartRowDefinition()
|
||||
.AddScriptBlockColumn(@"
|
||||
$sourceName = $_.PSComputerName;
|
||||
if($sourceName -eq ""."")
|
||||
{$sourceName = $env:COMPUTERNAME;}
|
||||
return $sourceName;
|
||||
")
|
||||
$sourceName = $_.PSComputerName;
|
||||
if($sourceName -eq ""."")
|
||||
{$sourceName = $env:COMPUTERNAME;}
|
||||
return $sourceName;
|
||||
")
|
||||
.AddPropertyColumn("Address")
|
||||
.AddPropertyColumn("IPV4Address")
|
||||
.AddPropertyColumn("IPV6Address")
|
||||
@@ -853,36 +853,36 @@ namespace System.Management.Automation.Runspaces
|
||||
.AddHeader(label: "RestorePointType", width: 22)
|
||||
.StartRowDefinition()
|
||||
.AddScriptBlockColumn(@"
|
||||
return $_.ConvertToDateTime($_.CreationTime)
|
||||
")
|
||||
return $_.ConvertToDateTime($_.CreationTime)
|
||||
")
|
||||
.AddPropertyColumn("Description")
|
||||
.AddPropertyColumn("SequenceNumber")
|
||||
.AddScriptBlockColumn(@"
|
||||
$eventType = $_.EventType;
|
||||
if($_.EventType -eq 100)
|
||||
{$eventType = ""BEGIN_SYSTEM_CHANGE"";}
|
||||
if($_.EventType -eq 101)
|
||||
{$eventType = ""END_SYSTEM_CHANGE"";}
|
||||
if($_.EventType -eq 102)
|
||||
{$eventType = ""BEGIN_NESTED_SYSTEM_CHANGE"";}
|
||||
if($_.EventType -eq 103)
|
||||
{$eventType = ""END_NESTED_SYSTEM_CHANGE"";}
|
||||
return $eventType;
|
||||
")
|
||||
$eventType = $_.EventType;
|
||||
if($_.EventType -eq 100)
|
||||
{$eventType = ""BEGIN_SYSTEM_CHANGE"";}
|
||||
if($_.EventType -eq 101)
|
||||
{$eventType = ""END_SYSTEM_CHANGE"";}
|
||||
if($_.EventType -eq 102)
|
||||
{$eventType = ""BEGIN_NESTED_SYSTEM_CHANGE"";}
|
||||
if($_.EventType -eq 103)
|
||||
{$eventType = ""END_NESTED_SYSTEM_CHANGE"";}
|
||||
return $eventType;
|
||||
")
|
||||
.AddScriptBlockColumn(@"
|
||||
$RestorePointType = $_.RestorePointType;
|
||||
if($_.RestorePointType -eq 0)
|
||||
{ $RestorePointType = ""APPLICATION_INSTALL"";}
|
||||
if($_.RestorePointType -eq 1)
|
||||
{ $RestorePointType = ""APPLICATION_UNINSTALL"";}
|
||||
if($_.RestorePointType -eq 10)
|
||||
{ $RestorePointType = ""DEVICE_DRIVER_INSTALL"";}
|
||||
if($_.RestorePointType -eq 12)
|
||||
{ $RestorePointType = ""MODIFY_SETTINGS"";}
|
||||
if($_.RestorePointType -eq 13)
|
||||
{ $RestorePointType = ""CANCELLED_OPERATION"";}
|
||||
return $RestorePointType;
|
||||
")
|
||||
$RestorePointType = $_.RestorePointType;
|
||||
if($_.RestorePointType -eq 0)
|
||||
{ $RestorePointType = ""APPLICATION_INSTALL"";}
|
||||
if($_.RestorePointType -eq 1)
|
||||
{ $RestorePointType = ""APPLICATION_UNINSTALL"";}
|
||||
if($_.RestorePointType -eq 10)
|
||||
{ $RestorePointType = ""DEVICE_DRIVER_INSTALL"";}
|
||||
if($_.RestorePointType -eq 12)
|
||||
{ $RestorePointType = ""MODIFY_SETTINGS"";}
|
||||
if($_.RestorePointType -eq 13)
|
||||
{ $RestorePointType = ""CANCELLED_OPERATION"";}
|
||||
return $RestorePointType;
|
||||
")
|
||||
.EndRowDefinition()
|
||||
.EndTable());
|
||||
}
|
||||
@@ -917,13 +917,13 @@ namespace System.Management.Automation.Runspaces
|
||||
.AddScriptBlockColumn(@"
|
||||
$RestorePointType = $_.RestorePointType;
|
||||
if($_.RestorePointType -eq 0)
|
||||
{ $RestorePointType = ""APPLICATION_INSTALL"";}
|
||||
{ $RestorePointType = ""APPLICATION_INSTALL"";}
|
||||
if($_.RestorePointType -eq 1)
|
||||
{ $RestorePointType = ""APPLICATION_UNINSTALL"";}
|
||||
{ $RestorePointType = ""APPLICATION_UNINSTALL"";}
|
||||
if($_.RestorePointType -eq 10)
|
||||
{ $RestorePointType = ""DEVICE_DRIVER_INSTALL"";}
|
||||
{ $RestorePointType = ""DEVICE_DRIVER_INSTALL"";}
|
||||
if($_.RestorePointType -eq 12)
|
||||
{ $RestorePointType = ""MODIFY_SETTINGS"";}
|
||||
{ $RestorePointType = ""MODIFY_SETTINGS"";}
|
||||
if($_.RestorePointType -eq 13)
|
||||
{ $RestorePointType = ""CANCELLED_OPERATION"";}
|
||||
return $RestorePointType;
|
||||
|
||||
@@ -14,14 +14,14 @@ namespace System.Management.Automation.ComInterop
|
||||
/// <summary>
|
||||
/// If a managed user type (as opposed to a primitive type or a COM object) is passed as an argument to a COM call, we need
|
||||
/// to determine the VarEnum type we will marshal it as. We have the following options:
|
||||
/// 1. Raise an exception. Languages with their own version of primitive types would not be able to call
|
||||
/// COM methods using the language's types (for eg. strings in IronRuby are not System.String). An explicit
|
||||
/// cast would be needed.
|
||||
/// 2. We could marshal it as VT_DISPATCH. Then COM code will be able to access all the APIs in a late-bound manner,
|
||||
/// but old COM components will probably malfunction if they expect a primitive type.
|
||||
/// 3. We could guess which primitive type is the closest match. This will make COM components be as easily
|
||||
/// accessible as .NET methods.
|
||||
/// 4. We could use the type library to check what the expected type is. However, the type library may not be available.
|
||||
/// 1.Raise an exception. Languages with their own version of primitive types would not be able to call
|
||||
/// COM methods using the language's types (for eg. strings in IronRuby are not System.String). An explicit
|
||||
/// cast would be needed.
|
||||
/// 2.We could marshal it as VT_DISPATCH. Then COM code will be able to access all the APIs in a late-bound manner,
|
||||
/// but old COM components will probably malfunction if they expect a primitive type.
|
||||
/// 3.We could guess which primitive type is the closest match. This will make COM components be as easily
|
||||
/// accessible as .NET methods.
|
||||
/// 4.We could use the type library to check what the expected type is. However, the type library may not be available.
|
||||
///
|
||||
/// VarEnumSelector implements option # 3
|
||||
/// </summary>
|
||||
|
||||
@@ -5307,7 +5307,7 @@ end
|
||||
"Receive-PSSession", "", ScopedItemOptions.ReadOnly | ScopedItemOptions.AllScope),
|
||||
new SessionStateAliasEntry("exsn",
|
||||
"Exit-PSSession", "", ScopedItemOptions.AllScope),
|
||||
// Win8: 121662/169179 Add "sls" alias for Select-String cmdlet
|
||||
// Win8: 121662/169179 Add "sls" alias for Select-String cmdlet
|
||||
// - do not use AllScope - this causes errors in profiles that set this somewhat commonly used alias.
|
||||
new SessionStateAliasEntry("sls",
|
||||
"Select-String", "", ScopedItemOptions.None),
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace System.Management.Automation
|
||||
ThrowIfWriteNotPermitted(true);
|
||||
_WriteObjectsSkipAllowCheck(sendToPipeline);
|
||||
}
|
||||
// Trust: public void WriteObject(object sendToPipeline, DataTrustCategory trustCategory); // enumerateCollection defaults to false
|
||||
// Trust: public void WriteObject(object sendToPipeline, DataTrustCategory trustCategory); // enumerateCollection defaults to false
|
||||
// Trust: public void WriteObject(object sendToPipeline, bool enumerateCollection, DataTrustCategory trustCategory);
|
||||
|
||||
// Variables needed to generate a unique SourceId for
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace System.Management.Automation
|
||||
|
||||
//new MITypeSerializationInfo(typeof(SecureString),
|
||||
// InternalSerializer.WriteSecureString),
|
||||
};
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary of knowntypes.
|
||||
|
||||
@@ -51,9 +51,9 @@ namespace System.Management.Automation.Runspaces
|
||||
new ScriptPropertyData(@"ConnectedUser", GetScriptBlock(@"$this.UserInfo.Identity.Name"), null));
|
||||
td2.Members.Add("RunAsUser",
|
||||
new ScriptPropertyData(@"RunAsUser", GetScriptBlock(@"if($this.UserInfo.WindowsIdentity -ne $null)
|
||||
{
|
||||
$this.UserInfo.WindowsIdentity.Name
|
||||
}"), null));
|
||||
{
|
||||
$this.UserInfo.WindowsIdentity.Name
|
||||
}"), null));
|
||||
yield return td2;
|
||||
|
||||
var td3 = new TypeData(@"System.Management.Automation.CompletionResult", true);
|
||||
|
||||
@@ -123,20 +123,20 @@ function Register-PSSessionConfiguration
|
||||
new-item -path WSMan:\localhost\Plugin -file ""$filepath"" -name ""$pluginName""
|
||||
# $? is to make sure the last operation is succeeded
|
||||
|
||||
if ($? -and $runAsUserName)
|
||||
{{
|
||||
try {{
|
||||
$runAsCredential = new-object system.management.automation.PSCredential($runAsUserName, $runAsPassword)
|
||||
set-item -WarningAction SilentlyContinue WSMan:\localhost\Plugin\""$pluginName""\RunAsUser $runAsCredential -confirm:$false
|
||||
}} catch {{
|
||||
remove-item WSMan:\localhost\Plugin\""$pluginName"" -recurse -force
|
||||
write-error $_
|
||||
if ($? -and $runAsUserName)
|
||||
{{
|
||||
try {{
|
||||
$runAsCredential = new-object system.management.automation.PSCredential($runAsUserName, $runAsPassword)
|
||||
set-item -WarningAction SilentlyContinue WSMan:\localhost\Plugin\""$pluginName""\RunAsUser $runAsCredential -confirm:$false
|
||||
}} catch {{
|
||||
remove-item WSMan:\localhost\Plugin\""$pluginName"" -recurse -force
|
||||
write-error $_
|
||||
# Do not add anymore clean up code after Write-Error, because if EA=Stop is set by user
|
||||
# any code at this point will not execute.
|
||||
|
||||
return
|
||||
}}
|
||||
}}
|
||||
return
|
||||
}}
|
||||
}}
|
||||
|
||||
## Replace the SDDL with any groups or restrictions defined in the PSSessionConfigurationFile
|
||||
if($? -and $configTableSddl -and (-not $isSddlSpecified))
|
||||
@@ -236,13 +236,13 @@ function Register-PSSessionConfiguration
|
||||
}}
|
||||
|
||||
}} catch {{
|
||||
remove-item WSMan:\localhost\Plugin\""$pluginName"" -recurse -force
|
||||
write-error $_
|
||||
remove-item WSMan:\localhost\Plugin\""$pluginName"" -recurse -force
|
||||
write-error $_
|
||||
# Do not add anymore clean up code after Write-Error, because if EA=Stop is set by user
|
||||
# any code at this point will not execute.
|
||||
|
||||
return
|
||||
}}
|
||||
return
|
||||
}}
|
||||
}}
|
||||
|
||||
if ($?){{
|
||||
@@ -293,10 +293,10 @@ else
|
||||
</PlugInConfiguration>
|
||||
";
|
||||
private const string architectureAttribFormat = @"
|
||||
Architecture='{0}'";
|
||||
Architecture='{0}'";
|
||||
|
||||
private const string sharedHostAttribFormat = @"
|
||||
UseSharedProcess='{0}'";
|
||||
UseSharedProcess='{0}'";
|
||||
|
||||
private const string runasVirtualAccountAttribFormat = @"
|
||||
RunAsVirtualAccount='{0}'";
|
||||
@@ -305,7 +305,7 @@ else
|
||||
RunAsVirtualAccountGroups='{0}'";
|
||||
|
||||
private const string allowRemoteShellAccessFormat = @"
|
||||
Enabled='{0}'";
|
||||
Enabled='{0}'";
|
||||
|
||||
private const string initParamFormat = @"
|
||||
<Param Name='{0}' Value='{1}' />{2}";
|
||||
@@ -2992,7 +2992,7 @@ Set-SessionPluginOptions $args[0]
|
||||
function Set-RunAsCredential{{
|
||||
param (
|
||||
[string]$runAsUserName,
|
||||
[system.security.securestring]$runAsPassword
|
||||
[system.security.securestring]$runAsPassword
|
||||
)
|
||||
|
||||
$cred = new-object System.Management.Automation.PSCredential($runAsUserName, $runAsPassword)
|
||||
|
||||
@@ -375,13 +375,13 @@ namespace System.Management.Automation
|
||||
_cimClassIdToClass.Add(key, cimClass);
|
||||
|
||||
/* PRINTF DEBUG
|
||||
Console.WriteLine("Contents of deserialization cache (after a call to AddCimClassToCache ({0})):", key);
|
||||
Console.WriteLine(" Count = {0}", this._cimClassIdToClass.Count);
|
||||
foreach (var t in this._cimClassIdToClass.Keys)
|
||||
{
|
||||
Console.WriteLine(" {0}", t);
|
||||
}
|
||||
*/
|
||||
Console.WriteLine("Contents of deserialization cache (after a call to AddCimClassToCache ({0})):", key);
|
||||
Console.WriteLine(" Count = {0}", this._cimClassIdToClass.Count);
|
||||
foreach (var t in this._cimClassIdToClass.Keys)
|
||||
{
|
||||
Console.WriteLine(" {0}", t);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
internal CimClass GetCimClassFromCache(TKey key)
|
||||
@@ -390,15 +390,15 @@ namespace System.Management.Automation
|
||||
if (_cimClassIdToClass.TryGetValue(key, out cimClass))
|
||||
{
|
||||
/* PRINTF DEBUG
|
||||
Console.WriteLine("GetCimClassFromCache - class found: {0}", key);
|
||||
*/
|
||||
Console.WriteLine("GetCimClassFromCache - class found: {0}", key);
|
||||
*/
|
||||
|
||||
return cimClass;
|
||||
}
|
||||
|
||||
/* PRINTF DEBUG
|
||||
Console.WriteLine("GetCimClassFromCache - class NOT found: {0}", key);
|
||||
*/
|
||||
Console.WriteLine("GetCimClassFromCache - class NOT found: {0}", key);
|
||||
*/
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -424,13 +424,13 @@ namespace System.Management.Automation
|
||||
_cimClassesHeldByDeserializer.Add(key);
|
||||
|
||||
/* PRINTF DEBUG
|
||||
Console.WriteLine("Contents of serialization cache (after adding {0}):", key);
|
||||
Console.WriteLine(" Count = {0}", this._cimClassesHeldByDeserializer.Count);
|
||||
foreach (var t in _cimClassesHeldByDeserializer)
|
||||
{
|
||||
Console.WriteLine(" {0}", t);
|
||||
}
|
||||
*/
|
||||
Console.WriteLine("Contents of serialization cache (after adding {0}):", key);
|
||||
Console.WriteLine(" Count = {0}", this._cimClassesHeldByDeserializer.Count);
|
||||
foreach (var t in _cimClassesHeldByDeserializer)
|
||||
{
|
||||
Console.WriteLine(" {0}", t);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5874,8 +5874,8 @@ namespace System.Management.Automation
|
||||
typeof(Int64),
|
||||
typeof(SByte),
|
||||
typeof(Single),
|
||||
// typeof(ScriptBlock) - don't want ScriptBlocks, because they are deserialized into strings
|
||||
typeof(String),
|
||||
// typeof(ScriptBlock) - don't want ScriptBlocks, because they are deserialized into strings
|
||||
typeof(String),
|
||||
typeof(TimeSpan),
|
||||
typeof(UInt16),
|
||||
typeof(UInt32),
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace System.Management.Automation.Runspaces
|
||||
/// </summary>
|
||||
/// <!--
|
||||
/// Monad Console File is in the following format:
|
||||
/// <?xml version="1.0"?>
|
||||
/// <?xml version="1.0"?>
|
||||
/// <PSConsoleFile ConsoleSchemaVersion=1.0>
|
||||
///<PSVersion>1</PSVersion>
|
||||
///<PSSnapIns>
|
||||
|
||||
@@ -19,37 +19,37 @@ namespace PSTests
|
||||
[Collection("AssemblyLoadContext")]
|
||||
public class FileSystemProviderTests: IDisposable
|
||||
{
|
||||
private string testPath;
|
||||
private string testContent;
|
||||
public FileSystemProviderTests()
|
||||
{
|
||||
testPath = Path.Combine(Path.GetTempPath(),"test");
|
||||
testContent = "test content!";
|
||||
if(File.Exists(testPath)) File.Delete(testPath);
|
||||
File.AppendAllText(testPath,testContent);
|
||||
}
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
File.Delete(testPath);
|
||||
}
|
||||
private string testPath;
|
||||
private string testContent;
|
||||
public FileSystemProviderTests()
|
||||
{
|
||||
testPath = Path.Combine(Path.GetTempPath(),"test");
|
||||
testContent = "test content!";
|
||||
if(File.Exists(testPath)) File.Delete(testPath);
|
||||
File.AppendAllText(testPath,testContent);
|
||||
}
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
File.Delete(testPath);
|
||||
}
|
||||
|
||||
private ExecutionContext GetExecutionContext()
|
||||
{
|
||||
CultureInfo currentCulture = CultureInfo.CurrentCulture;
|
||||
private ExecutionContext GetExecutionContext()
|
||||
{
|
||||
CultureInfo currentCulture = CultureInfo.CurrentCulture;
|
||||
PSHost hostInterface = new DefaultHost(currentCulture,currentCulture);
|
||||
RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create();
|
||||
InitialSessionState iss = InitialSessionState.CreateDefault2();
|
||||
AutomationEngine engine = new AutomationEngine(hostInterface, runspaceConfiguration, iss);
|
||||
ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss);
|
||||
return executionContext;
|
||||
}
|
||||
private ProviderInfo GetProvider()
|
||||
return executionContext;
|
||||
}
|
||||
private ProviderInfo GetProvider()
|
||||
{
|
||||
ExecutionContext executionContext = GetExecutionContext();
|
||||
SessionStateInternal sessionState = new SessionStateInternal(executionContext);
|
||||
|
||||
SessionStateProviderEntry providerEntry = new SessionStateProviderEntry("FileSystem",typeof(FileSystemProvider), null);
|
||||
sessionState.AddSessionStateEntry(providerEntry);
|
||||
SessionStateProviderEntry providerEntry = new SessionStateProviderEntry("FileSystem",typeof(FileSystemProvider), null);
|
||||
sessionState.AddSessionStateEntry(providerEntry);
|
||||
ProviderInfo matchingProvider = sessionState.ProviderList.ToList()[0];
|
||||
|
||||
return matchingProvider;
|
||||
@@ -61,114 +61,114 @@ namespace PSTests
|
||||
Assert.False(InternalSymbolicLinkLinkCodeMethods.CreateJunction("",""));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestGetHelpMaml()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,String.Empty),String.Empty);
|
||||
Assert.Equal(fileSystemProvider.GetHelpMaml("helpItemName",String.Empty),String.Empty);
|
||||
Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,"path"),String.Empty);
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,String.Empty),String.Empty);
|
||||
Assert.Equal(fileSystemProvider.GetHelpMaml("helpItemName",String.Empty),String.Empty);
|
||||
Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,"path"),String.Empty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestMode()
|
||||
{
|
||||
Assert.Equal(FileSystemProvider.Mode(null),String.Empty);
|
||||
FileSystemInfo directoryObject = new DirectoryInfo(@"/");
|
||||
FileSystemInfo fileObject = new FileInfo(@"/etc/hosts");
|
||||
FileSystemInfo executableObject = new FileInfo(@"/bin/echo");
|
||||
Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(directoryObject)).Replace("r","-"),"d-----");
|
||||
Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(fileObject)).Replace("r","-"),"------");
|
||||
Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(executableObject)).Replace("r","-"),"------");
|
||||
Assert.Equal(FileSystemProvider.Mode(null),String.Empty);
|
||||
FileSystemInfo directoryObject = new DirectoryInfo(@"/");
|
||||
FileSystemInfo fileObject = new FileInfo(@"/etc/hosts");
|
||||
FileSystemInfo executableObject = new FileInfo(@"/bin/echo");
|
||||
Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(directoryObject)).Replace("r","-"),"d-----");
|
||||
Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(fileObject)).Replace("r","-"),"------");
|
||||
Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(executableObject)).Replace("r","-"),"------");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestGetProperty()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
PSObject pso=new PSObject();
|
||||
pso.AddOrSetProperty("IsReadOnly",false);
|
||||
fileSystemProvider.SetProperty(testPath, pso);
|
||||
fileSystemProvider.GetProperty(testPath, new Collection<string>(){"IsReadOnly"});
|
||||
FileInfo fileSystemObject1 = new FileInfo(testPath);
|
||||
PSObject psobject1=PSObject.AsPSObject(fileSystemObject1);
|
||||
foreach(PSPropertyInfo property in psobject1.Properties)
|
||||
{
|
||||
if(property.Name == "IsReadOnly")
|
||||
{
|
||||
Assert.Equal(property.Value,false);
|
||||
}
|
||||
}
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
PSObject pso=new PSObject();
|
||||
pso.AddOrSetProperty("IsReadOnly",false);
|
||||
fileSystemProvider.SetProperty(testPath, pso);
|
||||
fileSystemProvider.GetProperty(testPath, new Collection<string>(){"IsReadOnly"});
|
||||
FileInfo fileSystemObject1 = new FileInfo(testPath);
|
||||
PSObject psobject1=PSObject.AsPSObject(fileSystemObject1);
|
||||
foreach(PSPropertyInfo property in psobject1.Properties)
|
||||
{
|
||||
if(property.Name == "IsReadOnly")
|
||||
{
|
||||
Assert.Equal(property.Value,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestSetProperty()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
fileSystemProvider.GetProperty(testPath, new Collection<string>(){"Name"});
|
||||
FileInfo fileSystemObject1 = new FileInfo(testPath);
|
||||
PSObject psobject1=PSObject.AsPSObject(fileSystemObject1);
|
||||
foreach(PSPropertyInfo property in psobject1.Properties)
|
||||
{
|
||||
if(property.Name == "Name")
|
||||
{
|
||||
Assert.Equal(property.Value,"test");
|
||||
}
|
||||
}
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
fileSystemProvider.GetProperty(testPath, new Collection<string>(){"Name"});
|
||||
FileInfo fileSystemObject1 = new FileInfo(testPath);
|
||||
PSObject psobject1=PSObject.AsPSObject(fileSystemObject1);
|
||||
foreach(PSPropertyInfo property in psobject1.Properties)
|
||||
{
|
||||
if(property.Name == "Name")
|
||||
{
|
||||
Assert.Equal(property.Value,"test");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestClearProperty()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
fileSystemProvider.ClearProperty(testPath, new Collection<string>(){"Attributes"});
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
fileSystemProvider.ClearProperty(testPath, new Collection<string>(){"Attributes"});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestGetContentReader()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
|
||||
IContentReader contentReader = fileSystemProvider.GetContentReader(testPath);
|
||||
Assert.Equal(contentReader.Read(1)[0],testContent);
|
||||
contentReader.Close();
|
||||
IContentReader contentReader = fileSystemProvider.GetContentReader(testPath);
|
||||
Assert.Equal(contentReader.Read(1)[0],testContent);
|
||||
contentReader.Close();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestGetContentWriter()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
|
||||
IContentWriter contentWriter = fileSystemProvider.GetContentWriter(testPath);
|
||||
contentWriter.Write(new List<string>(){"contentWriterTestContent"});
|
||||
contentWriter.Close();
|
||||
Assert.Equal(File.ReadAllText(testPath), testContent+@"contentWriterTestContent"+ System.Environment.NewLine);
|
||||
IContentWriter contentWriter = fileSystemProvider.GetContentWriter(testPath);
|
||||
contentWriter.Write(new List<string>(){"contentWriterTestContent"});
|
||||
contentWriter.Close();
|
||||
Assert.Equal(File.ReadAllText(testPath), testContent+@"contentWriterTestContent"+ System.Environment.NewLine);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact]
|
||||
public void TestClearContent()
|
||||
{
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
fileSystemProvider.ClearContent(testPath);
|
||||
Assert.Empty(File.ReadAllText(testPath));
|
||||
FileSystemProvider fileSystemProvider = new FileSystemProvider();
|
||||
ProviderInfo providerInfoToSet = GetProvider();
|
||||
fileSystemProvider.SetProviderInformation(providerInfoToSet);
|
||||
fileSystemProvider.Context = new CmdletProviderContext(GetExecutionContext());
|
||||
fileSystemProvider.ClearContent(testPath);
|
||||
Assert.Empty(File.ReadAllText(testPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user