<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Powershell on Nerdsid.com</title><link>https://nerdsid.com/tags/powershell/</link><description>Recent content in Powershell on Nerdsid.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 08 Apr 2026 05:17:46 +0000</lastBuildDate><atom:link href="https://nerdsid.com/tags/powershell/index.xml" rel="self" type="application/rss+xml"/><item><title>Kill Any Process Using a Port in Powershell</title><link>https://nerdsid.com/posts/kill-any-process-using-a-port-in-powershell/</link><pubDate>Wed, 08 Apr 2026 05:17:46 +0000</pubDate><guid>https://nerdsid.com/posts/kill-any-process-using-a-port-in-powershell/</guid><description>&lt;p>Recently I wanted to start a server in port 8899 &amp;amp; I got an error telling that some other process is using it.&lt;/p>
&lt;p>Here is a one-liner you can use to kill an existing process bound to a port.&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 POWERSHELL
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">Stop-Process&lt;/span> &lt;span class="n">-Id&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nb">Get-NetTCPConnection&lt;/span> &lt;span class="n">-LocalPort&lt;/span> &lt;span class="mf">8899&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="py">OwningProcess&lt;/span> &lt;span class="n">-Force&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div></description></item><item><title>Demystifying PowerShell Versions and Editions</title><link>https://nerdsid.com/posts/demystifying-powershell-versions-and-editions/</link><pubDate>Sun, 30 Apr 2023 05:27:57 +0000</pubDate><guid>https://nerdsid.com/posts/demystifying-powershell-versions-and-editions/</guid><description>&lt;h2 id="what-does-the-name-powershell-refer-to">What does the name PowerShell refer to?&lt;/h2>
&lt;p>PowerShell is a command-line shell and scripting language that is built on top of the .NET Framework. It can be used to automate tasks, deal with structured data (e.g. JSON, CSV, XML, etc.), interact with REST APIs, and more.&lt;/p>
&lt;p>Powershell is available in two editions: Desktop and Core. The Desktop edition is available on Windows 7/8/10/11, Windows Server 2019/2022, and in later versions of Windows. The Core edition is cross-platform and is available on Windows, macOS, and Linux. &lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>&lt;/p></description></item><item><title>How to Uninstall the NuGet Package Provider: PowerShell Guide</title><link>https://nerdsid.com/posts/uninstall-nuget-package-provider-powershell/</link><pubDate>Mon, 20 Feb 2023 08:01:00 +0000</pubDate><guid>https://nerdsid.com/posts/uninstall-nuget-package-provider-powershell/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>I happened to install the NuGet Package Provider on my Windows 10 machine. I was prompted to install it when I tried to install the &lt;code>Tree&lt;/code> module (using the &lt;code>Install-Module&lt;/code> cmdlet). But later I realised that I didn’t need the Tree module. So I wanted to uninstall it. I couldn&amp;rsquo;t find any documentation on how to uninstall it. So I decided to write this article to help others who might be facing the same problem.&lt;/p></description></item><item><title>Equivalent of Linux Commands in Powershell</title><link>https://nerdsid.com/posts/equivalent-of-linux-commands-in-powershell/</link><pubDate>Wed, 26 Oct 2022 17:54:30 +0530</pubDate><guid>https://nerdsid.com/posts/equivalent-of-linux-commands-in-powershell/</guid><description>&lt;p>Being an avid linux user, I am used to the linux commands. But I often work on a windows machine, which is when I look for powershell equivalent of linux commands.&lt;/p>
&lt;p>I created this post to keep a track of the commands that I use often.&lt;/p>
&lt;h2 id="well-known-linux-commands-and-their-powershell-equivalents">Well-known linux commands and their powershell equivalents&lt;/h2>
&lt;p>The PowerShell commands for working with the file system are same as that of linux ones. You navigate around the file system with the &lt;code>cd&lt;/code> (alias for &lt;code>Set-Location&lt;/code>) command.&lt;/p></description></item><item><title>Powershell - Get Hashes of All Files in a Directory</title><link>https://nerdsid.com/posts/powershell-get-hashes-of-all-files-in-a-directory/</link><pubDate>Tue, 25 Oct 2022 00:00:00 +0530</pubDate><guid>https://nerdsid.com/posts/powershell-get-hashes-of-all-files-in-a-directory/</guid><description>&lt;h2 id="code">Code&lt;/h2>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 POWERSHELL
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="k">param&lt;/span> &lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$folders&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="vm">@&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;D:\hash\&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="c">#case sensitive&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nv">$allFiles&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="k">foreach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$folder&lt;/span> &lt;span class="k">in&lt;/span> &lt;span class="nv">$folders&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">Get-Childitem&lt;/span> &lt;span class="n">-path&lt;/span> &lt;span class="nv">$folder&lt;/span> &lt;span class="n">-recurse&lt;/span> &lt;span class="p">|&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">Select-Object&lt;/span> &lt;span class="n">FullName&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="n">Name&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="n">Length&lt;/span> &lt;span class="p">|&lt;/span> 
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">ForEach-Object&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$hash_SHA384&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nb">Get-FileHash&lt;/span> &lt;span class="n">-Algorithm&lt;/span> &lt;span class="n">SHA384&lt;/span> &lt;span class="nv">$_&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">FullName&lt;/span> &lt;span class="c"># compute sha384 hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$hash_SHA256&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nb">Get-FileHash&lt;/span> &lt;span class="n">-Algorithm&lt;/span> &lt;span class="n">SHA256&lt;/span> &lt;span class="nv">$_&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">FullName&lt;/span> &lt;span class="c"># compute sha256 hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$hash_MD5&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nb">Get-FileHash&lt;/span> &lt;span class="n">-Algorithm&lt;/span> &lt;span class="n">MD5&lt;/span> &lt;span class="nv">$_&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">FullName&lt;/span> &lt;span class="c"># compute md5 hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">add-member&lt;/span> &lt;span class="n">-InputObject&lt;/span> &lt;span class="nv">$_&lt;/span> &lt;span class="n">-NotePropertyName&lt;/span> &lt;span class="n">SHA384&lt;/span> &lt;span class="n">-NotePropertyValue&lt;/span> &lt;span class="nv">$hash_SHA384&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">Hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">add-member&lt;/span> &lt;span class="n">-InputObject&lt;/span> &lt;span class="nv">$_&lt;/span> &lt;span class="n">-NotePropertyName&lt;/span> &lt;span class="n">SHA256&lt;/span> &lt;span class="n">-NotePropertyValue&lt;/span> &lt;span class="nv">$hash_SHA256&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">Hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">add-member&lt;/span> &lt;span class="n">-InputObject&lt;/span> &lt;span class="nv">$_&lt;/span> &lt;span class="n">-NotePropertyName&lt;/span> &lt;span class="n">MD5&lt;/span> &lt;span class="n">-NotePropertyValue&lt;/span> &lt;span class="nv">$hash_MD5&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">Hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">add-member&lt;/span> &lt;span class="n">-InputObject&lt;/span> &lt;span class="nv">$_&lt;/span> &lt;span class="n">-NotePropertyName&lt;/span> &lt;span class="n">File&lt;/span> &lt;span class="n">-NotePropertyValue&lt;/span> &lt;span class="nv">$_&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">FullName&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="py">Replace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$folder&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="n">-PassThru&lt;/span> 
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> 
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h2 id="description-in-3-lines">Description in 3 lines&lt;/h2>
&lt;p>The above code does the following:&lt;/p>
&lt;ol>
&lt;li>For each folder in the variable &lt;code>$folders&lt;/code>, get all files and folders in that folder and its subfolders.&lt;/li>
&lt;li>For each file, compute its SHA384, SHA256 and MD5 hashes.&lt;/li>
&lt;li>Output the results to a file called process.txt&lt;/li>
&lt;/ol>
&lt;h2 id="description-in-10-lines">Description in 10 lines&lt;/h2>
&lt;p>Here is a short explanation for the above code:&lt;/p></description></item><item><title>Buho CMS</title><link>https://nerdsid.com/projects/buho-cms/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://nerdsid.com/projects/buho-cms/</guid><description>&lt;h2 id="contribution-in-brief">Contribution in brief&lt;/h2>
&lt;p>I created a GitHub action workflow that utilizes both Windows and Ubuntu runners. The workflow creates installers for both Windows and Linux. Additionally, it simplifies the release process by automatically including these installers as assets in the final release.&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/iakmds/buhocms/pull/21">Link to Pull request&lt;/a>&lt;/li>
&lt;li>Tools used: Git, GitHub action, PowerShell, Bash &amp;amp; Innosetup.&lt;/li>
&lt;/ul>
&lt;h2 id="what-is-buho-cms">What is Buho CMS?&lt;/h2>
&lt;p>Buho CMS is a local content management system for static sites. In simple terms it provides a beautiful UI to edit Markdown files (it has more features than that). As of Jun 2023, it supports Hugo, Jkeyll &amp;amp; X static site generators.&lt;/p></description></item></channel></rss>