Files
2025-05-09 16:49:09 -04:00

28 lines
890 B
PowerShell

# Install the PSProxmox module to the current user's module directory
# Get the latest release
$releaseDir = Get-ChildItem -Path "$PSScriptRoot\..\Release" -Directory | Sort-Object Name -Descending | Select-Object -First 1
if (-not $releaseDir) {
Write-Error "No release found. Please build the module first."
exit 1
}
$modulePath = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules\PSProxmox"
# Create the module directory if it doesn't exist
if (-not (Test-Path $modulePath)) {
New-Item -Path $modulePath -ItemType Directory -Force | Out-Null
}
# Copy the module files
Copy-Item -Path "$PSScriptRoot\..\Module\*" -Destination $modulePath -Recurse -Force
Write-Host "PSProxmox module installed to $modulePath"
# Import the module
Import-Module PSProxmox -Force
# List the cloud image cmdlets
Get-Command -Module PSProxmox | Where-Object { $_.Name -like "*Cloud*" }