diff --git a/build.psm1 b/build.psm1 index 619b862d70..ac16bf14d2 100644 --- a/build.psm1 +++ b/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 diff --git a/demos/Apache/Apache/Apache.psm1 b/demos/Apache/Apache/Apache.psm1 index c5d6e44f0d..5537fd124f 100644 --- a/demos/Apache/Apache/Apache.psm1 +++ b/demos/Apache/Apache/Apache.psm1 @@ -100,7 +100,7 @@ Class ApacheVirtualHost{ $vHostDef += "" $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 } diff --git a/demos/Azure/Azure-Demo.ps1 b/demos/Azure/Azure-Demo.ps1 index 8678bd8e15..e08371d109 100644 --- a/demos/Azure/Azure-Demo.ps1 +++ b/demos/Azure/Azure-Demo.ps1 @@ -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 diff --git a/demos/DSC/dsc-demo.ps1 b/demos/DSC/dsc-demo.ps1 index e35a36f418..95b694c638 100644 --- a/demos/DSC/dsc-demo.ps1 +++ b/demos/DSC/dsc-demo.ps1 @@ -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" diff --git a/demos/crontab/CronTab/CronTab.ps1xml b/demos/crontab/CronTab/CronTab.ps1xml index 1d1f1f90d8..4246b1f62a 100644 --- a/demos/crontab/CronTab/CronTab.ps1xml +++ b/demos/crontab/CronTab/CronTab.ps1xml @@ -1,6 +1,6 @@ - + Default diff --git a/demos/crontab/CronTab/CronTab.psm1 b/demos/crontab/CronTab/CronTab.psm1 index 308ff4ea9e..d706333126 100644 --- a/demos/crontab/CronTab/CronTab.psm1 +++ b/demos/crontab/CronTab/CronTab.psm1 @@ -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 ( diff --git a/demos/dsc.ps1 b/demos/dsc.ps1 index c1fdd69037..27e09f29e4 100644 --- a/demos/dsc.ps1 +++ b/demos/dsc.ps1 @@ -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 diff --git a/demos/powershellget/PowerShellGet.ps1 b/demos/powershellget/PowerShellGet.ps1 index d371a7d42a..6703215241 100644 --- a/demos/powershellget/PowerShellGet.ps1 +++ b/demos/powershellget/PowerShellGet.ps1 @@ -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' diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs index 70492544e5..4cb2c7ab20 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimAsyncOperation.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs index c5a21c4f3f..829152def7 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimBaseAction.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs index 4e62515f95..b8138e8768 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCmdletModuleInitialize.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs index dbf90255cc..2f545311bc 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimCommandBase.cs @@ -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 /// /// - /// Set object, to which + /// Set object, to which /// current cmdlet will delegate all operations. /// /// @@ -787,7 +787,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// resource Uri computer set name /// - internal const string ResourceUriComputerSet = "ResourceUriComputerSet"; + internal const string ResourceUriComputerSet = "ResourceUriComputerSet"; /// /// computer set name @@ -808,7 +808,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// resource Uri session set name /// - internal const string ResourceUriSessionSet = "ResourceUriSessionSet"; + internal const string ResourceUriSessionSet = "ResourceUriSessionSet"; /// /// session set name diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs index 4f83c7dee4..b21e8304ac 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetAssociatedInstance.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs index 4c7b2dc5b2..2fec594ad3 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetCimClass.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs index b0495df2b4..562bce3b62 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimGetInstance.cs @@ -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), diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs index 91d9006f6c..98098e0f3f 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimIndicationWatcher.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs index 6e38493a06..63c8bafbe0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimInvokeCimMethod.cs @@ -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, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs index bc462dd7c6..c56e604d90 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimNewCimInstance.cs @@ -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 keys = new List(); if (key != null) { @@ -309,7 +309,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets flag); cimInstance.CimInstanceProperties.Add(newProperty); } - + } return cimInstance; } diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs index 0c9ee96dba..a36c59a2ca 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimPromptUser.cs @@ -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; - } + } /// /// @@ -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 /// /// prompt message /// - public string Message + public string Message { get { diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs index d1635eb98c..81e3cf2adb 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRegisterCimIndication.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs index 20837d5b7a..726136fa33 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimRemoveCimInstance.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs index eb7c10ebb7..0ea01b2a64 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimResultObserver.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs index d17891c084..bbf9094988 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionOperations.cs @@ -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 /// /// Create a new base on given cmdlet /// and its parameter - /// + /// /// /// /// @@ -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); } } } diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs index 80c2f474fa..ba2cd51372 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSessionProxy.cs @@ -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; } - } + } /// /// Enable/Disable the method result streaming, @@ -600,9 +600,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets if(value) { this.options.PromptUser = this.PromptUser; - } + } } - } + } /// /// Enable the pssemantics @@ -1021,7 +1021,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets } /// - /// This method adds a note property to , + /// This method adds a note property to , /// which will cause the default PowerShell formatting and output /// to include PSComputerName column/property in the display. /// @@ -1639,8 +1639,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets private IObjectPreProcess objectPreprocess; /// - /// is true if this was - /// created to handle the "default" session, in cases where cmdlets are invoked without + /// is true if this was + /// created to handle the "default" session, in cases where cmdlets are invoked without /// ComputerName and/or CimSession parameters. /// private bool isDefaultSession; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs index 46e40ef539..57ddb857cc 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimSetCimInstance.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs index 780eae5254..97c45cd77c 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteError.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs index 914d499bbf..b224364bfc 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteMessage.cs @@ -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; } } diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs index ce28ce1440..08eb6acc87 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteProgress.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs index c95bb72846..b060a728c0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CimWriteResultObject.cs @@ -1,5 +1,5 @@ /*============================================================================ - * Copyright (C) Microsoft Corporation, All rights reserved. + * Copyright (C) Microsoft Corporation, All rights reserved. *============================================================================ */ diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs index b3aac9c1ce..9d770ee22d 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/CmdletOperation.cs @@ -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; } /// @@ -295,7 +295,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets DebugHelper.WriteLogEx(); if (sendToPipeline is CimInstance) - { + { this.cimInvokeCimMethod.InvokeCimMethodOnCimInstance(sendToPipeline as CimInstance, context, this); } else diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs index 642b02a362..7afe732523 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimAssociatedInstanceCommand.cs @@ -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 - + /// /// constructor /// @@ -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; /// /// @@ -311,7 +311,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// Noun of current cmdlet /// - 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 { - new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true), + new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true), } }, { nameCimInstance, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.ComputerSetName, true), - new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true), + new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true), } }, { nameResourceUri, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.ComputerSetName, false), - new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, false), + new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, false), } }, }; diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs index 5684d4c0dd..2201d64fdf 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimClassCommand.cs @@ -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 { /// /// - /// 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. /// @@ -30,7 +30,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets public class GetCimClassCommand : CimBaseCommand { #region constructor - + /// /// constructor /// @@ -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() /// @@ -283,7 +283,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.SessionSetName, true), } }, - + { nameComputerName, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.ComputerSetName, false), diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs index 91706dd397..248e716c51 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimInstanceCommand.cs @@ -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 { /// - /// 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. /// [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 - + /// /// constructor /// @@ -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; /// - /// 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 + /// 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. /// /// @@ -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 /// /// /// 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. /// /// [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 /// /// /// 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). /// /// [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 { 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 diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs index f7145e6aee..86b26890b7 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/GetCimSessionCommand.cs @@ -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 { /// - /// 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. /// @@ -23,7 +23,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets public sealed class GetCimSessionCommand : CimBaseCommand { #region constructor - + /// /// constructor /// @@ -32,7 +32,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets { DebugHelper.WriteLogEx(); } - + #endregion #region parameters @@ -40,17 +40,17 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// /// 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). /// /// - /// 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. /// /// - /// 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. /// /// @@ -111,7 +111,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Parameter(Mandatory = true, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs index c23b9b20e5..eb434f16b6 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/InvokeCimMethodCommand.cs @@ -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 { /// - /// 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. /// @@ -28,7 +28,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets public class InvokeCimMethodCommand : CimBaseCommand { #region constructor - + /// /// constructor /// @@ -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; /// /// The following is the definition of the input parameter "CimClass". @@ -140,7 +140,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// /// 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. /// /// @@ -193,9 +193,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets private CimInstance cimInstance; /// - /// 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 + /// 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. /// /// @@ -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 /// [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 /// /// 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. /// [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 { 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), } - }, + }, }; /// @@ -541,8 +541,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets static Dictionary parameterSets = new Dictionary { { 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) }, diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs index 1f916b5f60..b1a5986a0f 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimInstanceCommand.cs @@ -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 - + /// /// constructor /// @@ -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; /// /// @@ -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 /// /// 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. /// [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; /// - /// The following is the definition of the input parameter "ComputerName". + /// The following is the definition of the input parameter "ComputerName". /// Provides the name of the computer from which to create the instances. /// /// @@ -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 { new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true), - new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true), + new ParameterDefinitionEntry(CimBaseCommand.ResourceUriComputerSet, true), } - }, + }, { nameKey, new HashSet { 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 { 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 { new ParameterDefinitionEntry(CimBaseCommand.ClassNameSessionSet, true), - new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true), + new ParameterDefinitionEntry(CimBaseCommand.ResourceUriSessionSet, true), new ParameterDefinitionEntry(CimBaseCommand.CimClassSessionSet, true), } }, { nameComputerName, new HashSet { 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), } - }, + }, }; /// @@ -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 diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs index 99b7d46bd0..f1083747e8 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionCommand.cs @@ -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 { /// - /// 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. /// [Cmdlet(VerbsCommon.New, "CimSession", DefaultParameterSetName = CredentialParameterSet, HelpUri = "https://go.microsoft.com/fwlink/?LinkId=227967")] @@ -74,7 +74,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Alias(AliasCN, AliasServerName)] @@ -96,8 +96,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// Specifies a friendly name for the CIM Session connection. /// /// - /// If a name is not passed, then the session is given the name CimSession, - /// where is the next available session number. Example, CimSession1, + /// If a name is not passed, then the session is given the name CimSession, + /// where is the next available session number. Example, CimSession1, /// CimSession2, etc... /// /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index 05d3276010..9e12e007f3 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -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 }; /// - /// 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. /// [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 - + /// /// constructor /// @@ -52,7 +52,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets { DebugHelper.WriteLogEx(); } - + #endregion #region cmdlet parameters @@ -153,8 +153,8 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Parameter(ValueFromPipelineByPropertyName = true, @@ -174,7 +174,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Parameter(ValueFromPipelineByPropertyName = true, @@ -302,7 +302,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Parameter(ParameterSetName = DcomParameterSet)] @@ -321,7 +321,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Parameter(ParameterSetName = DcomParameterSet)] @@ -340,7 +340,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [Parameter(ParameterSetName = DcomParameterSet)] @@ -660,13 +660,13 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameSkipCACheck, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameSkipCNCheck, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), @@ -677,7 +677,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameEncodePortInServicePrincipalName, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), @@ -688,7 +688,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameHttpPrefix, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), @@ -699,7 +699,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameProxyAuthentication, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), @@ -710,7 +710,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameProxyCredential, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), @@ -721,7 +721,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), } }, - + { nameUseSsl, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.WSManParameterSet, false), @@ -732,7 +732,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.DcomParameterSet, false), } }, - + { namePacketIntegrity, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.DcomParameterSet, false), @@ -743,7 +743,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets new ParameterDefinitionEntry(CimBaseCommand.DcomParameterSet, false), } }, - + { nameProtocol, new HashSet { new ParameterDefinitionEntry(CimBaseCommand.ProtocolNameParameterSet, true), diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs index 68ef388c49..6621385061 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RegisterCimIndicationCommand.cs @@ -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 { /// - /// 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? /// @@ -92,7 +92,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// /// 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. /// /// @@ -146,7 +146,7 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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. /// [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 { new ParameterDefinitionEntry(CimBaseCommand.QueryExpressionSessionSet, true), diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs index c3d0517c74..3e6e4166a4 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimInstanceCommand.cs @@ -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 - + /// /// constructor /// @@ -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; /// /// 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), } - }, + }, }; /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs index 8361729fbd..f02f159859 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/RemoveCimSessionCommand.cs @@ -35,14 +35,14 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets : base(parameters, parameterSets) { } - + #endregion #region parameters /// /// 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. /// [Parameter( @@ -65,9 +65,9 @@ namespace Microsoft.Management.Infrastructure.CimCmdlets /// /// 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). - /// This is the only optional parameter. If no value for this parameter is + /// This is the only optional parameter. If no value for this parameter is /// provided, all CimSession(s) are terminated. /// [Alias(AliasCN, AliasServerName)] diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs index 6d8e78a61d..717d3f805b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/SetCimInstanceCommand.cs @@ -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; /// /// 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), } - }, + }, }; /// diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs index 0c32a51805..5482e4bbb4 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Utils.cs @@ -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); } - + } } } diff --git a/src/Microsoft.PowerShell.Activities/Activities/GetCimAssociatedInstanceActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/GetCimAssociatedInstanceActivity.cs index 97fb15bc21..046fdb79fe 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/GetCimAssociatedInstanceActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/GetCimAssociatedInstanceActivity.cs @@ -25,14 +25,14 @@ namespace Microsoft.PowerShell.Activities /// Gets the fully qualified name of the command invoked by this activity. /// public override string PSCommandName { get { return "CimCmdlets\\Get-CimAssociatedInstance"; } } - + /// /// The .NET type implementing the cmdlet to invoke. /// public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.GetCimAssociatedInstanceCommand); } } - + // Arguments - + /// /// Provides access to the Association parameter. /// @@ -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)); diff --git a/src/Microsoft.PowerShell.Activities/Activities/GetCimClassActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/GetCimClassActivity.cs index 249864c181..04cf6c7bd2 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/GetCimClassActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/GetCimClassActivity.cs @@ -30,9 +30,9 @@ namespace Microsoft.PowerShell.Activities /// The .NET type implementing the cmdlet to invoke. /// public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.GetCimClassCommand); } } - + // Arguments - + /// /// Provides access to the ClassName parameter. /// diff --git a/src/Microsoft.PowerShell.Activities/Activities/GetCimInstanceActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/GetCimInstanceActivity.cs index bf08b44b64..10bada7885 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/GetCimInstanceActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/GetCimInstanceActivity.cs @@ -30,9 +30,9 @@ namespace Microsoft.PowerShell.Activities /// The .NET type implementing the cmdlet to invoke. /// public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand); } } - + // Arguments - + /// /// Provides access to the ClassName parameter. /// @@ -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)); diff --git a/src/Microsoft.PowerShell.Activities/Activities/GetPSWorkflowData.cs b/src/Microsoft.PowerShell.Activities/Activities/GetPSWorkflowData.cs index a2a7b9daac..599480c688 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/GetPSWorkflowData.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/GetPSWorkflowData.cs @@ -13,159 +13,159 @@ namespace Microsoft.PowerShell.Activities { /// - /// + /// /// public enum PSWorkflowRuntimeVariable { // Command Parameters /// - /// + /// /// PSComputerName = 0, /// - /// + /// /// PSCredential = 1, /// - /// + /// /// PSPort = 2, /// - /// + /// /// PSUseSsl = 3, /// - /// + /// /// PSConfigurationName = 4, /// - /// + /// /// PSApplicationName = 5, /// - /// + /// /// PSConnectionUri = 6, /// - /// + /// /// PSAllowRedirection = 7, /// - /// + /// /// PSSessionOption = 8, /// - /// + /// /// PSAuthentication = 9, /// - /// + /// /// PSAuthenticationLevel = 10, /// - /// + /// /// PSCertificateThumbprint = 11, /// - /// + /// /// Input = 13, /// - /// + /// /// Verbose = 15, // Retry policy constants /// - /// + /// /// PSConnectionRetryCount = 19, /// - /// + /// /// PSConnectionRetryIntervalSec = 21, /// - /// + /// /// PSPrivateMetadata = 24, // Timers /// - /// + /// /// PSRunningTimeoutSec = 27, /// - /// + /// /// PSElapsedTimeoutSec = 28, /// - /// + /// /// PSWorkflowRoot = 31, /// - /// + /// /// JobName = 32, /// - /// + /// /// JobInstanceId = 33, /// - /// + /// /// JobId = 34, /// - /// + /// /// - JobCommandName = 36, + JobCommandName = 36, /// - /// + /// /// ParentJobInstanceId = 40, /// - /// + /// /// ParentJobName = 41, /// - /// + /// /// ParentJobId = 42, /// - /// + /// /// ParentCommandName = 43, /// - /// + /// /// WorkflowInstanceId = 48, /// - /// + /// /// PSSenderInfo = 49, /// - /// + /// /// PSCulture = 50, /// - /// + /// /// [SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly")] PSUICulture = 51, /// - /// + /// /// PSVersionTable = 52, @@ -279,7 +279,7 @@ namespace Microsoft.PowerShell.Activities outputStream = parameter.Value as PSDataCollection; } } - + // // 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; } diff --git a/src/Microsoft.PowerShell.Activities/Activities/InvokeCimMethodActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/InvokeCimMethodActivity.cs index da7558d5f0..5dda7530c0 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/InvokeCimMethodActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/InvokeCimMethodActivity.cs @@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Activities public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.InvokeCimMethodCommand); } } // Arguments - + /// /// Provides access to the ClassName parameter. /// @@ -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)); diff --git a/src/Microsoft.PowerShell.Activities/Activities/NewCimInstanceActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/NewCimInstanceActivity.cs index 53f94aa054..7d503cb4e4 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/NewCimInstanceActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/NewCimInstanceActivity.cs @@ -30,9 +30,9 @@ namespace Microsoft.PowerShell.Activities /// The .NET type implementing the cmdlet to invoke. /// public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.NewCimInstanceCommand); } } - + // Arguments - + /// /// Provides access to the ClassName parameter. /// @@ -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)); diff --git a/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionActivity.cs index 26511b9a72..291c9ef5ae 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionActivity.cs @@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Activities public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCommand); } } // Arguments - + /// /// Provides access to the Authentication parameter. /// diff --git a/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionOptionActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionOptionActivity.cs index 570c667316..695072fffd 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionOptionActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/NewCimSessionOptionActivity.cs @@ -32,7 +32,7 @@ namespace Microsoft.PowerShell.Activities public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionOptionCommand); } } // Arguments - + /// /// Provides access to the NoEncryption parameter. /// @@ -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)); diff --git a/src/Microsoft.PowerShell.Activities/Activities/PowerShellValue.cs b/src/Microsoft.PowerShell.Activities/Activities/PowerShellValue.cs index c945009255..9c1e7cf46f 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/PowerShellValue.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/PowerShellValue.cs @@ -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 /// /// - /// 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. /// @@ -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) } diff --git a/src/Microsoft.PowerShell.Activities/Activities/RemoveCimInstanceActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/RemoveCimInstanceActivity.cs index bcc130c665..44e6fc1694 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/RemoveCimInstanceActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/RemoveCimInstanceActivity.cs @@ -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)); diff --git a/src/Microsoft.PowerShell.Activities/Activities/SetCimInstanceActivity.cs b/src/Microsoft.PowerShell.Activities/Activities/SetCimInstanceActivity.cs index 16759ec2b4..2e90f2ae24 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/SetCimInstanceActivity.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/SetCimInstanceActivity.cs @@ -30,7 +30,7 @@ namespace cimcmdlets.Activities /// The .NET type implementing the cmdlet to invoke. /// public override System.Type TypeImplementingCmdlet { get { return typeof(Microsoft.Management.Infrastructure.CimCmdlets.SetCimInstanceCommand); } } - + /// /// Provides access to the Namespace parameter. /// @@ -87,7 +87,7 @@ namespace cimcmdlets.Activities protected override string PSDefiningModule { get { return "CimCmdlets"; } } // Additional custom code for this activity - + /// /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run. diff --git a/src/Microsoft.PowerShell.Activities/Activities/SetHostValue.cs b/src/Microsoft.PowerShell.Activities/Activities/SetHostValue.cs index eb06b2da64..42b26f9c68 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/SetHostValue.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/SetHostValue.cs @@ -29,7 +29,7 @@ namespace Microsoft.PowerShell.Activities } /// - /// + /// /// [DefaultValue(null)] public InArgument Value @@ -252,7 +252,7 @@ namespace Microsoft.PowerShell.Activities } /// - /// 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. /// [BehaviorCategory] diff --git a/src/Microsoft.PowerShell.Activities/Activities/ThrottledParallelForeach.cs b/src/Microsoft.PowerShell.Activities/Activities/ThrottledParallelForeach.cs index c7af205d0a..a197ca0ca8 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/ThrottledParallelForeach.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/ThrottledParallelForeach.cs @@ -63,7 +63,7 @@ namespace Microsoft.PowerShell.Activities metadata.AddArgument(new RuntimeArgument("Values", typeof(IEnumerable), 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(); 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) diff --git a/src/Microsoft.PowerShell.Activities/Activities/WmiActivities.cs b/src/Microsoft.PowerShell.Activities/Activities/WmiActivities.cs index de89e6a4e2..bb11f09784 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/WmiActivities.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/WmiActivities.cs @@ -25,7 +25,7 @@ using System.Globalization; namespace Microsoft.PowerShell.Activities { - + /// /// Workflow activity wrapping the Get-Wmiobject cmdlet /// diff --git a/src/Microsoft.PowerShell.Activities/Activities/WorkflowJobConverter.cs b/src/Microsoft.PowerShell.Activities/Activities/WorkflowJobConverter.cs index a09ae005ec..fc02a62f7a 100644 --- a/src/Microsoft.PowerShell.Activities/Activities/WorkflowJobConverter.cs +++ b/src/Microsoft.PowerShell.Activities/Activities/WorkflowJobConverter.cs @@ -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 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 {{"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 parameterValidation = new Dictionary(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 = @""; @@ -882,7 +882,7 @@ namespace Microsoft.PowerShell.Workflow private const string GenericTypesKey = @"Activity-GenericTypes"; private const string MemberTemplate = @""; 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]; } /// - /// + /// /// /// /// @@ -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).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 = 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))) { - // 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 in that case. return typeof(PSDataCollection); @@ -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. /// /// @@ -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 . /// 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(""); IndentLevel(); - + WriteLine(""); 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 savedHostDefaults = new Collection(); - + // 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 completeProperties = new List(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 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(""); IndentLevel(); - + if (isParallel) { EnterScope(); @@ -7366,7 +7366,7 @@ namespace Microsoft.PowerShell.Workflow foreach (CatchClauseAst catchClause in tryStatementAst.CatchClauses) { List catchTypes = new List(); - + if (catchClause.IsCatchAll) { catchTypes.Add(typeof(System.Exception)); @@ -7401,7 +7401,7 @@ namespace Microsoft.PowerShell.Workflow WriteLine(@""); UnindentLevel(); WriteLine(@""); - + WriteLine(""); 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(@""); 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. /// 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; } diff --git a/src/Microsoft.PowerShell.Activities/Xamls/InlineScriptDesigner.xaml b/src/Microsoft.PowerShell.Activities/Xamls/InlineScriptDesigner.xaml index a01b00c045..6b5083509e 100644 --- a/src/Microsoft.PowerShell.Activities/Xamls/InlineScriptDesigner.xaml +++ b/src/Microsoft.PowerShell.Activities/Xamls/InlineScriptDesigner.xaml @@ -1,14 +1,14 @@  @@ -19,8 +19,8 @@ - - diff --git a/src/Microsoft.PowerShell.GraphicalHost/xamls/ColumnPicker.xaml b/src/Microsoft.PowerShell.GraphicalHost/xamls/ColumnPicker.xaml index 2a4934e903..e036a2d26d 100644 --- a/src/Microsoft.PowerShell.GraphicalHost/xamls/ColumnPicker.xaml +++ b/src/Microsoft.PowerShell.GraphicalHost/xamls/ColumnPicker.xaml @@ -74,7 +74,7 @@ -