Skip to content

HOWTO: Deploy Prerelease Tug Server & PS5 Bundle

Eugene Bekker edited this page Feb 25, 2017 · 3 revisions

We maintain a pre-configured bundle known as Tug.Server-ps5 that includes the Tug Server with the PowerShell v5 DSC Handler. Normally this bundle would be installed directly from the PowerShell Gallery (TODO: Not Yet), but you can install pre-release builds from a custom NuGet feed.

Step 1: Register the Pre-release Tug NuGet Feed

PS> Register-PSRepository -Name tug-pre -SourceLocation https://www.myget.org/F/tug/api/v2 -PackageManagementProvider nuget -Verbose

## You can list all the available modules in the Pre-release feed
PS> Find-Module -Repository tug-pre

Step 2: Install the PowerShell Module containing the Pre-Configured Bundle

If this is the first time that you're installing the bundle PowerShell Module:

PS> Install-Module -Repository tug-pre Tug.Server-ps5

If you're doing an update and already have an older version of this PowerShell Module installed locally, make sure you first remove the old version

## Make sure to unload the module from the current session
PS> Remove-Module Tug.Server-ps5 -Force
## Then remove it from your locally-installed modules
PS> Uninstall-Module Tug.Server-ps5 -Force
## Finally, install the latest version of the module
PS> Install-Module -Repository tug-pre Tug.Server-ps5

Step 3: Install the Tug Server Bundle

PS> Import-Module Tug.Server-ps5

If you are installing Tug Server for the first time, you just do

PS> Install-TugServer

If you are updating an existing Tug Server installation the installer will complain and fail unless you tell it to overwrite -- don't worry, this won't actually overwrite any configuration or human-edited files, only the binary components in the bin sub-directory. Read more about overwriting down below...

PS> Install-TugServer -Overwrite

Miscellaneous

  • The Install-TugServer cmdlet takes a parameter to override the default installation path, which is %PROGRAMFILES%\Tug\Server.
  • You can specify the -Verbose switch to see some additional details about installation steps.

Step 4: README, Final Configuration and Running

In the installation directory, you'll find a README.md file that will give an overview of what the bundle contains, what options you can tweak and where to get more info. I would love your feedback on this to make sure it's clear for someone to start with. I know it's not complete, but I think it's in a good condition to start with.

Using the README, you can adjust the final settings and then you can launch the server in an interactive console from CMD or PowerShell:

> cd <install-directory>
> .\tug-server.cmd

Updates and Configuration Files

The first time that you install the Tug Server using this PowerShell Module, it will install a number of initial configuration and script files as samples that will provide a fully functional DSC Server. The sample files include the following files:

  • appsettings.json
  • nlog.config
  • BasicTugCmdlets.ps1
  • README.md

When you do an update to later versions, the installer will check to see if your initial files already exist, and if they differ (i.e. you have made local modifications, or the later versions have been updated), it will install them into a samples sub-directory. This ensures that your local modifications will not be overwritten.

You can choose to review and compare the differing versions in the sample folder against your running configuration and decide what pieces to pull in.