Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Syntax on PsDSC help needed
-
Hello
I am migrating our DSC script into Otter and PSDsc documentation is cheap.Here is my DSC Script:
Registry RemoteManagement { Key = 'HKLM:\SOFTWARE\Microsoft\WebManagement\Server' ValueName = 'EnableRemoteManagement' ValueType = 'Dword' ValueData = '1' DependsOn = @('[WindowsFeature]IIS','[WindowsFeature]Management') }
Here is my PSDsc
PSDsc Registry ( Otter_ConfigurationKey: isEnableRemoteManagement, Key: 'HKLM:\SOFTWARE\Microsoft\WebManagement\Server', ValueName: 'EnableRemoteManagement', ValueType: 'Dword', ValueData: '1' );
but it did not work
Please help us :)
Best RegardsPhilippe Camelio
Product: Otter
Version: 1.7.3
-
I had a similar issue with a Dword value the error message was something about converting SINT64 to STRING[].
Try
ValueData: "`@([string[]](1))"
This worked for me on 1.7.4, but it shouldn't need special processing in my opinion.
-
Thanks a lot Eric
It is working fine also in 1.7.2I agree that the syntax should not be so tricky
Have nice day
Best regards
-
It seems the part is causing '1' to be converted to a decimal: https://github.com/Inedo/inedox-windows/blob/88f5924bc1d2397c9edfb135eb9429bbe9fa34e8/Windows/OtterExtension/Operations/PSDscOperation.cs#L241-L243
Of course, because OtterScript is only strings, there's no way to know if it "should" be a string or a decimal. I wonder if the property could be inspected of the dsc resource?
I'll note you can shorten
@([string[]](1)) to
@('1'),