{"id":241,"date":"2019-07-16T09:35:14","date_gmt":"2019-07-16T13:35:14","guid":{"rendered":"http:\/\/www.thelamberts.com\/wiki\/?p=241"},"modified":"2019-10-11T15:55:08","modified_gmt":"2019-10-11T19:55:08","slug":"load-exchange-powershell-management-shell-into-ise","status":"publish","type":"post","link":"http:\/\/www.thelamberts.com\/wiki\/2019\/07\/16\/load-exchange-powershell-management-shell-into-ise\/","title":{"rendered":"Load Exchange Powershell Management Shell into ISE"},"content":{"rendered":"\n<p><strong>First start by forcing the creation of your PowerShell ISE profile file if it doesn&#8217;t exist<\/strong><\/p>\n\n\n<p><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">if (!(Test-Path -Path $PROFILE ))&amp;amp;lt;br&amp;amp;gt;&amp;lt;br&amp;gt;&lt;br&gt;\n{ New-Item -Type File -Path $PROFILE -Force }<\/pre><\/p>\n\n\n<p><strong>Second, within your ISE console, type the following<\/strong><\/p>\n\n\n<p><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">psEdit $profile<\/pre><\/p>\n\n\n<p><strong>In the script pane, just copy\/paste the below blue script<\/strong><\/p>\n\n\n\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n$StopWatch = &#x5B;System.Diagnostics.StopWatch]::StartNew()\n\nFunction Test-Command ($Command)\n\n{\n\nTry\n\n{\n\nGet-command $command -ErrorAction Stop\n\nReturn $True\n\n}\n\nCatch &#x5B;System.SystemException]\n\n{\n\nReturn $False\n\n}\n\n}\n\n\nIF (Test-Command &quot;Get-Mailbox&quot;) {Write-Host &quot;Exchange cmdlets already present&quot;}\n\nElse {\n\n$CallEMS = &quot;. '$env:ExchangeInstallPath\\bin\\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell &quot;\n\nInvoke-Expression $CallEMS\n\n\n$stopwatch.Stop()\n$msg = &quot;`n`nThe script took $(&#x5B;math]::round($($StopWatch.Elapsed.TotalSeconds),2)) seconds to execute...&quot;\nWrite-Host $msg\n$msg = $null\n$StopWatch = $null\n\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"First start by forcing the creation of your PowerShell ISE profile file if it doesn&#8217;t exist if (!(Test-Path -Path $PROFILE ))&amp;amp;lt;br&amp;amp;gt;&amp;lt;br&amp;gt;&lt;br&gt; { New-Item -Type File -Path $PROFILE -Force } Second, within your ISE console, type the following psEdit $profile In the script pane, just copy\/paste the below blue script $StopWatch = &#x5B;System.Diagnostics.StopWatch]::StartNew() Function Test-Command ($Command) [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,1],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-exchange","category-powershell","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":10,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":267,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/posts\/241\/revisions\/267"}],"wp:attachment":[{"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thelamberts.com\/wiki\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}