Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to start/stop Website and application pool on another server while deploying my project?


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 /"${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.

1 answer

0 votes
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jul 02, 2021

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.


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events