mirror of
https://github.com/Grace-Solutions/PSProxmox.git
synced 2026-07-26 08:18:19 +00:00
28 lines
890 B
PowerShell
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*" }
|