PSScriptAnalyzer Fixes

This commit is contained in:
Simon Heather
2019-04-25 09:28:44 +01:00
parent 52942260cf
commit c0043d4ba9
10 changed files with 229 additions and 12 deletions
@@ -38,6 +38,7 @@ function Get-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Process', 'Machine')]
[ValidateNotNullOrEmpty()]
[String[]]
@@ -47,7 +48,7 @@ function Get-TargetResource
$valueToReturn = $null
if ($Target -contains 'Machine')
{
{
$environmentVaraible = Get-EnvironmentVariableWithoutExpanding -Name $Name -ErrorAction 'SilentlyContinue'
if ($null -ne $environmentVaraible)
@@ -67,9 +68,9 @@ function Get-TargetResource
}
if ($null -eq $valueToReturn)
{
{
Write-Verbose -Message ($script:localizedData.EnvVarNotFound -f $Name)
}
}
else
{
Write-Verbose -Message ($script:localizedData.EnvVarFound -f $Name, $valueToReturn)
@@ -122,17 +123,21 @@ function Set-TargetResource
[String]
$Name,
[Parameter()]
[ValidateNotNull()]
[String]
$Value = [String]::Empty,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[Boolean]
$Path = $false,
[Parameter()]
[ValidateSet('Process', 'Machine')]
[ValidateNotNullOrEmpty()]
[String[]]
@@ -192,7 +197,6 @@ function Set-TargetResource
if ($createMachineVariable -and $createProcessVariable)
{
if (-not $valueSpecified)
{
<#
@@ -430,17 +434,21 @@ function Test-TargetResource
[String]
$Name,
[Parameter()]
[ValidateNotNull()]
[String]
$Value,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[Boolean]
$Path = $false,
[Parameter()]
[ValidateSet('Process', 'Machine')]
[ValidateNotNullOrEmpty()]
[String[]]
@@ -525,9 +533,9 @@ function Test-TargetResource
# If the control reaches here, the expected environment variable exists, it is a path variable and a $Value is specified to test against
if ($Ensure -eq 'Present')
{
{
if ($checkMachineTarget)
{
{
if (-not (Test-PathsInValue -ExistingPaths $currentValueFromMachine -QueryPaths $Value -FindCriteria 'All'))
{
# If the control reached here some part of the specified path ($Value) was not found in the existing variable, return failure
@@ -693,8 +701,8 @@ function Add-PathsToValue
$currentPaths = $CurrentValue -split ';'
$newPaths = $NewValue -split ';'
foreach ($path in $newPaths)
{
foreach ($path in $newPaths)
{
if ($currentPaths -notcontains $path)
{
<#
@@ -703,8 +711,8 @@ function Add-PathsToValue
#>
$finalValue += ($path + ';')
}
}
}
}
# Remove any extraneous ';' at the end (and potentially start - as a side-effect) of the value to be set
return $finalValue.Trim(';')
@@ -803,6 +811,7 @@ function Set-EnvironmentVariable
[String]
$Name,
[Parameter()]
[String]
$Value,
@@ -931,6 +940,7 @@ function Set-ProcessEnvironmentVariable
[String]
$Name,
[Parameter()]
[String]
$Value = [String]::Empty
)
@@ -1023,7 +1033,7 @@ function Test-PathsInValue
'Any'
{
foreach ($queryPath in $queryPathList)
{
{
if ($existingPathList -contains $queryPath)
{
# Found this $queryPath in the existing paths, return $true
@@ -96,6 +96,7 @@ function Get-TargetResource
[String]
$GroupName,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -188,22 +189,28 @@ function Set-TargetResource
[String]
$GroupName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Description,
[Parameter()]
[String[]]
$Members,
[Parameter()]
[String[]]
$MembersToInclude,
[Parameter()]
[String[]]
$MembersToExclude,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -286,22 +293,28 @@ function Test-TargetResource
[String]
$GroupName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Description,
[Parameter()]
[String[]]
$Members,
[Parameter()]
[String[]]
$MembersToInclude,
[Parameter()]
[String[]]
$MembersToExclude,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -343,6 +356,7 @@ function Get-TargetResourceOnFullSKU
[String]
$GroupName,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -411,6 +425,7 @@ function Get-TargetResourceOnNanoServer
[String]
$GroupName,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -508,22 +523,28 @@ function Set-TargetResourceOnFullSKU
[String]
$GroupName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Description,
[Parameter()]
[String[]]
$Members,
[Parameter()]
[String[]]
$MembersToInclude,
[Parameter()]
[String[]]
$MembersToExclude,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -859,22 +880,28 @@ function Set-TargetResourceOnNanoServer
[String]
$GroupName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Description,
[Parameter()]
[String[]]
$Members,
[Parameter()]
[String[]]
$MembersToInclude,
[Parameter()]
[String[]]
$MembersToExclude,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -1092,22 +1119,28 @@ function Test-TargetResourceOnFullSKU
[String]
$GroupName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Description,
[Parameter()]
[String[]]
$Members,
[Parameter()]
[String[]]
$MembersToInclude,
[Parameter()]
[String[]]
$MembersToExclude,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -1353,22 +1386,28 @@ function Test-TargetResourceOnNanoServer
[String]
$GroupName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Description,
[Parameter()]
[String[]]
$Members,
[Parameter()]
[String[]]
$MembersToInclude,
[Parameter()]
[String[]]
$MembersToExclude,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -1571,6 +1610,7 @@ function Get-MembersOnFullSKU
[AllowEmptyCollection()]
$Disposables,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -1656,6 +1696,7 @@ function Get-MembersAsPrincipalsList
[AllowEmptyCollection()]
$Disposables,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -1833,6 +1874,7 @@ function ConvertTo-UniquePrincipalsList
[AllowEmptyCollection()]
$Disposables,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -1922,6 +1964,7 @@ function ConvertTo-Principal
[AllowEmptyCollection()]
$Disposables,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential
@@ -2007,6 +2050,7 @@ function Resolve-SidToPrincipal
[System.DirectoryServices.AccountManagement.PrincipalContext]
$PrincipalContext,
[Parameter()]
[Parameter(Mandatory = $true)]
[String]
$Scope
@@ -2329,6 +2373,7 @@ function Find-Principal
[String]
$IdentityValue,
[Parameter()]
[System.DirectoryServices.AccountManagement.IdentityType]
$IdentityType
)
@@ -130,36 +130,46 @@ function Set-TargetResource
[String]
$Path,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Arguments,
[Parameter()]
[PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[String]
$LogPath,
[Parameter()]
[String]
$FileHash,
[Parameter()]
[ValidateSet('SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5', 'RIPEMD160')]
[String]
$HashAlgorithm = 'SHA256',
[Parameter()]
[String]
$SignerSubject,
[Parameter()]
[String]
$SignerThumbprint,
[Parameter()]
[String]
$ServerCertificateValidationCallback,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.CredentialAttribute()]
$RunAsCredential
@@ -411,36 +421,46 @@ function Test-TargetResource
[String]
$Path,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Arguments,
[Parameter()]
[PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[String]
$LogPath,
[Parameter()]
[String]
$FileHash,
[Parameter()]
[ValidateSet('SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5', 'RIPEMD160')]
[String]
$HashAlgorithm = 'SHA256',
[Parameter()]
[String]
$SignerSubject,
[Parameter()]
[String]
$SignerThumbprint,
[Parameter()]
[String]
$ServerCertificateValidationCallback,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.CredentialAttribute()]
$RunAsCredential
@@ -748,6 +768,7 @@ function Get-WebRequestResponse
[Uri]
$Uri,
[Parameter()]
[String]
$ServerCertificateValidationCallback
)
@@ -941,15 +962,19 @@ function Assert-FileValid
[String]
$Path,
[Parameter()]
[String]
$FileHash,
[Parameter()]
[String]
$HashAlgorithm = 'SHA256',
[Parameter()]
[String]
$SignerThumbprint,
[Parameter()]
[String]
$SignerSubject
)
@@ -992,6 +1017,7 @@ function Assert-FileHashValid
[String]
$Hash,
[Parameter()]
[String]
$Algorithm = 'SHA256'
)
@@ -1028,9 +1054,11 @@ function Assert-FileSignatureValid
[String]
$Path,
[Parameter()]
[String]
$Thumbprint,
[Parameter()]
[String]
$Subject
)
@@ -1098,16 +1126,20 @@ function Start-MsiProcess
[String]
$Path,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$Arguments,
[Parameter()]
[String]
$LogPath,
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.CredentialAttribute()]
$RunAsCredential
@@ -53,9 +53,11 @@ function Get-TargetResource
[AllowEmptyString()]
$ValueName,
[Parameter()]
[String[]]
$ValueData,
[Parameter()]
[ValidateSet('String', 'Binary', 'DWord', 'QWord', 'MultiString', 'ExpandString')]
[String]
$ValueType
@@ -190,21 +192,26 @@ function Set-TargetResource
[AllowEmptyString()]
$ValueName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[ValidateNotNull()]
[String[]]
$ValueData = @(),
[Parameter()]
[ValidateSet('String', 'Binary', 'DWord', 'QWord', 'MultiString', 'ExpandString')]
[String]
$ValueType = 'String',
[Parameter()]
[Boolean]
$Hex = $false,
[Parameter()]
[Boolean]
$Force = $false
)
@@ -394,21 +401,26 @@ function Test-TargetResource
[String]
$ValueName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[ValidateNotNull()]
[String[]]
$ValueData = @(),
[Parameter()]
[ValidateSet('String', 'Binary', 'DWord', 'QWord', 'MultiString', 'ExpandString')]
[String]
$ValueType = 'String',
[Parameter()]
[Boolean]
$Hex = $false,
[Parameter()]
[Boolean]
$Force = $false
)
@@ -735,6 +747,7 @@ function Get-RegistryKey
[String]
$RegistryKeyPath,
[Parameter()]
[Switch]
$WriteAccessAllowed
)
@@ -182,47 +182,59 @@ function Set-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$Path,
[Parameter()]
[ValidateSet('Automatic', 'Manual', 'Disabled')]
[String]
$StartupType,
[Parameter()]
[ValidateSet('LocalSystem', 'LocalService', 'NetworkService')]
[String]
$BuiltInAccount,
[Parameter()]
[ValidateSet('Running', 'Stopped', 'Ignore')]
[String]
$State = 'Running',
[Parameter()]
[Boolean]
$DesktopInteract = $false,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$DisplayName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$Description,
[Parameter()]
[String[]]
[AllowEmptyCollection()]
$Dependencies,
[Parameter()]
[UInt32]
$StartupTimeout = 30000,
[Parameter()]
[UInt32]
$TerminateTimeout = 30000,
[Parameter()]
[ValidateNotNull()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -393,47 +405,59 @@ function Test-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$Path,
[Parameter()]
[ValidateSet('Automatic', 'Manual', 'Disabled')]
[String]
$StartupType,
[Parameter()]
[ValidateSet('LocalSystem', 'LocalService', 'NetworkService')]
[String]
$BuiltInAccount,
[Parameter()]
[Boolean]
$DesktopInteract = $false,
[Parameter()]
[ValidateSet('Running', 'Stopped', 'Ignore')]
[String]
$State = 'Running',
[Parameter()]
[ValidateNotNull()]
[String]
$DisplayName,
[Parameter()]
[String]
[AllowEmptyString()]
$Description,
[Parameter()]
[String[]]
[AllowEmptyCollection()]
$Dependencies,
[Parameter()]
[UInt32]
$StartupTimeout = 30000,
[Parameter()]
[UInt32]
$TerminateTimeout = 30000,
[Parameter()]
[ValidateNotNull()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -104,30 +104,38 @@ function Set-TargetResource
[String]
$UserName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$FullName,
[Parameter()]
[String]
$Description,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Password,
[Parameter()]
[Boolean]
$Disabled,
[Parameter()]
[Boolean]
$PasswordNeverExpires,
[Parameter()]
[Boolean]
$PasswordChangeRequired,
[Parameter()]
[Boolean]
$PasswordChangeNotAllowed
)
@@ -187,30 +195,38 @@ function Test-TargetResource
[String]
$UserName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$FullName,
[Parameter()]
[String]
$Description,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Password,
[Parameter()]
[Boolean]
$Disabled,
[Parameter()]
[Boolean]
$PasswordNeverExpires,
[Parameter()]
[Boolean]
$PasswordChangeRequired,
[Parameter()]
[Boolean]
$PasswordChangeNotAllowed
)
@@ -343,30 +359,38 @@ function Set-TargetResourceOnFullSKU
[String]
$UserName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$FullName,
[Parameter()]
[String]
$Description,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Password,
[Parameter()]
[Boolean]
$Disabled,
[Parameter()]
[Boolean]
$PasswordNeverExpires,
[Parameter()]
[Boolean]
$PasswordChangeRequired,
[Parameter()]
[Boolean]
$PasswordChangeNotAllowed
)
@@ -559,30 +583,38 @@ function Test-TargetResourceOnFullSKU
[String]
$UserName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$FullName,
[Parameter()]
[String]
$Description,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Password,
[Parameter()]
[Boolean]
$Disabled,
[Parameter()]
[Boolean]
$PasswordNeverExpires,
[Parameter()]
[Boolean]
$PasswordChangeRequired,
[Parameter()]
[Boolean]
$PasswordChangeNotAllowed
)
@@ -703,7 +735,7 @@ function Get-TargetResourceOnNanoServer
[CmdletBinding()]
param
(
[parameter(Mandatory = $true)]
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
$UserName
@@ -807,30 +839,38 @@ function Set-TargetResourceOnNanoServer
[String]
$UserName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$FullName,
[Parameter()]
[String]
$Description,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Password,
[Parameter()]
[Boolean]
$Disabled,
[Parameter()]
[Boolean]
$PasswordNeverExpires,
[Parameter()]
[Boolean]
$PasswordChangeRequired,
[Parameter()]
[Boolean]
$PasswordChangeNotAllowed
)
@@ -1000,30 +1040,38 @@ function Test-TargetResourceOnNanoServer
[String]
$UserName,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$FullName,
[Parameter()]
[String]
$Description,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Password,
[Parameter()]
[Boolean]
$Disabled,
[Parameter()]
[Boolean]
$PasswordNeverExpires,
[Parameter()]
[Boolean]
$PasswordChangeRequired,
[Parameter()]
[Boolean]
$PasswordChangeNotAllowed
)
@@ -1178,6 +1226,7 @@ function Test-CredentialsValidOnNanoServer
[String]
$UserName,
[Parameter()]
[ValidateNotNullOrEmpty()]
[SecureString]
$Password
@@ -1522,6 +1571,7 @@ function Remove-DisposableObject
[CmdletBinding()]
param
(
[Parameter()]
[System.Collections.ArrayList]
[AllowEmptyCollection()]
$Disposables
@@ -39,6 +39,7 @@ function Get-TargetResource
[String]
$Name,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -169,18 +170,22 @@ function Set-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[Boolean]
$IncludeAllSubFeature = $false,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$LogPath
@@ -339,18 +344,22 @@ function Test-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[Boolean]
$IncludeAllSubFeature = $false,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$LogPath
@@ -466,9 +475,11 @@ function Assert-SingleFeatureExists
[CmdletBinding()]
param
(
[Parameter()]
[PSObject]
$Feature,
[Parameter()]
[String]
$Name
)
@@ -109,19 +109,24 @@ function Set-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[Boolean]
$RemoveFilesOnDisable,
[Parameter()]
[Boolean]
$NoWindowsUpdateCheck,
[Parameter()]
[String]
$LogPath,
[Parameter()]
[ValidateSet('ErrorsOnly', 'ErrorsAndWarning', 'ErrorsAndWarningAndInformation')]
[String]
$LogLevel = 'ErrorsAndWarningAndInformation'
@@ -237,19 +242,24 @@ function Test-TargetResource
[String]
$Name,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[Boolean]
$RemoveFilesOnDisable,
[Parameter()]
[Boolean]
$NoWindowsUpdateCheck,
[Parameter()]
[String]
$LogPath,
[Parameter()]
[ValidateSet('ErrorsOnly', 'ErrorsAndWarning', 'ErrorsAndWarningAndInformation')]
[String]
$LogLevel = 'ErrorsAndWarningAndInformation'
@@ -291,6 +301,7 @@ function Convert-CustomPropertyArrayToStringArray
[OutputType([String[]])]
param
(
[Parameter()]
[PSCustomObject[]]
$CustomProperties
)
@@ -48,6 +48,7 @@ function Get-TargetResource
[String]
$SourcePath,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$LogPath
@@ -130,6 +131,7 @@ function Set-TargetResource
[String]
$SourcePath,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$LogPath
@@ -196,6 +198,7 @@ function Test-TargetResource
[String]
$SourcePath,
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
$LogPath
@@ -46,6 +46,7 @@ function Get-TargetResource
[String]
$Arguments,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
@@ -159,24 +160,30 @@ function Set-TargetResource
[String]
$Arguments,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$StandardOutputPath,
[Parameter()]
[String]
$StandardErrorPath,
[Parameter()]
[String]
$StandardInputPath,
[Parameter()]
[String]
$WorkingDirectory
)
@@ -436,24 +443,30 @@ function Test-TargetResource
[String]
$Arguments,
[Parameter()]
[ValidateNotNullOrEmpty()]
[PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[ValidateSet('Present', 'Absent')]
[String]
$Ensure = 'Present',
[Parameter()]
[String]
$StandardOutputPath,
[Parameter()]
[String]
$StandardErrorPath,
[Parameter()]
[String]
$StandardInputPath,
[Parameter()]
[String]
$WorkingDirectory
)
@@ -562,14 +575,17 @@ function Get-ProcessCimInstance
[String]
$Path,
[Parameter()]
[String]
$Arguments,
[Parameter()]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.PSCredential]
[System.Management.Automation.Credential()]
$Credential,
[Parameter()]
[ValidateRange(0, [Int]::MaxValue)]
[Int]
$UseGetCimInstanceThreshold = 8
@@ -748,6 +764,7 @@ function Get-ArgumentsFromCommandLineInput
[CmdletBinding()]
param
(
[Parameter()]
[String]
$CommandLineInput
)
@@ -844,6 +861,7 @@ function Wait-ProcessCount
[Int]
$ProcessCount,
[Parameter()]
[Int]
$WaitTime = 200000
)