Remove trailing whitespace (#3001)
This commit is contained in:
parent
f4f576c92b
commit
02b5f357a2
64
build.psm1
64
build.psm1
|
@ -34,7 +34,7 @@ if ($IsLinux) {
|
|||
}
|
||||
|
||||
#
|
||||
# At the moment, we just support x64 builds. When we support x86 builds, this
|
||||
# At the moment, we just support x64 builds. When we support x86 builds, this
|
||||
# check may need to verify the SDK for the specified architecture.
|
||||
#
|
||||
function Get-Win10SDKBinDir {
|
||||
|
@ -120,7 +120,7 @@ function Start-PSBuild {
|
|||
Push-Location $PSScriptRoot
|
||||
try {
|
||||
git clean -fdX
|
||||
# Extra cleaning is required to delete the CMake temporary files.
|
||||
# Extra cleaning is required to delete the CMake temporary files.
|
||||
# These are not cleaned when using "X" and cause CMake to retain state, leading to
|
||||
# mis-configured environment issues when switching between x86 and x64 compilation
|
||||
# environments.
|
||||
|
@ -318,7 +318,7 @@ cmd.exe /C cd /d "$currentLocation" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeH
|
|||
# Describes wither it should build the CoreCLR or FullCLR version
|
||||
[ValidateSet("ON", "OFF")]
|
||||
[string]$OneCoreValue,
|
||||
|
||||
|
||||
# Array of file names to copy from the local build directory to the packaging directory
|
||||
[string[]]$FilesToCopy
|
||||
)
|
||||
|
@ -348,19 +348,19 @@ cmd.exe /C cd /d "$location" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch
|
|||
Copy-Item $srcPath $dstPath
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($FullCLR) {
|
||||
$fullBinaries = @(
|
||||
$fullBinaries = @(
|
||||
'powershell.exe',
|
||||
'powershell.pdb',
|
||||
'pwrshplugin.dll',
|
||||
'pwrshplugin.pdb'
|
||||
)
|
||||
Build-NativeWindowsBinaries "OFF" $fullBinaries
|
||||
Build-NativeWindowsBinaries "OFF" $fullBinaries
|
||||
}
|
||||
else
|
||||
{
|
||||
$coreClrBinaries = @(
|
||||
$coreClrBinaries = @(
|
||||
'pwrshplugin.dll',
|
||||
'pwrshplugin.pdb'
|
||||
)
|
||||
|
@ -405,7 +405,7 @@ cmd.exe /C cd /d "$location" "&" "$($vcVarsPath)\vcvarsall.bat" "$NativeHostArch
|
|||
# $Options.Output is pointing to something like "...\src\powershell-win-core\bin\Debug\netcoreapp1.1\win10-x64\publish\powershell.exe",
|
||||
# so we need to get its parent directory
|
||||
$publishPath = Split-Path $Options.Output -Parent
|
||||
log "Restore PowerShell modules to $publishPath"
|
||||
log "Restore PowerShell modules to $publishPath"
|
||||
# PowerShellGet depends on PackageManagement module, so PackageManagement module will be installed with the PowerShellGet module.
|
||||
Restore-PSModule -Name @('PowerShellGet') -Destination (Join-Path -Path $publishPath -ChildPath "Modules")
|
||||
}
|
||||
|
@ -417,11 +417,11 @@ function Compress-TestContent {
|
|||
$Destination
|
||||
)
|
||||
|
||||
$powerShellTestRoot = Join-Path $PSScriptRoot 'test\powershell'
|
||||
$powerShellTestRoot = Join-Path $PSScriptRoot 'test\powershell'
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
$resolvedPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Destination)
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($powerShellTestRoot, $resolvedPath)
|
||||
[System.IO.Compression.ZipFile]::CreateFromDirectory($powerShellTestRoot, $resolvedPath)
|
||||
}
|
||||
|
||||
function New-PSOptions {
|
||||
|
@ -718,7 +718,7 @@ function Start-PSPester {
|
|||
{
|
||||
$outputBufferFilePath = [System.IO.Path]::GetTempFileName()
|
||||
}
|
||||
|
||||
|
||||
$Command += "Invoke-Pester "
|
||||
|
||||
$Command += "-OutputFormat ${OutputFormat} -OutputFile ${OutputFile} "
|
||||
|
@ -784,7 +784,7 @@ function Start-PSPester {
|
|||
{
|
||||
Remove-Item $outputBufferFilePath
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($ThrowOnFailure)
|
||||
{
|
||||
|
@ -819,7 +819,7 @@ function Show-PSPesterError
|
|||
|
||||
#
|
||||
# Read the test result file and
|
||||
# Throw if a test failed
|
||||
# Throw if a test failed
|
||||
function Test-PSPesterResults
|
||||
{
|
||||
param(
|
||||
|
@ -830,7 +830,7 @@ function Test-PSPesterResults
|
|||
if(!(Test-Path $TestResultsFile))
|
||||
{
|
||||
throw "Test result file '$testResultsFile' not found for $TestArea."
|
||||
}
|
||||
}
|
||||
|
||||
$x = [xml](Get-Content -raw $testResultsFile)
|
||||
if ([int]$x.'test-results'.failures -gt 0)
|
||||
|
@ -1204,7 +1204,7 @@ function Start-PSPackage {
|
|||
[ValidateSet("deb", "osxpkg", "rpm", "msi", "appx", "zip")]
|
||||
[string[]]$Type,
|
||||
|
||||
# Generate windows downlevel package
|
||||
# Generate windows downlevel package
|
||||
[ValidateSet("win81-x64", "win7-x86", "win7-x64")]
|
||||
[ValidateScript({$IsWindows})]
|
||||
[string]$WindowsDownLevel
|
||||
|
@ -1733,7 +1733,7 @@ function Start-DevPowerShell {
|
|||
{
|
||||
Remove-Item env:DEVPATH
|
||||
}
|
||||
|
||||
|
||||
if ($ZapDisable) {
|
||||
Remove-Item env:COMPLUS_ZapDisable
|
||||
}
|
||||
|
@ -2305,7 +2305,7 @@ function New-MSIPackage
|
|||
{
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
|
||||
|
||||
# Name of the Product
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $ProductName = 'PowerShell',
|
||||
|
@ -2334,7 +2334,7 @@ function New-MSIPackage
|
|||
# Path to Assets folder containing artifacts such as icons, images
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $AssetsPath,
|
||||
[string] $AssetsPath,
|
||||
|
||||
# Path to license.rtf file - for the EULA
|
||||
[Parameter(Mandatory = $true)]
|
||||
|
@ -2364,16 +2364,16 @@ function New-MSIPackage
|
|||
|
||||
$ProductSemanticVersion = Get-PackageSemanticVersion -Version $ProductVersion
|
||||
$ProductVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $ProductVersion
|
||||
|
||||
|
||||
$assetsInSourcePath = Join-Path $ProductSourcePath 'assets'
|
||||
New-Item $assetsInSourcePath -type directory -Force | Write-Verbose
|
||||
|
||||
Write-Verbose "Place dependencies such as icons to $assetsInSourcePath"
|
||||
Write-Verbose "Place dependencies such as icons to $assetsInSourcePath"
|
||||
Copy-Item "$AssetsPath\*.ico" $assetsInSourcePath -Force
|
||||
|
||||
|
||||
$productVersionWithName = $ProductName + "_" + $ProductVersion
|
||||
$productSemanticVersionWithName = $ProductName + "_" + $ProductSemanticVersion
|
||||
|
||||
|
||||
Write-Verbose "Create MSI for Product $productSemanticVersionWithName"
|
||||
|
||||
[Environment]::SetEnvironmentVariable("ProductSourcePath", $ProductSourcePath, "Process")
|
||||
|
@ -2398,13 +2398,13 @@ function New-MSIPackage
|
|||
if ($ProductNameSuffix) {
|
||||
$packageName += "-$ProductNameSuffix"
|
||||
}
|
||||
$msiLocationPath = Join-Path $pwd "$packageName.msi"
|
||||
$msiLocationPath = Join-Path $pwd "$packageName.msi"
|
||||
Remove-Item -ErrorAction SilentlyContinue $msiLocationPath -Force
|
||||
|
||||
& $wixHeatExePath dir $ProductSourcePath -dr $productVersionWithName -cg $productVersionWithName -gg -sfrag -srd -scom -sreg -out $wixFragmentPath -var env.ProductSourcePath -v | Write-Verbose
|
||||
& $wixCandleExePath "$ProductWxsPath" "$wixFragmentPath" -out (Join-Path "$env:Temp" "\\") -arch x64 -v | Write-Verbose
|
||||
& $wixLightExePath -out $msiLocationPath $wixObjProductPath $wixObjFragmentPath -ext WixUIExtension -dWixUILicenseRtf="$LicenseFilePath" -v | Write-Verbose
|
||||
|
||||
|
||||
Remove-Item -ErrorAction SilentlyContinue *.wixpdb -Force
|
||||
|
||||
Write-Verbose "You can find the MSI @ $msiLocationPath" -Verbose
|
||||
|
@ -2439,8 +2439,8 @@ function New-AppxPackage
|
|||
[ValidateNotNullOrEmpty()]
|
||||
[string] $AssetsPath
|
||||
)
|
||||
|
||||
$PackageSemanticVersion = Get-PackageSemanticVersion -Version $PackageVersion
|
||||
|
||||
$PackageSemanticVersion = Get-PackageSemanticVersion -Version $PackageVersion
|
||||
|
||||
$PackageVersion = Get-PackageVersionAsMajorMinorBuildRevision -Version $PackageVersion
|
||||
Write-Verbose "Package Version is $PackageVersion"
|
||||
|
@ -2527,7 +2527,7 @@ function New-ZipPackage
|
|||
{
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
|
||||
|
||||
# Name of the Product
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string] $PackageName = 'PowerShell',
|
||||
|
@ -2547,12 +2547,12 @@ function New-ZipPackage
|
|||
)
|
||||
|
||||
$ProductSemanticVersion = Get-PackageSemanticVersion -Version $PackageVersion
|
||||
|
||||
|
||||
$zipPackageName = $PackageName + "_" + $ProductSemanticVersion
|
||||
if ($PackageNameSuffix) {
|
||||
$zipPackageName = $zipPackageName, $PackageNameSuffix -join "-"
|
||||
}
|
||||
|
||||
|
||||
Write-Verbose "Create Zip for Product $zipPackageName"
|
||||
|
||||
$zipLocationPath = Join-Path $PWD "$zipPackageName.zip"
|
||||
|
@ -2565,7 +2565,7 @@ function New-ZipPackage
|
|||
$zipLocationPath
|
||||
|
||||
}
|
||||
#TODO: Use .NET Api to do compresss-archive equivalent if the cmdlet is not present
|
||||
#TODO: Use .NET Api to do compresss-archive equivalent if the cmdlet is not present
|
||||
else
|
||||
{
|
||||
Write-Error -Message "Compress-Archive cmdlet is missing in this PowerShell version"
|
||||
|
@ -2755,7 +2755,7 @@ function Clear-PSRepo
|
|||
[switch] $IncludePackages
|
||||
)
|
||||
Get-ChildItem $PSScriptRoot\* -Directory -Exclude 'Packages' | ForEach-Object {
|
||||
Write-Verbose "Cleaning $_ ..."
|
||||
Write-Verbose "Cleaning $_ ..."
|
||||
git clean -fdX $_
|
||||
}
|
||||
|
||||
|
@ -2846,7 +2846,7 @@ function Restore-PSModule
|
|||
# pull down the module
|
||||
log "running save-module $_"
|
||||
PowerShellGet\Save-Module @command -Force
|
||||
|
||||
|
||||
# Remove PSGetModuleInfo.xml file
|
||||
Find-Module -Name $_ -Repository $RepositoryName -IncludeDependencies | ForEach-Object {
|
||||
Remove-Item -Path $Destination\$($_.Name)\*\PSGetModuleInfo.xml -Force
|
||||
|
|
|
@ -100,7 +100,7 @@ Class ApacheVirtualHost{
|
|||
$vHostDef += "</VirtualHost>"
|
||||
$filName = $ConfigurationFile
|
||||
$VhostDef | Out-File "/tmp/${filName}" -Force -Encoding:ascii
|
||||
& $global:sudocmd "mv" "/tmp/${filName}" "${VhostsDirectory}/${filName}"
|
||||
& $global:sudocmd "mv" "/tmp/${filName}" "${VhostsDirectory}/${filName}"
|
||||
Write-Information "Restarting Apache HTTP Server"
|
||||
Restart-ApacheHTTPServer
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ Login-AzureRmAccount
|
|||
$resourceGroupName = "PSAzDemo" + (New-Guid | % guid) -replace "-",""
|
||||
$resourceGroupName
|
||||
|
||||
### Create a new Azure Resource Group
|
||||
### Create a new Azure Resource Group
|
||||
New-AzureRmResourceGroup -Name $resourceGroupName -Location "West US"
|
||||
|
||||
### Deploy an Ubuntu 14.04 VM using Resource Manager cmdlets
|
||||
### Template is available at
|
||||
### Template is available at
|
||||
### http://armviz.io/#/?load=https:%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2F101-vm-simple-linux%2Fazuredeploy.json
|
||||
$dnsLabelPrefix = $resourceGroupName | % tolower
|
||||
$dnsLabelPrefix
|
||||
|
@ -32,7 +32,7 @@ $password = ConvertTo-SecureString -String "PowerShellRocks!" -AsPlainText -Forc
|
|||
New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile ./Compute-Linux.json -adminUserName psuser -adminPassword $password -dnsLabelPrefix $dnsLabelPrefix
|
||||
|
||||
### Monitor the status of the deployment
|
||||
Get-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName
|
||||
Get-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName
|
||||
|
||||
### Discover the resources we created by the previous deployment
|
||||
Find-AzureRmResource -ResourceGroupName $resourceGroupName | select Name,ResourceType,Location
|
||||
|
@ -46,20 +46,20 @@ Get-AzureRmResource -ResourceName MyUbuntuVM -ResourceType Microsoft.Compute/vir
|
|||
Get-AzureRmProviderOperation -OperationSearchString Microsoft.Compute/* | select OperationName,Operation
|
||||
|
||||
### Power Off the Virtual Machine we created
|
||||
Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Compute/virtualMachines -ResourceName MyUbuntuVM -Action poweroff
|
||||
Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Compute/virtualMachines -ResourceName MyUbuntuVM -Action poweroff
|
||||
|
||||
### Check the VM state again. It should be stopped now.
|
||||
Get-AzureRmResource -ResourceName MyUbuntuVM -ResourceType Microsoft.Compute/virtualMachines -ResourceGroupName $resourceGroupName -ODataQuery '$expand=instanceView' | % properties | % instanceview | % statuses
|
||||
|
||||
### As you know, you may still be incurring charges even if the VM is in stopped state
|
||||
### Deallocate the resource to avoid this charge
|
||||
Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Compute/virtualMachines -ResourceName MyUbuntuVM -Action deallocate
|
||||
Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroupName -ResourceType Microsoft.Compute/virtualMachines -ResourceName MyUbuntuVM -Action deallocate
|
||||
|
||||
### The following command removes the Virtual Machine
|
||||
Remove-AzureRmResource -ResourceName MyUbuntuVM -ResourceType Microsoft.Compute/virtualMachines -ResourceGroupName $resourceGroupName
|
||||
Remove-AzureRmResource -ResourceName MyUbuntuVM -ResourceType Microsoft.Compute/virtualMachines -ResourceGroupName $resourceGroupName
|
||||
|
||||
### Look at the resources that still exists
|
||||
Find-AzureRmResource -ResourceGroupName $resourceGroupName | select Name,ResourceType,Location
|
||||
|
||||
### Remove the resource group and its resources
|
||||
Remove-AzureRmResourceGroup -Name $resourceGroupName
|
||||
Remove-AzureRmResourceGroup -Name $resourceGroupName
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
#Get Distro type and set distro-specific variables
|
||||
$OSname = Get-Content "/etc/os-release" |Select-String -Pattern "^Name="
|
||||
$OSname = Get-Content "/etc/os-release" |Select-String -Pattern "^Name="
|
||||
$OSName = $OSName.tostring().split("=")[1].Replace('"','')
|
||||
if ($OSName -like "Ubuntu*"){
|
||||
$distro = "Ubuntu"
|
||||
|
@ -56,12 +56,12 @@ Configuration ApacheServer{
|
|||
|
||||
nxFile Welcome.conf{
|
||||
DestinationPath = "${VhostDir}/welcome.conf"
|
||||
Ensure = "Absent"
|
||||
Ensure = "Absent"
|
||||
}
|
||||
|
||||
nxFile UserDir.conf{
|
||||
DestinationPath = "${VhostDir}/userdir.conf"
|
||||
Ensure = "Absent"
|
||||
Ensure = "Absent"
|
||||
}
|
||||
|
||||
#Ensure website is defined
|
||||
|
@ -107,8 +107,8 @@ ServerName $hostname
|
|||
Controller = $ServiceCtl
|
||||
DependsOn = "[nxFile]DefaultSite.conf"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ApacheServer -OutputPath "/tmp"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<Configuration>
|
||||
<Configuration>
|
||||
<ViewDefinitions>
|
||||
<View>
|
||||
<Name>Default</Name>
|
||||
|
|
|
@ -51,7 +51,7 @@ function Invoke-CronTab ([String] $user, [String[]] $arguments, [Switch] $noThro
|
|||
If ($user -ne [String]::Empty) {
|
||||
$arguments = Write-Output "-u" $UserName $arguments
|
||||
}
|
||||
|
||||
|
||||
Write-Verbose "Running: $crontabcmd $arguments"
|
||||
$output = & $crontabcmd @arguments 2>&1
|
||||
if ($LastExitCode -ne 0 -and -not $noThrow) {
|
||||
|
@ -87,7 +87,7 @@ function Remove-CronJob {
|
|||
Cron job object returned from Get-CronJob
|
||||
.PARAMETER Force
|
||||
Don't prompt when removing the cron job
|
||||
#>
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact="High")]
|
||||
param (
|
||||
[ArgumentCompleter( { $wordToComplete = $args[2]; Get-CronTabUser | Where-Object { $_ -like "$wordToComplete*" } | Sort-Object } )]
|
||||
|
@ -109,7 +109,7 @@ function Remove-CronJob {
|
|||
[string[]] $crontab = Get-CronTab -user $UserName
|
||||
$newcrontab = [List[string]]::new()
|
||||
$found = $false
|
||||
|
||||
|
||||
$JobAsString = $Job.ToString()
|
||||
foreach ($line in $crontab) {
|
||||
if ($JobAsString -ceq $line) {
|
||||
|
@ -118,7 +118,7 @@ function Remove-CronJob {
|
|||
$newcrontab.Add($line)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (-not $found) {
|
||||
$e = New-Object System.Exception -ArgumentList "Job not found"
|
||||
throw $e
|
||||
|
@ -126,7 +126,7 @@ function Remove-CronJob {
|
|||
if ($Force -or $pscmdlet.ShouldProcess($Job.Command,"Remove")) {
|
||||
Import-CronTab -user $UserName -crontab $newcrontab
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function New-CronJob {
|
||||
|
@ -136,7 +136,7 @@ function New-CronJob {
|
|||
.DESCRIPTION
|
||||
Create a new job in the cron table. Date and time parameters can be specified
|
||||
as ranges such as 10-30, as a list: 5,6,7, or combined 1-5,10-15. An asterisk
|
||||
means 'first through last' (the entire allowed range). Step values can be used
|
||||
means 'first through last' (the entire allowed range). Step values can be used
|
||||
with ranges or with an asterisk. Every 2 hours can be specified as either
|
||||
0-23/2 or */2.
|
||||
.EXAMPLE
|
||||
|
@ -157,7 +157,7 @@ function New-CronJob {
|
|||
Valid values are 0-7. 0 and 7 are both Sunday. If not specified, defaults to *.
|
||||
.PARAMETER Command
|
||||
Command to execute at the scheduled time and day.
|
||||
#>
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[ArgumentCompleter( { $wordToComplete = $args[2]; Get-CronTabUser | Where-Object { $_ -like "$wordToComplete*" } | Sort-Object } )]
|
||||
|
@ -175,7 +175,7 @@ function New-CronJob {
|
|||
)
|
||||
process {
|
||||
# TODO: validate parameters, note that different versions of crontab support different capabilities
|
||||
$line = "{0} {1} {2} {3} {4} {5}" -f [String]::Join(",",$Minute), [String]::Join(",",$Hour),
|
||||
$line = "{0} {1} {2} {3} {4} {5}" -f [String]::Join(",",$Minute), [String]::Join(",",$Hour),
|
||||
[String]::Join(",",$DayOfMonth), [String]::Join(",",$Month), [String]::Join(",",$DayOfWeek), $Command
|
||||
[string[]] $crontab = Get-CronTab -user $UserName
|
||||
$crontab += $line
|
||||
|
@ -196,7 +196,7 @@ function Get-CronJob {
|
|||
CronJob objects
|
||||
.PARAMETER UserName
|
||||
Optional parameter to specify a specific user's cron table
|
||||
#>
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
[OutputType([CronJob])]
|
||||
param (
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Defines base configuration users, groups, settings
|
||||
# Uses PS function to set package configuration (ensure=Present) for an array of packages
|
||||
# Probes for the existence of a package (Apache or MySQL) and conditionally configures the workload. I.e., if Apache is installed, configure Apache settings
|
||||
|
||||
|
||||
# Demo execution:
|
||||
# Show the .ps1
|
||||
# Run the .ps1 to generate a MOF
|
||||
|
|
|
@ -49,7 +49,7 @@ Update-Module
|
|||
|
||||
#endregion
|
||||
|
||||
#region Using PowerShellGet with tags
|
||||
#region Using PowerShellGet with tags
|
||||
|
||||
# Look for all the scripts we'll be demoing today
|
||||
Find-Script -Tag 'PowerShellCore_Demo'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -697,7 +697,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Set <see cref="CimAsyncOperation"/> object, to which
|
||||
/// Set <see cref="CimAsyncOperation"/> object, to which
|
||||
/// current cmdlet will delegate all operations.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
|
@ -787,7 +787,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// resource Uri computer set name
|
||||
/// </summary>
|
||||
internal const string ResourceUriComputerSet = "ResourceUriComputerSet";
|
||||
internal const string ResourceUriComputerSet = "ResourceUriComputerSet";
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="CimInstance"/> computer set name
|
||||
|
@ -808,7 +808,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// resource Uri session set name
|
||||
/// </summary>
|
||||
internal const string ResourceUriSessionSet = "ResourceUriSessionSet";
|
||||
internal const string ResourceUriSessionSet = "ResourceUriSessionSet";
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="CimInstance"/> session set name
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -182,7 +182,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
proxy.EnumerateInstancesAsync(GetNamespace(cmdlet), GetClassName(cmdlet));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
proxy.OperationTimeout = removeCimInstance.OperationTimeoutSec;
|
||||
if(removeCimInstance.ResourceUri != null )
|
||||
{
|
||||
proxy.ResourceUri = removeCimInstance.ResourceUri;
|
||||
proxy.ResourceUri = removeCimInstance.ResourceUri;
|
||||
}
|
||||
CimRemoveCimInstanceContext context = new CimRemoveCimInstanceContext(
|
||||
ConstValue.GetNamespace(removeCimInstance.Namespace),
|
||||
|
@ -388,7 +388,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
proxy.OperationTimeout = setCimInstance.OperationTimeoutSec;
|
||||
if(setCimInstance.ResourceUri != null )
|
||||
{
|
||||
proxy.ResourceUri = setCimInstance.ResourceUri;
|
||||
proxy.ResourceUri = setCimInstance.ResourceUri;
|
||||
}
|
||||
CimSetCimInstanceContext context = new CimSetCimInstanceContext(
|
||||
ConstValue.GetNamespace(setCimInstance.Namespace),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -106,7 +106,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
break;
|
||||
case CimBaseCommand.ClassNameComputerSet:
|
||||
case CimBaseCommand.CimClassComputerSet:
|
||||
case CimBaseCommand.ResourceUriComputerSet:
|
||||
case CimBaseCommand.ResourceUriComputerSet:
|
||||
case CimBaseCommand.QueryComputerSet:
|
||||
foreach (string computerName in computerNames)
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
default:
|
||||
break;
|
||||
}
|
||||
CimMethodParametersCollection paramsCollection =
|
||||
CimMethodParametersCollection paramsCollection =
|
||||
CreateParametersCollection(cmdlet.Arguments, cmdlet.CimClass, cmdlet.CimInstance, cmdlet.MethodName);
|
||||
|
||||
// Invoke methods
|
||||
|
@ -135,7 +135,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
case CimBaseCommand.ClassNameComputerSet:
|
||||
case CimBaseCommand.ClassNameSessionSet:
|
||||
case CimBaseCommand.ResourceUriSessionSet:
|
||||
case CimBaseCommand.ResourceUriSessionSet:
|
||||
case CimBaseCommand.ResourceUriComputerSet:
|
||||
{
|
||||
string target = string.Format(CultureInfo.CurrentUICulture, targetClass, cmdlet.ClassName);
|
||||
|
@ -408,7 +408,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
if (parameterValue == null)
|
||||
{
|
||||
// try the best to get the type while value is null
|
||||
// try the best to get the type while value is null
|
||||
parameter = CimMethodParameter.Create(
|
||||
parameterName,
|
||||
parameterValue,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -81,11 +81,11 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
cmdlet.Key,
|
||||
cmdlet.Property,
|
||||
cmdlet);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case CimBaseCommand.ResourceUriSessionSet:
|
||||
case CimBaseCommand.ResourceUriComputerSet:
|
||||
case CimBaseCommand.ResourceUriComputerSet:
|
||||
{
|
||||
nameSpace = cmdlet.Namespace; //passing null is ok for resourceUri set
|
||||
cimInstance = CreateCimInstance("DummyClass",
|
||||
|
@ -93,7 +93,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
cmdlet.Key,
|
||||
cmdlet.Property,
|
||||
cmdlet);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case CimBaseCommand.CimClassComputerSet:
|
||||
|
@ -103,7 +103,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
cimInstance = CreateCimInstance(cmdlet.CimClass,
|
||||
cmdlet.Property,
|
||||
cmdlet);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -272,7 +272,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
return cimInstance;
|
||||
}
|
||||
|
||||
|
||||
List<string> keys = new List<string>();
|
||||
if (key != null)
|
||||
{
|
||||
|
@ -309,7 +309,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
flag);
|
||||
cimInstance.CimInstanceProperties.Add(newProperty);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return cimInstance;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
this.message = message;
|
||||
this.prompt = prompt;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
|
@ -77,13 +77,13 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
catch
|
||||
{
|
||||
this.responseType = CimResponseType.NoToAll;
|
||||
throw;
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// unblocking the waiting thread
|
||||
this.OnComplete();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CimPromptType.Normal:
|
||||
try
|
||||
|
@ -101,26 +101,26 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
catch
|
||||
{
|
||||
this.responseType = CimResponseType.NoToAll;
|
||||
throw;
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// unblocking the waiting thread
|
||||
this.OnComplete();
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.OnComplete();
|
||||
}
|
||||
}
|
||||
|
||||
#region members
|
||||
|
||||
/// <summary>
|
||||
/// prompt message
|
||||
/// </summary>
|
||||
public string Message
|
||||
public string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -95,7 +95,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
case ProtocolType.Dcom:
|
||||
return "DCOM";
|
||||
case ProtocolType.Default:
|
||||
case ProtocolType.Wsman:
|
||||
case ProtocolType.Wsman:
|
||||
default:
|
||||
return "WSMAN";
|
||||
}
|
||||
|
@ -919,7 +919,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// Create a new <see cref="CimSession"/> base on given cmdlet
|
||||
/// and its parameter
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
/// <param name="cmdlet"></param>
|
||||
/// <param name="sessionOptions"></param>
|
||||
/// <param name="credential"></param>
|
||||
|
@ -952,7 +952,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
else
|
||||
{
|
||||
//CimSession will be returned as part of TestConnection
|
||||
this.cimTestSession.TestCimSession(computerName, proxy);
|
||||
this.cimTestSession.TestCimSession(computerName, proxy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -401,7 +401,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
}
|
||||
|
||||
Debug.Assert(cimInstance != null, "Caller should verify cimInstance != null");
|
||||
|
||||
|
||||
// computerName is null, fallback to create session from cimInstance
|
||||
CimSessionState state = CimSessionBase.GetCimSessionState();
|
||||
if (state != null)
|
||||
|
@ -569,7 +569,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
return this.options.ResourceUri;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable/Disable the method result streaming,
|
||||
|
@ -600,9 +600,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
if(value)
|
||||
{
|
||||
this.options.PromptUser = this.PromptUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable the pssemantics
|
||||
|
@ -1021,7 +1021,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method adds a note property to <paramref name="o"/>,
|
||||
/// This method adds a note property to <paramref name="o"/>,
|
||||
/// which will cause the default PowerShell formatting and output
|
||||
/// to include PSComputerName column/property in the display.
|
||||
/// </summary>
|
||||
|
@ -1639,8 +1639,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
private IObjectPreProcess objectPreprocess;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="isDefaultSession"/> is <c>true</c> if this <see cref="CimSessionProxy"/> was
|
||||
/// created to handle the "default" session, in cases where cmdlets are invoked without
|
||||
/// <see cref="isDefaultSession"/> is <c>true</c> if this <see cref="CimSessionProxy"/> was
|
||||
/// created to handle the "default" session, in cases where cmdlets are invoked without
|
||||
/// ComputerName and/or CimSession parameters.
|
||||
/// </summary>
|
||||
private bool isDefaultSession;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
#region Properties
|
||||
|
||||
internal UInt32 Channel
|
||||
internal UInt32 Channel
|
||||
{
|
||||
get { return channel; }
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
: base(cmdlet)
|
||||
{
|
||||
ValidationHelper.ValidateNoNullArgument(cimRemoveCimInstance, cimRemoveCimInstanceParameterName);
|
||||
this.removeCimInstance = cimRemoveCimInstance;
|
||||
this.removeCimInstance = cimRemoveCimInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -295,7 +295,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
DebugHelper.WriteLogEx();
|
||||
|
||||
if (sendToPipeline is CimInstance)
|
||||
{
|
||||
{
|
||||
this.cimInvokeCimMethod.InvokeCimMethodOnCimInstance(sendToPipeline as CimInstance, context, this);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public class GetCimAssociatedInstanceCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -42,7 +42,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -175,7 +175,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
base.SetParameter(value, nameResourceUri);
|
||||
}
|
||||
}
|
||||
private Uri resourceUri;
|
||||
private Uri resourceUri;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
|
@ -311,7 +311,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// Noun of current cmdlet
|
||||
/// </summary>
|
||||
internal const string Noun = @"CimAssociatedInstance";
|
||||
internal const string Noun = @"CimAssociatedInstance";
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -324,7 +324,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
// internal const string nameOperationTimeoutSec = "OperationTimeoutSec";
|
||||
internal const string nameComputerName = "ComputerName";
|
||||
internal const string nameCimSession = "CimSession";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
// internal const string nameKeyOnly = "KeyOnly";
|
||||
#endregion
|
||||
|
||||
|
@ -340,19 +340,19 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
},
|
||||
{
|
||||
nameCimSession, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true),
|
||||
}
|
||||
},
|
||||
{
|
||||
nameCimInstance, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ComputerSetName, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true),
|
||||
}
|
||||
},
|
||||
{
|
||||
nameResourceUri, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ComputerSetName, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, false),
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Enables the user to enumerate the list of CIM Classes under a specific
|
||||
/// Enables the user to enumerate the list of CIM Classes under a specific
|
||||
/// Namespace. If no list of classes is given, the Cmdlet returns all
|
||||
/// classes in the given namespace.
|
||||
/// </para>
|
||||
|
@ -30,7 +30,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public class GetCimClassCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -39,7 +39,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -211,7 +211,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
cimGetCimClass = CreateOperationAgent();
|
||||
}
|
||||
cimGetCimClass.GetCimClass(this);
|
||||
cimGetCimClass.ProcessActions(this.CmdletOperation);
|
||||
cimGetCimClass.ProcessActions(this.CmdletOperation);
|
||||
}//End ProcessRecord()
|
||||
|
||||
/// <summary>
|
||||
|
@ -283,7 +283,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameComputerName, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ComputerSetName, false),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -17,8 +17,8 @@ using System.Diagnostics.CodeAnalysis;
|
|||
namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns zero, one or more CIM (dynamic) instances with the properties
|
||||
/// specified in the Property parameter, KeysOnly parameter or the Select clause
|
||||
/// Returns zero, one or more CIM (dynamic) instances with the properties
|
||||
/// specified in the Property parameter, KeysOnly parameter or the Select clause
|
||||
/// of the Query parameter.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsCommon.Get, "CimInstance", DefaultParameterSetName = CimBaseCommand.ClassNameComputerSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227961")]
|
||||
|
@ -26,7 +26,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public class GetCimInstanceCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -35,7 +35,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -61,7 +61,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(
|
||||
Mandatory = true,
|
||||
ValueFromPipeline = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
public CimSession[] CimSession
|
||||
{
|
||||
|
@ -114,13 +114,13 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(
|
||||
ParameterSetName = CimBaseCommand.CimInstanceComputerSet)]
|
||||
[Parameter(
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.QueryComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.QuerySessionSet)]
|
||||
ParameterSetName = CimBaseCommand.QuerySessionSet)]
|
||||
public Uri ResourceUri
|
||||
{
|
||||
get { return resourceUri; }
|
||||
|
@ -130,12 +130,12 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
base.SetParameter(value, nameResourceUri);
|
||||
}
|
||||
}
|
||||
private Uri resourceUri;
|
||||
private Uri resourceUri;
|
||||
|
||||
/// <summary>
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// Provides the name of the computer from which to retrieve the instances. The
|
||||
/// ComputerName is used to create a temporary CimSession with default parameter
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// Provides the name of the computer from which to retrieve the instances. The
|
||||
/// ComputerName is used to create a temporary CimSession with default parameter
|
||||
/// values, which is then used to retrieve the instances.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
@ -148,7 +148,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.ClassNameComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.QueryComputerSet)]
|
||||
|
@ -176,7 +176,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ParameterSetName = CimBaseCommand.ClassNameComputerSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ClassNameSessionSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
public SwitchParameter KeyOnly
|
||||
{
|
||||
get { return keyOnly; }
|
||||
|
@ -205,7 +205,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.QueryComputerSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
|
@ -307,19 +307,19 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// <para>
|
||||
/// The following is the definition of the input parameter "QueryDialect".
|
||||
/// Specifies the dialect used by the query Engine that interprets the Query
|
||||
/// Specifies the dialect used by the query Engine that interprets the Query
|
||||
/// string.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.QueryComputerSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.QuerySessionSet)]
|
||||
ParameterSetName = CimBaseCommand.QuerySessionSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ClassNameSessionSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ClassNameComputerSet)]
|
||||
|
||||
|
||||
public String QueryDialect
|
||||
{
|
||||
get { return queryDialect; }
|
||||
|
@ -334,16 +334,16 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// <para>
|
||||
/// The following is the definition of the input parameter "Shallow".
|
||||
/// If the switch is set to True, only instance of the class identified by
|
||||
/// Namespace + ClassName will be returned. If the switch is not set, instances
|
||||
/// of the above class and of all of its descendents will be returned (the
|
||||
/// If the switch is set to True, only instance of the class identified by
|
||||
/// Namespace + ClassName will be returned. If the switch is not set, instances
|
||||
/// of the above class and of all of its descendents will be returned (the
|
||||
/// enumeration will cascade the class inheritance hierarchy).
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ClassNameComputerSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ClassNameSessionSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.QueryComputerSet)]
|
||||
[Parameter(ParameterSetName = CimBaseCommand.QuerySessionSet)]
|
||||
public SwitchParameter Shallow
|
||||
|
@ -370,7 +370,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
public String Filter
|
||||
{
|
||||
get { return filter; }
|
||||
|
@ -395,7 +395,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
[Alias("SelectProperties")]
|
||||
public String[] Property
|
||||
|
@ -513,7 +513,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
internal const string nameCimInstance = "InputObject";
|
||||
internal const string nameCimSession = "CimSession";
|
||||
internal const string nameClassName = "ClassName";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameComputerName = "ComputerName";
|
||||
internal const string nameFilter = "Filter";
|
||||
internal const string nameKeyOnly = "KeyOnly";
|
||||
|
@ -545,9 +545,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QuerySessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QuerySessionSet, false),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
nameClassName, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, true),
|
||||
|
@ -559,7 +559,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -567,7 +567,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -575,7 +575,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QuerySessionSet, false),
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -606,7 +606,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.QuerySessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -624,7 +624,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -640,7 +640,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{ CimBaseCommand.ClassNameSessionSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.QueryComputerSet, new ParameterSetEntry(1) },
|
||||
{ CimBaseCommand.ResourceUriSessionSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.ResourceUriComputerSet, new ParameterSetEntry(1) },
|
||||
{ CimBaseCommand.ResourceUriComputerSet, new ParameterSetEntry(1) },
|
||||
{ CimBaseCommand.QuerySessionSet, new ParameterSetEntry(2) }
|
||||
};
|
||||
#endregion
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -14,7 +14,7 @@ using System.Management.Automation;
|
|||
namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
{
|
||||
/// <summary>
|
||||
/// The command returns zero, one or more CimSession objects that represent
|
||||
/// The command returns zero, one or more CimSession objects that represent
|
||||
/// connections with remote computers established from the current PS Session.
|
||||
/// </summary>
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public sealed class GetCimSessionCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -32,7 +32,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -40,17 +40,17 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// <para>
|
||||
/// The following is the definition of the input parameter "ComputerName".
|
||||
/// Specifies one or more connections by providing their ComputerName(s). The
|
||||
/// Cmdlet then gets CimSession(s) opened with those connections. This parameter
|
||||
/// is an alternative to using CimSession(s) that also identifies the remote
|
||||
/// Specifies one or more connections by providing their ComputerName(s). The
|
||||
/// Cmdlet then gets CimSession(s) opened with those connections. This parameter
|
||||
/// is an alternative to using CimSession(s) that also identifies the remote
|
||||
/// computer(s).
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This is the only optional parameter of the Cmdlet. If not provided, the
|
||||
/// Cmdlet returns all CimSession(s) live/active in the runspace.
|
||||
/// This is the only optional parameter of the Cmdlet. If not provided, the
|
||||
/// Cmdlet returns all CimSession(s) live/active in the runspace.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If an instance of CimSession is pipelined to Get-CimSession, the
|
||||
/// If an instance of CimSession is pipelined to Get-CimSession, the
|
||||
/// ComputerName property of the instance is bound by name with this parameter.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
|
@ -111,7 +111,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Name".
|
||||
/// Specifies one or more session Name(s) for which to get CimSession(s). The
|
||||
/// Specifies one or more session Name(s) for which to get CimSession(s). The
|
||||
/// argument may contain wildcard characters.
|
||||
/// </summary>
|
||||
[Parameter(Mandatory = true,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -15,7 +15,7 @@ using System.Management.Automation;
|
|||
namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
{
|
||||
/// <summary>
|
||||
/// This cmdlet enables the user to invoke a static method on a CIM class using
|
||||
/// This cmdlet enables the user to invoke a static method on a CIM class using
|
||||
/// the arguments passed as a list of name value pair dictionary.
|
||||
/// </summary>
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public class InvokeCimMethodCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -37,7 +37,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -75,13 +75,13 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.CimInstanceComputerSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
[Parameter(Mandatory = true,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(Mandatory = true,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
public Uri ResourceUri
|
||||
{
|
||||
get { return resourceUri; }
|
||||
|
@ -90,8 +90,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
this.resourceUri = value;
|
||||
base.SetParameter(value, nameResourceUri);
|
||||
}
|
||||
}
|
||||
private Uri resourceUri;
|
||||
}
|
||||
private Uri resourceUri;
|
||||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "CimClass".
|
||||
|
@ -140,7 +140,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// <para>
|
||||
/// The following is the definition of the input parameter "QueryDialect".
|
||||
/// Specifies the dialect used by the query Engine that interprets the Query
|
||||
/// Specifies the dialect used by the query Engine that interprets the Query
|
||||
/// string.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
|
@ -193,9 +193,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
private CimInstance cimInstance;
|
||||
|
||||
/// <summary>
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// Provides the name of the computer from which to invoke the method. The
|
||||
/// ComputerName is used to create a temporary CimSession with default parameter
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// Provides the name of the computer from which to invoke the method. The
|
||||
/// ComputerName is used to create a temporary CimSession with default parameter
|
||||
/// values, which is then used to retrieve the instances.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
@ -216,7 +216,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.CimClassComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
public String[] ComputerName
|
||||
{
|
||||
|
@ -254,7 +254,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimClassSessionSet)]
|
||||
[Parameter(Mandatory = true,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
public CimSession[] CimSession
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// </summary>
|
||||
[Parameter(Position = 1, ValueFromPipelineByPropertyName = true)]
|
||||
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public IDictionary Arguments
|
||||
public IDictionary Arguments
|
||||
{
|
||||
get { return arguments; }
|
||||
set { arguments = value; }
|
||||
|
@ -314,10 +314,10 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.QuerySessionSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
public String Namespace
|
||||
{
|
||||
get { return nameSpace; }
|
||||
|
@ -331,7 +331,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "OperationTimeoutSec".
|
||||
/// Enables the user to specify the operation timeout in Seconds. This value
|
||||
/// Enables the user to specify the operation timeout in Seconds. This value
|
||||
/// overwrites the value specified by the CimSession Operation timeout.
|
||||
/// </summary>
|
||||
[Alias(AliasOT)]
|
||||
|
@ -438,7 +438,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
internal const string nameClassName = "ClassName";
|
||||
internal const string nameCimClass = "CimClass";
|
||||
internal const string nameQuery = "Query";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameQueryDialect = "QueryDialect";
|
||||
internal const string nameCimInstance = "InputObject";
|
||||
internal const string nameComputerName = "ComputerName";
|
||||
|
@ -489,7 +489,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -498,9 +498,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.QuerySessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
nameMethodName, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, true),
|
||||
|
@ -512,7 +512,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.CimClassComputerSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -522,7 +522,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.QueryComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QuerySessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -530,9 +530,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true),
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -541,8 +541,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
static Dictionary<string, ParameterSetEntry> parameterSets = new Dictionary<string, ParameterSetEntry>
|
||||
{
|
||||
{ CimBaseCommand.ClassNameComputerSet, new ParameterSetEntry(2, true) },
|
||||
{ CimBaseCommand.ResourceUriSessionSet, new ParameterSetEntry(3) },
|
||||
{ CimBaseCommand.ResourceUriComputerSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.ResourceUriSessionSet, new ParameterSetEntry(3) },
|
||||
{ CimBaseCommand.ResourceUriComputerSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.ClassNameSessionSet, new ParameterSetEntry(3) },
|
||||
{ CimBaseCommand.QueryComputerSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.QuerySessionSet, new ParameterSetEntry(3) },
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public class NewCimInstanceCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -38,7 +38,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -79,7 +79,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(Mandatory = true,
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
public Uri ResourceUri
|
||||
{
|
||||
get { return resourceUri; }
|
||||
|
@ -89,7 +89,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
base.SetParameter(value, nameResourceUri);
|
||||
}
|
||||
}
|
||||
private Uri resourceUri;
|
||||
private Uri resourceUri;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
|
@ -111,7 +111,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
public String[] Key
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ValueFromPipelineByPropertyName = true)]
|
||||
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
[Alias("Arguments")]
|
||||
public IDictionary Property
|
||||
public IDictionary Property
|
||||
{
|
||||
get { return property; }
|
||||
set { property = value; }
|
||||
|
@ -186,7 +186,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
public String Namespace
|
||||
{
|
||||
get { return nameSpace; }
|
||||
|
@ -200,7 +200,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "OperationTimeoutSec".
|
||||
/// Operation Timeout of the cmdlet in seconds. Overrides the value in the Cim
|
||||
/// Operation Timeout of the cmdlet in seconds. Overrides the value in the Cim
|
||||
/// Session.
|
||||
/// </summary>
|
||||
[Alias(AliasOT)]
|
||||
|
@ -225,7 +225,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(
|
||||
Mandatory = true,
|
||||
ValueFromPipeline = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriSessionSet)]
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
ValueFromPipeline = true,
|
||||
|
@ -243,7 +243,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
private CimSession[] cimSession;
|
||||
|
||||
/// <summary>
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// Provides the name of the computer from which to create the instances.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
@ -256,7 +256,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
ParameterSetName = CimBaseCommand.ClassNameComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
ParameterSetName = CimBaseCommand.ResourceUriComputerSet)]
|
||||
[Parameter(
|
||||
ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimClassComputerSet)]
|
||||
|
@ -286,13 +286,13 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(
|
||||
ParameterSetName = CimBaseCommand.CimClassComputerSet)]
|
||||
[Parameter(
|
||||
ParameterSetName = CimBaseCommand.CimClassSessionSet)]
|
||||
public SwitchParameter ClientOnly
|
||||
ParameterSetName = CimBaseCommand.CimClassSessionSet)]
|
||||
public SwitchParameter ClientOnly
|
||||
{
|
||||
get { return clientOnly; }
|
||||
set {
|
||||
clientOnly = value;
|
||||
base.SetParameter(value, nameClientOnly);
|
||||
set {
|
||||
clientOnly = value;
|
||||
base.SetParameter(value, nameClientOnly);
|
||||
}
|
||||
}
|
||||
private SwitchParameter clientOnly;
|
||||
|
@ -431,15 +431,15 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
nameResourceUri, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
nameKey, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -447,26 +447,26 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.CimClassSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassComputerSet, true),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
nameNamespace, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, false),
|
||||
}
|
||||
},
|
||||
{
|
||||
nameCimSession, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassSessionSet, true),
|
||||
}
|
||||
},
|
||||
{
|
||||
nameComputerName, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassComputerSet, false),
|
||||
}
|
||||
},
|
||||
|
@ -475,9 +475,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassComputerSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimClassComputerSet, true),
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
@ -490,7 +490,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{ CimBaseCommand.CimClassSessionSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.CimClassComputerSet, new ParameterSetEntry(1) },
|
||||
{ CimBaseCommand.ResourceUriSessionSet, new ParameterSetEntry(2) },
|
||||
{ CimBaseCommand.ResourceUriComputerSet, new ParameterSetEntry(1) },
|
||||
{ CimBaseCommand.ResourceUriComputerSet, new ParameterSetEntry(1) },
|
||||
};
|
||||
#endregion
|
||||
}//End Class
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -15,10 +15,10 @@ using Microsoft.Management.Infrastructure.Options;
|
|||
namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
{
|
||||
/// <summary>
|
||||
/// This Cmdlet enables the IT Pro to create a CIM Session. CIM Session object
|
||||
/// is a client-side representation of the connection between the client and the
|
||||
/// server.
|
||||
/// The CimSession object returned by the Cmdlet is used by all other CIM
|
||||
/// This Cmdlet enables the IT Pro to create a CIM Session. CIM Session object
|
||||
/// is a client-side representation of the connection between the client and the
|
||||
/// server.
|
||||
/// The CimSession object returned by the Cmdlet is used by all other CIM
|
||||
/// cmdlets.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsCommon.New, "CimSession", DefaultParameterSetName = CredentialParameterSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227967")]
|
||||
|
@ -74,7 +74,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ComputerName".
|
||||
/// Specifies the computer on which the commands associated with this session
|
||||
/// Specifies the computer on which the commands associated with this session
|
||||
/// will run. The default value is LocalHost.
|
||||
/// </summary>
|
||||
[Alias(AliasCN, AliasServerName)]
|
||||
|
@ -96,8 +96,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// Specifies a friendly name for the CIM Session connection.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// If a name is not passed, then the session is given the name CimSession<int>,
|
||||
/// where <int> is the next available session number. Example, CimSession1,
|
||||
/// If a name is not passed, then the session is given the name CimSession<int>,
|
||||
/// where <int> is the next available session number. Example, CimSession1,
|
||||
/// CimSession2, etc...
|
||||
/// </para>
|
||||
/// </summary>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -28,14 +28,14 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
};
|
||||
|
||||
/// <summary>
|
||||
/// The Cmdlet allows the IT Pro to create a CimSessionOptions object that she/he
|
||||
/// can subsequently use to create one or more CimSession connections. The
|
||||
/// options object holds the CIM Session information that is less commonly set
|
||||
/// and used by the IT Pro, and most commonly defaulted.
|
||||
/// The Cmdlet allows the IT Pro to create a CimSessionOptions object that she/he
|
||||
/// can subsequently use to create one or more CimSession connections. The
|
||||
/// options object holds the CIM Session information that is less commonly set
|
||||
/// and used by the IT Pro, and most commonly defaulted.
|
||||
///
|
||||
/// The Cmdlet has two parameter sets, one for WMMan options and one for DCOM
|
||||
/// options. Depending on the arguments the Cmdlet will return an instance of
|
||||
/// DComSessionOptions or WSManSessionOptions, which derive from
|
||||
/// The Cmdlet has two parameter sets, one for WMMan options and one for DCOM
|
||||
/// options. Depending on the arguments the Cmdlet will return an instance of
|
||||
/// DComSessionOptions or WSManSessionOptions, which derive from
|
||||
/// CimSessionOptions.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsCommon.New, "CimSessionOption", DefaultParameterSetName = ProtocolNameParameterSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227969")]
|
||||
|
@ -43,7 +43,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public sealed class NewCimSessionOptionCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -52,7 +52,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region cmdlet parameters
|
||||
|
@ -153,8 +153,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Encoding".
|
||||
/// Defined the message encoding.
|
||||
/// The allowed encodings are { Default | Utf8 | Utf16 }. The default value
|
||||
/// Defined the message encoding.
|
||||
/// The allowed encodings are { Default | Utf8 | Utf16 }. The default value
|
||||
/// should be Utf8.
|
||||
/// </summary>
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
|
@ -174,7 +174,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "HttpPrefix".
|
||||
/// This is the HTTP URL on the server on which the WSMan service is listening.
|
||||
/// This is the HTTP URL on the server on which the WSMan service is listening.
|
||||
/// In most cases it is /wsman, which is the default.
|
||||
/// </summary>
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
|
@ -302,7 +302,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Impersonation".
|
||||
/// Used to select if, and if so what kind of, impersonation should be used.
|
||||
/// Used to select if, and if so what kind of, impersonation should be used.
|
||||
/// Applies only to the DCOM channel.
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = DcomParameterSet)]
|
||||
|
@ -321,7 +321,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "PacketIntegrity".
|
||||
/// Switch indicating if the package integrity in DCOM connections should be
|
||||
/// Switch indicating if the package integrity in DCOM connections should be
|
||||
/// checked/enforced.
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = DcomParameterSet)]
|
||||
|
@ -340,7 +340,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "PacketPrivacy".
|
||||
/// Switch indicating if packet privacy of the packets in DCOM communications
|
||||
/// Switch indicating if packet privacy of the packets in DCOM communications
|
||||
/// should be checked/enforced.
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = DcomParameterSet)]
|
||||
|
@ -660,13 +660,13 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameSkipCACheck, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameSkipCNCheck, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
|
@ -677,7 +677,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameEncodePortInServicePrincipalName, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
|
@ -688,7 +688,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameHttpPrefix, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
|
@ -699,7 +699,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameProxyAuthentication, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
|
@ -710,7 +710,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameProxyCredential, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
|
@ -721,7 +721,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameUseSsl, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false),
|
||||
|
@ -732,7 +732,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.DcomParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
namePacketIntegrity, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.DcomParameterSet, false),
|
||||
|
@ -743,7 +743,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.DcomParameterSet, false),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
nameProtocol, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ProtocolNameParameterSet, true),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -15,10 +15,10 @@ using Microsoft.PowerShell.Commands;
|
|||
namespace Microsoft.Management.Infrastructure.CimCmdlets
|
||||
{
|
||||
/// <summary>
|
||||
/// Enables the user to subscribe to indications using Filter Expression or
|
||||
/// Enables the user to subscribe to indications using Filter Expression or
|
||||
/// Query Expression.
|
||||
/// -SourceIdentifier is a name given to the subscription
|
||||
/// The Cmdlet should return a PS EventSubscription object that can be used to
|
||||
/// The Cmdlet should return a PS EventSubscription object that can be used to
|
||||
/// cancel the subscription
|
||||
/// Should we have the second parameter set with a -Query?
|
||||
/// </summary>
|
||||
|
@ -92,7 +92,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
/// <summary>
|
||||
/// <para>
|
||||
/// The following is the definition of the input parameter "QueryDialect".
|
||||
/// Specifies the dialect used by the query Engine that interprets the Query
|
||||
/// Specifies the dialect used by the query Engine that interprets the Query
|
||||
/// string.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
|
@ -146,7 +146,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ComputerName".
|
||||
/// Specifies the computer on which the commands associated with this session
|
||||
/// Specifies the computer on which the commands associated with this session
|
||||
/// will run. The default value is LocalHost.
|
||||
/// </summary>
|
||||
[Alias(CimBaseCommand.AliasCN, CimBaseCommand.AliasServerName)]
|
||||
|
@ -308,7 +308,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, true),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.ClassNameComputerSet, true),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
nameQuery, new HashSet<ParameterDefinitionEntry> {
|
||||
new ParameterDefinitionEntry(CimBaseCommand.QueryExpressionSessionSet, true),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
public class RemoveCimInstanceCommand : CimBaseCommand
|
||||
{
|
||||
#region constructor
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// constructor
|
||||
/// </summary>
|
||||
|
@ -36,7 +36,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
DebugHelper.WriteLogEx();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -74,7 +74,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.CimInstanceComputerSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
public Uri ResourceUri
|
||||
{
|
||||
get { return resourceUri; }
|
||||
|
@ -83,8 +83,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
this.resourceUri = value;
|
||||
base.SetParameter(value, nameResourceUri);
|
||||
}
|
||||
}
|
||||
private Uri resourceUri;
|
||||
}
|
||||
private Uri resourceUri;
|
||||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ComputerName".
|
||||
|
@ -352,7 +352,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceSessionSet, false),
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -35,14 +35,14 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
: base(parameters, parameterSets)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "CimSession".
|
||||
/// Specifies one or more CimSession object to be removed from the local PS
|
||||
/// Specifies one or more CimSession object to be removed from the local PS
|
||||
/// session/runspace.
|
||||
/// </summary>
|
||||
[Parameter(
|
||||
|
@ -65,9 +65,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
|
||||
/// <summary>
|
||||
/// <para>The following is the definition of the input parameter "ComputerName".
|
||||
/// Specified one or more computer names for which all CimSession(s)
|
||||
/// Specified one or more computer names for which all CimSession(s)
|
||||
/// (connections) should be removed (terminated).</para>
|
||||
/// <para>This is the only optional parameter. If no value for this parameter is
|
||||
/// <para>This is the only optional parameter. If no value for this parameter is
|
||||
/// provided, all CimSession(s) are terminated.</para>
|
||||
/// </summary>
|
||||
[Alias(AliasCN, AliasServerName)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
: base(parameters, parameterSets)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region parameters
|
||||
|
@ -94,7 +94,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.CimInstanceComputerSet)]
|
||||
[Parameter(ValueFromPipelineByPropertyName = true,
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
ParameterSetName = CimBaseCommand.CimInstanceSessionSet)]
|
||||
public Uri ResourceUri
|
||||
{
|
||||
get { return resourceUri; }
|
||||
|
@ -103,8 +103,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
this.resourceUri = value;
|
||||
base.SetParameter(value, nameResourceUri);
|
||||
}
|
||||
}
|
||||
private Uri resourceUri;
|
||||
}
|
||||
private Uri resourceUri;
|
||||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Namespace".
|
||||
|
@ -350,7 +350,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
#region const string of parameter names
|
||||
internal const string nameCimSession = "CimSession";
|
||||
internal const string nameComputerName = "ComputerName";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameResourceUri = "ResourceUri";
|
||||
internal const string nameNamespace = "Namespace";
|
||||
internal const string nameCimInstance = "InputObject";
|
||||
internal const string nameQuery = "Query";
|
||||
|
@ -412,7 +412,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceComputerSet, false),
|
||||
new ParameterDefinitionEntry(CimBaseCommand.CimInstanceSessionSet, false),
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*============================================================================
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
* Copyright (C) Microsoft Corporation, All rights reserved.
|
||||
*============================================================================
|
||||
*/
|
||||
|
||||
// #define LOGENABLE // uncomment this line to enable the log,
|
||||
// #define LOGENABLE // uncomment this line to enable the log,
|
||||
// create c:\temp\cim.log before invoking cimcmdlets
|
||||
|
||||
using System;
|
||||
|
@ -231,7 +231,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
return string.Format(CultureInfo.CurrentUICulture, "{0}::{1} ",
|
||||
frame.GetMethod().DeclaringType.Name,
|
||||
frame.GetMethod().Name);
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
#endregion
|
||||
|
@ -371,7 +371,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets
|
|||
{
|
||||
writer.WriteLineAsync(spaces[indent] + sourceInformation + @" " + message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,14 +25,14 @@ namespace Microsoft.PowerShell.Activities
|
|||
/// Gets the fully qualified name of the command invoked by this activity.
|
||||
/// </summary>
|
||||
public override string PSCommandName { get { return "CimCmdlets\\Get-CimAssociatedInstance"; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The .NET type implementing the cmdlet to invoke.
|
||||
/// </summary>
|
||||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.GetCimAssociatedInstanceCommand); } }
|
||||
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Association parameter.
|
||||
/// </summary>
|
||||
|
@ -92,7 +92,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
|
||||
|
||||
// Initialize the arguments
|
||||
|
||||
|
||||
if(Association.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Association", Association.Get(context));
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace Microsoft.PowerShell.Activities
|
|||
/// The .NET type implementing the cmdlet to invoke.
|
||||
/// </summary>
|
||||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.GetCimClassCommand); } }
|
||||
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the ClassName parameter.
|
||||
/// </summary>
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace Microsoft.PowerShell.Activities
|
|||
/// The .NET type implementing the cmdlet to invoke.
|
||||
/// </summary>
|
||||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand); } }
|
||||
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the ClassName parameter.
|
||||
/// </summary>
|
||||
|
@ -115,7 +115,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
|
||||
|
||||
// Initialize the arguments
|
||||
|
||||
|
||||
if(ClassName.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("ClassName", ClassName.Get(context));
|
||||
|
|
|
@ -13,159 +13,159 @@ namespace Microsoft.PowerShell.Activities
|
|||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public enum PSWorkflowRuntimeVariable
|
||||
{
|
||||
// Command Parameters
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSComputerName = 0,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSCredential = 1,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSPort = 2,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSUseSsl = 3,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSConfigurationName = 4,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSApplicationName = 5,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSConnectionUri = 6,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSAllowRedirection = 7,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSSessionOption = 8,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSAuthentication = 9,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSAuthenticationLevel = 10,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSCertificateThumbprint = 11,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
Input = 13,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
Verbose = 15,
|
||||
|
||||
// Retry policy constants
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSConnectionRetryCount = 19,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSConnectionRetryIntervalSec = 21,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSPrivateMetadata = 24,
|
||||
|
||||
// Timers
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSRunningTimeoutSec = 27,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSElapsedTimeoutSec = 28,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSWorkflowRoot = 31,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
JobName = 32,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
JobInstanceId = 33,
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
JobId = 34,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
JobCommandName = 36,
|
||||
JobCommandName = 36,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
ParentJobInstanceId = 40,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
ParentJobName = 41,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
ParentJobId = 42,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
ParentCommandName = 43,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
WorkflowInstanceId = 48,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSSenderInfo = 49,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSCulture = 50,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")]
|
||||
PSUICulture = 51,
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
PSVersionTable = 52,
|
||||
|
||||
|
@ -279,7 +279,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
outputStream = parameter.Value as PSDataCollection<PSObject>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// If the property to return was all, then just return the entire collection as a hashtable.
|
||||
// (We still needed to loop to find the output stream to write into.)
|
||||
|
@ -305,7 +305,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
//
|
||||
if (workflowRuntimeVariables.ContainsKey(varKey))
|
||||
{
|
||||
Object value = null;
|
||||
Object value = null;
|
||||
dictionaryParam.TryGetValue(varKey, out value);
|
||||
workflowRuntimeVariables[varKey] = value;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand); } }
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the ClassName parameter.
|
||||
/// </summary>
|
||||
|
@ -113,7 +113,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
|
||||
|
||||
// Initialize the arguments
|
||||
|
||||
|
||||
if(ClassName.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("ClassName", ClassName.Get(context));
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace Microsoft.PowerShell.Activities
|
|||
/// The .NET type implementing the cmdlet to invoke.
|
||||
/// </summary>
|
||||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.NewCimInstanceCommand); } }
|
||||
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the ClassName parameter.
|
||||
/// </summary>
|
||||
|
@ -99,7 +99,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
|
||||
|
||||
// Initialize the arguments
|
||||
|
||||
|
||||
if(ClassName.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("ClassName", ClassName.Get(context));
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCommand); } }
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Authentication parameter.
|
||||
/// </summary>
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionOptionCommand); } }
|
||||
|
||||
// Arguments
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the NoEncryption parameter.
|
||||
/// </summary>
|
||||
|
@ -183,7 +183,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
|
||||
|
||||
// Initialize the arguments
|
||||
|
||||
|
||||
if(NoEncryption.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("NoEncryption", NoEncryption.Get(context));
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
// The guard check for a null expression string is done in Execute() instead
|
||||
// of in this property. It's also done in the validation check for CacheMetadata
|
||||
string updatedExpression = Expression;
|
||||
|
||||
|
||||
// Hack to make sure the $input *does* get unrolled...
|
||||
if (string.Equals("$input", Expression.Trim(), StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
/// List of command names to allow in the expression
|
||||
/// </param>
|
||||
/// <param name="allowedVariables">
|
||||
/// List of variable names to allow in the expression. If the collection contains a single
|
||||
/// List of variable names to allow in the expression. If the collection contains a single
|
||||
/// element "*", all variables will be allowed including environment variables
|
||||
/// functions, etc.
|
||||
/// </param>
|
||||
|
@ -270,7 +270,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// it is fine to catch generic exception here
|
||||
// it is fine to catch generic exception here
|
||||
// if the local runspace provider does not give us
|
||||
// a runspace we will create one locally (fallback)
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);
|
||||
|
||||
// Initialize the arguments
|
||||
|
||||
|
||||
if(Namespace.Expression != null)
|
||||
{
|
||||
targetCommand.AddParameter("Namespace", Namespace.Get(context));
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace cimcmdlets.Activities
|
|||
/// The .NET type implementing the cmdlet to invoke.
|
||||
/// </summary>
|
||||
public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.SetCimInstanceCommand); } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Provides access to the Namespace parameter.
|
||||
/// </summary>
|
||||
|
@ -87,7 +87,7 @@ namespace cimcmdlets.Activities
|
|||
protected override string PSDefiningModule { get { return "CimCmdlets"; } }
|
||||
|
||||
// Additional custom code for this activity
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
[DefaultValue(null)]
|
||||
public InArgument<Object> Value
|
||||
|
@ -252,7 +252,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forces the activity to not call the persist functionality, which will be responsible for
|
||||
/// Forces the activity to not call the persist functionality, which will be responsible for
|
||||
/// persisting the workflow state onto the disk.
|
||||
/// </summary>
|
||||
[BehaviorCategory]
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
metadata.AddArgument(new RuntimeArgument("Values", typeof(IEnumerable<T>), ArgumentDirection.In, true));
|
||||
metadata.AddArgument(new RuntimeArgument("ThrottleLimit", typeof(int), ArgumentDirection.In));
|
||||
|
||||
// initialize the hasCompleted and valueEnumerator and add it to the list of private variables
|
||||
// initialize the hasCompleted and valueEnumerator and add it to the list of private variables
|
||||
this.hasCompleted = new Variable<bool>();
|
||||
metadata.AddImplementationVariable(this.hasCompleted);
|
||||
|
||||
|
@ -87,7 +87,7 @@ namespace Microsoft.PowerShell.Activities
|
|||
throw new ApplicationException("ParallelForEach requires a non null Values collection");
|
||||
}
|
||||
|
||||
// get the enumerator
|
||||
// get the enumerator
|
||||
this.valueEnumerator.Set(context, values.GetEnumerator());
|
||||
|
||||
// initialize the values for creating the execution window (max and runningCount)
|
||||
|
|
|
@ -25,7 +25,7 @@ using System.Globalization;
|
|||
|
||||
namespace Microsoft.PowerShell.Activities
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Workflow activity wrapping the Get-Wmiobject cmdlet
|
||||
/// </summary>
|
||||
|
|
|
@ -369,7 +369,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
errorList.AddRange(e.Errors);
|
||||
errorList.AddRange(e.Errors);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
functionDefinition = helpContent.GetCommentBlock() + functionDefinition;
|
||||
}
|
||||
|
||||
|
||||
var sb = ScriptBlock.Create(functionDefinition);
|
||||
sb.DebuggerHidden = true;
|
||||
|
||||
|
@ -460,7 +460,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
static internal IEnumerable<string> GetRequiredAssembliesFromInitialSessionState(
|
||||
InitialSessionState initialSessionState,
|
||||
System.Management.Automation.PowerShell invoker)
|
||||
{
|
||||
{
|
||||
var getModuleCommand = new CmdletInfo("Get-Module", typeof(GetModuleCommand));
|
||||
invoker.Commands.Clear();
|
||||
invoker.AddCommand(getModuleCommand)
|
||||
|
@ -634,7 +634,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
case AstToXamlConverter.ActivityKind.InlineScript:
|
||||
return AstToXamlConverter.GetAvailableProperties(typeof(InlineScript), null);
|
||||
|
||||
|
||||
case AstToXamlConverter.ActivityKind.Persist:
|
||||
// The checkpoint-workflow activity accepts no parameters
|
||||
return null;
|
||||
|
@ -657,7 +657,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
return new Dictionary<string, Type> {{"TypeName", typeof (string)}};
|
||||
|
||||
case AstToXamlConverter.ActivityKind.RegularCommand:
|
||||
// If the command resolved to a script, the command metadata has all of it's parameters,
|
||||
// If the command resolved to a script, the command metadata has all of it's parameters,
|
||||
if ((command != null) && (command.CommandType & (CommandTypes.ExternalScript | CommandTypes.Workflow | CommandTypes.Function | CommandTypes.Filter | CommandTypes.Configuration)) != 0)
|
||||
{
|
||||
return null;
|
||||
|
@ -840,12 +840,12 @@ namespace Microsoft.PowerShell.Workflow
|
|||
get { return parameterValidation; }
|
||||
}
|
||||
private Dictionary<string, ParameterAst> parameterValidation = new Dictionary<string, ParameterAst>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
|
||||
private bool disableSymbolGeneration = false;
|
||||
private string name = null;
|
||||
private PSModuleInfo definingModule = null;
|
||||
private readonly Ast scriptWorkflowAstRoot;
|
||||
private int _currentIndentLevel;
|
||||
private int _currentIndentLevel;
|
||||
private Scope scope;
|
||||
private System.Management.Automation.PowerShell invoker;
|
||||
|
||||
|
@ -874,7 +874,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
xmlns:sad=""clr-namespace:System.Activities.Debugger;assembly=System.Activities""
|
||||
xmlns:local=""clr-namespace:Microsoft.PowerShell.DynamicActivities""
|
||||
xmlns:mva=""clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities""
|
||||
mva:VisualBasic.Settings=""Assembly references and imported namespaces serialized as XML namespaces""
|
||||
mva:VisualBasic.Settings=""Assembly references and imported namespaces serialized as XML namespaces""
|
||||
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""";
|
||||
|
||||
private const string xamlFooter = @"</Activity>";
|
||||
|
@ -882,7 +882,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
private const string GenericTypesKey = @"Activity-GenericTypes";
|
||||
private const string MemberTemplate = @"<Variable Name=""{0}"" x:TypeArguments=""{1}"" {2}/>";
|
||||
private const string M3PKeyForThrowStatement = @"__Microsoft.PowerShell.Activities.Throw";
|
||||
|
||||
|
||||
// PseudoCommands that only work in the script workflow
|
||||
// Please keep in sync with the System.Management.Automation.CompletionCompleter.PseudoCommands
|
||||
private const string CheckpointWorkflow = "Checkpoint-Workflow";
|
||||
|
@ -957,11 +957,11 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
throw new ParseException(errors);
|
||||
}
|
||||
return (FunctionDefinitionAst)block.EndBlock.Statements[0];
|
||||
return (FunctionDefinitionAst)block.EndBlock.Statements[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="definition"></param>
|
||||
|
@ -1386,7 +1386,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
scriptBlockAst.ParamBlock.Visit(this);
|
||||
}
|
||||
|
||||
// Initialize the 'result' reference parameter with empty collection, without this result parameter is generating
|
||||
// Initialize the 'result' reference parameter with empty collection, without this result parameter is generating
|
||||
// wrong results if it is first used in a += operation in Powershell value activity.
|
||||
if(members.ContainsKey("result") && typeof(PSDataCollection<PSObject>).IsAssignableFrom(members["result"].Type))
|
||||
{
|
||||
|
@ -1506,7 +1506,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
// workflow.
|
||||
if (parameterAst.DefaultValue != null)
|
||||
{
|
||||
bool areParameterAndDefaultCompatible =
|
||||
bool areParameterAndDefaultCompatible =
|
||||
(parameterAst.StaticType == typeof(object)) ||
|
||||
(parameterAst.StaticType == typeof(bool)) ||
|
||||
(parameterAst.StaticType == parameterAst.DefaultValue.StaticType);
|
||||
|
@ -1574,7 +1574,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
actualVariableName = name;
|
||||
if (name == null) { return false; }
|
||||
|
||||
|
||||
if (!isParameter)
|
||||
{
|
||||
// Allow the "WORKFLOW:" scope qualifier in nested scopes
|
||||
|
@ -1680,7 +1680,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
// See if it's the variable we're looking for
|
||||
// Variable = <Expression>
|
||||
string workingVariableName = detectedVariableName;
|
||||
|
||||
|
||||
// Allow the "WORKFLOW:" scope qualifier in nested scopes
|
||||
if (workingVariableName.StartsWith("WORKFLOW:", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
@ -1793,7 +1793,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
}
|
||||
else if (detectedTypes.Contains(typeof(PSDataCollection<PSObject>)))
|
||||
{
|
||||
// When we see that a variable is storing the result of an activity call,
|
||||
// When we see that a variable is storing the result of an activity call,
|
||||
// we can't have the detected type be an Object, as Workflow doesn't allow that.
|
||||
// So we just return PSDataCollection<PSObject> in that case.
|
||||
return typeof(PSDataCollection<PSObject>);
|
||||
|
@ -1901,7 +1901,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
/// Block variable scope prefix like "$GLOBAL:" and "$SCRIPT:". In script workflow,
|
||||
/// the only valid scope prefix is "$WORKFLOW:". When generating expression for the
|
||||
/// PowerShellValue activity, we need to remove the $WORKFLOW part. Otherwise it will
|
||||
/// generate error during execution, because the prefix "WORKFLOW" is not actually
|
||||
/// generate error during execution, because the prefix "WORKFLOW" is not actually
|
||||
/// supported in the PowerShell.
|
||||
/// </summary>
|
||||
/// <param name="expression"></param>
|
||||
|
@ -1915,7 +1915,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
string variableName = variableExpr.VariablePath.ToString();
|
||||
if (variableName.IndexOf(':') != -1 && !variableName.StartsWith("ENV:", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
@ -2061,7 +2061,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
/// This needs to be propagated to the synthesized driver function .
|
||||
/// </summary>
|
||||
internal string CmdletAttributeText { get; set; }
|
||||
|
||||
|
||||
object ICustomAstVisitor.VisitParamBlock(ParamBlockAst paramBlockAst)
|
||||
{
|
||||
foreach (ParameterAst parameter in paramBlockAst.Parameters)
|
||||
|
@ -2102,8 +2102,8 @@ namespace Microsoft.PowerShell.Workflow
|
|||
|
||||
object ICustomAstVisitor.VisitStatementBlock(StatementBlockAst statementBlockAst)
|
||||
{
|
||||
// If the statement block is the body of a parallel block statement, we enclose each
|
||||
// statement in a Try/Catch block, so that:
|
||||
// If the statement block is the body of a parallel block statement, we enclose each
|
||||
// statement in a Try/Catch block, so that:
|
||||
// 1. the activities generated for each statement will be executed sequentially.
|
||||
// 2. the terminating exception thrown from one statement will not terminate other statements that
|
||||
// are running in parallel.
|
||||
|
@ -2206,7 +2206,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
WriteLine("<If.Else>");
|
||||
IndentLevel();
|
||||
|
||||
|
||||
WriteLine("<Sequence>");
|
||||
IndentLevel();
|
||||
|
||||
|
@ -2432,7 +2432,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
UnaryExpressionAst unaryExpression = value as UnaryExpressionAst;
|
||||
|
||||
if ((
|
||||
(rightExpression != null) && (!(rightExpression.Expression is SubExpressionAst)) &&
|
||||
(rightExpression != null) && (!(rightExpression.Expression is SubExpressionAst)) &&
|
||||
((rightExpression.Expression is ConvertExpressionAst) || !(rightExpression.Expression is AttributedExpressionAst))
|
||||
) ||
|
||||
(unaryExpression != null)
|
||||
|
@ -2594,7 +2594,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
resultVariables.Pop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private StorageVariable GetVariableToUse()
|
||||
{
|
||||
if (resultVariables != null && resultVariables.Count > 0)
|
||||
|
@ -2624,7 +2624,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
string trimmedExpression = expression.Trim();
|
||||
|
||||
if (trimmedExpression.StartsWith("{", StringComparison.OrdinalIgnoreCase) &&
|
||||
if (trimmedExpression.StartsWith("{", StringComparison.OrdinalIgnoreCase) &&
|
||||
trimmedExpression.EndsWith("}", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
trimmedExpression = trimmedExpression.Remove(0, 1);
|
||||
|
@ -2695,7 +2695,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
|
||||
return visitor.ExpressionHasSideEffects;
|
||||
}
|
||||
|
||||
|
||||
object ICustomAstVisitor.VisitPipeline(PipelineAst pipelineAst)
|
||||
{
|
||||
// If it's one command, generate the call alone
|
||||
|
@ -2740,7 +2740,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
// foreach($a2 in A)
|
||||
// {
|
||||
// $psPipelineResults = @( @{} )
|
||||
//
|
||||
//
|
||||
// $psPipelineResults = foreach($item in $psPipelineResults)
|
||||
// {
|
||||
// foreach($output in Command1)
|
||||
|
@ -2808,7 +2808,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
}
|
||||
|
||||
boundParameter = parameterName;
|
||||
|
||||
|
||||
// DisplayName can also be used as a Activity.DisplayName in that case DisplayName param value is not treated as a PipelineVariable
|
||||
if (String.Equals(parameterName, "DisplayName", StringComparison.OrdinalIgnoreCase) &&
|
||||
!Regex.IsMatch(currentPipelineVariable, "^[a-zA-Z][a-zA-Z0-9-_]*$"))
|
||||
|
@ -3500,7 +3500,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
{
|
||||
ReportError("OperatorRequiresVariable", ActivityResources.OperatorRequiresVariable, unaryExpressionAst.Extent);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case TokenKind.Minus:
|
||||
case TokenKind.Plus:
|
||||
|
@ -3823,11 +3823,11 @@ namespace Microsoft.PowerShell.Workflow
|
|||
|
||||
// Remove the ")" from the end
|
||||
string newParamBlock = paramBlock.Substring(0, paramBlock.Length - 2);
|
||||
|
||||
|
||||
StringBuilder actualParamBlock = new StringBuilder();
|
||||
actualParamBlock.Append(newParamBlock);
|
||||
actualParamBlock.Append(additionalParameters);
|
||||
|
||||
|
||||
// Add the ")" at the end
|
||||
actualParamBlock.Append("\n)");
|
||||
|
||||
|
@ -3915,7 +3915,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
StringBuilder newFunctionCall = null;
|
||||
int baseOffset = command.Extent.StartOffset;
|
||||
int commandTextRelativeStartOffset = 0;
|
||||
|
||||
|
||||
foreach (Ast ast in variableExprs)
|
||||
{
|
||||
var variableExpr = ast as VariableExpressionAst;
|
||||
|
@ -4389,7 +4389,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
Sequence undoSequenceInCatch = new Sequence() { Activities = { } };
|
||||
|
||||
Collection<Variable> savedHostDefaults = new Collection<Variable>();
|
||||
|
||||
|
||||
// Go through all the properties in PSRemotingActivity they use, and add them as
|
||||
// virtual properties to this activity
|
||||
foreach (PropertyInfo field in propertiesToUse)
|
||||
|
@ -4752,7 +4752,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
|
||||
// Update the activity map with the full name to support users specifying
|
||||
// an activity with full name.
|
||||
// If the activity map already contains an assembly with this full name,
|
||||
// If the activity map already contains an assembly with this full name,
|
||||
// set the value to NULL as is done for Name key.
|
||||
if (activityMap.ContainsKey(type.FullName))
|
||||
{
|
||||
|
@ -5117,7 +5117,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
}
|
||||
|
||||
StaticBindingResult bindingResult = StaticParameterBinder.BindCommand(commandAst, false);
|
||||
|
||||
|
||||
// Remove the first positional element (the script) if there is one
|
||||
if (bindingResult.BoundParameters.ContainsKey("0"))
|
||||
{
|
||||
|
@ -5233,8 +5233,8 @@ namespace Microsoft.PowerShell.Workflow
|
|||
|
||||
private void SetVariableArgumentValue(CommandArgumentInfo argument, ref object argumentValue)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(argumentValue != null, "argumentValue should not be null");
|
||||
|
||||
System.Diagnostics.Debug.Assert(argumentValue != null, "argumentValue should not be null");
|
||||
|
||||
if (argument != null)
|
||||
{
|
||||
argumentValue = "$" + argument.OriginalValue;
|
||||
|
@ -5387,7 +5387,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
variableToUseDefinition = GetVariableDefinition(variableToUse);
|
||||
variableToUseDefinition = variableToUseDefinition ?? members[variableToUse];
|
||||
}
|
||||
|
||||
|
||||
string appendOutput = String.Empty;
|
||||
string actualAggregatingVariable = String.Empty;
|
||||
bool needAggregationVariable = false;
|
||||
|
@ -5696,7 +5696,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
// of the properties for them.
|
||||
List<string> completeProperties = new List<string>(availableProperties.Keys);
|
||||
|
||||
// If this is a workflow calling workflow, add in the virtual properties that don't exist, since they may not
|
||||
// If this is a workflow calling workflow, add in the virtual properties that don't exist, since they may not
|
||||
// have been actually compiled (if they were not used).
|
||||
foreach(PropertyInfo psRemotingProperty in typeof(PSRemotingActivity).GetProperties())
|
||||
{
|
||||
|
@ -5736,7 +5736,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check if multiple specified parameters can be resolved to the same actual parameter
|
||||
if (!boundParameters.Contains(parameterName))
|
||||
{
|
||||
|
@ -6056,8 +6056,8 @@ namespace Microsoft.PowerShell.Workflow
|
|||
// --- 'ResolveGenericParameterType' returns null if we cannot find the actual type of the specified generic parameter,
|
||||
// in that case, we use the "actualPropertyType" directly
|
||||
Type parameterType = ResolveGenericParameterType(actualPropertyType, genericTypeMap, parameterName, extent);
|
||||
actualPropertyType = !this.validateOnly
|
||||
? parameterType
|
||||
actualPropertyType = !this.validateOnly
|
||||
? parameterType
|
||||
: (parameterType ?? actualPropertyType);
|
||||
}
|
||||
else if (actualPropertyType.IsGenericType && actualPropertyType.ContainsGenericParameters)
|
||||
|
@ -6256,7 +6256,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
|
||||
// The list of parameters that need to be ignored.
|
||||
static List<string> ignoredParameters;
|
||||
|
||||
|
||||
private static bool IsNotSupportedCommonParameter(string parameterName)
|
||||
{
|
||||
return ignoredParameters.Contains(parameterName, StringComparer.OrdinalIgnoreCase);
|
||||
|
@ -7062,7 +7062,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
// And the statement body
|
||||
WriteLine("<Sequence>");
|
||||
IndentLevel();
|
||||
|
||||
|
||||
if (isParallel)
|
||||
{
|
||||
EnterScope();
|
||||
|
@ -7366,7 +7366,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
foreach (CatchClauseAst catchClause in tryStatementAst.CatchClauses)
|
||||
{
|
||||
List<Type> catchTypes = new List<Type>();
|
||||
|
||||
|
||||
if (catchClause.IsCatchAll)
|
||||
{
|
||||
catchTypes.Add(typeof(System.Exception));
|
||||
|
@ -7401,7 +7401,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
WriteLine(@"<DelegateInArgument x:TypeArguments=""" + friendlyTypeName + @""" Name=""_"" />");
|
||||
UnindentLevel();
|
||||
WriteLine(@"</ActivityAction.Argument>");
|
||||
|
||||
|
||||
|
||||
WriteLine("<Sequence>");
|
||||
IndentLevel();
|
||||
|
@ -7568,7 +7568,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
LeaveStorage();
|
||||
}
|
||||
|
||||
// Check if the exception is thrown by the 'Throw' statement. If not, add the special key-value pair to
|
||||
// Check if the exception is thrown by the 'Throw' statement. If not, add the special key-value pair to
|
||||
// the 'Data' property. Then we re-throw the exception.
|
||||
GenerateXamlForThrowStatement(rethrowExceptionName, isRethrow: true);
|
||||
}
|
||||
|
@ -7592,7 +7592,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
string errorTemplate = ActivityResources.ThrowStatementCannotInvokeActivities;
|
||||
ReportError("ThrowStatementCannotInvokeActivities", errorTemplate, throwStatementAst.Pipeline.Extent);
|
||||
}
|
||||
|
||||
|
||||
if (isInParallelBlock)
|
||||
{
|
||||
// Define the temp variable
|
||||
|
@ -7614,7 +7614,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
LeaveStorage();
|
||||
}
|
||||
|
||||
// Check if the exception is thrown by the 'Throw' statement. If not, add the special key-value pair to
|
||||
// Check if the exception is thrown by the 'Throw' statement. If not, add the special key-value pair to
|
||||
// the 'Data' property. Then we throw the exception.
|
||||
GenerateXamlForThrowStatement(throwExceptionName, isRethrow: false);
|
||||
}
|
||||
|
@ -7695,7 +7695,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
IndentLevel();
|
||||
|
||||
AddOrRemoveSpecialKey(variableName, addKey: true);
|
||||
|
||||
|
||||
UnindentLevel();
|
||||
WriteLine(@"</If.Then>");
|
||||
UnindentLevel();
|
||||
|
@ -8001,7 +8001,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
/// This indicates if the variable is one that will aggregate results from a parallel/sequence/foreach block.
|
||||
/// For example:
|
||||
/// workflow bar { $a = parallel { Get-Process -Name powershell; Get-Service -Name Dhcp } }
|
||||
/// $a here will contain all results generated from the parallel block, including a process object "powershell"
|
||||
/// $a here will contain all results generated from the parallel block, including a process object "powershell"
|
||||
/// and a service object "Dhcp". We call $a an aggregating variable.
|
||||
/// </summary>
|
||||
internal bool IsAggregatingVariable { get; set; }
|
||||
|
@ -8034,7 +8034,7 @@ namespace Microsoft.PowerShell.Workflow
|
|||
StackTrace = 8,
|
||||
PID = 9
|
||||
}
|
||||
|
||||
|
||||
internal class ExpressionHasUnsupportedVariableOrSideEffectsVisitor : AstVisitor
|
||||
{
|
||||
internal bool ExpressionHasSideEffects { get; set; }
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
|
||||
<sap:ActivityDesigner
|
||||
x:Class="Microsoft.PowerShell.Activities.InlineScriptDesigner"
|
||||
Collapsible="True"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:conv="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
|
||||
xmlns:sap="clr-namespace:System.Activities.Presentation"
|
||||
Collapsible="True"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:conv="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
|
||||
xmlns:sap="clr-namespace:System.Activities.Presentation"
|
||||
xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
|
||||
mc:Ignorable="d"
|
||||
mc:Ignorable="d"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="128" d:DesignWidth="463">
|
||||
|
@ -19,8 +19,8 @@
|
|||
</StackPanel>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="Expanded">
|
||||
<TextBox x:Uid="TextBox_1" Text="{Binding Path=ModelItem.Command, Mode=TwoWay}"
|
||||
TextWrapping="WrapWithOverflow" AcceptsReturn="True" MinLines="4"
|
||||
<TextBox x:Uid="TextBox_1" Text="{Binding Path=ModelItem.Command, Mode=TwoWay}"
|
||||
TextWrapping="WrapWithOverflow" AcceptsReturn="True" MinLines="4"
|
||||
Background="{x:Null}" Margin="3" DockPanel.Dock="Bottom" Height="97" Width="488" />
|
||||
</DataTemplate>
|
||||
<Style x:Key="ExpandOrCollapsedStyle" TargetType="{x:Type ContentPresenter}">
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<DockPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5">
|
||||
<Polygon
|
||||
Points="25,12 35,25 45,12 25,12"
|
||||
Stroke="DarkBlue"
|
||||
Stroke="DarkBlue"
|
||||
StrokeThickness="2">
|
||||
<Polygon.Fill>
|
||||
<SolidColorBrush Color="LightBlue" Opacity="0.4"/>
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace System.Diagnostics
|
|||
CountPerTimeInterval64 = 4523264,
|
||||
|
||||
/// <summary>
|
||||
/// An instantaneous percentage counter that shows the ratio of a subset
|
||||
/// 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
|
||||
|
@ -115,7 +115,7 @@ namespace System.Diagnostics
|
|||
RawBase = 1073939459,
|
||||
|
||||
/// <summary>
|
||||
/// An average counter that measures the time it takes, on average, to
|
||||
/// 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
|
||||
|
@ -155,7 +155,7 @@ namespace System.Diagnostics
|
|||
|
||||
/// <summary>
|
||||
/// A base counter that stores the number of sampling interrupts taken
|
||||
/// and is used as a denominator in the sampling fraction. The sampling
|
||||
/// 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.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
///
|
||||
/// Class that implements the Get-Counter cmdlet.
|
||||
///
|
||||
///
|
||||
[Cmdlet(VerbsData.Export, "Counter", DefaultParameterSetName = "ExportCounterSet", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=138337")]
|
||||
public sealed class ExportCounterCommand : PSCmdlet
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2007 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
|
@ -22,9 +22,9 @@ using System.Text;
|
|||
|
||||
namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
///
|
||||
///
|
||||
/// Class that implements the Get-WinEvent cmdlet.
|
||||
///
|
||||
///
|
||||
[Cmdlet(VerbsCommon.Get, "WinEvent", DefaultParameterSetName = "GetLogSet", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=138336")]
|
||||
public sealed class GetWinEventCommand : PSCmdlet
|
||||
{
|
||||
|
@ -719,7 +719,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
if (!Oldest.IsPresent)
|
||||
{
|
||||
//
|
||||
// Do minimal parsing of xmlQuery to determine if any direct channels or ETL files are in it.
|
||||
// Do minimal parsing of xmlQuery to determine if any direct channels or ETL files are in it.
|
||||
//
|
||||
XmlElement root = _xmlQuery.DocumentElement;
|
||||
XmlNodeList queryNodes = root.SelectNodes("//Query//Select");
|
||||
|
@ -764,7 +764,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
//
|
||||
// At this point, _path array contains paths that might have wildcards,
|
||||
// environment variables or PS drives. Let's resolve those.
|
||||
// environment variables or PS drives. Let's resolve those.
|
||||
//
|
||||
for (int i = 0; i < _path.Length; i++)
|
||||
{
|
||||
|
@ -839,7 +839,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
if (_computerName == string.Empty)
|
||||
{
|
||||
// Set _computerName to "localhost" for future error messages,
|
||||
// but do not use it for the connection to avoid RPC overhead.
|
||||
// but do not use it for the connection to avoid RPC overhead.
|
||||
_computerName = "localhost";
|
||||
|
||||
if (_credential == PSCredential.Empty)
|
||||
|
@ -1080,7 +1080,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
xpathString.Append(added);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return xpathString.ToString();
|
||||
|
@ -1120,9 +1120,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
// Process log, _path, or provider parameters first
|
||||
// to create initial partially-filled query templates.
|
||||
// Error out for direct channels unless -oldest is present.
|
||||
//
|
||||
//
|
||||
// Order is important! Process "providername" key after "logname" and "file".
|
||||
//
|
||||
//
|
||||
if (hash.ContainsKey(hashkey_logname_lc))
|
||||
{
|
||||
List<string> logPatterns = new List<string>();
|
||||
|
@ -1262,7 +1262,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
// Let's build xpathString to attach to each query opening.
|
||||
//
|
||||
xpathString = BuildXPathFromHashTable(hash);
|
||||
|
||||
|
||||
//
|
||||
// Build xpath for <Suppress>
|
||||
//
|
||||
|
@ -1277,7 +1277,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
// Handle the case where the query opener already has provider predicate(s).
|
||||
// Add the queries from queriedLogsQueryMap into the resulting string.
|
||||
// Add <Suppress> from queriedLogsQueryMapSuppress into the resulting string.
|
||||
//
|
||||
//
|
||||
foreach (string keyLogName in queriedLogsQueryMap.Keys)
|
||||
{
|
||||
// For every Log a separate query is
|
||||
|
@ -1319,7 +1319,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
result.Append(queryCloser);
|
||||
}
|
||||
} //end foreach hashtable
|
||||
} //end foreach hashtable
|
||||
|
||||
|
||||
result.Append(queryListClose);
|
||||
|
@ -1628,7 +1628,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
//
|
||||
// TerminateForNonEvtxFileWithoutOldest terminates for .evt and .etl files unless -Oldest is specified.
|
||||
// TerminateForNonEvtxFileWithoutOldest terminates for .evt and .etl files unless -Oldest is specified.
|
||||
//
|
||||
private void TerminateForNonEvtxFileWithoutOldest(string fileName)
|
||||
{
|
||||
|
@ -1646,7 +1646,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
//
|
||||
// ValidateLogName writes an error if logName is not a valid log.
|
||||
// It also terminates for direct ETW channels unless -Oldest is specified.
|
||||
// It also terminates for direct ETW channels unless -Oldest is specified.
|
||||
//
|
||||
private bool ValidateLogName(string logName, EventLogSession eventLogSession)
|
||||
{
|
||||
|
@ -1710,7 +1710,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
// StringToDateTime helper converts a string to DateTime object.
|
||||
// Returns true and DateTime ref if successful.
|
||||
// Writes an error and returns false if dtString cannot be converted.
|
||||
//
|
||||
//
|
||||
private bool StringToDateTime(string dtString, ref DateTime dt)
|
||||
{
|
||||
try
|
||||
|
@ -1733,7 +1733,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
// Returns a string collection of resolved file paths.
|
||||
// Writes non-terminating errors for invalid paths
|
||||
// and returns an empty collection.
|
||||
//
|
||||
//
|
||||
private StringCollection ValidateAndResolveFilePath(string path)
|
||||
{
|
||||
StringCollection retColl = new StringCollection();
|
||||
|
@ -1782,7 +1782,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// Check the extension: only .evt, .evtx, and .etl files are allowed.
|
||||
// If the file was specified without wildcards, display an error.
|
||||
// Otherwise, skip silently.
|
||||
|
@ -1849,7 +1849,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
//
|
||||
// AddProviderPredicatesToFilter() builds an XPath query
|
||||
// by adding provider predicates to _filter.
|
||||
// Note that this is by no means an XPath expression parser
|
||||
// Note that this is by no means an XPath expression parser
|
||||
// and will may produce garbage if the _filterXPath expression provided by the user is invalid.
|
||||
// However, we are relying on the EventLog XPath parser to reject the garbage later on.
|
||||
//
|
||||
|
@ -1918,7 +1918,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
// BuildAllProvidersPredicate() builds a predicate expression like:
|
||||
// "System/Provider[@Name='a' or @Name='b']"
|
||||
// for all unique provider names specified in _providersByLogMap.
|
||||
// Eliminates duplicates, too, since the same provider can
|
||||
// Eliminates duplicates, too, since the same provider can
|
||||
// be writing to several different logs.
|
||||
//
|
||||
private string BuildAllProvidersPredicate()
|
||||
|
@ -1964,7 +1964,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
// Retrieves log names to which _providerName writes.
|
||||
// NOTE: there are many misconfigured providers in the system.
|
||||
// We therefore catch EventLogException exceptions and write them out as non-terminating errors.
|
||||
// The results are added to _providersByLogMap dictionary.
|
||||
// The results are added to _providersByLogMap dictionary.
|
||||
//
|
||||
private void AddLogsForProviderToInternalMap(EventLogSession eventLogSession, string providerName)
|
||||
{
|
||||
|
@ -1981,7 +1981,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
//
|
||||
// Skip direct ETW channels unless -force is present.
|
||||
// Error out for direct channels unless -oldest is present.
|
||||
//
|
||||
//
|
||||
EventLogConfiguration logObj = new EventLogConfiguration(logLink.LogName, eventLogSession);
|
||||
if (logObj.LogType == EventLogType.Debug || logObj.LogType == EventLogType.Analytical)
|
||||
{
|
||||
|
@ -2030,9 +2030,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
//
|
||||
// FindLogNamesMatchingWildcards helper.
|
||||
// Finds all logs whose names match wildcard patterns in the 'logPatterns' argument.
|
||||
// Finds all logs whose names match wildcard patterns in the 'logPatterns' argument.
|
||||
// For each non-matched pattern, a non-terminating error is written.
|
||||
// The results are added to _logNamesMatchingWildcard array.
|
||||
// The results are added to _logNamesMatchingWildcard array.
|
||||
//
|
||||
private void FindLogNamesMatchingWildcards(EventLogSession eventLogSession, IEnumerable<string> logPatterns)
|
||||
{
|
||||
|
@ -2104,9 +2104,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
//
|
||||
// FindProvidersByLogForWildcardPatterns helper.
|
||||
// Finds all providers whose names match wildcard patterns in 'providerPatterns' argument.
|
||||
// Finds all providers whose names match wildcard patterns in 'providerPatterns' argument.
|
||||
// For each non-matched pattern, a non-terminating error is written.
|
||||
// The results are added to _providersByLogMap dictionary (keyed by log names to which these providers write).
|
||||
// The results are added to _providersByLogMap dictionary (keyed by log names to which these providers write).
|
||||
//
|
||||
private void FindProvidersByLogForWildcardPatterns(EventLogSession eventLogSession, IEnumerable<string> providerPatterns)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2007 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
|
@ -12,7 +12,7 @@ using System.ComponentModel;
|
|||
namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Create the PowerShell snap-in used to register the
|
||||
/// Create the PowerShell snap-in used to register the
|
||||
/// Get-WinEvent cmdlet. Declaring the PSSnapIn class identifies
|
||||
/// this .cs file as a PowerShell snap-in.
|
||||
/// </summary>
|
||||
|
@ -50,7 +50,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get resource information for vendor. This is a string of format: resourceBaseName,resourceName.
|
||||
/// Get resource information for vendor. This is a string of format: resourceBaseName,resourceName.
|
||||
/// </summary>
|
||||
public override string VendorResource
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get resource information for description. This is a string of format: resourceBaseName,resourceName.
|
||||
/// Get resource information for description. This is a string of format: resourceBaseName,resourceName.
|
||||
/// </summary>
|
||||
public override string DescriptionResource
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
///
|
||||
/// Class that implements the Get-Counter cmdlet.
|
||||
///
|
||||
///
|
||||
[Cmdlet(VerbsData.Import, "Counter", DefaultParameterSetName = "GetCounterSet", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=138338")]
|
||||
public sealed class ImportCounterCommand : PSCmdlet
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// Copyright (c) 2007 Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Management.Automation;
|
||||
|
@ -16,10 +16,10 @@ using System.IO;
|
|||
|
||||
namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
///
|
||||
///
|
||||
/// Class that implements the New-WinEvent cmdlet.
|
||||
/// This cmdlet writes a new Etw event using the provider specified in parameter.
|
||||
///
|
||||
///
|
||||
[Cmdlet(VerbsCommon.New, "WinEvent", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=217469")]
|
||||
public sealed class NewWinEventCommand : PSCmdlet
|
||||
{
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
//public string AnsiStringValue;
|
||||
|
||||
//[FieldOffset(4), MarshalAs(UnmanagedType.LPWStr)]
|
||||
//public string WideStringValue;
|
||||
//public string WideStringValue;
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
@ -282,25 +282,25 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
// We access those fields directly. The struct is here for reference only.
|
||||
//
|
||||
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)]
|
||||
struct PDH_COUNTER_INFO {
|
||||
[FieldOffset(0)] public UInt32 dwLength;
|
||||
[FieldOffset(4)] public UInt32 dwType;
|
||||
[FieldOffset(8)] public UInt32 CVersion;
|
||||
[FieldOffset(12)] public UInt32 CStatus;
|
||||
[FieldOffset(16)] public UInt32 lScale;
|
||||
[FieldOffset(20)] public UInt32 lDefaultScale;
|
||||
[FieldOffset(24)] public IntPtr dwUserData;
|
||||
[FieldOffset(32)] public IntPtr dwQueryUserData;
|
||||
[FieldOffset(40)] public string szFullPath;
|
||||
struct PDH_COUNTER_INFO {
|
||||
[FieldOffset(0)] public UInt32 dwLength;
|
||||
[FieldOffset(4)] public UInt32 dwType;
|
||||
[FieldOffset(8)] public UInt32 CVersion;
|
||||
[FieldOffset(12)] public UInt32 CStatus;
|
||||
[FieldOffset(16)] public UInt32 lScale;
|
||||
[FieldOffset(20)] public UInt32 lDefaultScale;
|
||||
[FieldOffset(24)] public IntPtr dwUserData;
|
||||
[FieldOffset(32)] public IntPtr dwQueryUserData;
|
||||
[FieldOffset(40)] public string szFullPath;
|
||||
|
||||
[FieldOffset(48)] public string szMachineName;
|
||||
[FieldOffset(56)] public string szObjectName;
|
||||
[FieldOffset(64)] public string szInstanceName;
|
||||
[FieldOffset(72)] public string szParentInstance;
|
||||
[FieldOffset(80)] public UInt32 dwInstanceIndex;
|
||||
[FieldOffset(48)] public string szMachineName;
|
||||
[FieldOffset(56)] public string szObjectName;
|
||||
[FieldOffset(64)] public string szInstanceName;
|
||||
[FieldOffset(72)] public string szParentInstance;
|
||||
[FieldOffset(80)] public UInt32 dwInstanceIndex;
|
||||
[FieldOffset(88)] public string szCounterName;
|
||||
|
||||
[FieldOffset(96)] public string szExplainText;
|
||||
|
||||
[FieldOffset(96)] public string szExplainText;
|
||||
[FieldOffset(104)]public IntPtr DataBuffer;
|
||||
}*/
|
||||
|
||||
|
@ -530,7 +530,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
res = PdhGetCounterInfo(hCounter, false, ref pBufferSize, bufCounterInfo);
|
||||
if (res == 0 && bufCounterInfo != IntPtr.Zero)
|
||||
{
|
||||
//PDH_COUNTER_INFO pdhCounterInfo = (PDH_COUNTER_INFO)Marshal.PtrToStructure(bufCounterInfo, typeof(PDH_COUNTER_INFO));
|
||||
//PDH_COUNTER_INFO pdhCounterInfo = (PDH_COUNTER_INFO)Marshal.PtrToStructure(bufCounterInfo, typeof(PDH_COUNTER_INFO));
|
||||
|
||||
counterType = (uint)Marshal.ReadInt32(bufCounterInfo, 4);
|
||||
defaultScale = (uint)Marshal.ReadInt32(bufCounterInfo, 20);
|
||||
|
@ -973,7 +973,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
if (res == 0)
|
||||
{
|
||||
//
|
||||
// Marshal.PtrToStructure will allocate managed memory for the object,
|
||||
// Marshal.PtrToStructure will allocate managed memory for the object,
|
||||
// so the unmanaged ptr can be freed safely
|
||||
//
|
||||
pCounterPathElements = Marshal.PtrToStructure<PDH_COUNTER_PATH_ELEMENTS>(structPtr);
|
||||
|
@ -991,12 +991,12 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
// TranslateLocalCounterPath() helper translates counter paths from English into the current locale language.
|
||||
// NOTE: we can only translate counter set and counter names.
|
||||
// Translated instance names come from providers
|
||||
// This function will leave them unchanged:
|
||||
// This function will leave them unchanged:
|
||||
// however, it works for common cases like "*" and "_total"
|
||||
// and many instance names are just numbers, anyway.
|
||||
//
|
||||
// Also - this only supports local paths, b/c connecting to remote registry
|
||||
// requires a different firewall exception.
|
||||
// Also - this only supports local paths, b/c connecting to remote registry
|
||||
// requires a different firewall exception.
|
||||
// This function checks and Asserts if the path is not valid.
|
||||
//
|
||||
public uint TranslateLocalCounterPath(string englishPath, out string localizedPath)
|
||||
|
@ -1023,7 +1023,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
string[] regCounters = (string[])rootKey.GetValue("Counter");
|
||||
|
||||
|
||||
// NOTE: 1-based enumeration because the name strings follow index strings in the array
|
||||
// NOTE: 1-based enumeration because the name strings follow index strings in the array
|
||||
Int32 counterIndex = -1;
|
||||
Int32 objIndex = -1;
|
||||
for (uint enumIndex = 1; enumIndex < regCounters.Length; enumIndex++)
|
||||
|
@ -1093,7 +1093,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
public uint LookupPerfNameByIndex(string machineName, uint index, out string locName)
|
||||
{
|
||||
//
|
||||
// NOTE: to make PdhLookupPerfNameByIndex() work,
|
||||
// NOTE: to make PdhLookupPerfNameByIndex() work,
|
||||
// localizedPath needs to be pre-allocated on the first call.
|
||||
// This is different from most other PDH functions that tolerate NULL buffers and return required size.
|
||||
//
|
||||
|
@ -1213,7 +1213,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
|
||||
//
|
||||
// AddRelogCounters combines instances and adds counters to m_hQuery.
|
||||
// The counter handles and full paths
|
||||
// The counter handles and full paths
|
||||
//
|
||||
public uint AddRelogCounters(PerformanceCounterSampleSet sampleSet)
|
||||
{
|
||||
|
@ -1223,9 +1223,9 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
|
||||
Dictionary<string, List<PerformanceCounterSample>> prefixInstanceMap = new Dictionary<string, List<PerformanceCounterSample>>();
|
||||
|
||||
//
|
||||
//
|
||||
// Go through all the samples one, constructing prefixInstanceMap and adding new counters as needed
|
||||
//
|
||||
//
|
||||
foreach (PerformanceCounterSample sample in sampleSet.CounterSamples)
|
||||
{
|
||||
PDH_COUNTER_PATH_ELEMENTS pathElts = new PDH_COUNTER_PATH_ELEMENTS();
|
||||
|
@ -1254,12 +1254,12 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
prefixInstanceMap.Add(lcPathMinusInstance, newList);
|
||||
}
|
||||
|
||||
//Console.WriteLine ("Added path " + sample.Path + " to the 1ist map with prefix " + lcPathMinusInstance);
|
||||
//Console.WriteLine ("Added path " + sample.Path + " to the 1ist map with prefix " + lcPathMinusInstance);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// Add counters to the query, consolidating multi-instance with a wildcard path,
|
||||
// and construct m_ReloggerPathToHandleAndInstanceMap where each full path would be pointing to its counter handle
|
||||
// and construct m_ReloggerPathToHandleAndInstanceMap where each full path would be pointing to its counter handle
|
||||
// and an instance name (might be empty for no-instance counter types).
|
||||
// You can have multiple full paths inside m_ReloggerPathToHandleAndInstanceMap pointing to the same handle.
|
||||
//
|
||||
|
@ -1294,7 +1294,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
|
||||
//Console.WriteLine ("added pdh query path:" + unifiedPath );
|
||||
|
||||
//now, add all actual paths to m_ReloggerPathToHandleAndInstanceMap
|
||||
//now, add all actual paths to m_ReloggerPathToHandleAndInstanceMap
|
||||
foreach (PerformanceCounterSample sample in prefixInstanceMap[prefix])
|
||||
{
|
||||
PDH_COUNTER_PATH_ELEMENTS pathElts = new PDH_COUNTER_PATH_ELEMENTS();
|
||||
|
@ -1339,9 +1339,9 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
|
||||
uint res = 0;
|
||||
|
||||
//
|
||||
//
|
||||
// Go through all the samples one, constructing prefixInstanceMap and adding new counters as needed
|
||||
//
|
||||
//
|
||||
foreach (PerformanceCounterSample sample in sampleSet.CounterSamples)
|
||||
{
|
||||
PDH_COUNTER_PATH_ELEMENTS pathElts = new PDH_COUNTER_PATH_ELEMENTS();
|
||||
|
@ -1461,11 +1461,11 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
(uint)rawValue.TimeStamp.dwLowDateTime;
|
||||
|
||||
//
|
||||
// NOTE: PDH returns the filetime as local time, therefore
|
||||
// NOTE: PDH returns the filetime as local time, therefore
|
||||
// we need to call FromFileTimUtc() to avoid .NET applying the timezone adjustment.
|
||||
// However, that would result in the DateTime object having Kind.Utc.
|
||||
// We have to copy it once more to correct that (Kind is a read-only property).
|
||||
//
|
||||
//
|
||||
sampleTimeStamp = new DateTime(DateTime.FromFileTimeUtc(dtFT).Ticks, DateTimeKind.Local);
|
||||
|
||||
PDH_FMT_COUNTERVALUE_DOUBLE fmtValueDouble;
|
||||
|
@ -1514,7 +1514,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
}
|
||||
|
||||
//
|
||||
// Prior to Vista, PdhCollectQueryDataWithTime() was not available,
|
||||
// Prior to Vista, PdhCollectQueryDataWithTime() was not available,
|
||||
// so we could not collect a timestamp for the entire sample set.
|
||||
// We will use the last sample's timestamp instead.
|
||||
//
|
||||
|
@ -1527,7 +1527,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
//
|
||||
// Reset the error - any errors are saved per sample in PerformanceCounterSample.Status for kvetching later
|
||||
//
|
||||
res = 0;
|
||||
|
@ -1562,11 +1562,11 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
}
|
||||
|
||||
//
|
||||
// NOTE: PDH returns the filetime as local time, therefore
|
||||
// NOTE: PDH returns the filetime as local time, therefore
|
||||
// we need to call FromFileTimUtc() to avoid .NET applying the timezone adjustment.
|
||||
// However, that would result in the DateTime object having Kind.Utc.
|
||||
// We have to copy it once more to correct that (Kind is a read-only property).
|
||||
//
|
||||
//
|
||||
DateTime batchStamp = DateTime.Now;
|
||||
if (res != PdhResults.PDH_NO_DATA)
|
||||
{
|
||||
|
@ -1670,7 +1670,7 @@ namespace Microsoft.Powershell.Commands.GetCounter.PdhNative
|
|||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
//
|
||||
// Reset the error - any errors are saved per sample in PerformanceCounterSample.Status for kvetching later
|
||||
//
|
||||
res = 0;
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
// Additionally in both instance and static cmdlets, if the pipeline object is a CimInstance, then it can affect the session acted against
|
||||
if (invocationInfo.ExpectingInput)
|
||||
{
|
||||
// can get unlimited number of CimInstances through pipeline
|
||||
// can get unlimited number of CimInstances through pipeline
|
||||
// - this translates into potentially unlimited number of CimSession we will work with
|
||||
return int.MaxValue;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
cmdlet.WriteError(errorRecord);
|
||||
}
|
||||
|
||||
return false; // not really needed here, but required by CmdletMethodInvoker
|
||||
return false; // not really needed here, but required by CmdletMethodInvoker
|
||||
};
|
||||
|
||||
return new CmdletMethodInvoker<bool>
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
}
|
||||
|
||||
WsManErrorCode wsManErrorCode = (WsManErrorCode)(UInt32)(errorCodeProperty.Value);
|
||||
switch (wsManErrorCode) // error codes that should result in sleep-and-retry are based on an email from Ryan
|
||||
switch (wsManErrorCode) // error codes that should result in sleep-and-retry are based on an email from Ryan
|
||||
{
|
||||
case WsManErrorCode.ERROR_WSMAN_QUOTA_MAX_SHELLS:
|
||||
case WsManErrorCode.ERROR_WSMAN_QUOTA_MAX_OPERATIONS:
|
||||
|
@ -232,8 +232,8 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
{
|
||||
get
|
||||
{
|
||||
// this.JobContext is set in the constructor of CimChildJobBase,
|
||||
// but the constructor of Job wants to access Location property
|
||||
// this.JobContext is set in the constructor of CimChildJobBase,
|
||||
// but the constructor of Job wants to access Location property
|
||||
// before CimChildJobBase is fully initialized
|
||||
if (this.JobContext == null)
|
||||
{
|
||||
|
|
|
@ -614,7 +614,7 @@ namespace Microsoft.PowerShell.Cim
|
|||
Dbg.Assert(arrayType != null, "Caller should verify arrayType != null");
|
||||
Dbg.Assert(arrayType.IsArray, "Caller should verify arrayType.IsArray");
|
||||
|
||||
// MOF syntax from Appendix A of DSP0004 doesn't allow expressing
|
||||
// MOF syntax from Appendix A of DSP0004 doesn't allow expressing
|
||||
// of 1) nested arrays and 2) multi-dimensional arrays
|
||||
// (see production for "array" and how this production is used in
|
||||
// other productions like "propertyDeclaration" or "parameter")
|
||||
|
|
|
@ -196,7 +196,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
/// <param name="propertyName">Property name to query on</param>
|
||||
/// <param name="allowedPropertyValues">Property values to accept in the query</param>
|
||||
/// <param name="wildcardsEnabled">
|
||||
/// <c>true</c> if <paramref name="allowedPropertyValues"/> should be treated as a <see cref="System.String"/> containing a wildcard pattern;
|
||||
/// <c>true</c> if <paramref name="allowedPropertyValues"/> should be treated as a <see cref="System.String"/> containing a wildcard pattern;
|
||||
/// <c>false otherwise</c>
|
||||
/// </param>
|
||||
/// <param name="behaviorOnNoMatch">
|
||||
|
@ -219,7 +219,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
/// <param name="propertyName">Property name to query on</param>
|
||||
/// <param name="excludedPropertyValues">Property values to reject in the query</param>
|
||||
/// <param name="wildcardsEnabled">
|
||||
/// <c>true</c> if <paramref name="excludedPropertyValues"/> should be treated as a <see cref="System.String"/> containing a wildcard pattern;
|
||||
/// <c>true</c> if <paramref name="excludedPropertyValues"/> should be treated as a <see cref="System.String"/> containing a wildcard pattern;
|
||||
/// <c>false otherwise</c>
|
||||
/// </param>
|
||||
/// <param name="behaviorOnNoMatch">
|
||||
|
|
|
@ -289,8 +289,8 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="System.Management.Automation.Job"/> object that invokes a static method
|
||||
/// (of the class named by <see cref="Microsoft.PowerShell.Cmdletization.CmdletAdapter<TObjectInstance>.ClassName"/>)
|
||||
/// Creates a <see cref="System.Management.Automation.Job"/> object that invokes a static method
|
||||
/// (of the class named by <see cref="Microsoft.PowerShell.Cmdletization.CmdletAdapter<TObjectInstance>.ClassName"/>)
|
||||
/// in the wrapped object model.
|
||||
/// </summary>
|
||||
/// <param name="session">Remote session to invoke the method in</param>
|
||||
|
@ -353,7 +353,7 @@ namespace Microsoft.PowerShell.Cmdletization.Cim
|
|||
return GetSessionOfOriginFromCimInstance(instance);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Handling of dynamic parameters
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ using Dbg = System.Management.Automation.Diagnostics;
|
|||
namespace Microsoft.PowerShell.Cmdletization.Cim
|
||||
{
|
||||
/// <summary>
|
||||
/// Client-side filtering for
|
||||
/// Client-side filtering for
|
||||
/// 1) filtering that cannot be translated into a server-side query (i.e. when CimQuery.WildcardToWqlLikeOperand reports that it cannot translate into WQL)
|
||||
/// 2) detecting if all expected results have been received and giving friendly user errors otherwise (i.e. could not find process with name='foo'; details in Windows 8 Bugs: #60926)
|
||||
/// </summary>
|
||||
|
|
|
@ -20,18 +20,18 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region protected members
|
||||
|
||||
/// <summary>
|
||||
/// Seeks to the end of the writer stream in each of the writers in the
|
||||
/// Seeks to the end of the writer stream in each of the writers in the
|
||||
/// content holders.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="contentHolders">
|
||||
/// The content holders that contain the writers to be moved.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <exception cref="ProviderInvocationException">
|
||||
/// If calling Seek on the content writer throws an exception.
|
||||
/// </exception>
|
||||
///
|
||||
///
|
||||
internal override void SeekContentPosition(List<ContentHolder> contentHolders)
|
||||
{
|
||||
foreach (ContentHolder holder in contentHolders)
|
||||
|
@ -70,15 +70,15 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Makes the call to ShouldProcess with appropriate action and target strings.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="path">
|
||||
/// The path to the item on which the content will be added.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// True if the action should continue or false otherwise.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override bool CallShouldProcess(string path)
|
||||
{
|
||||
string action = NavigationResources.AddContentAction;
|
||||
|
|
|
@ -83,16 +83,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
|
|
@ -78,16 +78,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
Collection<string> propertyCollection = new Collection<string>();
|
||||
|
|
|
@ -11,8 +11,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
{
|
||||
/// <summary>
|
||||
/// Defines the implementation of the 'Clear-RecycleBin' cmdlet.
|
||||
/// This cmdlet clear all files in the RecycleBin for the given DriveLetter.
|
||||
/// If not DriveLetter is specified, then the RecycleBin for all drives are cleared.
|
||||
/// This cmdlet clear all files in the RecycleBin for the given DriveLetter.
|
||||
/// If not DriveLetter is specified, then the RecycleBin for all drives are cleared.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsCommon.Clear, "RecycleBin", SupportsShouldProcess = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=524082", ConfirmImpact = ConfirmImpact.High)]
|
||||
public class ClearRecycleBinCommand : PSCmdlet
|
||||
|
@ -21,9 +21,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
private DriveInfo[] _availableDrives;
|
||||
private bool _force;
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Property that sets DriveLetter parameter.
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
[Parameter(Position = 0, ValueFromPipelineByPropertyName = true)]
|
||||
[ValidateNotNullOrEmpty]
|
||||
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
|
||||
|
@ -33,9 +33,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
set { _drivesList = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Property that sets force parameter. This will allow to clear the recyclebin.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Property that sets force parameter. This will allow to clear the recyclebin.
|
||||
/// </summary>
|
||||
[Parameter()]
|
||||
public SwitchParameter Force
|
||||
{
|
||||
|
@ -142,7 +142,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the given input is of the form c, c:, c:\, C, C: or C:\
|
||||
/// Returns true if the given input is of the form c, c:, c:\, C, C: or C:\
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -152,7 +152,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a drive path of the form C:\ for the given drive driveName.
|
||||
/// Returns a drive path of the form C:\ for the given drive driveName.
|
||||
/// Supports the following inputs: C, C:, C:\
|
||||
/// </summary>
|
||||
/// <param name="driveName"></param>
|
||||
|
@ -176,7 +176,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear the recyclebin for the given drive name.
|
||||
/// Clear the recyclebin for the given drive name.
|
||||
/// If no driveName is provided, it clears the recyclebin for all drives.
|
||||
/// </summary>
|
||||
/// <param name="drivePath"></param>
|
||||
|
@ -197,7 +197,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
if (_force || (ShouldProcess(clearRecycleBinShouldProcessTarget, "Clear-RecycleBin")))
|
||||
{
|
||||
// If driveName is null, then clear the recyclebin for all drives; otherwise, just for the specified driveName.
|
||||
// If driveName is null, then clear the recyclebin for all drives; otherwise, just for the specified driveName.
|
||||
|
||||
string activity = String.Format(CultureInfo.InvariantCulture, ClearRecycleBinResources.ClearRecycleBinProgressActivity);
|
||||
string statusDescription;
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Command code
|
||||
|
||||
/// <summary>
|
||||
/// Parses the specified path and returns the portion determined by the
|
||||
/// Parses the specified path and returns the portion determined by the
|
||||
/// boolean parameters.
|
||||
/// </summary>
|
||||
protected override void ProcessRecord()
|
||||
|
|
|
@ -47,9 +47,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Test-Connection
|
||||
|
||||
/// <summary>
|
||||
/// This cmdlet is used to test whether a particular host is reachable across an
|
||||
/// IP network. It works by sending ICMP "echo request" packets to the target
|
||||
/// host and listening for ICMP "echo response" replies. This cmdlet prints a
|
||||
/// This cmdlet is used to test whether a particular host is reachable across an
|
||||
/// IP network. It works by sending ICMP "echo request" packets to the target
|
||||
/// host and listening for ICMP "echo response" replies. This cmdlet prints a
|
||||
/// statistical summary when finished.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsDiagnostic.Test, "Connection", DefaultParameterSetName = RegularParameterSet,
|
||||
|
@ -65,7 +65,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
private const string SourceParameterSet = "Source";
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = SourceParameterSet)]
|
||||
[Parameter(ParameterSetName = RegularParameterSet)]
|
||||
|
@ -73,9 +73,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "DcomAuthentication".
|
||||
/// Specifies the authentication level to be used with WMI connection. Valid
|
||||
/// Specifies the authentication level to be used with WMI connection. Valid
|
||||
/// values are:
|
||||
///
|
||||
///
|
||||
/// Unchanged = -1,
|
||||
/// Default = 0,
|
||||
/// None = 1,
|
||||
|
@ -129,8 +129,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ComputerName".
|
||||
/// Value of the address requested. The form of the value can be either the
|
||||
/// computer name ("wxyz1234"), IPv4 address ("192.168.177.124"), or IPv6
|
||||
/// Value of the address requested. The form of the value can be either the
|
||||
/// computer name ("wxyz1234"), IPv4 address ("192.168.177.124"), or IPv6
|
||||
/// address ("2010:836B:4179::836B:4179").
|
||||
/// </summary>
|
||||
[Parameter(Mandatory = true,
|
||||
|
@ -151,8 +151,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Credential".
|
||||
/// Specifies a user account that has permission to perform this action. Type a
|
||||
/// user-name, such as "User01" or "Domain01\User01", or enter a PSCredential
|
||||
/// Specifies a user account that has permission to perform this action. Type a
|
||||
/// user-name, such as "User01" or "Domain01\User01", or enter a PSCredential
|
||||
/// object, such as one from the Get-Credential cmdlet
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = SourceParameterSet, Mandatory = false)]
|
||||
|
@ -172,9 +172,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Impersonation".
|
||||
/// Specifies the impersonation level to use when calling the WMI method. Valid
|
||||
/// values are:
|
||||
///
|
||||
/// Specifies the impersonation level to use when calling the WMI method. Valid
|
||||
/// values are:
|
||||
///
|
||||
/// Default = 0,
|
||||
/// Anonymous = 1,
|
||||
/// Identify = 2,
|
||||
|
@ -186,7 +186,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ThrottleLimit".
|
||||
/// The number of concurrent computers on which the command will be allowed to
|
||||
/// The number of concurrent computers on which the command will be allowed to
|
||||
/// execute
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = SourceParameterSet)]
|
||||
|
@ -206,9 +206,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "TimeToLive".
|
||||
/// Life span of the packet in seconds. The value is treated as an upper limit.
|
||||
/// All routers must decrement this value by 1 (one). When this value becomes 0
|
||||
/// (zero), the packet is dropped by the router. The default value is 80
|
||||
/// Life span of the packet in seconds. The value is treated as an upper limit.
|
||||
/// All routers must decrement this value by 1 (one). When this value becomes 0
|
||||
/// (zero), the packet is dropped by the router. The default value is 80
|
||||
/// seconds. The hops between routers rarely take this amount of time.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
|
@ -340,7 +340,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
/// <summary>
|
||||
/// to implement ^C
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
protected override void StopProcessing()
|
||||
{
|
||||
#if !CORECLR
|
||||
|
@ -674,7 +674,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Parameters
|
||||
/// <summary>
|
||||
/// Specifies the Drive on which the system restore will be enabled.
|
||||
/// The drive string should be of the form "C:\".
|
||||
/// The drive string should be of the form "C:\".
|
||||
/// </summary>
|
||||
[Parameter(Position = 0, Mandatory = true)]
|
||||
[ValidateNotNullOrEmpty]
|
||||
|
@ -766,7 +766,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
continue;
|
||||
}
|
||||
//parameter for Enable method
|
||||
//if the input drive is not system drive
|
||||
//if the input drive is not system drive
|
||||
if (!driveNew.Equals(sysdrive, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
object[] inputDrive = { driveNew };
|
||||
|
@ -778,7 +778,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
retValue = Convert.ToInt32(WMIClass.InvokeMethod("Enable", inputDrive), System.Globalization.CultureInfo.CurrentCulture);
|
||||
}
|
||||
}
|
||||
//if not success and if it is not already enabled (error code is 1056 in XP)
|
||||
//if not success and if it is not already enabled (error code is 1056 in XP)
|
||||
// Error 1717 - The interface is unknown. Even though this comes sometimes . The Drive is getting enabled.
|
||||
if (!(retValue.Equals(0)) && !(retValue.Equals(ComputerWMIHelper.ErrorCode_Service)) && !(retValue.Equals(ComputerWMIHelper.ErrorCode_Interface)))
|
||||
{
|
||||
|
@ -854,7 +854,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Parameters
|
||||
/// <summary>
|
||||
/// Specifies the Drive on which the system restore will be enabled.
|
||||
/// The drive string should be of the form "C:\".
|
||||
/// The drive string should be of the form "C:\".
|
||||
/// </summary>
|
||||
[Parameter(Position = 0, Mandatory = true)]
|
||||
[ValidateNotNullOrEmpty]
|
||||
|
@ -996,7 +996,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Checkpoint-Computer
|
||||
|
||||
/// <summary>
|
||||
/// Creates the Restore Point for the Local computer
|
||||
/// Creates the Restore Point for the Local computer
|
||||
/// </summary>
|
||||
|
||||
[Cmdlet(VerbsData.Checkpoint, "Computer", HelpUri = "https://go.microsoft.com/fwlink/?LinkID=135197")]
|
||||
|
@ -1005,7 +1005,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Parameters
|
||||
|
||||
/// <summary>
|
||||
/// The description to be displayed so the user can easily identify a restore point.
|
||||
/// The description to be displayed so the user can easily identify a restore point.
|
||||
/// </summary>
|
||||
[Parameter(Position = 0, Mandatory = true)]
|
||||
[ValidateNotNullOrEmpty]
|
||||
|
@ -1013,7 +1013,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// The type of restore point.
|
||||
/// The type of restore point.
|
||||
/// </summary>
|
||||
[Parameter(Position = 1)]
|
||||
[Alias("RPT")]
|
||||
|
@ -1081,7 +1081,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
string activityDescription = StringUtil.Format(ComputerResources.ProgressActivity);
|
||||
ProgressRecord progressRecord = new ProgressRecord(
|
||||
1905347723, // unique id
|
||||
1905347723, // unique id
|
||||
activityDescription,
|
||||
statusDescription);
|
||||
|
||||
|
@ -1456,7 +1456,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region overrides
|
||||
/// <summary>
|
||||
/// Gets the list of Computer Restore point.
|
||||
/// ID parameter id used to refer the sequence no. When given searched with particular
|
||||
/// ID parameter id used to refer the sequence no. When given searched with particular
|
||||
/// sequence no. and returns the restore point
|
||||
/// </summary>
|
||||
protected override void BeginProcessing()
|
||||
|
@ -1644,7 +1644,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// The message used in the exception.
|
||||
/// </param>
|
||||
///
|
||||
/// <param name="innerException">
|
||||
/// <param name="innerException">
|
||||
/// An exception that led to this exception.
|
||||
/// </param>
|
||||
public RestartComputerTimeoutException(string message, Exception innerException) : base(message, innerException) { }
|
||||
|
@ -1653,13 +1653,13 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Serialization constructor for class RestartComputerTimeoutException
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="info">
|
||||
/// serialization information
|
||||
///
|
||||
/// <param name="info">
|
||||
/// serialization information
|
||||
/// </param>
|
||||
///
|
||||
/// <param name="context">
|
||||
/// streaming context
|
||||
///
|
||||
/// <param name="context">
|
||||
/// streaming context
|
||||
/// </param>
|
||||
private RestartComputerTimeoutException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
|
@ -1676,13 +1676,13 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Serializes the RestartComputerTimeoutException.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="info">
|
||||
/// serialization information
|
||||
///
|
||||
/// <param name="info">
|
||||
/// serialization information
|
||||
/// </param>
|
||||
///
|
||||
/// <param name="context">
|
||||
/// streaming context
|
||||
///
|
||||
/// <param name="context">
|
||||
/// streaming context
|
||||
/// </param>
|
||||
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
|
||||
public override void GetObjectData(SerializationInfo info, StreamingContext context)
|
||||
|
@ -1722,7 +1722,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restarts the computer
|
||||
/// Restarts the computer
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsLifecycle.Restart, "Computer", SupportsShouldProcess = true, DefaultParameterSetName = DefaultParameterSet,
|
||||
HelpUri = "https://go.microsoft.com/fwlink/?LinkID=135253", RemotingCapability = RemotingCapability.OwnedByCommand)]
|
||||
|
@ -1734,17 +1734,17 @@ namespace Microsoft.PowerShell.Commands
|
|||
private const string AsJobParameterSet = "AsJobSet";
|
||||
|
||||
/// <summary>
|
||||
/// Used to start a command remotely as a Job. The Job results are collected
|
||||
/// and stored in the global cache on the client machine.
|
||||
/// Used to start a command remotely as a Job. The Job results are collected
|
||||
/// and stored in the global cache on the client machine.
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = AsJobParameterSet)]
|
||||
public SwitchParameter AsJob { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Authentication".
|
||||
/// Specifies the authentication level to be used with WMI connection. Valid
|
||||
/// Specifies the authentication level to be used with WMI connection. Valid
|
||||
/// values are:
|
||||
///
|
||||
///
|
||||
/// Unchanged = -1,
|
||||
/// Default = 0,
|
||||
/// None = 1,
|
||||
|
@ -1771,9 +1771,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Impersonation".
|
||||
/// Specifies the impersonation level to use when calling the WMI method. Valid
|
||||
/// values are:
|
||||
///
|
||||
/// Specifies the impersonation level to use when calling the WMI method. Valid
|
||||
/// values are:
|
||||
///
|
||||
/// Default = 0,
|
||||
/// Anonymous = 1,
|
||||
/// Identify = 2,
|
||||
|
@ -1832,10 +1832,10 @@ namespace Microsoft.PowerShell.Commands
|
|||
private bool _isProtocolSpecified = false;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the computer (s)Name on which this command is executed.
|
||||
/// Specifies the computer (s)Name on which this command is executed.
|
||||
/// When this parameter is omitted, this cmdlet restarts the local computer.
|
||||
/// Type the NETBIOS name, IP address, or fully-qualified domain name of one
|
||||
/// or more computers in a comma-separated list. To specify the local computer, type the computername or "localhost".
|
||||
/// Type the NETBIOS name, IP address, or fully-qualified domain name of one
|
||||
/// or more computers in a comma-separated list. To specify the local computer, type the computername or "localhost".
|
||||
/// </summary>
|
||||
[Parameter(Position = 0, ValueFromPipeline = true,
|
||||
ValueFromPipelineByPropertyName = true)]
|
||||
|
@ -1850,8 +1850,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Credential".
|
||||
/// Specifies a user account that has permission to perform this action. Type a
|
||||
/// user-name, such as "User01" or "Domain01\User01", or enter a PSCredential
|
||||
/// Specifies a user account that has permission to perform this action. Type a
|
||||
/// user-name, such as "User01" or "Domain01\User01", or enter a PSCredential
|
||||
/// object, such as one from the Get-Credential cmdlet
|
||||
/// </summary>
|
||||
[Parameter(Position = 1)]
|
||||
|
@ -1860,8 +1860,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
public PSCredential Credential { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Using Force in conjunction with Reboot on a
|
||||
/// remote computer immediately reboots the remote computer.
|
||||
/// Using Force in conjunction with Reboot on a
|
||||
/// remote computer immediately reboots the remote computer.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
[Alias("f")]
|
||||
|
@ -1893,7 +1893,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
public SwitchParameter Wait { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specify the Timeout parameter.
|
||||
/// Specify the Timeout parameter.
|
||||
/// Negative value indicates wait infinitely.
|
||||
/// Positive value indicates the seconds to wait before timeout.
|
||||
/// </summary>
|
||||
|
@ -2570,7 +2570,7 @@ $result
|
|||
Dbg.Diagnostics.Assert(false, "This should never happen. Invoke should never return null.");
|
||||
}
|
||||
|
||||
// If ^C or timeout happens when we are in powershell.Invoke(), the psObjectCollection might be empty
|
||||
// If ^C or timeout happens when we are in powershell.Invoke(), the psObjectCollection might be empty
|
||||
if (psObjectCollection.Count == 0)
|
||||
{
|
||||
return computerNames;
|
||||
|
@ -2758,7 +2758,7 @@ $result
|
|||
|
||||
// DCOM Authentication is not supported for CoreCLR. Throw an error
|
||||
// and request that the user specify WSMan Authentication.
|
||||
if (_isDcomAuthenticationSpecified ||
|
||||
if (_isDcomAuthenticationSpecified ||
|
||||
Protocol.Equals(ComputerWMIHelper.DcomProtocol, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
InvalidOperationException ex = new InvalidOperationException(ComputerResources.InvalidParameterDCOMNotSupported);
|
||||
|
@ -2850,7 +2850,7 @@ $result
|
|||
}
|
||||
else if (ParameterSetName.Equals(DefaultParameterSet, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// CoreCLR does not support DCOM, so there is no point checking
|
||||
// CoreCLR does not support DCOM, so there is no point checking
|
||||
// it here. It was already validated in BeginProcessing().
|
||||
|
||||
bool dcomInUse = Protocol.Equals(ComputerWMIHelper.DcomProtocol, StringComparison.OrdinalIgnoreCase);
|
||||
|
@ -3018,7 +3018,7 @@ $result
|
|||
}
|
||||
else
|
||||
#endif
|
||||
// This statement block executes for both CLRs.
|
||||
// This statement block executes for both CLRs.
|
||||
// In the "full" CLR, it serves as the else case.
|
||||
{
|
||||
if (_waitOnComputers.Count == 1)
|
||||
|
@ -3049,7 +3049,7 @@ $result
|
|||
}
|
||||
else
|
||||
#endif
|
||||
// This statement block executes for both CLRs.
|
||||
// This statement block executes for both CLRs.
|
||||
// In the "full" CLR, it serves as the else case.
|
||||
{
|
||||
// CIM-WSMan in use. In this case, restart stage checking is done by using WMIv2,
|
||||
|
@ -3207,9 +3207,9 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "DcomAuthentication".
|
||||
/// Specifies the authentication level to be used with WMI connection. Valid
|
||||
/// Specifies the authentication level to be used with WMI connection. Valid
|
||||
/// values are:
|
||||
///
|
||||
///
|
||||
/// Unchanged = -1,
|
||||
/// Default = 0,
|
||||
/// None = 1,
|
||||
|
@ -3242,7 +3242,7 @@ $result
|
|||
/// </summary>
|
||||
[Parameter]
|
||||
[ValidateSet(ComputerWMIHelper.DcomProtocol, ComputerWMIHelper.WsmanProtocol)]
|
||||
public string Protocol { get; set; } =
|
||||
public string Protocol { get; set; } =
|
||||
#if CORECLR
|
||||
//CoreClr does not support DCOM protocol
|
||||
// This change makes sure that the the command works seamlessly if user did not explicitly entered the protocol
|
||||
|
@ -3253,8 +3253,8 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ComputerName".
|
||||
/// Value of the address requested. The form of the value can be either the
|
||||
/// computer name ("wxyz1234"), IPv4 address ("192.168.177.124"), or IPv6
|
||||
/// Value of the address requested. The form of the value can be either the
|
||||
/// computer name ("wxyz1234"), IPv4 address ("192.168.177.124"), or IPv6
|
||||
/// address ("2010:836B:4179::836B:4179").
|
||||
/// </summary>
|
||||
[Parameter(Position = 0, ValueFromPipelineByPropertyName = true)]
|
||||
|
@ -3266,8 +3266,8 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Credential".
|
||||
/// Specifies a user account that has permission to perform this action. Type a
|
||||
/// user-name, such as "User01" or "Domain01\User01", or enter a PSCredential
|
||||
/// Specifies a user account that has permission to perform this action. Type a
|
||||
/// user-name, such as "User01" or "Domain01\User01", or enter a PSCredential
|
||||
/// object, such as one from the Get-Credential cmdlet
|
||||
/// </summary>
|
||||
[Parameter(Position = 1)]
|
||||
|
@ -3277,9 +3277,9 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Impersonation".
|
||||
/// Specifies the impersonation level to use when calling the WMI method. Valid
|
||||
/// values are:
|
||||
///
|
||||
/// Specifies the impersonation level to use when calling the WMI method. Valid
|
||||
/// values are:
|
||||
///
|
||||
/// Default = 0,
|
||||
/// Anonymous = 1,
|
||||
/// Identify = 2,
|
||||
|
@ -3291,7 +3291,7 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ThrottleLimit".
|
||||
/// The number of concurrent computers on which the command will be allowed to
|
||||
/// The number of concurrent computers on which the command will be allowed to
|
||||
/// execute
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
|
@ -3310,7 +3310,7 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ThrottleLimit".
|
||||
/// The number of concurrent computers on which the command will be allowed to
|
||||
/// The number of concurrent computers on which the command will be allowed to
|
||||
/// execute
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
|
@ -3614,7 +3614,7 @@ $result
|
|||
#region Parameters
|
||||
/// <summary>
|
||||
/// Restorepoint parameter
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
|
||||
[Parameter(Position = 0, Mandatory = true)]
|
||||
[ValidateNotNull]
|
||||
|
@ -3658,7 +3658,7 @@ $result
|
|||
|
||||
#region overrides
|
||||
/// <summary>
|
||||
/// Restores the computer with
|
||||
/// Restores the computer with
|
||||
/// </summary>
|
||||
protected override void BeginProcessing()
|
||||
{
|
||||
|
@ -3796,7 +3796,7 @@ $result
|
|||
PasswordPass = 0x80,
|
||||
|
||||
/// <summary>
|
||||
/// Writing SPN and DNSHostName attributes on the computer object should be deferred until the rename operation that
|
||||
/// Writing SPN and DNSHostName attributes on the computer object should be deferred until the rename operation that
|
||||
/// follows the join operation
|
||||
/// </summary>
|
||||
DeferSPNSet = 0x100,
|
||||
|
@ -3819,10 +3819,10 @@ $result
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified computer(s) to the Domain or Work Group. If the account
|
||||
/// does not already exist on the domain, it also creates one (see notes for
|
||||
/// Adds the specified computer(s) to the Domain or Work Group. If the account
|
||||
/// does not already exist on the domain, it also creates one (see notes for
|
||||
/// implementation details).
|
||||
/// If the computer is already joined to a domain, it can be moved to a new
|
||||
/// If the computer is already joined to a domain, it can be moved to a new
|
||||
/// domain (see notes for implementation details).
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.PowerShell", "PS1004AcceptForceParameterWhenCallingShouldContinue")]
|
||||
|
@ -3965,14 +3965,14 @@ $result
|
|||
/// Unjoin the computer from its current domain
|
||||
/// <remarks>
|
||||
/// In the DomainParameterSet, the UnjoinDomainCredential is our first choice to unjoin a domain.
|
||||
/// But if the UnjoinDomainCredential is not specified, the DomainCredential will be our second
|
||||
/// But if the UnjoinDomainCredential is not specified, the DomainCredential will be our second
|
||||
/// choice. This is to keep the backward compatibility. In Win7, we can do:
|
||||
/// Add-Computer -DomainName domain1 -Credential $credForDomain1AndDomain2
|
||||
/// to switch the local machine that is currently in domain2 to domain1.
|
||||
///
|
||||
///
|
||||
/// Since DomainCredential has an alias "Credential", the same command should still work for the
|
||||
/// new Add-Computer cmdlet.
|
||||
///
|
||||
///
|
||||
/// In the WorkgroupParameterSet, the UnjoinDomainCredential is the only choice.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
|
@ -4006,7 +4006,7 @@ $result
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If a computer is already in a domain, we first unjoin it from its current domain, and
|
||||
/// then do the join operation to the new domain. So when this method is invoked, we are
|
||||
/// then do the join operation to the new domain. So when this method is invoked, we are
|
||||
/// currently in a workgroup
|
||||
/// </remarks>
|
||||
/// <param name="computerSystem"></param>
|
||||
|
@ -4216,7 +4216,7 @@ $result
|
|||
}
|
||||
}
|
||||
|
||||
// If LocalCred is given, use the local credential for WMI connection. Otherwise, use
|
||||
// If LocalCred is given, use the local credential for WMI connection. Otherwise, use
|
||||
// the current caller's context (Username = null, Password = null)
|
||||
if (LocalCredential != null)
|
||||
{
|
||||
|
@ -4245,7 +4245,7 @@ $result
|
|||
{
|
||||
using (computerSystem)
|
||||
{
|
||||
// If we are not using the new computer name, check the length of the target machine name
|
||||
// If we are not using the new computer name, check the length of the target machine name
|
||||
string hostName = (string)computerSystem["DNSHostName"];
|
||||
if (newName == null && hostName.Length > ComputerWMIHelper.NetBIOSNameMaxLength)
|
||||
{
|
||||
|
@ -4552,7 +4552,7 @@ $result
|
|||
int oldJoinDomainFlags = _joinDomainflags;
|
||||
if (NewName != null && ParameterSetName == DomainParameterSet)
|
||||
{
|
||||
// We rename the computer after it's joined to the target domain, so writing SPN and DNSHostName attributes
|
||||
// We rename the computer after it's joined to the target domain, so writing SPN and DNSHostName attributes
|
||||
// on the computer object should be deferred until the rename operation that follows the join operation
|
||||
_joinDomainflags |= (int)JoinOptions.DeferSPNSet;
|
||||
}
|
||||
|
@ -4619,7 +4619,7 @@ $result
|
|||
#region RemoveComputer
|
||||
|
||||
/// <summary>
|
||||
/// Removes the Specified Computer(s) from the relevant Domain or Work Group
|
||||
/// Removes the Specified Computer(s) from the relevant Domain or Work Group
|
||||
/// </summary>
|
||||
|
||||
[Cmdlet(VerbsCommon.Remove, "Computer", SupportsShouldProcess = true, DefaultParameterSetName = LocalParameterSet,
|
||||
|
@ -4676,7 +4676,7 @@ $result
|
|||
private bool _force;
|
||||
|
||||
/// <summary>
|
||||
/// Only emit if passthru is specified. One bool/string pair for each
|
||||
/// Only emit if passthru is specified. One bool/string pair for each
|
||||
/// computer that was joined. Bool = success/failure. String = ComputerName.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
|
@ -4959,8 +4959,8 @@ $result
|
|||
#region Rename-Computer
|
||||
|
||||
/// <summary>
|
||||
/// Renames a domain computer and its corresponding domain account or a
|
||||
/// workgroup computer. Use this command to rename domain workstations and local
|
||||
/// Renames a domain computer and its corresponding domain account or a
|
||||
/// workgroup computer. Use this command to rename domain workstations and local
|
||||
/// machines only. It cannot be used to rename Domain Controllers.
|
||||
/// </summary>
|
||||
|
||||
|
@ -5484,7 +5484,7 @@ $result
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// This cmdlet queries the status of trust relationships and will remove and
|
||||
/// This cmdlet queries the status of trust relationships and will remove and
|
||||
/// rebuild the trust if specified.
|
||||
/// </summary>
|
||||
|
||||
|
@ -5714,7 +5714,7 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "Server".
|
||||
/// Specifies the name of the domain controller to use for setting the machine
|
||||
/// Specifies the name of the domain controller to use for setting the machine
|
||||
/// account password.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
|
@ -6458,7 +6458,7 @@ $result
|
|||
{
|
||||
string localUserName = null;
|
||||
|
||||
// The format of local admin username should be "ComputerName\AdminName"
|
||||
// The format of local admin username should be "ComputerName\AdminName"
|
||||
if (psLocalCredential.UserName.Contains("\\"))
|
||||
{
|
||||
localUserName = psLocalCredential.UserName;
|
||||
|
@ -6529,7 +6529,7 @@ $result
|
|||
|
||||
/// <summary>
|
||||
/// Gets the Scope
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="computer"></param>
|
||||
/// <param name="namespaceParameter"></param>
|
||||
|
|
|
@ -105,29 +105,29 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// An array of content holder objects that contain the path information
|
||||
/// and content readers/writers for the item represented by the path information.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
internal List<ContentHolder> contentStreams = new List<ContentHolder>();
|
||||
|
||||
/// <summary>
|
||||
/// Wraps the content into a PSObject and adds context information as notes
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="content">
|
||||
/// The content being written out.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <param name="readCount">
|
||||
/// The number of blocks that have been read so far.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <param name="pathInfo">
|
||||
/// The context the content was retrieved from.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context the command is being run under.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
internal void WriteContentObject(object content, long readCount, PathInfo pathInfo, CmdletProviderContext context)
|
||||
{
|
||||
Dbg.Diagnostics.Assert(
|
||||
|
@ -251,11 +251,11 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Constructs a content cache item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="pathInfo">
|
||||
/// The path information for which the cache will be bound.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
public ContentPathsCache(PathInfo pathInfo)
|
||||
{
|
||||
PathInfo = pathInfo;
|
||||
|
@ -264,51 +264,51 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The path information for the cached item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public PathInfo PathInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The cached PSPath of the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public String PSPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The cached parent path of the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public String ParentPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The cached drive for the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public PSDriveInfo Drive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The cached provider of the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public ProviderInfo Provider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The cached child name of the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public String ChildName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Attaches the cached notes to the specified PSObject.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="content">
|
||||
/// The PSObject to attached the cached notes to.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// The PSObject that was passed in with the cached notes added.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
public PSObject AttachNotes(PSObject content)
|
||||
{
|
||||
// Construct a provider qualified path as the Path note
|
||||
|
@ -353,7 +353,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// A struct to hold the path information and the content readers/writers
|
||||
/// for an item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
internal struct ContentHolder
|
||||
{
|
||||
internal ContentHolder(
|
||||
|
@ -472,16 +472,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Overridden by derived classes to support ShouldProcess with
|
||||
/// the appropriate information.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="path">
|
||||
/// The path to the item from which the content writer will be
|
||||
/// retrieved.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// True if the action should continue or false otherwise.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal virtual bool CallShouldProcess(string path)
|
||||
{
|
||||
return true;
|
||||
|
@ -490,11 +490,11 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the IContentReaders for the current path(s)
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An array of IContentReaders for the current path(s)
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal List<ContentHolder> GetContentReaders(
|
||||
string[] readerPaths,
|
||||
CmdletProviderContext currentCommandContext)
|
||||
|
@ -576,28 +576,28 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Resolves the specified paths to PathInfo objects
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="pathsToResolve">
|
||||
/// The paths to be resolved. Each path may contain glob characters.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <param name="allowNonexistingPaths">
|
||||
/// If true, resolves the path even if it doesn't exist.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <param name="allowEmptyResult">
|
||||
/// If true, allows a wildcard that returns no results.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <param name="currentCommandContext">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An array of PathInfo objects that are the resolved paths for the
|
||||
/// <paramref name="pathsToResolve"/> parameter.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal Collection<PathInfo> ResolvePaths(
|
||||
string[] pathsToResolve,
|
||||
bool allowNonexistingPaths,
|
||||
|
|
|
@ -170,8 +170,8 @@ $result
|
|||
((version.Major == 6) && (version.Minor < 2))
|
||||
))
|
||||
{
|
||||
// Below Win8, this cmdlet is not supported because of Win8:794135
|
||||
// throw terminating
|
||||
// Below Win8, this cmdlet is not supported because of Win8:794135
|
||||
// throw terminating
|
||||
string message = string.Format(CultureInfo.InvariantCulture,
|
||||
ControlPanelResources.ControlPanelItemCmdletNotSupported,
|
||||
this.CommandInfo.Name);
|
||||
|
@ -241,10 +241,10 @@ $result
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// IsServerCoreORHeadLessServer is a helper function that checks if the current SKU is a
|
||||
/// IsServerCoreORHeadLessServer is a helper function that checks if the current SKU is a
|
||||
/// Server Core machine or if the Server-GUI-Shell feature is removed on the machine.
|
||||
/// </summary>
|
||||
/// <returns>True if the current SKU is a Server Core machine or if the Server-GUI-Shell
|
||||
/// <returns>True if the current SKU is a Server Core machine or if the Server-GUI-Shell
|
||||
/// feature is removed on the machine or else returns false.</returns>
|
||||
private bool IsServerCoreOrHeadLessServer()
|
||||
{
|
||||
|
@ -605,7 +605,7 @@ $result
|
|||
#endregion "Parameters"
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
|
@ -722,7 +722,7 @@ $result
|
|||
#endregion "Parameters"
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ using Dbg = System.Management.Automation;
|
|||
namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// A command to convert a drive qualified or provider qualified path to
|
||||
/// A command to convert a drive qualified or provider qualified path to
|
||||
/// a provider internal path.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsData.Convert, "Path", DefaultParameterSetName = "Path", SupportsTransactions = true,
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The path to the destination item to copy the property to.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true)]
|
||||
public string Destination { get; set; }
|
||||
|
||||
|
@ -63,16 +63,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
|
|
@ -716,7 +716,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
public string Source { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// String which represents One of the EventLogEntryType values.
|
||||
/// String which represents One of the EventLogEntryType values.
|
||||
/// </summary>
|
||||
[Parameter(Position = 3)]
|
||||
[Alias("ET")]
|
||||
|
@ -725,7 +725,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
public EventLogEntryType EntryType { get; set; } = EventLogEntryType.Information;
|
||||
|
||||
/// <summary>
|
||||
/// The application-specific subcategory associated with the message.
|
||||
/// The application-specific subcategory associated with the message.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Int16 Category { get; set; } = 1;
|
||||
|
@ -1103,22 +1103,22 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
# region NewEventLogCommand
|
||||
/// <summary>
|
||||
/// This cmdlet creates the new event log .This cmdlet can also be used to
|
||||
/// configure a new source for writing entries to an event log on the local
|
||||
/// This cmdlet creates the new event log .This cmdlet can also be used to
|
||||
/// configure a new source for writing entries to an event log on the local
|
||||
/// computer or a remote computer.
|
||||
/// You can create an event source for an existing event log or a new event log.
|
||||
/// When you create a new source for a new event log, the system registers the
|
||||
/// source for that log, but the log is not created until the first entry is
|
||||
/// You can create an event source for an existing event log or a new event log.
|
||||
/// When you create a new source for a new event log, the system registers the
|
||||
/// source for that log, but the log is not created until the first entry is
|
||||
/// written to it.
|
||||
/// The operating system stores event logs as files. The associated file is
|
||||
/// stored in the %SystemRoot%\System32\Config directory on the specified
|
||||
/// computer. The file name is set by appending the first 8 characters of the
|
||||
/// The operating system stores event logs as files. The associated file is
|
||||
/// stored in the %SystemRoot%\System32\Config directory on the specified
|
||||
/// computer. The file name is set by appending the first 8 characters of the
|
||||
/// Log property with the ".evt" file name extension.
|
||||
/// You can register the event source with localized resource file(s) for your
|
||||
/// event category and message strings. Your application can write event log
|
||||
/// entries using resource identifiers, rather than specifying the actual
|
||||
/// string. You can register a separate file for event categories, messages and
|
||||
/// parameter insertion strings, or you can register the same resource file for
|
||||
/// You can register the event source with localized resource file(s) for your
|
||||
/// event category and message strings. Your application can write event log
|
||||
/// entries using resource identifiers, rather than specifying the actual
|
||||
/// string. You can register a separate file for event categories, messages and
|
||||
/// parameter insertion strings, or you can register the same resource file for
|
||||
/// all three types of strings.
|
||||
/// </summary>
|
||||
|
||||
|
@ -1128,7 +1128,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
# region Parameter
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "CategoryResourceFile".
|
||||
/// Specifies the path of the resource file that contains category strings for
|
||||
/// Specifies the path of the resource file that contains category strings for
|
||||
/// the source
|
||||
/// Resource File is expected to be present in Local/Remote Machines
|
||||
/// </summary>
|
||||
|
@ -1150,7 +1150,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The following is the definition of the input parameter "LogName".
|
||||
/// Specifies the name of the log
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter(Mandatory = true,
|
||||
Position = 0)]
|
||||
|
@ -1160,7 +1160,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "MessageResourceFile".
|
||||
/// Specifies the path of the message resource file that contains message
|
||||
/// Specifies the path of the message resource file that contains message
|
||||
/// formatting strings for the source
|
||||
/// Resource File is expected to be present in Local/Remote Machines
|
||||
/// </summary>
|
||||
|
@ -1171,7 +1171,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "ParameterResourceFile".
|
||||
/// Specifies the path of the resource file that contains message parameter
|
||||
/// Specifies the path of the resource file that contains message parameter
|
||||
/// strings for the source
|
||||
/// Resource File is expected to be present in Local/Remote Machines
|
||||
/// </summary>
|
||||
|
@ -1269,8 +1269,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
#region RemoveEventLogCommand
|
||||
/// <summary>
|
||||
/// This cmdlet is used to delete the specified event log from the specified
|
||||
/// computer. This can also be used to Clear the entries of the specified event
|
||||
/// This cmdlet is used to delete the specified event log from the specified
|
||||
/// computer. This can also be used to Clear the entries of the specified event
|
||||
/// log and also to unregister the Source associated with the eventlog.
|
||||
/// </summary>
|
||||
|
||||
|
@ -1304,11 +1304,11 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// The following is the definition of the input parameter "RemoveSource".
|
||||
/// Specifies either to remove the event log and and associated source or
|
||||
/// Specifies either to remove the event log and and associated source or
|
||||
/// source. alone.
|
||||
/// When this parameter is not specified, the cmdlet uses Delete Method which
|
||||
/// clears the eventlog and also the source associated with it.
|
||||
/// When this parameter value is true, then this cmdlet uses DeleteEventSource
|
||||
/// When this parameter is not specified, the cmdlet uses Delete Method which
|
||||
/// clears the eventlog and also the source associated with it.
|
||||
/// When this parameter value is true, then this cmdlet uses DeleteEventSource
|
||||
/// Method to delete the Source alone.
|
||||
/// </summary>
|
||||
[Parameter(ParameterSetName = "Source")]
|
||||
|
|
|
@ -12,10 +12,10 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// The get-childitem command class.
|
||||
/// This command lists the contents of a container
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
[Cmdlet(VerbsCommon.Get, "ChildItem", DefaultParameterSetName = "Items", SupportsTransactions = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113308")]
|
||||
public class GetChildItemCommand : CoreCommandBase
|
||||
{
|
||||
|
@ -36,13 +36,13 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The string declaration for the -relationship parameter set.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <remarks>
|
||||
/// The "relationship" parameter set includes the following parameters:
|
||||
/// -relationship
|
||||
/// -property
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
private const string relationshipSet = "Relationship";
|
||||
#endif
|
||||
#region Command parameters
|
||||
|
@ -221,10 +221,10 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Gets and sets the value of the Relationship parameter which determines
|
||||
/// which relationship the targets should be retrieved for.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(
|
||||
Mandatory = true,
|
||||
ParameterSetName = relationshipSet,
|
||||
Mandatory = true,
|
||||
ParameterSetName = relationshipSet,
|
||||
ValueFromPipelineByPropertyName = true)]
|
||||
public string[] Relationship
|
||||
{
|
||||
|
@ -243,7 +243,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Gets or sets the property parameter which may provide guidance to the relationship
|
||||
/// provider on which targets to return.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Property
|
||||
{
|
||||
|
@ -264,16 +264,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
object result = null;
|
||||
|
@ -349,7 +349,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region command code
|
||||
|
||||
/// <summary>
|
||||
/// The main execution method for the get-childitem command.
|
||||
/// The main execution method for the get-childitem command.
|
||||
/// </summary>
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
|
@ -456,7 +456,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
foreach (string target in results)
|
||||
{
|
||||
// Create an PSObject with the result.
|
||||
// Create an PSObject with the result.
|
||||
// Attach the relationship name as a note,
|
||||
// and set "System.Management.Automation.RelationshipTarget"
|
||||
// as the TreatAs.
|
||||
|
@ -464,7 +464,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
PSObject result = PSObject.AsPSObject (target);
|
||||
result.Properties.Add (
|
||||
new PSNoteProperty (
|
||||
"Relationship",
|
||||
"Relationship",
|
||||
relationship));
|
||||
|
||||
Collection<string> treatAs = new Collection<string> ();
|
||||
|
|
|
@ -34,22 +34,22 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// Defines the implementation of the 'Get-Clipboard' cmdlet.
|
||||
/// This cmdlet get the content from system clipboard.
|
||||
/// This cmdlet get the content from system clipboard.
|
||||
/// </summary>
|
||||
[Cmdlet(VerbsCommon.Get, "Clipboard", HelpUri = "https://go.microsoft.com/fwlink/?LinkId=526219")]
|
||||
[Alias("gcb")]
|
||||
[OutputType(typeof(String), typeof(FileInfo), typeof(Image), typeof(Stream))]
|
||||
public class GetClipboardCommand : PSCmdlet
|
||||
{
|
||||
/// <summary>
|
||||
/// Property that sets clipboard type. This will return the required format from clipboard
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Property that sets clipboard type. This will return the required format from clipboard
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public ClipboardFormat Format { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Property that sets format type when the return type is text.
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
[ValidateNotNullOrEmpty]
|
||||
public TextDataFormat TextFormatType
|
||||
|
@ -64,9 +64,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
private TextDataFormat _textFormat = TextDataFormat.UnicodeText;
|
||||
private bool _isTextFormatTypeSet = false;
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Property that sets raw parameter. This will allow clipboard return text or file list as one string.
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public SwitchParameter Raw
|
||||
{
|
||||
|
|
|
@ -2954,7 +2954,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// operating system.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value does not necessarily indicate the true amount of
|
||||
/// This value does not necessarily indicate the true amount of
|
||||
/// physical memory, but what is reported to the operating system
|
||||
/// as available to it.
|
||||
/// </remarks>
|
||||
|
@ -3687,7 +3687,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
BackupDomainController = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Primary Domain Controller
|
||||
/// Primary Domain Controller
|
||||
/// </summary>
|
||||
PrimaryDomainController = 5
|
||||
}
|
||||
|
@ -4094,7 +4094,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
ServerForSmallBusinessEdition = 24,
|
||||
|
||||
/// <summary>
|
||||
/// SKU is Small Business Server Premium Edition
|
||||
/// SKU is Small Business Server Premium Edition
|
||||
/// </summary>
|
||||
SmallBusinessServerPremiumEdition = 25,
|
||||
|
||||
|
@ -4732,7 +4732,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
FullPower = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Power Save - Low Power mode
|
||||
/// Power Save - Low Power mode
|
||||
/// </summary>
|
||||
PowerSaveLowPowerMode = 2,
|
||||
|
||||
|
@ -4784,7 +4784,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
Other = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Processor type is
|
||||
/// Processor type is
|
||||
/// </summary>
|
||||
Unknown = 2,
|
||||
|
||||
|
@ -5099,22 +5099,22 @@ namespace Microsoft.PowerShell.Commands
|
|||
[DllImport(PInvokeDllNames.LCIDToLocaleNameDllName, SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern int LCIDToLocaleName(uint localeID, System.Text.StringBuilder localeName, int localeNameSize, int flags);
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Gets the data specified for the passed in property name from the
|
||||
/// Software Licensing API
|
||||
/// </summary>
|
||||
/// <param name="licenseProperty">Name of the licensing property to get.</param>
|
||||
/// <param name="propertyValue">Out parameter for the value.</param>
|
||||
/// <returns>An hresult indicating success or failure.</returns>
|
||||
/// <param name="licenseProperty">Name of the licensing property to get.</param>
|
||||
/// <param name="propertyValue">Out parameter for the value.</param>
|
||||
/// <returns>An hresult indicating success or failure.</returns>
|
||||
[DllImport("slc.dll", CharSet = CharSet.Unicode)]
|
||||
internal static extern int SLGetWindowsInformationDWORD(string licenseProperty, out int propertyValue);
|
||||
/*
|
||||
* SLGetWindowsInformationDWORD function returns
|
||||
* S_OK (0x00000000): If the method succeeds
|
||||
* SL_E_RIGHT_NOT_GRANTED (0xC004F013): The caller does not have the permissions necessary to call this function.
|
||||
* SL_E_DATATYPE_MISMATCHED (0xC004F013): The value portion of the name-value pair is not a DWORD.
|
||||
[DllImport("Slc.dll", EntryPoint = "SLGetWindowsInformationDWORD", CharSet = CharSet.Unicode)]
|
||||
public static extern UInt32 SLGetWindowsInformationDWORD(string pwszValueName, ref int pdwValue);
|
||||
/*
|
||||
* SLGetWindowsInformationDWORD function returns
|
||||
* S_OK (0x00000000): If the method succeeds
|
||||
* SL_E_RIGHT_NOT_GRANTED (0xC004F013): The caller does not have the permissions necessary to call this function.
|
||||
* SL_E_DATATYPE_MISMATCHED (0xC004F013): The value portion of the name-value pair is not a DWORD.
|
||||
[DllImport("Slc.dll", EntryPoint = "SLGetWindowsInformationDWORD", CharSet = CharSet.Unicode)]
|
||||
public static extern UInt32 SLGetWindowsInformationDWORD(string pwszValueName, ref int pdwValue);
|
||||
*/
|
||||
}
|
||||
#endregion Native
|
||||
|
|
|
@ -75,16 +75,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -151,9 +151,9 @@ namespace Microsoft.PowerShell.Commands
|
|||
continue;
|
||||
}
|
||||
|
||||
// If Tail is negative, we are supposed to read all content out. This is same
|
||||
// If Tail is negative, we are supposed to read all content out. This is same
|
||||
// as reading forwards. So we read forwards in this case.
|
||||
// If Tail is positive, we seek the right position. Or, if the seek failed
|
||||
// If Tail is positive, we seek the right position. Or, if the seek failed
|
||||
// because of an unsupported encoding, we scan forward to get the tail content.
|
||||
if (Tail >= 0)
|
||||
{
|
||||
|
|
|
@ -79,16 +79,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -239,16 +239,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
//catch (PlatformNotSupportedException) // thrown (indirectly) by SecurityIdentifier.Translate (on Win95 only?)
|
||||
//{ catch not needed - this is already caught as SystemException
|
||||
//}
|
||||
//catch (UnauthorizedAccessException) // thrown (indirectly) by SecurityIdentifier.Translate
|
||||
//catch (UnauthorizedAccessException) // thrown (indirectly) by SecurityIdentifier.Translate
|
||||
//{ catch not needed - this is already caught as SystemException
|
||||
//}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The WMI Object to use
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(ValueFromPipeline = true, Mandatory = true, ParameterSetName = "object")]
|
||||
public ManagementObject InputObject
|
||||
{
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The path to the destination item to copy the property to.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(Mandatory = true, Position = 1, ValueFromPipelineByPropertyName = true)]
|
||||
public string Destination { get; set; }
|
||||
|
||||
|
@ -75,16 +75,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
string propertyName = String.Empty;
|
||||
|
|
|
@ -77,16 +77,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal virtual object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
return null;
|
||||
|
@ -94,7 +94,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
|
||||
/// <summary>
|
||||
/// Called by the base implementation that checks the SupportShouldProcess provider
|
||||
/// capability. This virtual method gives the
|
||||
/// capability. This virtual method gives the
|
||||
/// derived cmdlet a chance query the CmdletProvider capabilities to determine
|
||||
/// if the provider supports ShouldProcess
|
||||
/// </summary>
|
||||
|
@ -111,11 +111,11 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// A helper for derived classes to call to determine if the paths specified
|
||||
/// are for a provider that supports ShouldProcess
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="paths">
|
||||
/// The paths to check to see if the providers support ShouldProcess.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// If the paths are to different providers, and any don't support
|
||||
/// ShouldProcess, then the return value is false. If they all
|
||||
|
@ -159,7 +159,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// The dynamic parameters which have already been retrieved from the provider
|
||||
/// and bound by the command processor.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
protected internal object RetrievedDynamicParameters
|
||||
{
|
||||
get
|
||||
|
@ -171,7 +171,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// The dynamic parameters for the command. They are retrieved using the
|
||||
/// GetDynamicParameters virtual method.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
private object _dynamicParameters;
|
||||
|
||||
#endregion Protected members
|
||||
|
@ -179,8 +179,8 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Public members
|
||||
|
||||
/// <summary>
|
||||
/// Stops the processing of the provider by using the
|
||||
/// CmdletProviderContext to tunnel the stop message to
|
||||
/// Stops the processing of the provider by using the
|
||||
/// CmdletProviderContext to tunnel the stop message to
|
||||
/// the provider instance.
|
||||
/// </summary>
|
||||
///
|
||||
|
@ -197,26 +197,26 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets or sets the filter property
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is meant to be overridden by derived classes if
|
||||
/// they support the Filter parameter. This property is on
|
||||
/// the base class to simplify the creation of the CmdletProviderContext.
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
public virtual string Filter { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the include property
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is meant to be overridden by derived classes if
|
||||
/// they support the Include parameter. This property is on
|
||||
/// the base class to simplify the creation of the CmdletProviderContext.
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
public virtual string[] Include { get;
|
||||
// get
|
||||
set;
|
||||
|
@ -229,13 +229,13 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets or sets the exclude property
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is meant to be overridden by derived classes if
|
||||
/// they support the Exclude parameter. This property is on
|
||||
/// the base class to simplify the creation of the CmdletProviderContext.
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
public virtual string[] Exclude { get;
|
||||
// get
|
||||
set;
|
||||
|
@ -257,12 +257,12 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// For example, if the user tries to copy a file to a path that already exists and
|
||||
/// the destination is read-only, if force is true, the provider should copy over
|
||||
/// the existing read-only file. If force is false, the provider should write an error.
|
||||
///
|
||||
///
|
||||
/// This is meant to be overridden by derived classes if
|
||||
/// they support the Force parameter. This property is on
|
||||
/// the base class to simplify the creation of the CmdletProviderContext.
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
public virtual SwitchParameter Force
|
||||
{
|
||||
get
|
||||
|
@ -281,7 +281,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Retrieves the dynamic parameters for the command from
|
||||
/// the provider.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
public object GetDynamicParameters()
|
||||
{
|
||||
// Don't stream errors or Write* to the pipeline.
|
||||
|
@ -388,10 +388,10 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// This command does things like list the contents of a container, get
|
||||
/// an item at a given path, get the current working directory, etc.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
///
|
||||
///
|
||||
[Cmdlet(VerbsCommon.Get, "Location", DefaultParameterSetName = "Location", SupportsTransactions = true, HelpUri = "https://go.microsoft.com/fwlink/?LinkID=113321")]
|
||||
[OutputType(typeof(PathInfo), ParameterSetName = new string[] { "locationSet" })]
|
||||
[OutputType(typeof(PathInfoStack), ParameterSetName = new string[] { "Stack" })]
|
||||
|
@ -625,7 +625,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
}
|
||||
}
|
||||
|
||||
// Match the providers
|
||||
// Match the providers
|
||||
|
||||
foreach (ProviderInfo providerInfo in SessionState.Provider.GetAll())
|
||||
{
|
||||
|
@ -820,7 +820,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Gets or sets the relationship Parameter which determines which relationship
|
||||
/// to resolve to a path to set-location to.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(Mandatory = true, ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Relationship
|
||||
{
|
||||
|
@ -840,7 +840,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets or sets the Property parameter value
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Property
|
||||
{
|
||||
|
@ -859,7 +859,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets or sets the Target parameter value
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter (ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Target
|
||||
{
|
||||
|
@ -1163,7 +1163,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Gets or sets the relationship Parameter which determines which relationship
|
||||
/// to resolve to a path to set-location to.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter (Mandatory = true, ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Relationship
|
||||
{
|
||||
|
@ -1182,7 +1182,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets or sets the Property parameter value
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter (ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Property
|
||||
{
|
||||
|
@ -1201,7 +1201,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets or sets the Target parameter value
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter (ParameterSetName = relationshipSet, ValueFromPipelineByPropertyName = true)]
|
||||
public string Target
|
||||
{
|
||||
|
@ -1233,7 +1233,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
private bool _passThrough;
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the stack to use for the pop.
|
||||
/// The ID of the stack to use for the pop.
|
||||
/// </summary>
|
||||
private string _stackName;
|
||||
|
||||
|
@ -1405,7 +1405,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
private bool _passThrough;
|
||||
|
||||
/// <summary>
|
||||
/// The ID of the stack to use for the pop.
|
||||
/// The ID of the stack to use for the pop.
|
||||
/// </summary>
|
||||
private string _stackName;
|
||||
|
||||
|
@ -1582,16 +1582,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the new-psdrive cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
return SessionState.Drive.NewDriveDynamicParameters(PSProvider, context);
|
||||
|
@ -1778,7 +1778,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <returns>
|
||||
/// A collection of the drives that match the filters.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
/// <exception cref="DriveNotFoundException"></exception>
|
||||
/// <exception cref="ProviderNotFoundException"></exception>
|
||||
///
|
||||
|
@ -1786,12 +1786,12 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// If <paramref name="scope"/> is less than zero, or not
|
||||
/// a number and not "script", "global", "local", or "private"
|
||||
/// </exception>
|
||||
///
|
||||
///
|
||||
/// <exception cref="ArgumentOutOfRangeException">
|
||||
/// If <paramref name="scope"/> is less than zero or greater than the number of currently
|
||||
/// active scopes.
|
||||
/// </exception>
|
||||
///
|
||||
///
|
||||
internal List<PSDriveInfo> GetMatchingDrives(
|
||||
string driveName,
|
||||
string[] providerNames,
|
||||
|
@ -1983,7 +1983,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Gets or sets the force property which determines if the drive
|
||||
/// should be removed even if there were errors.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter]
|
||||
public override SwitchParameter Force
|
||||
{
|
||||
|
@ -2424,16 +2424,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the get-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -2569,16 +2569,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the new-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -2740,7 +2740,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// if the object that is set should be written to the pipeline.
|
||||
/// Defaults to false.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter]
|
||||
public SwitchParameter PassThru
|
||||
{
|
||||
|
@ -2781,16 +2781,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the set-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -3025,16 +3025,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the remove-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -3444,7 +3444,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// if the object that is set should be written to the pipeline.
|
||||
/// Defaults to false.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter]
|
||||
public SwitchParameter PassThru
|
||||
{
|
||||
|
@ -3455,16 +3455,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the move-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -3806,7 +3806,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// if the object that is set should be written to the pipeline.
|
||||
/// Defaults to false.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter]
|
||||
public SwitchParameter PassThru
|
||||
{
|
||||
|
@ -3817,16 +3817,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the rename-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
return InvokeProvider.Item.RenameItemDynamicParameters(Path, NewName, context);
|
||||
|
@ -4166,7 +4166,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// if the object that is set should be written to the pipeline.
|
||||
/// Defaults to false.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter]
|
||||
public SwitchParameter PassThru
|
||||
{
|
||||
|
@ -4177,16 +4177,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the copy-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -4425,16 +4425,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the clear-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
@ -4629,16 +4629,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Gets the dynamic parameters for the invoke-item cmdlet.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The type of the property to create on the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(ValueFromPipelineByPropertyName = true)]
|
||||
[Alias("Type")]
|
||||
public string PropertyType { get; set; }
|
||||
|
@ -72,7 +72,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// The value of the property to create on the item.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(ValueFromPipelineByPropertyName = true)]
|
||||
public object Value { get; set; }
|
||||
|
||||
|
@ -108,16 +108,16 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// that require dynamic parameters should override this method and return the
|
||||
/// dynamic parameter object.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="context">
|
||||
/// The context under which the command is running.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// An object representing the dynamic parameters for the cmdlet or null if there
|
||||
/// are none.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal override object GetDynamicParameters(CmdletProviderContext context)
|
||||
{
|
||||
if (Path != null && Path.Length > 0)
|
||||
|
|
|
@ -210,7 +210,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Determines if the path is an absolute path.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
[Parameter(ParameterSetName = isAbsoluteSet)]
|
||||
public SwitchParameter IsAbsolute
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ namespace Microsoft.PowerShell.Commands
|
|||
#region Command code
|
||||
|
||||
/// <summary>
|
||||
/// Parses the specified path and returns the portion determined by the
|
||||
/// Parses the specified path and returns the portion determined by the
|
||||
/// boolean parameters.
|
||||
/// </summary>
|
||||
protected override void ProcessRecord()
|
||||
|
@ -520,15 +520,15 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// <summary>
|
||||
/// Removes either the drive or provider qualifier or both from the path.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <param name="path">
|
||||
/// The path to strip the provider qualifier from.
|
||||
/// </param>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// The path without the qualifier.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
private string RemoveQualifier(string path)
|
||||
{
|
||||
Dbg.Diagnostics.Assert(
|
||||
|
|
|
@ -62,12 +62,12 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Initializes a CmdletProviderContext instance to the current context of
|
||||
/// the command.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// A CmdletProviderContext instance initialized to the context of the current
|
||||
/// command.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal CmdletProviderContext GetCurrentContext()
|
||||
{
|
||||
CmdletProviderContext currentCommandContext = CmdletProviderContext;
|
||||
|
|
|
@ -89,12 +89,12 @@ namespace Microsoft.PowerShell.Commands
|
|||
/// Initializes a CmdletProviderContext instance to the current context of
|
||||
/// the command.
|
||||
/// </summary>
|
||||
///
|
||||
///
|
||||
/// <returns>
|
||||
/// A CmdletProviderContext instance initialized to the context of the current
|
||||
/// command.
|
||||
/// </returns>
|
||||
///
|
||||
///
|
||||
internal CmdletProviderContext GetCurrentContext()
|
||||
{
|
||||
CmdletProviderContext currentCommandContext = CmdletProviderContext;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue