You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Currently I am using this Powershell script which runs before deployment.
$Password=Convertto-SecureString -String ${bamboo.deploy.password} -AsPlainText -force
$Credentials=New-object System.Management.Automation.PSCredential ${bamboo.deploy.username},$Password
Enter-PSSession -ComputerName ${Server} -Credential $Credentials
Invoke-Command -ScriptBlock {start cmd;cd C:\Windows\System32\inetsrv;appcmd stop apppool /apppool.name:"${app_pool_name}"}
But it gives the following error:
The term 'appcmd' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
I have also tried using the Stop-WebAppPool cmdlet. It also gave an error saying Stop-WebAppPool is not recognized as the name of any cmdlet. I have also tried Import-Module WebAdministration before Stop-WebAppPool cmdlet. It also was not successful.
Hi @l.aizdi,
Sorry no one has been able to help you with this issue yet.
Looking at it, my first thought would be to check what Powershell modules are installed/imported on your web server.
Stop-WebAppPool is not a part of the standard Powershell library. It's part of the WebAdministration Module which would need to be imported ahead of running the command.
What you can do, is add an if block to check if the WebAdministration module exists, and if not run:
Import-Module WebAdministration
I understand you may have solved this already but if not, I hope that might help you out.
-Jimmy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.