Giter VIP home page Giter VIP logo

ps-autolab-env's Introduction

PSAutoLab

PSGallery Version PSGallery Downloads

Version 5.0.0

This is a major update to the module with many breaking changes. It is recommended that you finish and remove all lab configurations before installing this update. Read the documentation on upgrading to version 5 for more information.

Overview

This project serves as a set of "wrapper" commands that utilize the Lability module which is a terrific tool for creating a lab environment of Windows-based systems. The downside is that it is a difficult module for less experienced PowerShell users. The configurations and control commands for the Hyper-V virtual machines in this module are written in PowerShell using Desired State Configuration (DSC) and deployed via Lability commands. If you feel sufficiently skilled, you can skip using this project and use the Lability module on your own. Note that the Lability module is not owned or managed by Pluralsight. This project and all files are released under an MIT License - meaning you can copy and use as your own, modify, borrow, steal - whatever you want.

While this project is under the Pluralsight banner, it is offered AS-IS as a free tool with no official support from Pluralsight. Pluralsight makes no guarantees or warranties. This project is intended to be used for educational purposes only.

Beginning with module version 4.17.0, you can run Open-PSAutoLabHelp to view a local PDF version of the module's documentation.

PS C:\> Open-PSAutoLabHelp

Requirements

This module is designed and intended to be run on a Windows 10/11 client that supports virtualization. Windows 10 Pro or Enterprise and later should be sufficient. It is assumed you will be installing this on a Windows 10/11 desktop running Windows PowerShell 5.1. This module will not work and is unsupported on any Home or Student edition, although there are reports of the module working on Windows 10 Education. The module might run on Windows Server (2016 or 2019) platforms, but this capability has not been fully tested nor is it supported.

Using this in a nested virtual environment may work, but don't be surprised if there are problems, especially related to networking and NAT.

The host computer, where you are installing, must meet the following requirements:

  • Windows PowerShell 5.1.
  • A high-speed internet connection.
  • Minimum 16GB of RAM (32GB is recommended).
  • Minimum 100GB free disk space preferably on a fast SSD device or equivalent.
  • An Intel i5 processor or equivalent. An i7 is recommended for the best performance.
  • Windows PowerShell Remoting enabled.
  • You should be logged in with a local or domain user account. The setup process may not work properly if using an O365 or Microsoft account to log on to Windows.

You must have administrator access and be able to update the TrustedHosts setting for PowerShell remoting. If you are in a corporate environment, these settings may be locked down or restricted. If this applies to you, this module may not work properly, if at all.

This module and configurations have NOT been tested running under PowerShell 7. You must run this under Windows PowerShell 5.1.

Pester Requirement

The module uses a standard PowerShell tool called Pester to validate lab configurations. It is a module dependency and the latest version should be installed with the PSAutolab module. Previous versions of this module required Pester version 4.10. Beginning with version 5.0 of this module, all Pester tests have been revised to support Pester version 5.

Installation

This module has been published in the PowerShell Gallery. It is recommended that you have at least version 2.2 of the PowerShellGet module which handles module installations.

Open an elevated PowerShell prompt and run:

Install-Module PSAutoLab -Force -SkipPublisherCheck

If you are using the Microsoft.PowerShell.PSResourceGetmodule run:

Install-PSResource PSAutoLab -Force

The installation should install the required dependencies of the Lability and Pester modules.** You must include the -SkipPublisherCheck to ensure the Pester module is installed**.

If prompted, answer yes to update the Nuget version and to install from an untrusted repository, unless you've already marked the PSGallery as trusted. If you have an old copy of this module from before Pluralsight took ownership, you will get an error. Manually remove the old module files and try again. See this document for more information.

Do not download or use any of the release packages from this GitHub repository. You must install this module from the PowerShell Gallery.

See the Changelog for update and version details.

DO NOT run this module on any mission-critical or production system.

If you encounter issues with a basic installation and setup, you should read and use the detailed setup instructions.

You can verify the module with these commands:

PS C:\> Import-Module PSAutoLab -force
PS C:\> Get-Module PSAutoLab

ModuleType Version    Name           ExportedCommands
---------- -------    ----           ----------------
Script     5.0.0      PSAutoLab     {Enable-Internet, Get-LabSnapshot,...}

Your version number may differ.

Hyper-V

This module and its configurations should not conflict with any existing Hyper-V virtual machines or networking. But you should be aware that the module will create a new., internal Hyper-V switch called LabNet. This switch will use a NAT configuration called LabNat.

PS C:\> Get-NetNat LabNat


Name                             : LabNat
ExternalIPInterfaceAddressPrefix :
InternalIPInterfaceAddressPrefix : 192.168.3.0/24
IcmpQueryTimeout                 : 30
TcpEstablishedConnectionTimeout  : 1800
TcpTransientConnectionTimeout    : 120
TcpFilteringBehavior             : AddressDependentFiltering
UdpFilteringBehavior             : AddressDependentFiltering
UdpIdleSessionTimeout            : 120
UdpInboundRefresh                : False
Store                            : Local
Active                           : True

The Instructions file in each configuration folder documents VMs will be created. You can also check the VMConfigurationData.psd1 file.

PS C:\Autolab\Configurations\MultiRole\> (Import-PowerShellDataFile .\VMConfigurationData.psd1).AllNodes.NodeName
*
DC1
S1
Cli1

Current configurations will use these names for the virtual machine and computer name:

  • DC1
  • S1
  • S2
  • Cli1
  • Cli2
  • DOM1
  • SRV1
  • SRV2
  • SRV3
  • WIN10
  • WIN11
  • Win10Ent

Nano Server images have been removed from configurations. These configurations were using the now deprecated version of Nano. Microsoft has changed direction with regards to Nano Server and none of the existing configurations use this new version.

Upgrading Previous Versions

Upgrading from v3.x

