{"id":994,"date":"2022-12-12T15:24:42","date_gmt":"2022-12-12T18:24:42","guid":{"rendered":"http:\/\/jonescarvalho.com\/Blog\/?p=994"},"modified":"2022-12-12T15:25:42","modified_gmt":"2022-12-12T18:25:42","slug":"check-and-up-pool-iis","status":"publish","type":"post","link":"https:\/\/jonescarvalho.com\/Blog\/?p=994","title":{"rendered":"Check and up pool IIS"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code># Load IIS module:\nImport-Module WebAdministration\n \n# SET AppPool Name\n$AppPoolName = \"DefaultAppPool\"\n \n#Testing if a String is NULL or EMPTY.\nif (&#91;string]::IsNullOrWhiteSpace($AppPoolName))\n{\nWrite-Output \"$AppPoolName does not exist\"\n}\nelse \n{\ntry {\n#Determines whether all elements of a file or directory path exist.\nif (Test-Path IIS:\\AppPools\\$AppPoolName){\n# Start App Pool if stopped else restart\n#Get the runtime state of the DefaultAppPool and checking the status\nif ((Get-WebAppPoolState($AppPoolName)).Value -eq \"Stopped\"){\nWrite-Output \"Starting IIS app pool\"\n#starting the App Pool\nStart-WebAppPool $AppPoolName\n}\nelse {\nWrite-Output \"Application pool is Running successfully\"\n}\n}\n}\ncatch {\nWrite-Output $_.Exception.Message\nthrow\n}  \n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-994","post","type-post","status-publish","format-standard","hentry","category-dicas"],"_links":{"self":[{"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/994"}],"collection":[{"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=994"}],"version-history":[{"count":3,"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/994\/revisions"}],"predecessor-version":[{"id":997,"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=\/wp\/v2\/posts\/994\/revisions\/997"}],"wp:attachment":[{"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=994"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=994"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jonescarvalho.com\/Blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=994"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}