diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 index 4e50c7b831..b43777f27a 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 @@ -163,13 +163,12 @@ Describe "Set/New/Remove-Service cmdlet tests" -Tags "Feature", "RequireAdminOnW $newServiceCommand.$parameter | Should -Be $value } - It "Set-Service can change credentials of a service" { + It "Set-Service can change credentials of a service" -Pending { try { $startUsername = "user1" $endUsername = "user2" $servicename = "testsetcredential" - $Password = ([char[]]([char]33..[char]95) + ([char[]]([char]97..[char]126)) + 0..9 | Sort-Object {Get-Random})[0..12] -join '' - $testPass = (New-Object -TypeName Net.NetworkCredential("", $Password)).SecurePassword + $testPass = [Net.NetworkCredential]::new("", (New-ComplexPassword)).SecurePassword $creds = [pscredential]::new(".\$endUsername", $testPass) net user $startUsername $creds.GetNetworkCredential().Password /add > $null net user $endUsername $creds.GetNetworkCredential().Password /add > $null @@ -283,7 +282,7 @@ Describe "Set/New/Remove-Service cmdlet tests" -Tags "Feature", "RequireAdminOnW { Remove-Service -Name "testremoveservice" -ErrorAction 'Stop' } | Should -Throw -ErrorId "InvalidOperationException,Microsoft.PowerShell.Commands.RemoveServiceCommand" } - It "Get-Service can get the '' of a service" -TestCases @( + It "Get-Service can get the '' of a service" -Pending -TestCases @( @{property = "Description"; value = "This is a test description"} @{property = "BinaryPathName"; value = "$PSHOME\powershell.exe";}, @{property = "UserName"; value = $creds.UserName; parameters = @{ Credential = $creds }},