您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
702B

  1. [CmdletBinding()]
  2. param(
  3. [string]$ProjectRoot = (Split-Path -Parent $PSScriptRoot)
  4. )
  5. $components = @(
  6. (Join-Path $ProjectRoot 'Controllers\HomeController.wsc'),
  7. (Join-Path $ProjectRoot 'Framework\Application.wsc')
  8. )
  9. foreach ($path in $components) {
  10. if (-not (Test-Path $path)) {
  11. Write-Warning "Component not found, skipping: $path"
  12. continue
  13. }
  14. Write-Output "Unregistering $path"
  15. $proc = Start-Process -FilePath 'regsvr32.exe' -ArgumentList "/s /u `"$path`"" -PassThru -Wait -WindowStyle Hidden
  16. if ($proc.ExitCode -ne 0) {
  17. throw "regsvr32 /u failed for $path (exit $($proc.ExitCode))"
  18. }
  19. }
  20. Write-Output "All WSC-MVC components unregistered."

Powered by TurnKey Linux.