Showing posts with label PowerShellGet. Show all posts
Showing posts with label PowerShellGet. Show all posts

Monday, August 22, 2016

Unattended installation octopus server - PowerShell DSC



I’ve been using Octopus deploy at work, and created a custom DSC resource to do the installation and configuration. The resource is now available to use from PowerShell gallery. You can use the Install-Module cmdlet to download the DSC resource

Install-Module Octopus

This will install the Octopus module. The module has a DSC resource OctopusServer that can be used for installation and configuring the octopus server on a node. You can create a simple configuration as below.

Configuration OctopusServerConfiguration{
    param(
        [PSCredential] $credentials
    )
    Node localhost{
        OctopusServer OctoServer{
            ServerName = $env:COMPUTERNAME
            Port = 8085
            Credentials = $credentials
            Ensure = "Present"
        }
    }

}


Sunday, September 20, 2015

PowerShell Gallery - Create a module for the community

With PowerShellGet, the new package manager for PowerShell, you can easily perform discovery and installation of software packages, PowerShell modules etc. in a unified way. What makes it more attractive is the ease to contribute your modules to the community so that it’s discoverable and used by users who want to.
All you need is a Microsoft account and login to the PowerShell Gallery to download your API key to publish your module. Let’s see the step by step process for the same.
  • Login to the PowerShell gallery at https://www.powershellgallery.com
  • Once you have signed in, navigate to the account page to download the API Key (https://www.powershellgallery.com/account )
  • Once you have the account key, you can use the Publish-Module command to publish your modules to the gallery.
  • For e.g. I have a module to install Visual Studio 2015 on my machine.
  • First we need to ensure that the module is available in our module path
get-module -ListAvailable
  • Now we can use the Publish-Module command as given below.
 Publish-Module -Name VisualStudio2015 -NuGetApiKey $ApiKey -Verbose


  • That’s it, it’s that simple to contribute!!!