diff --git a/MapUnmapDrive/VeeamOvhMountB.ps1 b/MapUnmapDrive/VeeamOvhMountB.ps1 new file mode 100644 index 0000000..e839805 --- /dev/null +++ b/MapUnmapDrive/VeeamOvhMountB.ps1 @@ -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 + } \ No newline at end of file