Version 1.0 of Configure
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
function Get-HyperVInventory {
|
||||
param([Parameter(Mandatory)][string]$Server)
|
||||
|
||||
foreach($Name in @("Get-VBRServer", "Find-VBRHvEntity")) {
|
||||
if($null -eq (Get-Command $Name -ErrorAction SilentlyContinue)) {
|
||||
throw "Veeam-Befehl nicht verfügbar: $Name"
|
||||
}
|
||||
}
|
||||
|
||||
$VBRServer = Get-VBRServer -Name $Server |
|
||||
Where-Object { $_.Type -in @("HvServer", "HvCluster", "Scvmm") } |
|
||||
Select-Object -First 1
|
||||
|
||||
if($null -eq $VBRServer) {
|
||||
throw "Hyper-V-Server ist in Veeam nicht registriert: $Server"
|
||||
}
|
||||
|
||||
@(Find-VBRHvEntity -Server $VBRServer -HostsAndVMs |
|
||||
Where-Object { $_.Type -match "Vm" } |
|
||||
Select-Object -ExpandProperty Name -Unique)
|
||||
}
|
||||
|
||||
Export-ModuleMember -Function Get-HyperVInventory
|
||||
Reference in New Issue
Block a user