nuovo script per veeam OVH - mount B

This commit is contained in:
marco.locatelli@steamware.net
2024-06-20 12:33:58 +02:00
parent 9b7f39b478
commit fd82959253
+25
View File
@@ -0,0 +1,25 @@
###SCRIPT PER MOUNT DISCO B (VHDX REMOTO)###
$hostname = hostname
$date = Get-Date
$filePath = "C:\Steamware\Log\" + $hostname + "_Mount_B.log"
$intestazione = $hostname + " " + $date
#diskpath varia in base alla singola macchina veeam
$diskpath = "\\ovh-hv13\v$\backup\bckhv15.vhdx"
#verifico se esiste file di log, se non esiste lo creo e scrivo intestazione
if(!(Test-Path -Path $filePath)) {
Out-File -FilePath $filePath -InputObject $intestazione
}
else {
Out-File -FilePath $filePath -InputObject $intestazione -Append
}
#verifico se è presente disco B:, se assente eseguo Mount-Diskimage per montarlo
if(!(Test-Path -Path "B:")) {
Mount-DiskImage -ImagePath $diskpath
Out-File -FilePath $filePath -InputObject "Eseguito Mount-Diskimage per disco B:" -Append
}
else {
Out-File -FilePath $filePath -InputObject "Disco B: già montato" -Append
}