AutomatedLab / AutomatedLab/AutomatedLab.Common

Install-LabSoftwarePackage and an MSI file

Đang mở
#42 9 bình luận 0 reaction 2 người được giao Được @raandree nhận Xem trên GitHub
enhancement
Ngôn ngữ chính
PowerShell
Star
70
Fork
23
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Following a successful run of _Install-Lab_ with a single Windows 7 Machine I am getting the following error when trying to install an MSI file:

```
PS C:\Users\adams\Documents> Install-LabSoftwarePackage -ComputerName OMS -Path $labSources\SoftwarePackages\OemMgmtSetu
p.msi -CommandLine '/qn' -Verbose
VERBOSE: Install-LabSoftwarePackage Entering...
(ComputerName=OMS,Path=D:\LabSources\SoftwarePackages\OemMgmtSetup.msi,CommandLine=/qn,Verbose=True)
VERBOSE: Get-LabVM Entering... (ComputerName=OMS)
13:22:22|22:54:57|00:00:00.000| Installing software package 'D:\LabSources\SoftwarePackages\OemMgmtSetup.msi' on machine
s 'OMS'
VERBOSE: Get-LabVM Entering... (ComputerName=OMS,IncludeLinux=True)
VERBOSE: Get-LabVMStatus...leaving...(Time elapsed: 00:00:00:053)
VERBOSE: Starting background job for 'Installation of 'C:\OemMgmtSetup.msi''
13:22:22|22:54:57|00:00:00.083| - Copying files and initiating setup on 'OMS' and waiting for completionVERBOSE: Invoke-
LabCommand Entering...
(ComputerName=OMS,DependencyFolderPath=D:\LabSources\SoftwarePackages\OemMgmtSetup.msi,DoNotUseCredSsp=,PassThru=
True,ScriptBlock=
Install-SoftwarePackage @installParams
,NoDisplay=True,AsJob=True,ActivityName=Installation of
'C:\OemMgmtSetup.msi',Variable=System.Management.Automation.PSVariable[](1),Function=System.Management.Automation.Funct
ionInfo[](1))
VERBOSE: Executing lab command activity 'Installation of 'C:\OemMgmtSetup.msi'' on machines 'OMS'
VERBOSE: Get-LabVM Entering... (IncludeLinux=True)
VERBOSE: Get-LabVM Entering... (ComputerName=OMS,IncludeLinux=True)
VERBOSE: Get-LabVM Entering... (ComputerName=OMS,IncludeLinux=True)
VERBOSE: Get-LabVMStatus...leaving...(Time elapsed: 00:00:00:031)
VERBOSE: Creating session to computer(s) 'OMS'
VERBOSE: New-LabPSSession Entering...
(ComputerName=OMS,DoNotUseCredSsp=,UseLocalCredential=,Credential=)
VERBOSE: Get-LabVM Entering... (ComputerName=OMS,IncludeLinux=True)
VERBOSE: Connecting to machine 'OMS' using the DNS name 'OMS'
VERBOSE: Creating a new PSSession to machine 'OMS:5985' (UserName='OMS\Administrator', Password='Somepass1',
DoNotUseCredSsp='False')
VERBOSE: Get-LabVM Entering... (ComputerName=OMS)
VERBOSE: Session OMS_535d5d45-da02-43b0-8d2c-3fd94db2b30f is available and will be reused
VERBOSE: New-LabPSSession...leaving - return value is 'Session IDs: 6'...(Time elapsed: 00:00:00:015)
VERBOSE: Adding functions 'Install-SoftwarePackage' to session
You must provide a value expression on the right-hand side of the '-' operator.
+ CategoryInfo : ParserError: (:) [Set-Item], ParseException
+ FullyQualifiedErrorId : ExpectedValueExpression,Microsoft.PowerShell.Commands.SetItemCommand
+ PSComputerName : OMS

VERBOSE: Adding variables 'System.Management.Automation.LocalVariable' to session
VERBOSE: Invoke-LWCommand Entering...
(AsJob=True,DependencyFolderPath=D:\LabSources\SoftwarePackages\OemMgmtSetup.msi,ComputerName=OMS,Retries=3,PassThru=Tr
ue,ScriptBlock=
Install-SoftwarePackage @installParams

,Verbose=True,Session=System.Management.Automation.Runspaces.PSSession[](1),RetryIntervalInSeconds=10,ActivityName=Inst
allation of 'C:\OemMgmtSetup.msi')
VERBOSE: Starting Activity 'Installation of 'C:\OemMgmtSetup.msi''
VERBOSE: Copying files from 'D:\LabSources\SoftwarePackages\OemMgmtSetup.msi' to OMS...
VERBOSE: Finished Installation Activity 'Installation of 'C:\OemMgmtSetup.msi''
VERBOSE: Invoke-LWCommand...leaving...(Time elapsed: 00:00:00:195)
VERBOSE: Invoke-LabCommand...leaving...(Time elapsed: 00:00:00:207)
VERBOSE: Waiting on job ID '332' with name 'Installation of 'C:\OemMgmtSetup.msi''
..
Write-Error : The term 'Install-SoftwarePackage' 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\AutomatedLabWorker\5.1.0.115\AutomatedLabWorker.psm1:895 char:17
+ Write-Error -ErrorRecord $jobError
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Install-SoftwarePackage:String) [Write-Error], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

VERBOSE: Job ID '' with name '' finished
13:22:36|22:55:11|00:00:14.326| - Installation done
VERBOSE: Install-LabSoftwarePackage...leaving...(Time elapsed: 00:00:00:060)
```

The host is Windows 10 Pro, 1803 PowerShell 5.1.17134.228, AutomatedLab 5.1.0.115

Lab details:
```
PS C:\Users\adams\Documents> Show-LabDeploymentSummary -Detailed
14:58:32|00:31:07|00:13:04.138| ---------------------------------------------------------------------------
14:58:32|00:31:07|00:13:04.147| Setting up the lab took 0 hour, 31 minutes and 7 seconds
14:58:32|00:31:07|00:13:04.154| Lab name is 'OmsInstallation' and is hosted on 'HyperV'. There are 1 machine(s) and 1 ne
twork(s) defined.
14:58:32|00:31:07|00:13:04.161|
14:58:32|00:31:07|00:13:04.169| ----------------------------- Network Summary -----------------------------
14:58:32|00:31:07|00:13:04.197|
14:58:32|00:31:07|00:13:04.205| Name AddressSpace SwitchType AdapterName IssuedIpAddresses
14:58:32|00:31:07|00:13:04.213| ---- ------------ ---------- ----------- -----------------
14:58:32|00:31:07|00:13:04.220| OmsInstallation 192.168.11.0/24 Internal 1
14:58:32|00:31:07|00:13:04.228|
14:58:32|00:31:07|00:13:04.235|
14:58:32|00:31:07|00:13:04.242| ----------------------------- Domain Summary ------------------------------
14:58:32|00:31:07|00:13:04.253| ------------------------- Virtual Machine Summary -------------------------
14:58:32|00:31:07|00:13:04.285|
14:58:32|00:31:07|00:13:04.292| Name DomainName IpAddress Roles OperatingSystem Local Admin Password
14:58:32|00:31:07|00:13:04.298| ---- ---------- --------- ----- --------------- ----------- --------
14:58:32|00:31:07|00:13:04.309| OMS {192.168.11.0/24} {} Windows 7 Professional Administrator Somepass1
14:58:32|00:31:07|00:13:04.315|
14:58:32|00:31:07|00:13:04.323|
14:58:32|00:31:07|00:13:04.329| ---------------------------------------------------------------------------
14:58:32|00:31:07|00:13:04.336| Please use the following cmdlets to interact with the machines:
14:58:33|00:31:07|00:13:04.344| - Get-LabVMStatus, Get, Start, Restart, Stop, Wait, Connect, Save-LabVM and Wait-LabVMRe
start (some of them provide a Wait switch)
14:58:33|00:31:07|00:13:04.351| - Invoke-LabCommand, Enter-LabPSSession, Install-LabSoftwarePackage and Install-LabWindo
wsFeature (do not require credentials and
14:58:33|00:31:07|00:13:04.357| work the same way with Hyper-V and Azure)
14:58:33|00:31:07|00:13:04.363| - Checkpoint-LabVM, Restore-LabVMSnapshot and Get-LabVMSnapshot (only for Hyper-V)
14:58:33|00:31:07|00:13:04.369| - Get-LabInternetFile downloads files from the internet and places them on LabSources (l
ocally or on Azure)
14:58:33|00:31:07|00:13:04.377| ---------------------------------------------------------------------------
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.