mirror of
https://github.com/PowerShell/PSDscResources
synced 2026-06-21 13:45:29 +00:00
More PSScriptAnalyzer Fixes
This commit is contained in:
@@ -2105,6 +2105,7 @@ function Get-PrincipalContext
|
||||
[String]
|
||||
$Scope,
|
||||
|
||||
[Parameter()]
|
||||
[System.Management.Automation.PSCredential]
|
||||
[System.Management.Automation.Credential()]
|
||||
$Credential,
|
||||
|
||||
@@ -1357,6 +1357,7 @@ function Add-UserOnFullSku
|
||||
[String]
|
||||
$UserName,
|
||||
|
||||
[Parameter()]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[System.Management.Automation.PSCredential]
|
||||
[System.Management.Automation.Credential()]
|
||||
|
||||
@@ -76,7 +76,6 @@ function Get-TargetResource
|
||||
{
|
||||
foreach ($currentSubFeatureName in $feature.SubFeatures)
|
||||
{
|
||||
|
||||
$getWindowsFeatureParameters = @{
|
||||
Name = $currentSubFeatureName
|
||||
}
|
||||
@@ -531,7 +530,8 @@ function Import-ServerManager
|
||||
{
|
||||
Import-Module -Name 'ServerManager' -ErrorAction Stop
|
||||
}
|
||||
catch [System.Management.Automation.RuntimeException] {
|
||||
catch [System.Management.Automation.RuntimeException]
|
||||
{
|
||||
if ($_.Exception.Message -like "*Some or all identity references could not be translated*")
|
||||
{
|
||||
Write-Verbose -Message $script:localizedData.IdentityNotFoundMessage
|
||||
|
||||
@@ -599,7 +599,6 @@ function Get-ProcessCimInstance
|
||||
|
||||
if ($getProcessResult.Count -ge $UseGetCimInstanceThreshold)
|
||||
{
|
||||
|
||||
$escapedPathForWqlFilter = ConvertTo-EscapedStringForWqlFilter -FilterString $Path
|
||||
$wqlFilter = "ExecutablePath = '$escapedPathForWqlFilter'"
|
||||
|
||||
@@ -1121,8 +1120,8 @@ function Assert-PsDscContextNotRunAsUser
|
||||
for a user from the local system.
|
||||
Currently Start-Process, which is the command used otherwise, cannot do this.
|
||||
#>
|
||||
function Import-DscNativeMethods
|
||||
{
|
||||
function Import-DscNativeMethods
|
||||
{
|
||||
$dscNativeMethodsSource = @"
|
||||
|
||||
using System;
|
||||
|
||||
Reference in New Issue
Block a user