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)
-
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:
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
-
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
RemediateEt voilà
This should workCheers
PhilippeC.
-
For the modules, 2 ways
-
Create a second role which depend on the previous one and use
Ensure-psmodule function to add the required module -
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
-
-
This post is deleted!