25 lines
889 B
PowerShell
25 lines
889 B
PowerShell
###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 = ###SCRIVERE PATH NECESSARIO
|
|
|
|
#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
|
|
} |