Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 746c6c5

Browse files
v4.17.0
1 parent 0c2a71d commit 746c6c5

26 files changed

+482
-207
lines changed

Detailed-Setup-Instructions.md

Lines changed: 62 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Please refer to this document to assist in installing and setting up the `PSAuto
44

55
It is also assumed that you have administrator rights to your computer and can makes changes. If your computer is controlled by Group Policy, you may encounter problems. You should also 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 logon to Windows.
66

7-
> It is *possible* to run this module with nested virtualization inside a Windows 10 Hyper-V virtual machine but it is **not** recommended. Some networking features may not work properly and overall performance will likely be reduced.
7+
It is *possible* to run this module with nested virtualization inside a Windows 10 Hyper-V virtual machine but it is **not** recommended. Some networking features may not work properly and overall performance will likely be reduced.
88

99
## Pre-Check
1010

11-
TYou can run these commands to verify your computer meets the minimum requirements. Run all PowerShell commands in an elevated session.
11+
You can run these commands to verify your computer meets the minimum requirements. Run all PowerShell commands in an elevated session.
1212

1313
### Operating System and Memory
1414

@@ -22,7 +22,7 @@ Microsoft Windows 10 Pro 32
2222

2323
If the Caption shows anything other than Pro or Enterprise this module may not work. Although it appears that Windows 10 Education might be supported. In fact, if you can't even open a PowerShell prompt, this module won't work on your computer.
2424

25-
The memory size should be at least 12. 16 or greater is recommended. If the number is less than 12, **STOP**. It is unlikely you have enough installed memory. Depending on the configuration you want to run, it *might* be possible to proceed with less memory. Open an Issue and ask for guidance indicating your memory settings from this command:
25+
The memory size should be at least 12GB. 16GB or greater is recommended. If the number is less than 12, **STOP**. It is unlikely you have enough installed memory. Depending on the configuration you want to run, it *might* be possible to proceed with less memory. Open an Issue and ask for guidance indicating your memory settings from this command:
2626

2727
```text
2828
PS C:\> Get-CimInstance Win32_OperatingSystem | Select-Object FreePhysicalMemory,TotalVisibleMemorySize
@@ -49,8 +49,8 @@ ProductVersion : OS: 0.0.0 SP: 0.0 Stack: 3.0
4949

5050
This is what you should see as a result. Any errors mean that PowerShell remoting is disabled. Enable it from your **elevated** PowerShell session. This will fail if your only network connection is over a public network.
5151

52-
```text
53-
PS C:\ Enable-PSRemoting -force
52+
```powershell
53+
Enable-PSRemoting -force
5454
```
5555

5656
If this fails, **STOP**. Do not proceed with this module until this is working and `Test-WSMan` gives you a result. If you are running as Administrator and this command fails it is most likely because the related settings are controlled by a Group Policy or your network is public. Run `Get-NetConnectionProfile` and look at the NetworkCategory. If must be `Private` or `DomainAuthenticated`.
@@ -68,20 +68,20 @@ D 477 183 38.41 Healthy
6868
C 237 87 36.71 Healthy
6969
```
7070

71-
You should have close to 100GB of free space on a fixed hard drive such as C or D. This module has not been tested running from a externally connected drive.
71+
You should have close to 100GB of free space on a fixed hard drive such as C or D. The module will setup an Autolab folder on drive C: by default, although you can specify an alternate drive. This module has not been tested running from a externally connected drive.
7272

7373
### Virtualization
7474

75-
The module requires the Hyper-V feature on Windows 10. Please refer to documentation for your computer to determine if it supports virtualization. You may need to configure settings in your BIOS. You don't need to manually enable the Hyper-V feature now, although you are welcome to if you want to verify it is available.
75+
The module requires the Hyper-V feature on Windows 10. Please refer to documentation for your computer hardware to determine if it supports virtualization. You may need to configure settings in your BIOS. You don't need to manually enable the Hyper-V feature now, although you are welcome to if you want to verify it is available.
7676

7777
## Installation and Configuration
7878

7979
### Install the Module
8080

8181
If you meet the requirements, you are ready to download and install this module. **Do not download anything from this GitHub repository.** In your PowerShell session run this command:
8282

83-
```text
84-
PS C:\> Install-Module PSAutolab -force -SkipPublisherCheck
83+
```powershell
84+
Install-Module PSAutolab -force -SkipPublisherCheck
8585
```
8686

8787
You may be prompted to update to a newer version of `nuget`. Answer "yes". You might also be prompted about installing from an untrusted source. Again, you will need to say "yes". After installation you can verify using `Get-Module`.
@@ -94,26 +94,26 @@ PS C:\> Get-Module PSAutoLab -list
9494
9595
ModuleType Version Name ExportedCommands
9696
---------- ------- ---- ----------------
97-
Script 4.11.0 PSAutoLab {Enable-Internet, Invoke-RefreshLab, Invoke-Run...
97+
Script 4.16.0 PSAutoLab {Enable-Internet, Invoke-RefreshLab, Invoke-Run...
9898
```
9999

100100
You may see a newer version number than what is indicated here. The `README` file indicates the current version in the PowerShell Gallery.
101101

102102
### Setup the Host
103103

104-
You have to setup your computer one-time to use this module. In your elevated PowerShell session run this command:
104+
There is a one-time step to setup your computer for the AutoLab environment. In your elevated PowerShell session run this command:
105105

106-
```text
107-
PS C:\> Setup-Host
106+
```powershell
107+
Setup-Host
108108
```
109109

110110
This command will create a directory structure for the module and all of its files. The default is `C:\Autolab` which you should be able to accept. If you are low on space or want to use an alternate drive, then you can specify an alternative top level path.
111111

112-
```text
113-
PS C:\> Setup-Host -DestinationPath D:\Autolab
112+
```powershell
113+
Setup-Host -DestinationPath D:\Autolab
114114
```
115115

116-
If you select a drive other than C:\ it is recommended you use the `Autolab` folder name. The setup process will install additional modules and files. If necessary, it will enable the Hyper-V feature. If Hyper-V is enabled, please reboot your computer before proceeding.
116+
If you select a drive other than C:\ it is recommended you use the `Autolab` folder name. The setup process will install additional modules and files. If necessary, it will enable the Hyper-V feature. If Hyper-V is enabled during the setup, please reboot your computer before proceeding.
117117

118118
To verify your configuration, run `Get-PSAutolabSetting`.
119119

@@ -131,7 +131,7 @@ Processor : Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
131131
IsElevated : True
132132
RemotingEnabled : True
133133
HyperV : 10.0.18362.1
134-
PSAutolab : 4.11.0
134+
PSAutolab : 4.16.0
135135
Lability : {0.19.1, 0.19.0, 0.18.0}
136136
Pester : {5.0.2, 4.10.1, 4.9.0, 4.8.1...}
137137
PowerShellGet : 2.2.4.1
@@ -145,35 +145,52 @@ If Hyper-V is not installed you will see errors. Any errors indicate a problem w
145145
In an elevated PowerShell session, **change directory** to the configuration folder that you want to use.
146146

147147
```text
148-
PS C:\> cd C:\Autolab\Configurations\SingleServer-GUI-2016\
149-
PS C:\Autolab\Configurations\SingleServer-GUI-2016>
148+
PS C:\> cd C:\Autolab\Configurations\SingleServer-GUI-2016
149+
PS C:\Autolab\Configurations\SingleServer-GUI-2016\>
150150
```
151151

152-
You can look at the `instructions.md` file to get more information about the configuration.
152+
You can look at the `instructions.md` file in the folder to get more information about the configuration.
153153

154154
```text
155-
PS C:\Autolab\Configurations\SingleServer-GUI-2016> get-content .\Instructions.md
155+
PS C:\Autolab\Configurations\SingleServer-GUI-2016\> get-content .\Instructions.md
156156
```
157157

158158
Or open the file with Notepad.
159159

160+
Another option is to use the `Get-LabSummary` command. This will show you what computers will be created and how they will be created. The Computername will also be the virtual machine name.
161+
162+
```text
163+
PS C:\Autolab\Configurations\SingleServer-GUI-2016\> Get-LabSummary
164+
165+
166+
Computername : S1
167+
VMName : S1
168+
InstallMedia : 2016_x64_Standard_EN_Eval
169+
Description : Windows Server 2016 Standard 64bit English Evaluation
170+
Role : RDP
171+
IPAddress : 192.168.3.75
172+
MemoryGB : 4
173+
Processors : 1
174+
Lab : SingleServer-GUI-2016
175+
```
176+
160177
You can run `Unattend-Lab` for a completely hands-free experience.
161178

162179
```text
163-
PS C:\Autolab\Configurations\SingleServer-GUI-2016> unattend-lab
180+
PS C:\Autolab\Configurations\SingleServer-GUI-2016\> unattend-lab
164181
```
165182

166183
The very first time you run a setup, the command will download ISO images of evaluation software from Microsoft. These files will be at least 4GB in size. If you are setting up a domain-based configuration, this means you will be downloading ISO images for Windows Server and Windows 10. This download only happens once.
167184

168185
Note that during the validation phase you may see errors. This is to be expected until all of the configurations merge. You can press `Ctrl+C` to break out of the testing. The virtual machines will continue to prepare themselves. Later, you can manually validate the lab:
169186

170187
```text
171-
PS C:\Autolab\Configurations\SingleServer-GUI-2016> Invoke-Pester .\vmvalidate.test.ps1
188+
PS C:\Autolab\Configurations\SingleServer-GUI-2016\> Invoke-Pester .\vmvalidate.test.ps1
172189
```
173190

174191
### Manual Configuration Setup
175192

176-
If you encounter errors running an unattended setup, you should step through the process manually to identify where exactly an error is occurring. Make sure you are in an elevated PowerShell session and you have changed location to the configuration folder. If you have tried to setup the lab before run `Wipe-Lab` to remove previous set up files. Then run each of these commands individually:
193+
If you encounter errors running an unattended setup, you should step through the process manually to identify where exactly an error is occurring. Make sure you are in an elevated PowerShell session and you have *changed location to the configuration folder*. If you have tried to setup the lab before run `Wipe-Lab` to remove previous set up files. Then run each of these commands individually:
177194

178195
* `Setup-Lab`
179196
* `Enable-Internet`
@@ -193,15 +210,31 @@ You might still see errors or failures, in which case try again in 10 minute int
193210

194211
All of the commands in this module have help and examples. You are also encouraged to read the about help topic.
195212

196-
```text
197-
PS C:\> help about_PSAutoLab
213+
```powershell
214+
help about_PSAutoLab
198215
```
199216

200217
## Using the Environment Prefix
201218

202-
In the `VMConfigurationData.psd1` file for each lab, you will see a commented out section for an environment prefix value. This value exists for special situations where you might have a virtual machine naming collision or want to be able to identify the virtual machines that belong to the AutoLab module. In a normal setup, the Hyper-V virtual machine name will be the same as the hostname in the VM guest. If the lab creates a guest with a computername of `S1`, the Hyper-V virtual machine will also be called `S1`. If you enable prefix setting, the Hyper-V virtual machine name will use the prefix, **but the guest computer name will not.** For example, if you enable the default prefix (you can change it to anything you'd like), you will create a Hyper-V virtual machine with a VMName of `Autolab-S1` but the actual computername will still be `S1`. The validation tests will reference the guest computer name, not the Hyper-V virtual machine name.
219+
In the `VMConfigurationData.psd1` file for each lab, you will see a commented out section for an environment prefix value. This value exists for special situations where you might have a virtual machine naming collision or want to be able to identify the virtual machines that belong to the AutoLab module. In a normal setup and for almost all users, the Hyper-V virtual machine name will be the same as the hostname (computername) in the VM guest. If the lab creates a guest with a computername of `S1`, the Hyper-V virtual machine will also be called `S1`. If you enable the prefix setting, the Hyper-V virtual machine name will use the prefix, **but the guest computer name will not.** For example, if you enable the default prefix (you can change it to anything you'd like), you will create a Hyper-V virtual machine with a VMName of `Autolab-S1` but the actual computername will still be `S1`. The validation tests will reference the guest computer name, not the Hyper-V virtual machine name.
220+
221+
If you must use this feature, open the `VMConfigurationData.psd1` file in a text or code editor. Scroll down to the `NonNodeData` section.
222+
223+
```powershell
224+
NonNodeData = @{
225+
Lability = @{
226+
227+
# You can uncomment this line to add a prefix to the virtual machine name.
228+
# It will not change the guest computername
229+
# See https://github.com/pluralsight/PS-AutoLab-Env/blob/master/Detailed-Setup-Instructions.md
230+
# for more information.
231+
232+
#EnvironmentPrefix = 'AutoLab-'
233+
```
234+
235+
Remove the `#` character before `EnvironmentPrefix`. If you want to change the value from `Autolab-` to something else go ahead. The prefix will be inserted before the computername to create the virtual machine name.
203236

204-
This setting should only be used in special situations as it can be confusing. While every effort has been made to ensure compatibility with commands in this module, there is no guarantee of 100% success. Also note that any changes you make to the configuration files could be overwritten in future updates.
237+
This setting should only be used in special situations as it can be confusing. While every effort has been made to ensure compatibility with commands in this module, there is no guarantee of 100% success. Also note that any changes you make to the configuration files could be overwritten in future updates or when you run `Refresh-Host`.
205238

206239
## Troubleshooting Tips
207240

@@ -223,4 +256,4 @@ Wait about 5 minutes and then test again.
223256

224257
If encounter problems getting any of this to work, you are welcome to post an Issue. If you get the module installed, please include the results of `Get-PSAutolabSetting`. If your problem is meeting one of the requirements, we will do our best to help. Although if your computer is locked down or otherwise controlled by corporate policies there may not be much that we can do.
225258

226-
last updated 2020-06-10 13:54:56Z UTC
259+
last updated 2020-08-05 17:39:25Z UTC

PSAutoLab.psd1

62 Bytes
Binary file not shown.

PSAutoLab.psm1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,25 @@ $PesterVersion = "4.10.1"
1414

1515
#declare the currently supported version of Lability
1616
$LabilityVersion = "0.19.1"
17+
18+
#configure TLS protocol to avoid problems downloading files from Microsoft
19+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
20+
21+
#open the PDF help file
22+
Function Open-PSAutoLabHelp {
23+
[cmdletbinding()]
24+
Param()
25+
26+
$pdf = Join-Path -path $PSScriptRoot -ChildPath PSAutoLabManual.pdf
27+
if (Test-Path -Path $pdf) {
28+
Try {
29+
Start-Process -FilePath $pdf -ErrorAction Stop
30+
}
31+
Catch {
32+
Write-Warning "Failed to automatically open the PDF. You will need to manually open $pdf."
33+
}
34+
}
35+
else {
36+
Write-Warning "Can't find $pdf."
37+
}
38+
}

PSAutoLabManual.pdf

208 KB
Binary file not shown.

0 commit comments

Comments
 (0)