If you installed previous versions of this module (v3.x) and struggled, hopefully, this version will be an improvement. To avoid any other complications, it is STRONGLY recommended that you manually remove the old version which is most likely under C:\Program Files\WindowsPowerShell\Modules\PSAutoLab. You can run a command like:

Get-Module PSAutoLab -ListAvailable | Select-Object Path

To identify the module location. Use this information to delete the PSAutoLab folder.

The previous version was not installed using PowerShell's module cmdlets so it can't be updated or removed except manually.

Upgrading from v4.x

Please read this document for more information on the steps to follow to update this module from version 4.x to 5.x

Note for VMware Users

This project is designed to work with Hyper-V. If you are going to build a Host VM of Server 2016 or Windows 10, In the general settings for your VM, you must change the OS type to Hyper-V(Unsupported) or the Host Hyper-V will not work! This module and its configurations have not been tested for compatibility with VMware.

Aliases and Language

While this module follows proper naming conventions, the commands you will typically use employ aliases that use non-standard verbs such as Run-Lab. This is to avoid conflicts with commands in the Lability module and to maintain backward compatibility. You can use the aliases or the full function name. All references in this document use the aliases. You do not need to run any commands from the Lability module.

Setup Host

The first time you use this module, you will need to configure the local machine or host. Open an elevated PowerShell session and run:

Setup-Host

This will install and configure the Lability module and install the Hyper-V feature if it is missing. By default, all AutoLab files will be stored under C:\AutoLab, which the setup process will create. If you prefer to use a different drive, you can specify it during setup.

Setup-Host -DestinationPath D:\AutoLab

You will be prompted to reboot, which you should do especially if the setup had to add the Hyper-V feature. To verify your configuration open an elevated PowerShell session and run this command:

PS C:\> Get-PSAutoLabSetting


AutoLab                     : C:\Autolab
PSVersion                   : 5.1.19041.1
PSEdition                   : Desktop
OS                          : Microsoft Windows 10 Pro
FreeSpaceGB                 : 172.49
MemoryGB                    : 32
PctFreeMemory               : 44.66
Processor                   : Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz
IsElevated                  : True
RemotingEnabled             : True
NetConnectionProfile        : Private
HyperV                      : 10.0.19041.1
PSAutoLab                   : {4.18.0, 4.17.0}
Lability                    : {0.19.1, 0.19.0, 0.18.0}
Pester                      : {4.10.1, 4.10.0, 4.9.0, 4.4.4...}
PowerShellGet               : 2.2.3
PSDesiredStateConfiguration : 1.1

Some of your values may be different. Please include this information when reporting any problems or issues.

Lab Summary

Once the host setup is complete, you can use the module's Get-LabSummary command to better understand what the lab configuration will set up. Run the command in the configuration folder.

PS C:\Autolab\Configurations\SingleServer-GUI-2016\> Get-LabSummary


   Computername: S1 VMName: S1

Lab                       IPAddress       MemGB Procs Role    Description
---                       ---------       ----- ----- ----    -----------
SingleServer-GUI-2016     192.168.3.75        4     1 RDP     Windows Server
                                                              2016 Standard
                                                              64bit English
                                                              Evaluation

The module includes a custom format file. You might also run the command like this:

PS C:\Autolab\Configurations\SingleServer-GUI-2016> Get-LabSummary |
Select-Object *


Computername : S1
VMName       : S1
InstallMedia : 2016_x64_Standard_EN_Eval
Description  : Windows Server 2016 Standard 64bit English Evaluation
Role         : RDP
IPAddress    : 192.168.3.75
MemoryGB     : 4
Processors   : 1
Lab          : SingleServer-GUI-2016

The Computername and VMName properties might differ if you are using an environmental prefix. The Computername is how the virtual machines refer to themselves and each other. The VMName is how you reference them in Hyper-V.

Creating a Lab

Lab information is stored under the AutoLab Configurations folder, which is C:\AutoLab\Configurations by default. Open an elevated PowerShell prompt and change your location to the desired configuration folder. View the Instructions and/or README markdown files in the folder to learn more about the configuration.

You can also run Get-LabSummary in the lab configuration folder to see what the configuration will create.

Where possible, information about what course goes with a particular Pluralsight course will be indicated.

A Note on Pluralsight Labs

This module started several years ago and several Pluralsight courses rely on configurations that may no longer exist. Configurations that were named with Test or POC were not assumed to be used in any courses. But that is turning out to not be the case. If you are trying to set up a lab for a specific course, and can't find the configuration the instructor calls for, please post an issue indicating the configuration you are looking for and the title of the Pluralsight course. Hopefully, there is an existing configuration you can use. Or the module can be updated with an appropriate lab configuration. In some cases, the course may assume a different password. All configurations use P@ssw0rd for all passwords.

The first time you set up a lab, Lability will download evaluation versions of required operating systems in ISO format. This may take some time depending on your Internet connection. These downloads only happen when the required ISO is not found locally. When you wipe and rebuild a lab it won't download files a second time.

Once the lab is created, you can use the PSAutoLab commands to manage it. If you have additional PowerShell experience, you can manage individual virtual machines using the Hyper-V manager or cmdlets.

It is assumed that you will only have one lab configuration created at a time.

Please be aware that all configurations were created for an EN-US culture and keyboard.

Manual Setup

Most, if not all, configurations should follow the same manual process. Run each command after the previous one has finished.

To verify that all virtual machines are properly configured you can run Validate-Lab. This will invoke a set of tests and keep looping until everything passes. Due to the nature of DSC and the complexity of some configurations, this could take up to 60 minutes. You can use Ctrl+C to break out of the testing loop at any time. You can manually run the test one time to see the current state of the configuration.

PS C:\Autolab\Configurations\SingleServer\> Invoke-Pester VMValidate.test.ps1

This can be useful for troubleshooting.

Unattended Setup

As an alternative, you can set up a lab environment with minimal prompting.

PS C:\Autolab\Configurations\SingleServer\> Unattend-Lab

Assuming you don't need to install a newer version of Nuget, you can leave the setup alone. It will run all of the manual steps for you. Beginning in version 4.3.0 you also have the option to run the unattended setup in a PowerShell background job.

PS C:\Autolab\Configurations\SingleServer\> Unattend-Lab -AsJob

Use the PowerShell job cmdlets to manage.

Stopping a Lab

To stop the lab VMs, change to the configuration folder in an elevated Windows PowerShell session and run:

PS C:\Autolab\Configurations\SingleServer\> Shutdown-Lab

You can also use the Hyper-V manager or cmdlets to manually shut down virtual machines. If your lab contains a domain controller such as DOM1 or DC1, that should be the last virtual machine to shut down.

Starting a Lab

The setup process will leave the virtual machines running. If you have stopped the lab and need to start it, change to the configuration folder in an elevated Windows PowerShell session and run:

PS C:\Autolab\Configurations\SingleServer\> Run-Lab

You can also use the Hyper-V manager or cmdlets to manually start virtual machines. If your lab contains a domain controller such as DOM1 or DC1, that should be the first virtual machine to start up.

Lab Checkpoints

You can snapshot the entire lab very easily. Change to the configuration folder in an elevated Windows PowerShell session and run:

PS C:\Autolab\Configurations\SingleServer\> Snapshot-Lab

To quickly rebuild the labs from the checkpoint, run:

PS C:\Autolab\Configurations\SingleServer\> Refresh-Lab

Or you can use the Hyper-V cmdlets to create and manage VM snapshots.

To Remove a Lab

To destroy the lab completely, change to the configuration folder in an elevated Windows PowerShell session and run:

PS C:\Autolab\Configurations\SingleServer\> Wipe-Lab

This will remove the virtual machines and DSC configuration files. If you intend to rebuild the lab or another configuration, you can keep the LabNat virtual switch. This is the default behavior. If you want to remove everything you would need to run a command like this:

PS C:\Autolab\Configurations\SingleServer\> Wipe-Lab -force -RemoveSwitch

Customizing a Lab

It is possible to customize a lab configuration by editing the VMConfigurationData.psd1 file that is in each configuration folder. You must modify the file before creating the lab. For example, the configuration might use Server Core and you want the Desktop Experience on the server. Open the file in your scripting editor and scroll down to find the Node definitions.

@{
    NodeName                = 'DOM1'
    IPAddress               = '192.168.3.10'
    Role                    = @('DC', 'DHCP', 'ADCS')
    Lability_BootOrder      = 10
    Lability_BootDelay      = 60
    Lability_timeZone       = 'US Mountain Standard Time'
    Lability_Media          = '2016_x64_Standard_Core_EN_Eval'
    Lability_MinimumMemory  = 2GB
    Lability_ProcessorCount = 2
    CustomBootStrap         = @'
            # This must be set to handle larger .mof files
            Set-Item -path wsman:\localhost\maxenvelopesize -value 1000
'@
},

@{
    NodeName           = 'SRV1'
    IPAddress          = '192.168.3.50'
    Role               = @('DomainJoin')
    Lability_BootOrder = 20
    Lability_timeZone  = 'US Mountain Standard Time'
    Lability_Media     = '2016_x64_Standard_Core_EN_Eval'
},

You can edit the Lability_Media setting. Change the setting using one of these ID values from running Get-LabMedia.

PS C:\> Get-LabMedia

Id                                      Arch Media Description
--                                      ---- ----- -----------
2022_x64_Standard_EN_Eval                x64   ISO Windows Server 2022 Standard 64bit English Evaluation with Deskto...
2022_x64_Standard_EN_Core_Eval           x64   ISO Windows Server 2022 Standard 64bit English Evaluation
2022_x64_Datacenter_EN_Eval              x64   ISO Windows Server 2022 Datacenter 64bit English Evaluation with Desk...
2022_x64_Datacenter_EN_Core_Eval         x64   ISO Windows Server 2022 Datacenter Evaluation in Core mode
2019_x64_Standard_EN_Eval                x64   ISO Windows Server 2019 Standard 64bit English Evaluation with Deskto...
2019_x64_Standard_EN_Core_Eval           x64   ISO Windows Server 2019 Standard 64bit English Evaluation
2019_x64_Datacenter_EN_Eval              x64   ISO Windows Server 2019 Datacenter 64bit English Evaluation with Desk...
...

You can also make changes to values such as minimum memory and processor count. When you run Unattend-Lab or Setup-Lab you can use the -UseLocalTimeZone to set all virtual machines to use your time zone. You could make minor changes to the IP address such as changing the address from 192.168.3.50 to 192.168.3.60. Changing the entire subnet will require modifying the virtual switch and should not be attempted unless you are very proficient with PowerShell and Hyper-V.

Note that if you make changes, the validation test may fail unless you modify it. But you can always try to run the lab without validating it.

If you make a mistake or want to restore the original configurations, run the Refresh-Host command.

Windows 10 Remote Server Administration Tools (RSAT)

Several lab configurations that include a Windows 10 client will also install RSAT. In the past, this has meant trying to install all RSAT features. This takes a long time and has caused validation issues. Beginning with v4.21.0 of the PSAutolab module, the RSAT configuration and testing will only use a subset of features.

  • ActiveDirectory
  • BitLocker +*CertificateServices
  • DHCP
  • DNS
  • FailoverCluster
  • FileServices
  • GroupPolicy
  • IPAM.Client
  • ServerManager

If you require any other tool, you will need to use Add-WindowsCapability in the Windows 10/11 client to add it.

This change has improved setup performance and module stability.

Windows Updates

When you build a lab, you are creating Windows virtual machines based on evaluation software. You might still want to make sure the virtual machines are up to date with security patches and updates. You can use Update-Lab to start the Windows update process on all lab members. This can be a time-consuming process. You have an option to run the updates as a background job. Do not close your PowerShell session before the jobs are complete or the build process will be interrupted.

PS C:\Autolab\Configurations\PowerShellLab\> update-lab -AsJob

Id   Name        PSJobTypeName   State      HasMoreData   Location    Command
--   ----        -------------   -----      -----------   --------    -------
18   WUUpdate    RemoteJob       Running    True          DOM1        WUUpdate
21   WUUpdate    RemoteJob       Running    True          SRV1        WUUpdate
24   WUUpdate    RemoteJob       Running    True          SRV2        WUUpdate
27   WUUpdate    RemoteJob       Running    True          SRV3        WUUpdate
30   WUUpdate    RemoteJob       Running    True          WIN10       WUUpdate

PS C:\Autolab\Configurations\PowerShellLab> receive-job -id 27 -Keep
[11/22/2019 12:05:43] Found 5 updates to install on SRV3
[11/22/2019 12:25:13] Update process complete on SRV3
WARNING: SRV3 requires a reboot

Run the update process as a background job. Use the PowerShell job cmdlets to manage.

Updating PSAutoLab

As this module is updated over time, new configurations may be added, or bugs fixed in existing configurations. There may also be new Lability updates. Use PowerShell to check for new versions:

Find-Module PSAutoLab

And update:

Update-Module PSAutoLab -Force

If you update, it is recommended that you update the AutoLab configuration.

Refresh-Host

This will update the Lability and Pester modules if required and copy all new configuration files to your AutoLab\Configurations folder. It will NOT delete any files or folders.

Removing PSAutoLab

If you want to completely remove the PSAutoLab module, first use Wipe-Lab to remove any existing lab configurations including the Hyper-V switch. Run this command to uninstall the module and its dependencies

Uninstall-Module PSAutoLab,Lability

You may need to manually delete the C:\Autolab folder. If you want to remove the NAT configuration"

Remove-NetNat LabNat

If you want to remove Hyper-V you can use the Control Panel to manually remove the optional feature. Or you can try using PowerShell.

Get-WindowsOptionalFeature -FeatureName *Hyper* -online |
Disable-WindowsOptionalFeature -Online

You will almost certainly need to reboot to complete the removal process.

Troubleshooting

Package Provider or Module Installation

If you try to install a module or update the NuGet provider, you might see warnings like these:

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.
PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider 'NuGet'. The package provider requires 'PackageManagement' and
'Provider' tags.

The first thing to check is to make sure you are using valid TLS settings. You can try running this command in PowerShell:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Beginning with v4.17.0 of this module, this change is made when the module is imported. It will only last for as long as your PowerShell session is running.

You could also modify the registry in an elevated PowerShell session for a more permanent solution.

Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value 1

Modifying the registry will require a reboot for the changes to take effect.

If the problem is the Nuget provider, after making the TLS changes try:

Install-PackageProvider Nuget -force -ForceBootStrap

You might also need to update the PackageManagement and/or PowerShellGet modules.

Update-Module PowershellGet,PackageManagement -force

Autolab Configurations

The commands and configurations in this module are not foolproof. During testing a lab configuration will run quickly and without error on one Windows 10 desktop but fail or take much longer on a different Windows 10 desktop. Most setups should be completed in under an hour. If validation is failing, manually run the validation test in the configuration folder.

PS C:\Autolab\Configurations\SingleServer\> Invoke-Pester VMValidate.test.ps1 -Show All -WarningAction SilentlyContinue

Take note of which virtual machines are generating errors. Verify the virtual machine is running in Hyper-V. On occasion, for reasons still undetermined, sometimes a virtual machine will shut down and not reboot. This often happens with the client nodes of the lab configuration. Verify that all virtual machines are running and manually start those that have stopped using the Hyper-V manager or cmdlets.

Start-VM Win10

Sometimes even if the virtual machine is running, manually shutting it down and restarting it can resolve the problem. Remember to wait at least 5 minutes before manually running the validation test again when restarting any virtual machine.

As a last resort, manually break out of any testing loop, wipe the lab, and restart the test.

If you still are having problems, wipe the lab and try a different configuration. This will help determine if the problem is with the configuration or a larger compatibility problem.

At this point, you can open an issue in this repository. Open an elevated PowerShell prompt and run Get-PSAutoLabSetting which will provide useful information. Copy and paste the results into a new issue along with any error messages you are seeing.

Known Issues

I get an error when importing the module

Starting with version 4.12.0 of this module, you might see this error when you import the module.

Import-Module : Assertion operator name 'Be' has been added multiple times.

This is most likely due to a conflict in Pester module versions. The solution is to remove the Pester module from your current session.

Get-Module Pester | Remove-Module

Then import this module again.

I get an error when attempting to update the Lability module

If you try to run Refresh-Host you might see an error about a certificate mismatch. Between v0.18.0 and v0.19.0 the Lability module changed code signing certificates. If you encounter this problem, run

Refresh-Host -SkipPublisherCheck

Multiple DSC Resources

Due to what is probably a bug in the current implementation of Desired State Configuration in Windows, if you have multiple versions of the same resource, a previous version might be used instead of the required one. You might especially see this with the xNetworking module and the xIPAddress resource. If you have any version older than 5.7.0.0 you might encounter problems. Run this command to see what you have installed:

Get-DSCResource xIPAddress

If you have older versions of the module, uninstall them if you can.

Uninstall-Module xNetworking -RequiredVersion 3.0.0.0

Beginning with version 4.20.0, you might see the same type of errors with the xDHCP resource. If you encounter errors like Invalid MOF definition for node 'DC1': Exception calling "ValidateInstanceText" with "1" argument(s): "Undefined property IsSingleInstance you might have an older version of a DSCResource module installed.

Run Get-Module xdhcpserver -list and remove anything older than version 3.0.0.

Uninstall-Module xdhcpserver -RequiredVersion 2.0.0.0

It is recommended that you restart your PowerShell session and try the lab setup again.

Acknowledgments

