如何在双引号字符串中使用对象的属性?
$DatabaseSettings = @();$NewDatabaseSetting = "" | select DatabaseName, DataFile, LogFile, LiveBackupPath;$NewDatabaseSetting. DatabaseName = "LiveEmployees_PD";$NewDatabaseSetting.DataFile = "LiveEmployees_PD_Data";$NewDatabaseSetting.LogFile = "LiveEmployees_PD_Log"; $NewDatabaseSetting.LiveBackupPath = '\\LiveServer\LiveEmployeesBackups';$DatabaseSettings += $NewDatabaseSetting;
& "$SQlBackupExePath\SQLBackupC.exe" -I $InstanceName -SQL ` "RESTORE DATABASE $DatabaseSettings[0].DatabaseName FROM DISK = '$tempPath\$LatestFullBackupFile' WITH NORECOVERY, REPLACE, MOVE '$DataFileName' TO '$DataFilegroupFolder\$DataFileName.mdf', MOVE '$LogFileName' TO '$LogFilegroupFolder\$LogFileName.ldf'"
$DatabaseSettings
$DatabaseSettings[0].DatabaseName
慕后森
慕姐4208626
相关分类