Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    otter
    4 Posts 2 Posters 5 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      PhilippeC.
      last edited by

      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 Regards

      Philippe Camelio

      Product: Otter
      Version: 1.7.3

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • P Offline
          PhilippeC.
          last edited by

          Thanks a lot Eric
          It is working fine also in 1.7.2

          I agree that the syntax should not be so tricky

          Have nice day

          Best regards

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            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'),

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation