<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual Studio Code | KC's Blog</title>
	<atom:link href="https://www.kjctech.net/tag/visual-studio-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.kjctech.net</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jan 2023 18:20:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/www.kjctech.net/wp-content/uploads/2016/12/cropped-KC-Logo.png?fit=32%2C32&#038;ssl=1</url>
	<title>Visual Studio Code | KC's Blog</title>
	<link>https://www.kjctech.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">24634607</site>	<item>
		<title>Fixing Visual Studio Code Failed to Run PowerShell Scripts</title>
		<link>https://www.kjctech.net/fixing-visual-studio-code-failed-to-run-powershell-scripts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fixing-visual-studio-code-failed-to-run-powershell-scripts</link>
					<comments>https://www.kjctech.net/fixing-visual-studio-code-failed-to-run-powershell-scripts/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Thu, 03 Oct 2019 23:56:10 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=4409</guid>

					<description><![CDATA[<p>After a Visual Studio Code update the other day, all the PowerShell scripts refusing to run due to a &#8220;Language server startup failed&#8221;. Both reinstalling Visual Studio Code and PowerShell extension didn&#8217;t do anything to fix it. And guess what to blame, the Digital Certificate, because it&#8217;s not trusted. Thanks to this thread on Github. Here is how to fix [&#8230;]</p>
The post <a href="https://www.kjctech.net/fixing-visual-studio-code-failed-to-run-powershell-scripts/">Fixing Visual Studio Code Failed to Run PowerShell Scripts</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>After a Visual Studio Code update the other day, all the PowerShell scripts refusing to run due to a &#8220;Language server startup failed&#8221;. Both reinstalling Visual Studio Code and PowerShell extension didn&#8217;t do anything to fix it.</p>



<p>And guess what to blame, the Digital Certificate, because it&#8217;s not trusted. Thanks to <a rel="noreferrer noopener" aria-label="this thread (opens in a new tab)" href="https://github.com/PowerShell/vscode-powershell/issues/1360" target="_blank">this thread</a> on Github. </p>



<p>Here is how to fix it:</p>



<p>Navigate to the following location:</p>



<pre class="wp-block-preformatted">%userprofile%\.vscode\extensions\ms-vscode.powershell-versionxxx\modules\PowerShellEditorServices</pre>



<p>Right-click the file <strong><em>Start-EditorServices.ps1</em></strong> and choose <strong>Properties</strong>.</p>



<p>Switch to <strong>Digital Signatures </strong>tab, highlight the digital certificate listed in there and click <strong>Details</strong>.</p>



<figure class="wp-block-image"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="405" height="509" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image.png?resize=405%2C509&#038;ssl=1" alt="" class="wp-image-4410" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image.png?w=405&amp;ssl=1 405w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image.png?resize=250%2C314&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image.png?resize=360%2C452&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image.png?resize=100%2C126&amp;ssl=1 100w" sizes="(max-width: 405px) 100vw, 405px" /></figure>



<p>Click <strong>View Certificate</strong>, go to the <strong>Details</strong> tab on the dialog box that pops up.</p>



<figure class="wp-block-image"><img decoding="async" width="908" height="641" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?fit=600%2C424&amp;ssl=1" alt="" class="wp-image-4411" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?w=908&amp;ssl=1 908w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=250%2C176&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=450%2C318&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=768%2C542&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=600%2C424&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=700%2C494&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=520%2C367&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=360%2C254&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-1.png?resize=100%2C71&amp;ssl=1 100w" sizes="(max-width: 640px) 100vw, 640px" /></figure>



<p>Click <strong>Copy to File&#8230;</strong>, follow the wizard to save a file with .CER extension.</p>



<p>Now, open the Certificate MMC and import the saved .CER certificate file into the Trusted Publishers Certificate Store, either in the User account or Local Machine.</p>



<figure class="wp-block-image"><img decoding="async" width="796" height="470" src="https://i2.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?fit=600%2C354&amp;ssl=1" alt="" class="wp-image-4412" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?w=796&amp;ssl=1 796w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=250%2C148&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=450%2C266&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=768%2C453&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=600%2C354&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=700%2C413&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=520%2C307&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=360%2C213&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/10/image-2.png?resize=100%2C59&amp;ssl=1 100w" sizes="(max-width: 640px) 100vw, 640px" /></figure>



<p>Re-open Visual Studio Code and you should be able to run any PowerShell scripts by now.</p>The post <a href="https://www.kjctech.net/fixing-visual-studio-code-failed-to-run-powershell-scripts/">Fixing Visual Studio Code Failed to Run PowerShell Scripts</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/fixing-visual-studio-code-failed-to-run-powershell-scripts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4409</post-id>	</item>
		<item>
		<title>Setting Up Visual Studio Code for PowerShell</title>
		<link>https://www.kjctech.net/setting-up-visual-studio-code-for-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-visual-studio-code-for-powershell</link>
					<comments>https://www.kjctech.net/setting-up-visual-studio-code-for-powershell/#respond</comments>
		
		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Fri, 08 Mar 2019 01:06:11 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Visual Studio Code]]></category>
		<guid isPermaLink="false">https://www.kjctech.net/?p=4252</guid>

					<description><![CDATA[<p>After watching a webinar recently where the presenter was using Visual Studio Code to run PowerShell codes he prepared for the demo, it strikes me that maybe it&#8217;s time to ditch PowerShell ISE and start using Visual Studio Code for all my coding needs. Setting up VS Code for PowerShell turns out super easy. First, download VS Code from https://code.visualstudio.com [&#8230;]</p>
The post <a href="https://www.kjctech.net/setting-up-visual-studio-code-for-powershell/">Setting Up Visual Studio Code for PowerShell</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></description>
										<content:encoded><![CDATA[<p>After watching a webinar recently where the presenter was using Visual Studio Code to run PowerShell codes he prepared for the demo, it strikes me that maybe it&#8217;s time to ditch PowerShell ISE and start using Visual Studio Code for all my coding needs.</p>



<p>Setting up VS Code for PowerShell turns out super easy.</p>



<p>First, download <strong>VS Code</strong> from <a rel="noreferrer noopener" aria-label="https://code.visualstudio.com (opens in a new tab)" href="https://code.visualstudio.com" target="_blank">https://code.visualstudio.com</a> and install it, if you haven&#8217;t done so.</p>



<p>Then, launch <strong><g class="gr_ gr_3 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="3" data-gr-id="3">VS</g> Code</strong> and head over to the <strong>Extension</strong> menu on the left or press <strong>Ctrl + Shift + X</strong>.</p>



<figure class="wp-block-image"><img data-recalc-dims="1" loading="lazy" decoding="async" width="344" height="363" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-4.png?resize=344%2C363&#038;ssl=1" alt="" class="wp-image-4253" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-4.png?w=344&amp;ssl=1 344w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-4.png?resize=250%2C264&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-4.png?resize=100%2C106&amp;ssl=1 100w" sizes="auto, (max-width: 344px) 100vw, 344px" /></figure>



<p>Search for &#8220;PowerShell&#8221; in the list, select it and click Install on the right side.</p>



<figure class="wp-block-image"><a href="//i0.wp.com/kjctech.net/wp-content/uploads/2019/03/image-5.png" data-rel="lightbox-image-0" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" width="1037" height="362" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?fit=600%2C209&amp;ssl=1" alt="" class="wp-image-4257" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?w=1037&amp;ssl=1 1037w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=250%2C87&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=450%2C157&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=768%2C268&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=600%2C209&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=700%2C244&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=520%2C182&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=360%2C126&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-5.png?resize=100%2C35&amp;ssl=1 100w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></figure>



<p>Believe it or not, there are almost 6 million downloads already as of today. It seems there are more than enough people really into using Visual Studio Code for PowerShell as well.</p>



<p>Open Settings menu and make sure <strong>PowerShell:Start Automatically</strong> is checked so the extension starts automatically when a PowerShell file opens.</p>



<figure class="wp-block-image"><a href="//i0.wp.com/kjctech.net/wp-content/uploads/2019/03/image-6.png" data-rel="lightbox-image-1" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" width="889" height="371" src="https://i2.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?fit=600%2C250&amp;ssl=1" alt="" class="wp-image-4258" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?w=889&amp;ssl=1 889w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=250%2C104&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=450%2C188&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=768%2C321&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=600%2C250&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=700%2C292&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=520%2C217&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=360%2C150&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-6.png?resize=100%2C42&amp;ssl=1 100w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></figure>



<p>And that&#8217;s all you need to get it started.</p>



<p>Right off the bat, there are two ways to run the code you wrote. You can highlight the code you want to run, either full or part of it, right-click anywhere in the window and choose <strong>Run Selection</strong> or simply press <strong>F8</strong> key.</p>



<figure class="wp-block-image"><a href="//i0.wp.com/kjctech.net/wp-content/uploads/2019/03/image-7.png" data-rel="lightbox-image-2" data-rl_title="" data-rl_caption="" title=""><img data-recalc-dims="1" loading="lazy" decoding="async" width="591" height="400" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?resize=591%2C400&#038;ssl=1" alt="" class="wp-image-4259" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?w=591&amp;ssl=1 591w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?resize=250%2C169&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?resize=450%2C305&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?resize=520%2C352&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?resize=360%2C244&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-7.png?resize=100%2C68&amp;ssl=1 100w" sizes="auto, (max-width: 591px) 100vw, 591px" /></a></figure>



<p>Or, press <strong>Ctrl + Shift + P</strong> to bring up the <strong>Command Palette</strong> and choose <strong>Terminal: Run Active File in Active Terminal</strong>.</p>



<figure class="wp-block-image"><a href="//i0.wp.com/kjctech.net/wp-content/uploads/2019/03/image-8.png" data-rel="lightbox-image-3" data-rl_title="" data-rl_caption="" title=""><img loading="lazy" decoding="async" width="875" height="290" src="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?fit=600%2C199&amp;ssl=1" alt="" class="wp-image-4260" srcset="https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?w=875&amp;ssl=1 875w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=250%2C83&amp;ssl=1 250w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=450%2C149&amp;ssl=1 450w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=768%2C255&amp;ssl=1 768w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=600%2C199&amp;ssl=1 600w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=700%2C232&amp;ssl=1 700w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=520%2C172&amp;ssl=1 520w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=360%2C119&amp;ssl=1 360w, https://i0.wp.com/www.kjctech.net/wp-content/uploads/2019/03/image-8.png?resize=100%2C33&amp;ssl=1 100w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></figure>



<p>As to why VS Code over PowerShell ISE, check out <a href="https://www.learnpwsh.com/setup-vs-code-for-powershell/" target="_blank" rel="noreferrer noopener" aria-label="this post (opens in a new tab)">this post</a> from Learn PowerShell.</p>The post <a href="https://www.kjctech.net/setting-up-visual-studio-code-for-powershell/">Setting Up Visual Studio Code for PowerShell</a> first appeared on <a href="https://www.kjctech.net">KC's Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://www.kjctech.net/setting-up-visual-studio-code-for-powershell/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4252</post-id>	</item>
	</channel>
</rss>
