Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #=======================================
  2. # Addtional IIS set up
  3. # 1. Creates new App pools
  4. # 2. Creates new Applications on App server
  5. #=======================================
  6. param($createUnderWebsite, $webSiteName, $physicalPath)
  7. Try
  8. {
  9.  
  10. if(!(Test-Path $physicalPath))
  11. {
  12. New-Item -ItemType directory -Path $physicalPath -ErrorAction Continue
  13. }
  14.  
  15. New-WebAppPool -Force $webSiteName -ErrorAction Continue
  16.  
  17. New-WebApplication -Name $webSiteName -Site $createUnderWebsite -PhysicalPath $physicalPath -ApplicationPool $webSiteName -Force
  18.  
  19.  
  20. }
  21. Catch {
  22. "Exception Message: $($_.Exception.Message)"
  23.  
  24. }
  25. finally {
  26. #"List App Pools"
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement