Author Posts

September 15, 2014 at 5:25 am

I have created a new DSC resource and it seems to fail no matter what I do. It is indicating that I am not returning a boolean from the Test-TargetResource function but I definitely am (you can see that I am below where I am outputting the the result and the result type). This is the second resource that I have created; I had no issues with the first. I cannot figure out what is going on here.

VERBOSE: [WIN-V3SJ92A5IFR]: LCM: [ Start Resource ] [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity]
VERBOSE: [WIN-V3SJ92A5IFR]: LCM: [ Start Test ] [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity]
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] Entering Test-TargetResource.
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] Entering Get-TargetResource.
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] Leaving Get-TargetResource.
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] The RequestIntervalInMilliseconds state for website IIS:\Sites\BonoboGi
tServer does not match the desired state.
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] Test result: False
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] Result type: bool
VERBOSE: [WIN-V3SJ92A5IFR]: [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] Leaving Test-TargetResource.
VERBOSE: [WIN-V3SJ92A5IFR]: LCM: [ End Test ] [[ASI_cWebDynamicIpSecurity]BonoboGitDynamicIpSecurity] in 0.0150 seconds.
The PowerShell provider C:\Program Files\WindowsPowerShell\Modules\ASI_cWebAdministration\DscResources\ASI_cWebDynamicIpSecurity returned results in a format that is not valid. The
results from running Test-TargetResource must be the boolean value True or False.
+ CategoryInfo : InvalidResult: (:) [], CimException
+ FullyQualifiedErrorId : TestTargetResourceInvalidResultFormat
+ PSComputerName : localhost

VERBOSE: [WIN-V3SJ92A5IFR]: LCM: [ End Set ]
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotImplemented: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 7
+ PSComputerName : localhost

September 15, 2014 at 5:54 am

Can you show us your resource? I'm seeing result type bool vs. boolean (you know, the difference between 'True' or '$True'), and I'm wondering if the answer may be found within your resource.

September 15, 2014 at 6:32 am

Sure, I uploaded what I have to GitHub: https://github.com/johnnymumbles/ASI_cWebIpSecurity. Thanks for taking a look at this.

September 15, 2014 at 11:35 am

This line is returning an object before you return a bool:

$MyInvocation.BoundParameters.GetType()

September 25, 2014 at 10:28 am

Thank you so much! That solved my problem.