Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

27 lignes
700B

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

Powered by TurnKey Linux.