Share via


Nano Server: Using New-NanoServerImage with Show-Command to deploy Nano Server

1. Introduction

With the release of Windows Server 2016 Technical Preview 5, building a new Nano Server has been made easier with the Show-Command cmdlet from PowerShell 5.0 and this Wiki article is to demonstrate how you can get the command generated for those who are new to PowerShell.

↑ Return to Top

2. Getting Started with New-NanoServerImage cmdlet

Have you ever find yourself struggling with PowerShell? In this Wiki article, we will use Show-Command to show you how easy it is to use New-NanoServerImage cmdlet to deploy your NanoServer easily. Let us get started with New-NanoServerImage cmdlet in Windows Server 2016 Technical Preview 5.

2.1. Copying Nano Server content from Media

Firstly, we will need to copy the NanoServer folder content to local disk.

# Copy NanoServer folder from Windows Server 2016

#  Technical Preview 5 Media to Local Disk

Copy-Item `

    -Path D:\NanoServer\ `

    -Destination C:\NanoServer `

    -Recurse ;

↑ Return to Top

2.2. Importing Nano Server Image Generator PowerShell Module

Secondly, we will need to import the Nano Server Image Generator PowerShell Module.

# Import Nano Server Image Generator PowerShell Module

Import-Module `

    -Global C:\NanoServer\NanoServerImageGenerator\NanoServerImageGenerator.psm1 ;

↑ Return to Top

2.3. Launching New-NanoServerImage Graphical User Interface with Show-Command

Thirdly, we will use the Show-Command from PowerShell 5.0 to launch the New-NanoServerImage graphical user interface.

# Show Command Graphical User Interface (GUI)

Show-Command `

    -Name New-NanoServerImage ;

↑ Return to Top

3. New-NanoServerImage graphical user interface

With Show-Command from PowerShell 5.0, the New-NanoServerImage command will launch a graphical user interface with all the available parameters. It will display a parameter name with a textfield for string or secure-string input, checkbox for true or false switch parameter input and dropbox for defined parameter input.

↑ Return to Top

3.1. Understanding the parameter input type

For textfield parameter input, it will accept string and secure string type and how do you find out? Simply, hover your mouse pointer over the textfield and the graphical user interface will prompt the acceptable type for the textfield.

↑ Return to Top

3.2. Demonstrating an example of deploying a Nano Web Server

In the below screenshot, it is an example of how to input all the required and desired parameter for the New-NanoServerImage graphical user interface prompted from Show-Command.

↑ Return to Top

3.3. Copying the New-NanoServerImage command with inputted parameter

Once you have completed desired parameter inputs on the New-NanoServerImage graphical user interface displayed from using Show-Command, you have the option to choose run or copy button. The copy button is extremely useful for PowerShell beginner or just wanting to keep the command for repeatable task. Below is an extract of the using copy and pasted on the PowerShell ISE.

↑ Return to Top

3.4. Running the New-NanoServerImage command with inputted parameter

After you have copied the command and kept it safe somewhere, you can choose the run button and it will exit the graphical user interface to return you back to the PowerShell console with the command ready for you to hit the Enter keyboard button.

↑ Return to Top

4. Conclusion

The Show-Command has elevated the New-NanoServerImage command to be more user friendly for beginners to start deploying NanoServer and that is the reason it deserves a Wiki article about it. It does has some flaws such as unable to inform you that you have used 2 or 3 parameters that are conflicting each other or provides you a help button on each parameter to prompt help on the specific parameter. But overall, it is still the best way to help PowerShell beginners and definitely more improvement will come. With this example, everyone will be able to deploy their own NanoServer pretty quickly.

↑ Return to Top

5. References

↑ Return to Top

6. See Also

↑ Return to Top