Comments (8)
Because if I deploy a Lab with PowerShell 7 i get the warning that is mentioned in the title
from automatedlab.common.
Nope, fully compatible. The warning you have seen is likely from here:
That reminds me: I need to add an issue template here to capture necessary information for troubleshooting...
from automatedlab.common.
That would be great. Should that line be removed
from automatedlab.common.
Well, no, of course not. Just because it is inconvenient doesn't diminish its purpose: Send-ModuleToPSSession is not helpful, if the module being sent cannot be imported. Thus, a warning is generated and the module is skipped.
Can you please provide all the required steps to reproduce this issue? I am unable to reproduce the issue, it works fine for me. Unless, that is, I deploy an old version of Windows Server, say 2012 R2, in which case the module is getting skipped as intended, as it is not compatible with PSv4 in this case.
AutomatedLab sends AutomatedLab.Common to all nodes in a lab since we rely on some of its functionality.
from automatedlab.common.
What I will do is to check if the Force parameter is present and if it is, send the module regardless of if it is supported - even if it does not make sense to me, personally.
I need to check where in AutomatedLab we do rely on this module. At some point, @raandree added better exception handling in Install-LabSoftwarePackage, which was the main reason we send the module to the sessions. Instead of the built-in type Win32Exception we use our own for a reason I cannot remember.
In general, I do not envision backporting this module to some ancient PowerShell versions. We use too many features of modern PowerShell editions and would essentially have to rip out functionality. Also, 5.1 has been out for so long now that there is no good reason to use any older version.
from automatedlab.common.
I will provide a Lab for you to test and post the PS 5.1 and PS 7 output.
from automatedlab.common.
The error I found is my fault. I used the following lab in PS 7
Name Value
---- -----
PSVersion 7.3.1
PSEdition Core
GitCommitId 7.3.1
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
AL Version in PS 7:
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 5.46.0 AutomatedLab {Add-LabAzureSubscription, Add-LabCertificate, Add-LabVMUserRight, Add-LabVMWareSettings…}
Script 2.3.0 AutomatedLab.Common {Add-AccountPrivilege, Add-CATemplateStandardPermission, Add-Certificate2, Add-FunctionToPSSession…}
Script 0.0 AutomatedLab.init
Script 5.46.0 AutomatedLabDefinition {Add-LabAzureAppServicePlanDefinition, Add-LabAzureWebAppDefinition, Add-LabDiskDefinition, Add-LabDomainDefinition…}
Script 5.46.0 AutomatedLabNotifications Send-ALNotification
Script 5.46.0 AutomatedLabTest {Import-LabTestResult, Invoke-LabPester, New-LabPesterTest, Test-LabDeployment}
Script 5.46.0 AutomatedLabUnattended {Add-UnattendedNetworkAdapter, Add-UnattendedRenameNetworkAdapters, Add-UnattendedSynchronousCommand, Export-UnattendedFi…
Script 5.46.0 AutomatedLabWorker {Add-LWAzureLoadBalancedPort, Add-LWVMVHDX, Checkpoint-LWAzureVM, Checkpoint-LWHypervVM…}
$LabName = 'PowerShellCourse'
New-LabDefinition -Name $LabName -DefaultVirtualizationEngine HyperV
$Parameters = @{
Name = 'Default Switch'
HyperVProperties = @{
SwitchType = 'External'
AdapterName = 'Ethernet'
}
}
Add-LabVirtualNetworkDefinition @Parameters
Add-LabDomainDefinition -Name 'pscourse.net' -AdminUser install -AdminPassword "Start.12345!"
Set-LabInstallationCredential -Username Install -Password "Start.12345!"
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:ToolsPath' = "$labSources\Tools"
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2022 Datacenter (Desktop Experience)'
'Add-LabMachineDefinition:Memory' = 2048MB
}
$roles = Get-LabMachineRoleDefinition -Role RootDC
Add-LabMachineDefinition -Name DC1 -Roles $roles -DomainName 'pscourse.net' -Network 'Default Switch'
Add-LabMachineDefinition -Name MemberServer -DomainName 'pscourse.net' -Network 'Default Switch'
Install-Lab
Install-LabSoftwarePackage -Path "$labSources\Tools\VSCodeSetup" -ComputerName MemberServer -CommandLine "/silent /mergetasks='!runcode,addcontextmenufiles,addcontextmenufolders,associatewithfiles,addtopath'"
Show-LabDeploymentSummary -Detailed
Output of this is:
17:27:24|00:00:00|00:00:00.000| Initialization
17:27:24|00:00:00|00:00:00.121| - Host operating system version: 'Microsoft Windows 11 Pro, 10.0.22621.0'
17:27:24|00:00:00|00:00:00.122| - Creating new lab definition with name 'PowerShellCourse'
17:27:24|00:00:00|00:00:00.126| - Location of lab definition files will be 'C:\ProgramData\AutomatedLab/Labs/PowerShellCourse'
17:27:25|00:00:00|00:00:00.825| - Location of LabSources folder is 'E:\LabSources'
17:27:25|00:00:00|00:00:00.000| - Auto-adding ISO files
17:27:25|00:00:00|00:00:00.045| - Added 'E:\LabSources\ISOs\en_sql_server_2008_r2_enterprise_x86_x64_ia64_dvd_520517.iso'
17:27:25|00:00:00|00:00:00.048| - Added 'E:\LabSources\ISOs\en_sql_server_2012_enterprise_edition_with_service_pack_4_x64_dvd_11444956.iso'
17:27:25|00:00:00|00:00:00.050| - Added 'E:\LabSources\ISOs\en_sql_server_2014_enterprise_edition_with_service_pack_3_x64_dvd_2f7d5d72.iso'
17:27:25|00:00:00|00:00:00.052| - Added 'E:\LabSources\ISOs\en_sql_server_2016_enterprise_with_service_pack_2_x64_dvd_12124051.iso'
17:27:25|00:00:00|00:00:00.055| - Added 'E:\LabSources\ISOs\en-us_windows_server_2022_updated_aug_2022_x64_dvd_8b65e57f.iso'
17:27:25|00:00:00|00:00:00.057| - Done
17:27:25|00:00:01|00:00:00.000| - Adding Hyper-V machine definition 'DC1' (Roles: RootDC)
17:27:26|00:00:02|00:00:01.403| - Done
17:27:27|00:00:02|00:00:00.000| - Adding Hyper-V machine definition 'MemberServer'
17:27:27|00:00:02|00:00:00.392| - Done
17:27:27|00:00:03|00:00:00.740| Estimated (additional) local drive space needed for all machines: 4 GB
17:27:28|00:00:03|00:00:01.135| Location of Hyper-V machines will be 'E:\AutomatedLab-VMs'
17:27:28|00:00:03|00:00:01.147| Done
17:27:28|00:00:03|00:00:00.000| Validating lab definition
17:27:28|00:00:04|00:00:00.543| - Could not invoke validator AutomatedLab.DomainMemberDns
17:27:34|00:00:09|00:00:05.843| - Issue: 'Default Switch'. Cause: There is already a virtual switch with the same name but a different switch type
17:27:34|00:00:09|00:00:05.847| - Success
17:27:34|00:00:09|00:00:05.915| Lab 'PowerShellCourse' hosted on 'HyperV' imported with 2 machines
17:27:34|00:00:10|00:00:00.000| Creating virtual networks
17:27:34|00:00:10|00:00:00.000| - Creating Hyper-V virtual network 'Default Switch'
17:27:34|00:00:10|00:00:00.008| - The network switch 'Default Switch' already exists, no changes will be made to configuration
17:27:34|00:00:10|00:00:00.014| - Done
17:27:34|00:00:10|00:00:00.019| - done
17:27:34|00:00:10|00:00:00.000| - Creating base images
17:27:34|00:00:10|00:00:00.012| - All base images were created previously
17:27:36|00:00:11|00:00:01.306| - Done
17:27:36|00:00:11|00:00:01.309| - done
17:27:36|00:00:11|00:00:00.000| - Creating Additional Disks
17:27:37|00:00:13|00:00:01.584| - Done
17:27:37|00:00:13|00:00:00.000| - Creating VMs
17:27:37|00:00:13|00:00:00.000| - Waiting for all machines to finish installing
17:27:37|00:00:13|00:00:00.000| - Creating HyperV machine 'DC1'.....
17:28:34|00:01:09|00:00:56.280| - ....Done
17:30:48|00:03:24|00:00:00.000| - Creating HyperV machine 'MemberServer'.....
17:30:53|00:03:29|00:00:05.209| - Done
17:30:53|00:03:29|00:00:05.211| - Done
17:30:54|00:03:29|00:00:05.563| - Done
17:30:54|00:03:29|00:00:00.000| - Installing Root Domain Controllers
17:30:54|00:03:29|00:00:00.035| - Machines with RootDC role to be installed: 'DC1'
17:30:54|00:03:29|00:00:00.057| - Waiting for machines to start up..
17:31:04|00:03:39|00:00:09.794| - Waiting for Root Domain Controllers to complete installation of Active Directory and restart....done
17:33:54|00:06:29|00:03:00.024| - Root Domain Controllers have now restarted. Waiting for Active Directory to start up.........
ConvertTo-Mask: Cannot validate argument on parameter 'MaskLength'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a collection that does not contain any
null values and then try the command again.
Get-NetworkSummary: Cannot bind argument to parameter 'IPAddress' because it is an empty string.
17:35:24|00:08:00|00:04:30.526| - Done
17:35:25|00:08:00|00:00:00.000| - Starting remaining machines
17:35:25|00:08:00|00:00:00.007| - Waiting for machines to start up....................................................................................................
17:54:10|00:26:46|00:18:45.418| - Done
17:54:10|00:26:46|00:00:00.000| - Installing RDS certificates of lab machines
17:54:11|00:26:47|00:00:00.976| - ..
17:54:14|00:26:49|00:00:03.697| - Done
17:54:14|00:26:49|00:00:00.000| - Adding lab machines to C:\Users\const/.ssh/known_hosts
17:54:24|00:27:00|00:00:10.436| - Done
from automatedlab.common.
I get the following output in PS 5.1
Name Value
---- -----
PSVersion 5.1.22621.963
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.963
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
AL Version in PS 5.1:
Script 5.46.0 AutomatedLab {Add-LabAzureSubscription, Add-LabCertificate, Add-LabVMUserRight, Add-LabVMWareSettings...}
Script 2.2.247 AutomatedLab.Common {Add-AccountPrivilege, Add-CATemplateStandardPermission, Add-Certificate2, Add-FunctionToPSSession...}
Script 0.0 AutomatedLab.init
Script 5.46.0 AutomatedLabDefinition {Add-LabAzureAppServicePlanDefinition, Add-LabAzureWebAppDefinition, Add-LabDiskDefinition, Add-LabDomainDefinition...}
Script 5.46.0 AutomatedLabNotifications Send-ALNotification
Script 5.46.0 AutomatedLabTest {Import-LabTestResult, Invoke-LabPester, New-LabPesterTest, Test-LabDeployment}
Script 5.46.0 AutomatedLabUnattended {Add-UnattendedNetworkAdapter, Add-UnattendedRenameNetworkAdapters, Add-UnattendedSynchronousCommand, Export-UnattendedFile...}
Script 5.46.0 AutomatedLabWorker {Add-LWAzureLoadBalancedPort, Add-LWVMVHDX, Checkpoint-LWAzureVM, Checkpoint-LWHypervVM...}
Output of Lab in PS 5.1:
The issue with this is that the MemberServer cannot find the domain because of a dns issue because the DefaultSwitch is used. What is the meaning of the two errors that appear with ConvertTo-Maskand and Get-NetworkSummary. Is this the fault of my misconfigured lab?
from automatedlab.common.
Related Issues (13)
- Variable name correct? HOT 1
- New-CATemplate HOT 1
- Find-CertificateAuthority does not work in a multi-domain forest
- New-CATemplate EnrollmentFlag NoRevocationInformation missing HOT 2
- Install-LabSoftwarePackage and an MSI file HOT 9
- Can you support PSRemoting as well as remote registry access in Get-DotNetFrameworkVersion.ps1? HOT 3
- Unable to add AutomatedLab.Common.dll HOT 4
- Send-ModuleToPSSession does not work when target PS version < 5
- Core build: Output does not contain ApplicationInsights library
- Remove-RunspacePool sometimes doesn't care
- Get-DotNetFrameworkVersion.ps1 script returns incorrect result for build 528040 HOT 1
- Problem when MSI-files have spaces in filename and -CommandLine is used HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automatedlab.common.