<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ahmad Almla Rashed on Medium]]></title>
        <description><![CDATA[Stories by Ahmad Almla Rashed on Medium]]></description>
        <link>https://medium.com/@A7MAD0x00?source=rss-3faa9c55eff2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FxrygPiTrMaYPJL6Ls-HPw.jpeg</url>
            <title>Stories by Ahmad Almla Rashed on Medium</title>
            <link>https://medium.com/@A7MAD0x00?source=rss-3faa9c55eff2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:27:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@A7MAD0x00/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to PowerShell: A Beginner’s Guide [Part 1]]]></title>
            <link>https://medium.com/@A7MAD0x00/introduction-to-powershell-a-beginners-guide-part-1-6a271c24b99c?source=rss-3faa9c55eff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a271c24b99c</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ahmad Almla Rashed]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 01:48:49 GMT</pubDate>
            <atom:updated>2025-03-09T18:19:25.222Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECLmpbg-7lVuMHUOwMJgrQ.jpeg" /></figure><h3>Intro</h3><p>This is the first part of an ongoing series that will take you from PowerShell basics to advanced-level automation and security workflows. By the end of this series, you’ll be equipped to use PowerShell effectively in your day-to-day job.</p><h3>A Brief History of PowerShell</h3><p>PowerShell was created to address the limitations of traditional command-line tools in Windows. By the early 2000s, Windows was widely used in complex enterprise environments, but existing tools like cmd.exe and batch scripting lacked the flexibility required for advanced system administration. Microsoft needed a more robust and scalable solution for automation and system management.</p><h3>What is PowerShell?</h3><p>PowerShell is a cross-platform task automation solution developed by Microsoft, consisting of a command-line shell, a scripting language, and a configuration management framework. Unlike traditional command-line tools, PowerShell is object-oriented, meaning it handles complex data structures more efficiently. Originally exclusive to Windows, PowerShell is now available on macOS and Linux, making it a versatile tool for IT professionals.</p><h3>A Brief History of PowerShell</h3><p>PowerShell was developed to address the limitations of Windows command-line tools like cmd.exe and batch scripting. In 2006, Microsoft introduced PowerShell as a powerful alternative, built on the .NET framework, enabling administrators to automate tasks and manage systems more effectively.</p><p>Jeffrey Snover, a Microsoft engineer, realized that Windows and Unix handled system operations differently — Windows used structured data and APIs, while Unix treated everything as text files. This difference made porting Unix tools to Windows impractical. Snover’s solution was to develop an object-oriented approach, combining scripting simplicity with the power of the .NET framework.</p><p>In 2016, Microsoft took a major step forward by making PowerShell open-source and cross-platform with PowerShell Core, allowing IT professionals to automate and manage environments across multiple operating systems.</p><h3>Why Use PowerShell?</h3><ul><li><strong>Automation:</strong> Streamlines repetitive administrative tasks.</li><li><strong>System Administration:</strong> Manages Windows, Active Directory, and cloud environments (Azure, AWS).</li><li><strong>Security &amp; DevSecOps:</strong> Aids in auditing, system hardening, and penetration testing.</li></ul><h3>Understanding the Power Behind PowerShell</h3><p>To fully appreciate PowerShell’s capabilities, it’s essential to understand one of its <strong>core principles</strong>: <strong>objects</strong>.</p><h4>Objects in PowerShell</h4><p>In programming, an <strong>object</strong> is a structure that contains <strong>properties</strong> (characteristics) and <strong>methods</strong> (actions). For example, a <strong>Car object</strong> might have:<br> 1. Properties: Color, Model, FuelLevel.<br> 2. Methods: Drive(), HonkHorn(), ReFuel()</p><p>Similarly, PowerShell operates using <strong>objects</strong> rather than raw text, making data manipulation far more efficient. Consider the difference:</p><h4>Traditional Command-Line (Text-Based)</h4><p>In a standard command-line environment like cmd.exe, listing processes requires parsing raw text output:</p><pre>tasklist | find &quot;chrome&quot;</pre><p>Here, text parsing is needed to extract relevant details.</p><h4>PowerShell (Object-Based)</h4><p>In PowerShell, the same task is handled using objects:</p><pre>Get-Process -Name chrome</pre><p>This command <strong>returns structured objects</strong> containing rich metadata about each process, such as:</p><ul><li>Process Name</li><li>Process ID (PID)</li><li>Memory Usage</li><li>CPU Time</li><li>Start Time</li></ul><p>Objects in PowerShell retain their <strong>properties and methods</strong>, eliminating the need for complex text parsing</p><h3>The Power of Cmdlets</h3><p>PowerShell’s functionality is built on <strong>cmdlets</strong> (pronounced “command-lets”), which are lightweight, single-function commands. Unlike traditional shell commands that return raw text, <strong>cmdlets return objects</strong>, enabling <strong>seamless data manipulation, filtering, and automation</strong>.</p><p>For example:</p><pre>Get-Service | Where-Object { $_.Status -eq &quot;Running&quot; }</pre><p>This command retrieves all running services <strong>without requiring string parsing</strong>, making PowerShell <strong>more powerful and flexible than traditional shells</strong>.</p><h3>Installing PowerShell</h3><h3>Windows:</h3><p>Most Windows versions come with PowerShell pre-installed. To check your version, run:</p><pre>$PSVersionTable.PSVersion</pre><p>For the latest version, install <strong>PowerShell Core</strong> from <a href="https://github.com/PowerShell/PowerShell">Microsoft’s GitHub</a>.</p><h3>macOS &amp; Linux:</h3><p>Install PowerShell using a package manager:</p><pre>brew install --cask powershell  # macOS (Homebrew)<br>sudo apt-get install powershell # Ubuntu/Debian<br>sudo yum install powershell     # CentOS/RHEL</pre><p>Start PowerShell by typing:</p><pre>pwsh</pre><h3>Launching PowerShell</h3><p>PowerShell can be launched in several ways:</p><ul><li><strong>Windows Start Menu:</strong> Type powershell and select the application.</li><li><strong>Run Dialog:</strong> Press Win + R, type powershell, and hit Enter.</li><li><strong>Command Prompt:</strong> Type powershell and press Enter.</li><li><strong>File Explorer:</strong> Navigate to a folder, type powershell in the address bar, and press Enter.</li><li><strong>Task Manager:</strong> Open Task Manager, go to File &gt; Run new task, type powershell, and press Enter.</li></ul><p>After launching, you’ll see the PowerShell prompt (PS C:\Users\&lt;Username&gt;), indicating that PowerShell is ready for commands.</p><h3>Understanding PowerShell Cmdlets</h3><p>PowerShell commands, called <strong>cmdlets</strong>, follow a consistent Verb-Noun naming convention:</p><ul><li>Get-Command - Lists all available commands.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xW07Ad1yQ4N3QMx_QIuyvg.png" /></figure><ul><li>Get-Help Get-Process - Displays help for a specific command.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFsWNyfH3euLylLkyii5Jg.png" /></figure><ul><li>Get-Process - Lists running processes.</li><li>Stop-Process -Name notepad - Stops a specific process.</li><li>Start-Process cmd.exe — Start a specific process</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*Sq1DInoQayhRPBZIqVWSIg.gif" /></figure><h3>Exploring Available Cmdlets</h3><p>To filter commands by type:</p><pre>Get-Command -CommandType Function</pre><p>For detailed command usage:</p><pre>Get-Help Get-Date</pre><h3>Working with Files and Directories</h3><p>PowerShell simplifies file system navigation and file management:</p><ul><li>Get-ChildItem (dir) - Lists files and folders.</li><li>Set-Location -Path &quot;C:\Users\Documents&quot; (cd) - Changes directory.</li><li>New-Item -Path &quot;C:\NewFolder&quot; -ItemType Directory - Creates a folder.</li><li>Remove-Item -Path &quot;C:\NewFolder&quot; - Deletes a folder.</li><li>Copy-Item -Path &quot;file.txt&quot; -Destination &quot;backup.txt&quot; - Copies a file.</li><li>Get-Content -Path &quot;file.txt&quot; - Reads file contents.</li></ul><h3>Example Output:</h3><pre>PS C:\Users\captain\Documents&gt; Get-ChildItem</pre><pre>Directory: C:\Users\captain\Documents</pre><pre>Mode                 LastWriteTime         Length Name<br>----                 -------------         ------ ----<br>d-----          9/4/2024  12:50 PM                captain-cabin<br>a----           9/4/2024  12:14 PM            264 captain-hat.txt<br>a----           9/4/2024  12:14 PM            264 captain-hat2.txt<br>a----           9/4/2024  12:37 PM           2116 ship-flag.txt</pre><h3>The Power of the Pipeline (|)</h3><p>Pipelines allow cmdlets to pass structured objects to one another, enabling advanced data processing. Example: Sorting files by size:</p><pre>Get-ChildItem | Sort-Object Length</pre><p>Filtering files with .txt extension:</p><pre>Get-ChildItem | Where-Object -Property &quot;Extension&quot; -eq &quot;.txt&quot;</pre><p>Selecting specific properties:</p><pre>Get-ChildItem | Select-Object Name, Length</pre><h3>Retrieving System and Network Information</h3><p>PowerShell provides cmdlets to extract detailed system and network information:</p><ul><li>Get-ComputerInfo - Displays OS, hardware, and BIOS details.</li><li>Get-LocalUser - Lists local user accounts.</li><li>Get-NetIPConfiguration - Shows IP, DNS, and gateway settings.</li><li>Get-NetIPAddress - Retrieves all configured IP addresses.</li></ul><h4>Example Output:</h4><pre>PS C:\Users\Ahmad.Rashed&gt; Get-LocalUser</pre><pre>Name               Enabled Description<br>----               ------- -----------<br>Administrator      False   Built-in account for administering the computer/domain<br>Ahmad.rashed       True<br>DefaultAccount     False   A user account managed by the system.<br>Guest              False   Built-in account for guest access to the computer/domain<br>User               False<br>WDAGUtilityAccount False   A user account managed and used by the system for Windows Defender Application Guard scen...</pre><h3>Conclusion &amp; Next Steps</h3><p>This introduction covered:</p><ul><li>PowerShell’s background and capabilities.</li><li>Installation and launching methods.</li><li>Basic cmdlets for file management and system monitoring.</li><li>The pipeline for processing objects and filtering output.</li><li>Retrieving system and network details with PowerShell.</li></ul><h3>What’s Next?</h3><p>In the next article, we’ll dive into <strong>PowerShell basics: Working with commands and objects</strong> to build a solid foundation.</p><p><strong>Now Back to you my friend:</strong><br> Go and try running the commands above and share your experience in the comments! What do you want to automate with PowerShell? maybe we can tackle this in the next parts of this series</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a271c24b99c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>