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!

    Examples of configuring PowerShell on a fresh server (win 2019 or 2022)

    Scheduled Pinned Locked Moved Support
    4 Posts 2 Posters 9 Views 2 Watching
    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.
    • J Offline
      Justinvolved
      last edited by

      Hi,

      I'm looking to use Otter to setup a fresh server and make sure PowerShell in general, and some specific modules I'm using are installed.

      Do you by any chance have basic example of such a task? For example how to check if PSGallery is trusted so I don't get:
      2ac750c8-caec-4d2c-bdc6-94641bd7e0c1-image.png

      I would probalby also need to set the Set-ExecutionPolicy, and I guess I might forget a lot of stuff here as well :-)

      Thanks,
      Justin

      P 1 Reply Last reply Reply Quote 0
      • P Offline
        philippe.camelio_3885 @Justinvolved
        last edited by

        @Justinvolved

        Make a role with this desired configuration

        Ensure-PsRepository
            (
                Exists: true,
                InstallationPolicy: trusted,
                SourceLocation: https://www.powershellgallery.com/api/v2,
                Name: PSGallery
            );
        
        

        Assign the role to the server
        Remediate

        Et voilà 😊
        This should work

        Cheers
        PhilippeC.

        1 Reply Last reply Reply Quote 1
        • P Offline
          philippe.camelio_3885
          last edited by philippe.camelio_3885

          For the modules, 2 ways

          1. Create a second role which depend on the previous one and use
            Ensure-psmodule function to add the required module

          2. You don t need the set psgallery to be trusted if you use the Force in the Ensure-psmodule
            Cf https://docs.inedo.com/docs/otter-reference-operations-powershell-ensure-powershell-module

          1 Reply Last reply Reply Quote 1
          • P Offline
            philippe.camelio_3885
            last edited by

            This post is deleted!
            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