Adding packages

For adding packages, you can use the following package switches which are supported with the New-NanoServerImage command:

  • -Storage: This allows you to add the File Server role and other storage components
  • -Compute: This allows you to add the compute (Hyper-V) role
  • -Defender: This allows you to add the Windows defender feature
  • -Clustering: This allows you to add the clustering role
  • -Containers: This allows you to add the containers role (see Chapter 8, Running Windows Server Containers and Hyper-V Containers on Nano Server)

The list of packages supported on Nano Server will keep growing over time. Therefore, instead of adding a new switch for each package, the Nano Server team has added a new parameter -Package that supports a comma separated list of all the packages that you want to include.

If you want to add the Hyper-V server role, failover clustering, and the storage role, you can use the -Package parameter as shown in the example covered earlier, followed by the name of each package, as shown in the following example:

-PackageMicrosoft-NanoServer-Compute-Package,Microsoft-
NanoServer-FailoverCluster-Package,Microsoft-NanoServer-
Storage-Package