-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequirements.psd1
More file actions
68 lines (60 loc) · 2.11 KB
/
Copy pathrequirements.psd1
File metadata and controls
68 lines (60 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@{
# PowerShell module requirements for VMware Tools Auto-Upgrade solution
# Required PowerShell version
PowerShellVersion = '5.1'
# Required modules
RequiredModules = @(
@{
ModuleName = 'VMware.PowerCLI'
ModuleVersion = '13.0.0'
Repository = 'PSGallery'
},
@{
ModuleName = 'Pester'
ModuleVersion = '5.0.0'
Repository = 'PSGallery'
}
)
# Optional modules for enhanced functionality
OptionalModules = @(
@{
ModuleName = 'PSScriptAnalyzer'
ModuleVersion = '1.21.0'
Repository = 'PSGallery'
Purpose = 'Code quality analysis'
},
@{
ModuleName = 'ImportExcel'
ModuleVersion = '7.8.0'
Repository = 'PSGallery'
Purpose = 'Excel report generation'
}
)
# Installation script
InstallScript = @'
# Install required PowerShell modules
Write-Host "Installing required PowerShell modules..." -ForegroundColor Green
# Install PowerCLI
if (-not (Get-Module -ListAvailable -Name VMware.PowerCLI)) {
Install-Module -Name VMware.PowerCLI -Scope CurrentUser -Force -AllowClobber
Write-Host "✓ VMware PowerCLI installed" -ForegroundColor Green
} else {
Write-Host "✓ VMware PowerCLI already installed" -ForegroundColor Yellow
}
# Install Pester for testing
if (-not (Get-Module -ListAvailable -Name Pester)) {
Install-Module -Name Pester -Scope CurrentUser -Force -SkipPublisherCheck
Write-Host "✓ Pester testing framework installed" -ForegroundColor Green
} else {
Write-Host "✓ Pester already installed" -ForegroundColor Yellow
}
# Optional: Install PSScriptAnalyzer for code quality
if (-not (Get-Module -ListAvailable -Name PSScriptAnalyzer)) {
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force
Write-Host "✓ PSScriptAnalyzer installed" -ForegroundColor Green
} else {
Write-Host "✓ PSScriptAnalyzer already installed" -ForegroundColor Yellow
}
Write-Host "Module installation completed!" -ForegroundColor Green
'@
}