This module is a continuation of the work done by Jason Helmick and Melissa (Missy) Januszko, whose efforts are greatly appreciated. Beginning with v4.0.0, this module is unrelated to any projects Jason or Missy may be developing under similar names.

We also appreciate all of the work that has gone into the Lability module. The Lability and PSAutoLab modules are completely separate and independently maintained.

Road Map

These are some of the items that are being considered for future updates:

  • While Lability currently is for Windows only, it would be nice to deploy a Linux VM.
  • Offer an easy way to customize a lab configuration such as node names and operating systems.

A complete list of enhancements (and bugs) can be found in the Issues section of this module's GitHub repository. Feel free to make a suggestion.

ps-autolab-env's People

Contributors

g0t4 avatar jdhitsolutions avatar majst32 avatar pssubmariner avatar thejasonhelmick avatar tijko avatar wcarroll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ps-autolab-env's Issues

Use standard names in PSAutolab module

I realize you intentionally wanted to use non-standard names for commands like Run-Lab and Setup-Lab. However, now that these are part of a module, PowerShell will complain about non-standard verbs if you import the module. I think the better approach would be to rename the commands using standard verbs. Then create aliases using the current names like Run-Lab. This should satisfy module requirements and not break anything.

adding * to existing trusted hosts is invalid

I allrady have one trusted host (my standalone hyper-v server) so I get this error
Set-Item : WinRM cannot process the configuration request. The hostname pattern is invalid: "" Hostname patterns must
contain one or more patterns. A pattern can contain at most one wildcard ("
"). The special pattern "" can be
used to indicate all hostnames that do not have a '.'. To trust all hosts use "*" as the only pattern.
At C:\Users\Blade_000\Downloads\PS-AutoLab-Env-master\PS-AutoLab-Env-master\Setup-Host.ps1:54 char:5

While I understand the reason for *, but if the host is used for other things than just the lab like my system is, it's not a setting I'm fond of using..

Setup-Lab script pauses after ISO downloads

There are times when the setup-lab script pauses after downloading ISO images. This appears to be an error, but can be resolved by pressing the return key once and the script will continue. This is an issue I am tracking with Lability. Please feel free to add comments to this issue if you are having this problem.

Checksum fail

With the current script using TP5, the checksums are failing during setup-lab.ps1. It appears they don't match. I've run through this twice with the same outcome.

VERBOSE: [7:54:27 PM] Calculating resource 'C:\Lability\ISOs\2016TP5_x64_EN.iso.checksum' checksum.
VERBOSE: [7:54:40 PM] Writing checksum '4D46EC27EA02B3255B2D6738241F71DB' to resource 'C:\Lability\ISOs\2016TP5_x64_EN.iso.checksum'.
VERBOSE: [7:54:40 PM] Resource 'C:\Lability\ISOs\2016TP5_x64_EN.iso' checksum does not match '6417BA460F95BD91DED05DFACD553783'.
Web resource 'http://care.dlservice.microsoft.com/dl/download/8/9/2/89284B3B-BA51-49C8-90F8-59C0A58D0E70/14300.1000.160324-1723.RS1_RELEASE_SVC_S
ERVER_OEMRET_X64FRE_EN-US.ISO' download failed.
At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.0\Lib\Resource.ps1:256 char:13

Alert - Win10 host bug from MS breaks AutoLab

** This does not impact Server 2016 host - only Windows 10 **

Recently an update to Windows 10 causes AutoLab to fail in multiple locations.

Problem:
The cmdlet used to read the configuration data (Import-PowerShellDatafile) has a bug in Windows 10 preventing it from building an object collection properly, therefor causing several configuration failures. To this date we have determine it is PowerShell version 5.0.10586.X. This problem does not occur on Server 2016.

You will encounter an error similar to the following when running a configuration:

_Install-Module : Cannot process argument transformation on parameter 'RequiredVersion'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Version".

  • ... $($DSCResource).Name -RequiredVersion $($DSCResource).RequiredVersion_

Workaround:
We have determined a coding solution, however it is impractical and would break server 2016. We have determined that this is a bug and not a future feature of the cmdlet.

A solution that has been tested is to upgrade PowerShell (WMF) to version 5.1. If you are running Windows 10 Pro, check for the latest updates. Then run Get-Host to verify. If running Windows 10 Enterprise, this has not been made available yet. The separate download of WMF 5.1 is not production release as of this date - so this can not be recommended until it is released.

LabNAT not working

So everything seems to running fine, but when I type Enable-Internet, i don't get an error, but I don't see a switch in Hyper-V appear for it...only my physical and LabNET (not NAT).

AutoLab presentation for Viewers

Will there be an intro course for this series that runs through the Autolab, or are we expected to set it up for viewer during first/last module?

Parameter for Snapshot-Lab

Would it be possible to have a parameter added to allow custom naming of the snapshots for the Snapshot-Lab command? I'd like to create a temporary snapshot after each module.

Design Suggestion

I've been thinking about the overall design of this project and there appears to be a lot of duplication. In each of the different configurations, are the scripts like Run-Lab identical? If so, I'd suggest creating a folder like Library or Tools and centralize the scripts. Perhaps even better would be to turn the scripts into functions and create a module. The functions could have a Path parameter that defaults to the current location. The end result is that you can still run the commands from each configuration directory but overall management of the code base could be simplified. Thoughts?

Test for Lability Version

In Setup-Host it is possible that someone might have an older version of Lability installed. Even though the script is downloading 0.10.1 it won't remove any previous versions and later when commands from the module are invoked, there is no guarantee about which version will be called.

I suggest in Setup-Host testing if the require version of Lability is installed. If there are any older versions STOP and ask the user to remove them then re-rerun Setup-Host If the version is the same, then skip installing otherwise install it

Unnattend-lab error running script

Every time I run Unattend-lab, I receive the following error:
Write-NodeMOFFile : Invalid MOF definition for node 'DC1': Exception calling "ValidateInstanceText" with "1" argument(s):
"Undefined property PrefixLength
At line:19, char:2
Buffer:
onName = "AutoLab";
};^
insta
"
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\PSDesiredStateConfiguration.psm1:2369 char:21

  • ... Write-NodeMOFFile $Name $mofNode $Script:NodeInstanceAlia ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Write-Error], InvalidOperationException
    • FullyQualifiedErrorId : InvalidMOFDefinition,Write-NodeMOFFile

