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 Prerelease 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 Preconfigured Bundle

First-time Install

## If this is the first time you're installing the bundle PowerShell Module:
PS> Install-Module -Repository tug-pre Tug.Server-ps5

Upgrade Install

## If you're doing a PowerShell Module update and already have an older
## version 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

First-time Install

See below for some optional switches and parameters you can provide during installation.

PS> Install-TugServer

Upgrade Install

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. You can also view a formatted version of this README file online.

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

TODO: intalling/running Tug server non-interactively (i.e. behind IIS).

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:

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

When you do an update to later versions of the PowerShell Module and run the installation cmdlet, 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 include updates), 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.