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"

 

posted on 2022-08-09 15:33  隨風.NET  阅读(33)  评论(0编辑  收藏  举报

导航