-
Notifications
You must be signed in to change notification settings - Fork 20
xSmbShare resource does not take into account properties other than Name, Path, Ensure when doing a Test-TargetResource #2
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
Comments
Test-TargetResource is not testing properly . |
PR #3 was closed without merging for this issue. |
Still not fixed nearly after 2 Years |
Initially I also always got false test result, problem for me was that the usernames I used for the access parameters didn't have a domain prepended. Using (hostname) + 'user' instead of just 'user' did the trick. This should imo be documented though. |
There are checks missing in the code, thats why, but the hassle microsoft do with this some kind of nda realy ruine the fun to fix it. |
This issue has been resolved in the resource that is pending in PR dsccommunity/ComputerManagementDsc#211. This resource is moving to ComputerManagementDsc, and the xSmbShare module will be deprecated once the resource has been moved. Closing this issue at this time. |
The xSmbShare resource always tests false on our staging server, so the share is re-created every time and configuration drift is always reported.
VERBOSE: [STGWEB1]: LCM: [ Start Resource ] [[xSmbShare]XX]
VERBOSE: [STGWEB1]: LCM: [ Start Test ] [[xSmbShare]XX]
VERBOSE: [STGWEB1]: LCM: [ End Test ] [[xSmbShare]XX] in 0.0160 seconds.
VERBOSE: [STGWEB1]: LCM: [ Start Set ] [[xSmbShare]XX]
VERBOSE: [STGWEB1]: [[xSmbShare]XX] Share with name XX exists
VERBOSE: [STGWEB1]: [[xSmbShare]XX] Setting FullAccess for Everyone
VERBOSE: [STGWEB1]: LCM: [ End Set ] [[xSmbShare]XX] in 0.1870 seconds.
VERBOSE: [STGWEB1]: LCM: [ End Resource ] [[xSmbShare]XX]
There's nothing configuration-specific to investigate (excerpt from function Test-TargetResource):
if ($Ensure -eq "Present")
{
if ($share -eq $null)
{
$testResult = $false
}
elseif ($share -ne $null -and $PSBoundParameters.Count -gt 3)
# This means some other parameter in addition to Name, Path, Ensure could have been specified
# Which means we need to modify something
{
$testResult = $false
}
else
{
$testResult = $true
}
}
Rather than verifying the current configuration, this test assumes $false if parameters other than Name, Path, or Ensure are provided.
The text was updated successfully, but these errors were encountered: