LabBuilder
LabBuilder copied to clipboard
New-Lab params requires absolute paths
Verison of PowerShell:
$PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 1007
PowerShell host:
Console
Operating system:
Get-CimInstance Win32_OperatingSystem | Select-Object Caption, Version, ServicePackMajorVersion, OSArchitecture, WindowsDirectory
Caption : Microsoft Windows Server 2019 Standard
Version : 10.0.17763
ServicePackMajorVersion : 0
OSArchitecture : 64-bit
WindowsDirectory : C:\Windows
- [ ] Version of LabBuilder:
PS C:\Windows\system32> Get-Module -Name LabBuilder -ListAvailable
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.5.105 LabBuilder {Get-LabResourceModule, Initialize-LabResourceModule, Get-...
When running the cmdlet New-Lab using relative paths it will fail...
PS C:\Users\Public> New-Lab -LabPath .\labtest -ConfigPath .\labtest\test.xml -Name Test
Exception calling "Save" with "1" argument(s): "Could not find a part of the path 'C:\Windows\system32\Get-Location\lab
test\labtest\test.xml'."
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:9987 char:5
+ $Lab.Save($ConfigPath)
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
New-LabException : Configuration file C:\Users\Public\Get-Location\.\labtest\.\labtest\test.xml is not found.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6119 char:9
+ New-LabException @exceptionParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-LabException], Exception
+ FullyQualifiedErrorId : ConfigurationFileNotFoundError,New-LabException
Get-Content : Cannot find path 'C:\Users\Public\Get-Location\labtest\labtest\test.xml' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6122 char:16
+ $content = Get-Content -Path $ConfigPath -Raw
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\Public...abtest\test.xml:String) [Get-Content], ItemNotFoundEx
ception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
New-LabException : Configuration file C:\Users\Public\Get-Location\.\labtest\.\labtest\test.xml is empty.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6132 char:9
+ New-LabException @exceptionParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-LabException], Exception
+ FullyQualifiedErrorId : ConfigurationFileEmptyError,New-LabException
Assert-LabValidConfigurationXMLSchema : Exception calling "Create" with "2" argument(s): "Could not find a part of the
path 'C:\Users\Public\Get-Location\labtest\labtest\test.xml'."
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6138 char:9
+ Assert-LabValidConfigurationXMLSchema `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Assert-LabValidConfigurationXMLSchema], MethodInvocationException
+ FullyQualifiedErrorId : DirectoryNotFoundException,Assert-LabValidConfigurationXMLSchema
Exception calling "LoadXml" with "1" argument(s): "Root element is missing."
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6146 char:5
+ $lab.LoadXML($content)
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6180 char:5
+ $lab.labbuilderconfig.settings.setattribute('fullconfigpath', $fu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6185 char:9
+ $lab.labbuilderconfig.settings.SetAttribute('labpath', $labPa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6202 char:5
+ $lab.labbuilderconfig.settings.setattribute('vhdparentpathfull', ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6214 char:5
+ $lab.labbuilderconfig.settings.setattribute('dsclibrarypathfull', ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\LabBuilder\1.0.5.105\LabBuilder.psm1:6226 char:5
+ $lab.labbuilderconfig.settings.setattribute('resourcepathfull', $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
NodeType : Document
ParentNode :
DocumentType :
Implementation : System.Xml.XmlImplementation
Name : #document
LocalName : #document
DocumentElement :
OwnerDocument :
Schemas : System.Xml.Schema.XmlSchemaSet
XmlResolver :
NameTable : System.Xml.NameTable
PreserveWhitespace : True
IsReadOnly : False
InnerText :
InnerXml :
SchemaInfo : System.Xml.Schema.XmlSchemaInfo
BaseURI :
Value :
ChildNodes : {}
PreviousSibling :
NextSibling :
Attributes :
FirstChild :
LastChild :
HasChildNodes : False
NamespaceURI :
Prefix :
OuterXml :
PreviousText :