8000 ADOrganizationalUnit: add property "RestoreFromRecycleBin" to ignorelist by svenboll · Pull Request #664 · dsccommunity/ActiveDirectoryDsc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ADOrganizationalUnit: add property "RestoreFromRecycleBin" to ignorelist #664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
`Get-ADObject` when `Get-ADGroupMember` throws a specific error.
([issue #616](https://github.com/dsccommunity/ActiveDirectoryDsc/issues/616)).
- ADOrganizationalUnit
- Removed Credential from the list of desired values to compare when passed
- Removed Credential and RestoreFromRecycleBin from the list of desired values to compare when passed
([issue #624](https://github.com/dsccommunity/ActiveDirectoryDsc/issues/624)).
- Allows use of apostrophe or single quote in Name attribute
([issue #674](https://github.com/dsccommunity/ActiveDirectoryDsc/issues/674)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function Test-TargetResource
{
# Resource should exist
$propertiesNotInDesiredState = (
Compare-ResourcePropertyState -CurrentValue $targetResource -DesiredValues $PSBoundParameters -IgnoreProperties 'Credential' |
Compare-ResourcePropertyState -CurrentValue $targetResource -DesiredValues $PSBoundParameters -IgnoreProperties ('Credential', 'RestoreFromRecycleBin') |
Where-Object -Property InDesiredState -eq $false)

if ($propertiesNotInDesiredState)
Expand Down
15 changes: 15 additions & 0 deletions tests/Unit/MSFT_ADOrganizationalUnit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,21 @@ try
Test-TargetResource @testTargetResourcePresentParams | Should -BeTrue
}
}

# Regression test for issue https://github.com/dsccommunity/ActiveDirectoryDsc/issues/624.
Context 'When parameter RestoreFromRecycleBin is specified' {
It 'Should return $true' {
$mockTestTargetResourceParameters = @{
Name = $mockResource.Name
Path = $mockResource.Path
Description = $mockResource.Description
ProtectedFromAccidentalDeletion = $mockResource.ProtectedFromAccidentalDeletion
RestoreFromRecycleBin = $true
}

Test-TargetResource @mockTestTargetResourceParameters | Should -BeTrue
}
}
}

Context 'When the Resource should be Absent' {
Expand Down
0