powershell升級cellreport

$old_path="20220802"
$new_path="20220808"

Import-Module WebAdministration



mv "D:\web\cellReport\$new_path\static" "D:\web\cellReport\$new_path\reportWeb" -Force
mv "D:\web\cellReport\$new_path\wwwroot" "D:\web\cellReport\$new_path\reportWeb" -Force



$arrcolors = "report.db","report.db-shm","report.db-wal"  
for($i=0; $i -lt $arrcolors.Length; $i++)   
{   
    cp "D:\web\cellReport\$old_path\reportWeb\report.db"  "D:\web\cellReport\$new_path\reportWeb"
    $file=$arrcolors[$i];
    #"D:\web\cellReport\$new_path\reportWeb\$file"
    $acl = Get-Acl "D:\web\cellReport\$new_path\reportWeb\$file"
    $arrcolors[$i]
    $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","Allow")
    $acl.SetAccessRule($accessRule)
    $acl | Set-Acl "D:\web\cellReport\$new_path\reportWeb\$file"

}



Set-ItemProperty "iis:\sites\cellreport" -Name physicalpath -Value "D:\web\cellReport\$new_path\reportWeb"
c:\windows\system32\inetsrv\appcmd recycle apppool /apppool.name:"cellreport"

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章