nuovo script per veeam OVH - mount B
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user