Skip to content

Commit

Permalink
Update Set-JCPolicy.Tests.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
jworkmanjc authored Nov 6, 2024
1 parent c063eb6 commit 2adeeac
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ Describe -Tag:('JCPolicy') 'Set-JCPolicy' {
Context 'Set-JCPolicy should reutrn policies with the correct data types' {
It 'Set-JCPolicy returns expected parameters' {
$registryTemplate = $policyTemplates | Where-Object { $_.name -eq "disable_usb_storage_linux" }
$usbLinuxPolicy = New-JCPolicy -TemplateID $registryTemplate.Id -Name "Pester - USB Linux $(new-randomString -NumberOfChars 8)"
$usbLinuxPolicy = New-JCPolicy -TemplateID $registryTemplate.Id -Name "Pester - USB Linux $(new-randomString -NumberOfChars 8)" -disable_mtp $true -disable_afc $false -disable_mmc $false
$usbLinuxPolicyUpdated = Set-JCPolicy -PolicyId $usbLinuxPolicy.Id -NewName "Pester - USB Linux $(new-randomString -NumberOfChars 8)" -Notes "usb"
$usbLinuxPolicyUpdated.name | Should -Not -BeNullOrEmpty
$usbLinuxPolicyUpdated.id | Should -Not -BeNullOrEmpty
Expand All @@ -492,8 +492,8 @@ Describe -Tag:('JCPolicy') 'Set-JCPolicy' {
It 'Should throw an error when multiple policies with the same name exist and the policyName param is specified' {
$registryTemplate = $policyTemplates | Where-Object { $_.name -eq "disable_usb_storage_linux" }
$randomValue = $(new-randomString -NumberOfChars 8)
$usbLinuxPolicy = New-JCPolicy -TemplateID $registryTemplate.Id -Name "Pester - USB Linux $($randomValue)"
$usbLinuxPolicy = New-JCPolicy -TemplateID $registryTemplate.Id -Name "Pester - USB Linux $($randomValue)"
$usbLinuxPolicy = New-JCPolicy -TemplateID $registryTemplate.Id -Name "Pester - USB Linux $($randomValue)" -disable_mtp $true -disable_afc $false -disable_mmc $false
$usbLinuxPolicy = New-JCPolicy -TemplateID $registryTemplate.Id -Name "Pester - USB Linux $($randomValue)" -disable_mtp $true -disable_afc $false -disable_mmc $false
{ Set-JCPolicy -PolicyName -Name "Pester - USB Linux $($randomValue)" -NewName "Pester - USB Linux $(new-randomString -NumberOfChars 8)" } | Should -Throw

}
Expand Down Expand Up @@ -616,4 +616,4 @@ Describe -Tag:('JCPolicy') 'Set-JCPolicy' {
$updatedPolicy.values.value[0].customValueName | Should -Not -Be $policyValue.customValueName
}
}
}
}

0 comments on commit 2adeeac

Please sign in to comment.