@greg-shields mentioned to me that their was a change in the DSC resource, XIPAddress, and that I needed to change references to subnetmask to PrefixLength. I'm not sure where to do this, if in fact it is a fix.

Please advise as I'm currently unable to proceed with my course development.

Thanks.

Need to enable RDP on Win10

In order to use VMConnect and enhanced session with full screen on the Windows 10 clients, remote desktop access must be enabled. I seem to recall this is a simple registry setting. I'm looking through my notes.

The C:\Lability location is hardcoded

Instead of hard coding the location of Lability files, allow the user to specify the location by modifying a variable in setup-host.ps1. C:\Lability probably works fine for 90%+ of people, but there may be that outlier who doesn't have the space to store all those ISOs on their C: drive.

Issue with Instructions

Currently the instructions on the main page have some gotchas.
First, .\Unattend-LabSetup (#8) does not exist.
Next, .\Unattend-Lab will not work with the leading .\ . It needs to run as just Unattend-Lab.

So I think it should read as follows:
Note: Unattend-Lab runs setup-lab, Run-Lab, and Validate-Lab all together for faster processing

If users don't look at the screenshot of commands and fully RTFM, they may try to run the command as written in 8 after changing to the proper config directory.

Split-brain scenario with PS-Auto-Lab and Lability folders

Line 66 of setup-host.ps1 forcibly copies the Configurations folder from C:\PS-AutoLab-Env\Configurations\ to C:\Lability\Configurations. The Lability scripts use the latter, and that works fine. But there are some potential problems:

  • If someone wants to modify the configurations or create new ones and push those to a repo, they have to manually copy those configs back to the folder in PS-AutoLab-Env.
  • If someone has already made changes to the configurations in the Lability folder and inadvertently runs setup-host.ps1 again, it will overwrite their configs.

Two possible fixes come to mind:

  • Symbolically link ?:\Lability\Configurations to ?:\PS-AutoLab-Env\Configurations.
  • Alternately, remove the ?:\Lability\Configurations folder and just point the scripts to ?:\PS-AutoLab-Env\Configurations

Create and prioritize "Allow Any/Any" firewall rule on all machines

If I'm reading these correctly, we're setting the firewall on these machines to a rather restricted setting -- allowing ping and file sharing.

Can we adjust the default firewall setting for all machines to "Allow Any/Any" in both directions? This isn't shutting down the firewall, which has implications all its own, but it does set it to wide open.

Although, yes, it isn't the right practice in production, this config in the lab greatly eases the job of teaching this content. If I'm trying to teach someone how to merely connect to Active Directory, having to also include a firewall conversation begins severely complicating that message.

Doing so lets each author, on a case-by-case basis, determine whether/when to apply more restrictive firewall rules in our individual courses as appropriate.

Vmware Fusion

Would this work in VMware fusion know that Thier is POSH for mac? If not would I be able to do this from my windows VM in VMware fusion? IS DSC Supported on MACS? I see in the youtube video your using a mac, is that through bootcamp Jason?

Wipe-Lab Should NOT delete other configurations

If you have created multiple lab configurations and run Wipe-Lab on one of them, that command kills the NAT config which might be used by other configurations and it wipes out ALL hard VDHX files, or at least tries to. This can't happen. Wipe-Lab should only remove the VM files for the virtual machines in the specific configuration.

Issue running script until network switched to private

You may wish to add a check of the network profile on the local machine to ensure it is either domain or private. I ran an issue because it was Public, thus winrm won't start properly and no trusted hosts. Setting to private fixed via Set-NetConnectionProfile -InterfaceIndex 8 -NetworkCategory Private.

Not working on server 2016 (non desktop)

This may be more of an issue with lability but the master hard drives do not complete correctly and result in the error , If i copy the master vhdx from windows 10 I am able to continue.

WARNING: [3:13:54 PM] Removing incomplete image 'C:\AutoLab\MasterVirtualHardDisks\2016_x64_Standard_Core_EN_Eval.vhdx'.
WARNING: [3:13:54 PM] DSC resource 'Test-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Genera
tion'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that
is in the set and then try the command again.'.
WARNING: [3:13:54 PM] DSC resource 'Set-VHDTargetResource' failed with errror 'Cannot validate argument on parameter 'Generat
ion'. The argument "" does not belong to the set "Vhd,Vhdx" specified by the ValidateSet attribute. Supply an argument that i
s in the set and then try the command again.'.
WARNING: [3:13:55 PM] DSC resource 'Test-VMTargetResource' failed with errror 'Vhd 'C:\AutoLab\VMVirtualHardDisks\DC1.vhdx' d
oes not exist.'.
New-VM : Adding the device 'Microsoft:Hyper-V:Virtual Hard Disk' to 'DC1' failed.
At C:\Program
Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xVMHyperV.psm1:350
char:21

  •         $null = New-VM @parameters
    
  •                 ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [New-VM], VirtualizationException
    • FullyQualifiedErrorId : Unspecified,Microsoft.HyperV.PowerShell.Commands.NewVM

Set-VM : Hyper-V was unable to find a virtual machine with name "DC1".
At C:\Program
Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xHyper-V\DSCResources\MSFT_xVMHyperV\MSFT_xVMHyperV.psm1:371
char:21

  •         $null = Set-VM @parameters
    
  •                 ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (:) [Set-VM], VirtualizationException
    • FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.SetVM

Win10 Client Wish List

This is a wish list for the Windows 10 client configuration.

  1. Automatic first login to get through the "finishing your setup".
  2. configure Internet Explorer as default browser instead of Edge. You can't use Edge when logged on as Admin.
  3. find a way to make it easy to deploy files to the client.
  4. I'd love to be able to deploy an app to the client like VSCode

Nothing here is a requirement but they are items that would make the process much easier. No expectations but wanted to at least get these recorded while thinking of them.

Disable auto updating

As a practice lab, this may not have much impact, but recently at a conference I ran into the issue of the VM's starting to download updates. This caused the whole system to slow down. I discovered how to disable the automatic updates.

This does not impact the ability to manually (or through a script) to get updates...it just prevents Windows from making the decision. I'm interested in everyones thoughts about including the doable of automatic updates in the Config. I believe Jeff can provide an easy way to update the VM's manually. @jdhitsolutions @majst32

thoughts?

Allow custom installation

There have been a number of requests for this and I think we can modify Setup-Host further. We already ask for an alternate location. We can then ask if the user would like to further customize. If so, prompt for these settings displaying the current default. It should be very easy then to customize this hashtable.

$DirDef = @{
    ConfigurationPath = "$DestinationPath\Configurations"
    DifferencingVhdPath = "$DestinationPath\VMVirtualHardDisks"
    HotfixPath = "$DestinationPath\Hotfixes"
    IsoPath = "$DestinationPath\ISOs"
    ModuleCachePath = "C:\ProgramData\Lability\Modules"
    ParentVhdPath = "$DestinationPath\MasterVirtualHardDisks"
    ResourcePath = "$DestinationPath\Resources"

}

Exclude version # in folder in zip file for releases

Could we exclude the version # from the folder inside the zip file for a release? How about only put it in the zip file name?

I copied the embedded folder as is onto my C drive (C:\PS-AutoLab-Env-2.1.0) and the setup failed at the end because it couldn't find files to copy. Another idea, the setup could run a sanity check before it runs to ensure that files are in the correct place.

Also, is there a way we could get rid of this dual folder thing? Why is it necessary to have C:\PS-AutoLab-Env and C:\Lability? - nevermind - I see that this is just for installation purposes now

Adding additional VMs to Lab

Is it possible to add additional VMs into an existing lab environment without impacting the current states of the existing VMs? After building and configuring my custom course environment, I now need another client VM.

Start-LabConfiguration Fails complaining about Reboot needed

Running Setup-Lab or Unattend-Lab always complain about needing a reboot. I fixed this by adjusting PSAutoLab.psm1 and added "-Force" to the Start-LabConfiguration on line 70. Not sure what this does on Win2012R2 or Win2016, but everything works for me now as it just moves on even though it warns about a reboot. And btw, I'm fully patched and have no reboots pending. I also updated Lability to 0.10.2, but no dice.

System specs:
Windows 10, version 1607.
PS C:\Autolab\Configurations\POC-MultiRole> $psversiontable

Name Value


PSVersion 5.0.10586.672
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.672
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

RFC - Graphical front-end for AutoLab

Entry-level students who haven't reached their learning curve with PowerShell may get mired in the AutoLab details. Same for _some_instructors.

Suggest creating a simple, single-form GUI layer on top of AutoLab.

Hard code admin passwords

The goal of this project is to streamline setup of a test environment. As such there's no need to prompt for administrator passwords to be used. We can simply set a default of P@ssw0rd. If someone wants to change it, they can after after the lab is complete.

Not prompting for a password removes the possibility of error in entering in a password or forgetting what you entered. It also makes it easier for us to have a completely unattended install.

VM Configuration Never Completes

I am using this for the first time so might be doing something wrong. I am trying to create the lab environment for the AD Certificate Services course Pluralsight. The standalone machine worked as expected, however, the lab setup using "AutoLab\Configurations\POC-MultiRole" never completes. Apart from the Nano Server all the other machines just sit at the Hyper-V black screen with the spinning dots. I have left this for 24 hours and the Pester test constantly fail. Apart from that I have seen no other error messages.

I have tried removing all the modules, including Lability but still get the same issue. I also tried running the lab setup up command individually and I am seeing the same results.

Any suggestions on what I am doing wrong? Thanks in advance for any help.

VM Errors installing OS

Received the following errors on VMs (see attached picture)
hyper-verror

OS won't build. Resetting VMs results in same result.

I believe the issue revolves around Secure Boot and perhaps is related to failing of hashes (Noted previously). If I have time, I'll attempt to disable secure boot in VM creation process to see if it resolves issue.

Request: Legacy OS Support

I have a need in a current course for a Windows Server 2012 R2 member server. Any chance of getting an option to add a 2012 R2 image? Thanks.

Move resources?

Is there a way to move the ISO's to a different drive or even mapped drive/share? I've tired editing the HostDefaults.json file section: "IsoPath": "D:\AutoLab\ISOs" to the following with "no joy"

Mapped Drive:
"IsoPath": "I:\ISOs\AutoLabISOs\ISOs"

Network Path:
"IsoPath": "\batcave1\ISOs\AutoLabISOs\ISOs"

Ideas?

Match time zone to host

I would like the setup process to set the time zones on all servers to the time zone of the host. If my Hyper-V host is using Eastern time then all of the servers in the lab domain should also be Eastern time. This shouldn't be that hard to make the default behavior.

I have to think the need to specify a different time zone would be an exception but perhaps other people have an opinion on that.

Posting this as a separate issue for tracking purposes.

Feature request

  • Add config to join Nano to domain
  • Set Client trusted hosts to *
    (this is so client can remote to nano not joined to domain)
  • Add documentation that remoting to nano requires -Credential

Errors w/Nano

First:
You should do a check to see if Enable-PSRemoting exists in Setup-Host; Nano server doesn't include it and enables Remoting by default.

Then:
Nano can't explicitly install Hyper-V; you might consider checking that so you're not tossing errors. I'm getting "WARNING: [6:54:19 PM] DSC resource 'Test-WindowsFeatureTargetResource' failed with
errror 'The term 'Test-WindowsFeatureTargetResource' is not recognized as the name of
a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.'." a bunch. Bear in mind that Nano lacks Get-WindowsFeature, which is what I suspect's going on under the hood.

Additionally:
Get-ItemProperty : Cannot find path 'HKLM:\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName' because
it does not exist. At C:\Program Files\WindowsPowerShell\Modules\Lability\0.10.1\DSCResources\xPendingReboot\DSCResources\MSFT_xPendingReb
oot\MSFT_xPendingReboot.psm1:35 char:28

  • ... uterName = (Get-ItemProperty 'hklm:\SYSTEM\CurrentControlSet\Control\ ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (HKLM:\SYSTEM\Cu...iveComputerName:String) [Get-ItemProperty], ItemNotFo
      undException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand

That appears to be in Lability. I'm not sure what-all else this will end up breaking.

Configuring Trusted Hosts

I think configuring Trusted Hosts should be a bit more forgiving and selective. The way I see the existing code you are forcing the user to set set Trusted Hosts to *. Or if they already have a setting you can't make any changes. It seems the only thing that needs to be added is the new subnet. We should be able to get that from a global setting or at least prompt the user to enter a value, or even skip it altogether.

Add an Unattend script file

I like that there are discreet steps for Setup-Lab. Run-Lab etc. But I suggest we also include an Unattend.ps1 script that essentially calls all of the build scripts in order. This way I can kick off a build and come back after lunch and have everything complete. The implication here is that each of the scripts must run with no user interaction. Or have parameters to suppress interactions.

unattend-lab failed on windows 10

I followed the instruction and tried to setup the PS Autolab on my window 10 (Ent) Machine, but the it failed at the very beginning.
can anyone help me on this?

here is the output on the screen:

PS C:\autolab\Configurations\POC-MultiRole> unattend-lab

   This runs Setup-Lab, Run-Lab, and validate-Lab

Starting the lab environment

    This is the Setup-Lab script. This script will perform the following:
    * Run the configs to generate the required .mof files
    Note! - If there is an error creating the .mofs, the setup will fail

    * Run the lab setup
    Note! If this is the first time you have run this, it can take several
    hours to download the .ISO's and resources.
    This only occurs the first time.

    **Possible problem, if the downloads finish but the script doesn't continue (pauses)
        Hit the return key once and it will continue

    *You will be able to wipe and rebuild this lab without needing to perform
    the downloads again.

Installing required DSCResource modules from PSGallery
You may need to say "yes" to a Nuget Provider
Import-PowerShellDataFile : The term 'Import-PowerShellDataFile' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\PSAutoLab\PSAutolab.psm1:51 char:16

  • $LabData = Import-PowerShellDataFile -Path .\*.psd1
    
  •            ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Import-PowerShellDataFile:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Build the .Mof files from the configs
At C:\autolab\Configurations\POC-MultiRole\VMConfiguration.ps1:26 char:5

  • Import-DSCresource -ModuleName PSDesiredStateConfiguration,
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

The DSC engine could not load the module <xPSDesiredStateConfiguration, 5.0.0.0>. It was not found on the system.
At C:\autolab\Configurations\POC-MultiRole\VMConfiguration.ps1:385 char:9

  •     xAdcsCertificationAuthority ADCSConfig
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

Undefined DSC resource 'xAdcsCertificationAuthority'. Use Import-DSCResource to import the resource.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : ModuleNotFoundDuringParse

Building the lab environment
ConvertTo-SecureString : Cannot bind argument to parameter 'String' because it is an empty string.
At C:\Program Files\WindowsPowerShell\Modules\PSAutoLab\PSAutolab.psm1:69 char:48

  • ... ertTo-SecureString -String "$($labdata.allnodes.labpassword)" -AsPlai ...
  •                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [ConvertTo-SecureString], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand

Start-LabConfiguration : Cannot validate argument on parameter 'Password'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\PSAutoLab\PSAutolab.psm1:70 char:87

  • ... -ConfigurationData .*.psd1 -path .\ -NoSnapshot -Password $Password
  •                                                             ~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Start-LabConfiguration], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Start-LabConfiguration

WARNING: [9:21:27 AM] DSC resource 'Get-VMTargetResource' failed with errror 'Cannot index into a null array.'.
WARNING: [9:21:27 AM] DSC resource 'Get-VMTargetResource' failed with errror 'Cannot index into a null array.'.
WARNING: [9:21:27 AM] DSC resource 'Get-VMTargetResource' failed with errror 'Cannot index into a null array.'.
WARNING: [9:21:28 AM] DSC resource 'Get-VMTargetResource' failed with errror 'Cannot index into a null array.'.
Get-VM : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\PSAutoLab\PSAutolab.psm1:72 char:12

  • Get-VM ( Get-LabVM -ConfigurationData .\*.psd1 ).Name -OutVariabl ...
    
  •        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VM], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.HyperV.PowerShell.Commands.GetVM

Set-VMFirmware : Cannot validate argument on parameter 'VM'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\PSAutoLab\PSAutolab.psm1:73 char:24

  • Set-VMFirmware -VM $vm -EnableSecureBoot Off -SecureBootTemplate  ...
    
  •                    ~~~
    
    • CategoryInfo : InvalidData: (:) [Set-VMFirmware], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.HyperV.PowerShell.Commands.SetVMFirmware

Default Gateway Suggestion

Using 192.168.3.254 as the default gateway would make it easier for those using VMware Workstation. VMware workstation defaults to using .1 as the host-to-vm virtual adapter so the Gateway needs to be modified to a number between .2-.254.

External Network type for LabNet

If I change the type of network to External, when it's created, the Setup-Lab script fails to download the ISO, because the host networking is temporarily lost. I'm not sure if this happens with Internal network type. Just a heads up, might want to delay a bit and/or poll for network connectivity, or maybe warn users to run the script again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.