<?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 Tomer Salakoff on Medium]]></title>
        <description><![CDATA[Stories by Tomer Salakoff on Medium]]></description>
        <link>https://medium.com/@tomer.salakoff?source=rss-bf392ff2a38b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VluFAm5Ahw2QpWnnFz3lSQ.jpeg</url>
            <title>Stories by Tomer Salakoff on Medium</title>
            <link>https://medium.com/@tomer.salakoff?source=rss-bf392ff2a38b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 08:14:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomer.salakoff/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[The Only DevOps Skill You’ll Ever Need to Master]]></title>
            <link>https://medium.com/cloud-mind/the-only-devops-skill-youll-ever-need-to-master-40dbf9752593?source=rss-bf392ff2a38b------2</link>
            <guid isPermaLink="false">https://medium.com/p/40dbf9752593</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[fast-learning]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Tomer Salakoff]]></dc:creator>
            <pubDate>Mon, 17 Jun 2024 07:02:43 GMT</pubDate>
            <atom:updated>2024-06-19T17:30:22.116Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8boOkI26MB8gKo8IxgaZoQ@2x.jpeg" /><figcaption>Photo by <a href="http://x1brett.redbubble.com/">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>If you’re going to master anything you first have to admit that you are not a master of it already.</blockquote><blockquote>– Jordan Peterson</blockquote><p>DevOps is the name. Learning is the game.</p><h3><strong>Buzzwords everywhere</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ca6bJV-6l2rQX9p3b-OHQw@2x.jpeg" /><figcaption>Photo by <a href="https://www.instagram.com/verenayunita/">Verena Yunita Yapi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>It is no secret, the world is abuzz with the craze that is DevOps. If you are involved in Tech development in any way you have most probably come across the term at the very least, and chances are good that your company has spent a fair amount of resources attempting to recruit someone just like me. That allure of on-demand, auto-provisioned, streamlined, cost-efficient and endlessly customisable cloud-native, production-like test environments. Those automagic CI/CD pipelines that are gloriously reusable and yet completely within the conceptual grasp of every junior JavaScript dev that walks through the door.</p><p>And who can forget… Kubernetes 🫠</p><p>In truth I am paid what some… including myself there… consider big bucks, to do one thing. A really cool thing in my book, and one that keeps me on my toes and out of mischief (mostly)… and it is the only skill you will ever need to succeed in DevOps.</p><h3>Fast Learning</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uVJupsJa0D7J8vsA58RVeg@2x.jpeg" /><figcaption>Photo by Dmitry Ratushny on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Myth: Only some people can learn, others just need to deal.</blockquote><blockquote>Hypothesis: Unless you are part of a small percentage of the population who suffer from learning disorders, you are fully able to learn just about anything you put your mind to, no matter your place of origin, gender, background. Evolution has your back!</blockquote><p>Ok ok… that’s a bold statement, and clearly it’s not all true. There are some people with superb spatial and technical awareness who automatically find it easier to learn technologically inclined subjects. Others find it easier to memorise reams of facts likes names, places, and dates… a perfect match for a study of history and the humanities.</p><p>But hang on… have you ever seen a person drawing and been like “damn I wish I was that talented!”? Next time try asking them if their ability is talent or practice? Try asking them how they take a talent they were actually born with, not just the one you see now, and develop it into something worth looking at…</p><p>My job as DevOps Tech Lead is about gathering as much knowledge of the world as quickly as possible, processing it, assimilating it, sharing it with others in my organisation so that we might all together make the best possible decisions and add the maximum possible value with hopefully the least amount of resources. It is also to ensure that everyone on my team is doing the same, to the same high standard. Obviously there is a fare amount of human interaction involved so I am constantly learning how to be more approachable, more understanding, more of a coach and less of a control freak.</p><p>The constant search for the best technologies is never-ending, and the world is getting faster and fuller than I have capacity to learn. Being a lead requires learning how to teach, and learning how to learn, and learning how to teach others to learn and teach…</p><p>And don’t get me started on the learning involved in organisational politics or contract nogtiations…</p><p>I do not think that these are specific to DevOps fields. I do know that DevOps has an extremely wide range of fields that it covers and so there is truly never a dull moment with a seemingly infinite set of worlds you can infinitely delve into.</p><h3>What the actual stack?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hR4M7rz0-cLd3cHEWKGFig@2x.jpeg" /><figcaption>Photo by <a href="http://www.kclemonade.com/">Sean Stratton</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>So what about those lists then? You know the ones…</p><ul><li>10 best DevOps tools of 2023</li><li>The essential DevOps tools you must learn</li><li>The must-have tech stack for any project</li><li>My journey to some tool certification</li></ul><p>Don’t get me wrong, respect to anyone who gets those crazy certifications… they are NOT easy. And there is definitely something to be said for the level of competence of a specialist in his given field. Nothing beats focused experience!</p><p>That having been said, if all I had was an AWS EKS certification, or only a Kubermetes Operator cert, or some Jenkins partner certification, then where would I be when faced with the challenge of implementing Nomad via Ansible based on Github Workflows in an organisation where they all just happen to be the perfect fit?</p><p>Tool stacks and catchphrases are essential, but they are not the way to focus unless you are in a position which demands those specific tools and specialties. A jack of all trades can sometimes add more value than a master of one.</p><h3>Dragons, not catchphrases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_Cy4mdMtSbBZz8PhyLeow@2x.jpeg" /><figcaption>Photo by <a href="http://goldendale159363830.wordpress.com/">Dinu J Nair</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>The idea is to look beyond the tool, to the essential skill required to learn the tool… to learn ANY tool… at the drop of a hat… to production standards, and to teach others…</p><p>Essentially you don’t need to learn every tool… All you need to learn is how to slay dragons… how to go boldly where no one has gone before and learn the tools available, and being able to distill understanding from the smallest interactions. Coming to a place of confidence with a tool in spite of our glaring inadequacies, and forging a path forward through the feelings of anxiety, our imposter syndrome, and finding the answer and the deeper understanding so that other people can get the distilled abstracted version and continue about their days creating value.</p><p>Sometimes this means understanding what you should learn first and what can be left for later. Or maybe the 20/80 principle applies, where 80% of use-cases will be covered in the first 20% of learning. Or even knowing when to get expert help in finding a deeper understanding of some topic. And especially knowing how to let go and allow others the opportunity to learn and teach.</p><p>If you want to succeed in DevOps, or Platform Engineering, or actually just any kind of Tech Development… learn one thing at the very least…</p><h3>Learn to learn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLSQ1U51nYEfUkmP3UgF-Q@2x.jpeg" /><figcaption>Photo by <a href="http://timmossholder.com/">Tim Mossholder</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Learn HOW to learn…</p><p>Learn the many aspects and techniques to learning, learn to love learning, learn how others learn and learn how to integrate all of this into your life and create your own styles of learning, so that even outside of the workplace the drive to learn can help enrich your life at every turn.</p><p>Want to see an example? Just look at kids.</p><p>Children are learning machines, they have an interesting approach which is not dissimilar from AI model training… they ask extremely complex questions, sometimes in extremely simple ways, and sometimes we cannot answer them fully, but we can also never lie (I mean you could but who are you fooling?), and so we use age appropriate terms which give a portion of the information and the child is left to deal with a certain level of not knowing… not fully… until the next time the child asks the question and gets a similar of maybe even fuller answer in a slightly different way, and this time is able to maybe understand the language a bit better… aggregating the answers and adding knowledge as they go until the understanding is clear.</p><p>Children will attempt to validate their understanding. They will attempt to explain the thing they learnt to someone else, usually their parents or siblings due to proximity and trust. The audience’s response will either be positive or negative causing a corresponding reaction in the child’s hormonal balance and creating a memory for later reference in the child’s brain, in the reward centre. Every time they get something right they get a dopamine hit and their brain says “more please!”.</p><p>There are situations where the opposite is true. The child’s brain attempts to learn something and the environment turns hostile for any of a thousand reasons, and then the result is predictably negative. And then an aversion to learning can be created and could last well into adulthood and beyond.</p><p>This interaction of hormone and neurone causes connections and pathways to be formed in the brain. And the more a similar interaction occurs, the more said pathway will be enforced and accessible. Additionally said pathway will be easily compared to current events so that similar techniques and responses can be drawn on in varied and seemingly unrelated circumstances.</p><p>This is why many developers will tell you that, barring the deepest intricacies, if you know one development language, you know them all. Because there are commonalities that make a coding language a coding language. Once you know those, the variations on syntax will seem like variations of a dialect, maybe difficult to fully understand, but you can kind of get the gist. Similar conjectures have been made related to human language.</p><p>Children incorporate a mix of supervised and unsupervised learning models and probably many that we do not yet fully understand 😅😉</p><p>All of this is to say that you should be flexible with your approach and allow for, and be comfortable with, a level of uncertainty while moving forward.</p><h3>Embrace the Failure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hBYjUMRVQrLL5rzGVCiEpA@2x.jpeg" /><figcaption>Photo by <a href="https://www.theblowup.io/">the blowup</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Failures give us crucial information so use them as a superpower!</p><p>Every failure gives us an opportunity to learn a deeper fact. There is no such thing as a meaningless known failure. The very fact that a failure happened at all is interesting and can lead you down a rabbit hole of discovery.</p><p>Failures allow us to find weak points and fix them, like a broken bone they become stronger where the break was.</p><p>Edison famously tried hundreds of elements before landing on the final filament for his light bulb.</p><p>And trying different things on each failure is the very antithesis of Einstein’s famous definition of madness.</p><h3>The Literature and Science</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kFKW7GwVK49SN1nHiofcpw@2x.jpeg" /><figcaption>Photo by <a href="https://www.syinq.fyi/">Susan Q Yin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Many books have been written about the subject, with many theories. From the 10,000 hours theory to the 10,000 experiments theory, from Information Processing to Multiple Intelligences theories, there are reams and reams of theory to go through on the subject of human (and non-human) learning going as far back as Confucius and probably further…</p><p>Much research has been done into how the act of learning itself can assist in prolonging our natural neuroplasticity, the brains ability to adapt and rewrite itself to match the requirements of our environment. Learning can be used to promote neurorehabilitation in patients with brain injuries, and can even lead to neurogenesis (the growth of new brain cells) in previously damaged regions like the hippocampus, a region critical for learning and memory</p><ul><li><a href="https://www.mdpi.com/2076-3425/13/12/1610">Exploring the Role of Neuroplasticity in Development, Aging, and Neurodegeneration</a></li><li><a href="https://solportal.ibe-unesco.org/articles/neuroplasticity-how-the-brain-changes-with-learning/">IBE - Science of learning portal - Neuroplasticity: How the brain changes with learning</a></li></ul><h3>Learning DevOps</h3><blockquote>Yeah yeah, ok… so what does this look like in DevOps day-to-day?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*zXwNuspNK8E3_WujmoH3XA@2x.jpeg" /></figure><p>The idea is to challenge yourself, even learning those certifications. Anything is learning and no information goes to waste.</p><p>Many will tell me that as a DevOps engineer they took the established technology and worked with it, learning how to manipulate it to assist them in their tasks. This is one aspect of learning DevOps. Understanding the technologies currently in-play and what magic can be achieved with them.</p><p>Yet others will tell me how they were able to find faults in current technologies and managed to discover or even develop a suitable alternative, and even implement it for their efficiency and that if the projects and people around them… this is next level!</p><p>And then there are some who will tell you a slightly more involved story.</p><p>“The shortfalls of the existing solution were too much, and so after fully understanding the requirements and limitations, I researched alternatives, compared POCs, presented my findings together with a plan to completion and a cost breakdown, and then implemented, documented and taught the organisation all the newly designed procedures necessary to use the new technologies comprehensively.”</p><p>Now that is beast level DevOps right there!</p><p>And along the way if you managed to also learn something new about your own learning process, maybe some new techniques or hacks, and maybe even managed to impart these on others along the way… well you might just be mentor material</p><p>And the only way to get there is to learn!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40dbf9752593" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloud-mind/the-only-devops-skill-youll-ever-need-to-master-40dbf9752593">The Only DevOps Skill You’ll Ever Need to Master</a> was originally published in <a href="https://medium.com/cloud-mind">Cloud Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The challenging delayed reboot]]></title>
            <link>https://medium.com/cloud-mind/the-challenging-delayed-reboot-f7f2a114ba4a?source=rss-bf392ff2a38b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7f2a114ba4a</guid>
            <dc:creator><![CDATA[Tomer Salakoff]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 06:59:34 GMT</pubDate>
            <atom:updated>2022-03-03T17:05:40.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6O0Gxsj6QtPvorx7.jpg" /></figure><p>After much searching the interwebs, to my utter dismay, for a baked solution of some sort on Stack Overflow or the such, I have come up with a way to schedule a delayed restart of a Linux machine running RedHat/CentOS flavors.</p><p><strong>Lets start with the why:</strong></p><p>There are some tools in our industry who’s focus is clicking on our behalf…</p><p>Where previously you would have an engineer sitting in front of a terminal running a set of scripts and commands, today you have automated systems managing these processes for us. One such system is Octopus Deploy which we use heavily to manage configuration and deployments across multiple mixed and distributed environments.</p><p>One of it’s many features is a Runbook. Called so after the good old manual tomb which engineers used in days gone by, and in many cases still today, usually on the way to automating said procedure. The secret is in the name, <strong>Runbook</strong>, a set of steps, clear and easy to follow, at a running pace, at 3am when support calls and alarm bells are ringing. Of course runbooks used to come in many shapes and sizes, some for just everyday procedures of creating servers or running rudimentary maintenance tasks. And this is where I found myself recently. The challenge of updating our Linux machines opened an opportunity to use Octopus Runbook to run the update procedure for us on any Linux machine in a list of given environments.</p><p>The schema of the runbook should look familiar to you:</p><ul><li>Check that the servers are available and ready for update</li><li>Trigger the level of updates you want based on a selected level. You may only want security updates this time.</li><li>Check if a restart is required by the updates installed</li><li>If needed, restart</li><li>Check the hosts are back to functionalperformance</li></ul><p>*Note: This is not <strong>best practice</strong> in all of its glory… it is a simple way to ensure that any and all security updates can be installed easily at any time. This does not take into account difference in timing of lifecycle stages between test and production and does not take into account promotion of specific updates through the lifecycle. To show best practices of system updates is not the point of this article.</p><p>We can start with the update command, and add yum-utils to the mix to help us decide when to restart. Something like this</p><pre>#!/bin/bash<br>echo &quot;Starting Linux Security Update procedure&quot;</pre><pre>sudo yum install -y yum-utils<br>sudo yum update --security -y</pre><pre>echo &quot;Updates completed...&quot; </pre><pre># needs-rebooting is a funky little tool from yum-utils<br># its output however does not provide a nice workable value<br># so lets convert it to boolean<br>rebootRequired=$(needs-restarting -r)<br>if [[ $rebootRequired == *&quot;Reboot is required&quot;* ]]; then<br>  rebootRequired=1<br>else<br>  rebootRequired=0<br>fi<br>echo &quot;RebootRequired: $rebootRequired&quot;</pre><pre># I can&#39;t be bothered at this point to loop over each service and restart it<br># so each service that needs restarting is just another vote for a reboot<br>servicesToRestart=( $(needs-restarting -s) )<br>rebootForServices=${#servicesToRestart[@]}<br>echo &quot;Number of services to restart: $rebootForServices&quot;<br>if [ &quot;$rebootForServices&quot; -gt &quot;0&quot; ]; then<br>  echo &quot;Services: &quot;<br>  echo ${servicesToRestart[@]}<br>fi<br>rebootRequired=$(($rebootRequired + $rebootForServices))</pre><pre># And the final tally is... *drum roll*<br>echo &quot;Tallied votes for reboot: $rebootRequired&quot;</pre><p>Ok, so the votes are in and final say goes to the rebooters… what next? Should be easy… right?</p><pre>if [ &quot;$rebootRequired&quot; -gt &quot;0&quot; ] ; then<br>    set_octopusvariable &quot;systemRestarted&quot; &quot;True&quot;<br>    sleep 5<br>    shutdown -r<br>fi</pre><p>However…</p><p>Looking into Octopus Deploy documentation you will find a little foot note that mentions the following… and I paraphrase… a step cannot request for the reboot of the server as this will cause the tentacle process to stop and the step will fail…</p><p>So, what to do? We could try schedule a reboot for a little later… say in like 10 seconds. Ok, nice. That should be easy. Something like this</p><pre>shutdown -r $(date --date=&quot;10 sec&quot;)</pre><p>You would expect for this to work, but more testing reveals that the issue remains and the command is unable to finish before the Octopus process is killed by the restart, therefore failing the run.</p><p>So we go one step further and actually schedule a pure run of the shutdown command for a later date 10 seconds in the future. We can do so using /usr/bin/at</p><pre>time=$(date --date=&quot;10 sec&quot; &quot;+%Y%m%d%H%M.%S&quot;)<br>echo &quot;sudo /sbin/shutdown -r&quot; | sudo /usr/bin/at -t $time 2&gt;&amp;1</pre><ul><li>Fist we generate the time string for 10 seconds in the future. (Note the format required by /usr/bin/at -time)</li><li>Then we echo the required command for shutdown (don’t forget the sudo)</li><li>And pass it through the pipe to the timed at command</li></ul><p>The resulting code:</p><pre>#!/bin/bash<br>echo &quot;Starting Linux Security Update procedure&quot;</pre><pre>sudo yum install -y yum-utils<br>sudo yum update --security -y</pre><pre>echo &quot;Updates completed...&quot; </pre><pre>rebootRequired=$(needs-restarting -r)<br>if [[ $rebootRequired == *&quot;Reboot is required&quot;* ]]; then<br>  rebootRequired=1<br>else<br>  rebootRequired=0<br>fi<br>echo &quot;RebootRequired: $rebootRequired&quot;</pre><pre>servicesToRestart=( $(needs-restarting -s) )<br>rebootForServices=${#servicesToRestart[@]}<br>echo &quot;Number of services to restart: $rebootForServices&quot;<br>if [ &quot;$rebootForServices&quot; -gt &quot;0&quot; ]; then<br>  echo &quot;Services: &quot;<br>  echo ${servicesToRestart[@]}<br>fi<br>rebootRequired=$(($rebootRequired + $rebootForServices))<br>echo &quot;Tallied votes for reboot: $rebootRequired&quot;</pre><pre>if [ &quot;$rebootRequired&quot; -gt &quot;0&quot; ] ; then<br>    set_octopusvariable &quot;systemRestarted&quot; &quot;True&quot;<br>    sleep 5<br>    echo &quot;restarting server in 30s...&quot;<br>    time=$(date --date=&quot;10 sec&quot; &quot;+%Y%m%d%H%M.%S&quot;)<br>    echo &quot;sudo /sbin/shutdown -r&quot; | sudo /usr/bin/at -t $time 2&gt;&amp;1<br>fi</pre><p>And the resulting output for success</p><pre>Updates completed... <br>RebootRequired: 1 <br>Number of services to restart: 6 <br>Services: <br>network.service <br>....<br>....<br>Tallied votes for reboot: 7 <br>restarting server in 10s... <br>job 1 at Wed Apr  7 12:21:00 2021</pre><p>This solution allowed me to trigger the reboot from Octopus Deploy while allowing the Octopus process to finish gracefully. I find myself wondering where else this could be useful</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7f2a114ba4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloud-mind/the-challenging-delayed-reboot-f7f2a114ba4a">The challenging delayed reboot</a> was originally published in <a href="https://medium.com/cloud-mind">Cloud Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who’s afraid of the big bad PowerShell?]]></title>
            <link>https://medium.com/cloud-mind/whos-afraid-of-the-big-bad-powershell-2968a56c2fb0?source=rss-bf392ff2a38b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2968a56c2fb0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[powershell]]></category>
            <category><![CDATA[microsoft]]></category>
            <dc:creator><![CDATA[Tomer Salakoff]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 09:34:36 GMT</pubDate>
            <atom:updated>2022-02-10T09:34:36.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*zdV_9Dti8bu6SUCr.jpg" /></figure><p>So… you are maintaining a distributed Windows or multi-platform environment, or automating a repetitive task, or creating a set of tools for yourself and colleagues. When it comes to automation the tendency is to run off in directions of Python or C# or other languages or tools. And when someone mentions the name PowerShell people run screaming for the hills “<strong>Anything but POWERSHELLLLLLL…….</strong>”</p><h3>Why?</h3><p>PowerShell is usually seen as some monstrous scripting language comprised of shell commands made up of strange combinations of words not usually associated with scripting, easy learning or fluid coding. Just a quick squint at the never-ending list of CMDlets available in a standard PowerShell setup is enough to send a fair few people in the other direction.</p><p>Where most platforms use recognized commands like “cd” or “ls” or “dir”, PowerShell makes use of <strong>Verb-Noun</strong> pairs that seem intimidating at first. And PowerShell’s use of full words to name parameters make PowerShell commands look long an unwieldy (<strong>FYI</strong>… lookup <strong>PowerShell Splatting</strong>…!!!). This, together with the fact that PowerShell has (up till recently) been limited to the Windows ecosystem, generally leads non-Windows admins towards other more ubiquitous, well-known tools.</p><p>There may be fears regarding security of PowerShell, or the highly unlikable <strong>PowerShell ISE</strong> as a development platform, or views that simply label PowerShell as a particularly difficult or convoluted shell language.</p><p>I will go through why these fears are baseless, and why learning to use PowerShell in the administration of all your Windows and non-Windows environments alike should be made a priority in your organization.</p><h3>PowerShell is not a scripting language… only</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*zvvgI9B5NQK4vjaT.jpg" /></figure><p>I know… you’re thinking “this guy has lost it”. Well you may be right, but that is a topic for an entirely separate post…</p><p>PowerShell is primarily a real-time interactive administration tool that allows you to administrate your systems without the need for a cumbersome, slow GUI, and to automate repetitive tasks. It comes with a built-in command-line shell and a scripting language in one package.</p><p>This includes a huge native lexicon of useful CMDlets that will allow you to interact with your system without the need to create the tools yourself or install third-party extensions/modules. From managing Windows services, to sending emails, to making REST API calls, to creating a mobile device policy and enforcing it all in one line of code, and far far more. The list of built-in native tools is staggering, reducing your external dependencies and coding overhead. No need for lists of imports at the top of your script to perform basic administration tasks. That having been said, there is a huge ecosystem of third-party modules you can use to boost your PowerShell setup, and writing your own is a piece of pie. (not cake… we prefer pie)</p><p>The addition of PowerShell modules available for most Cloud providers (AWS, GCP, Azure) makes administration of cloud-based infra a breeze, automating your most common maintenance tasks world-wide without the need to work through a time-consuming console UI.</p><p>It has built-in security, so you can be assured that non-secure scripts or unauthorized users are unable to ruin your day, by accident or otherwise. And it works seamlessly through the network with distributed Windows and non-Windows systems alike (read on if your eyebrow rose a bit). This means you can interact with multiple, distributed systems simultaneously, in parallel, both in real-time and via scripting/automation, be it simple or complex.</p><p>There are even cases where PowerShell has vast advantages over Windows GUI’s, where some features and options are only available via PowerShell, forcing power-users towards the command-line and away from those cumbersome UI’s.</p><h3>A CMDlet by any other name</h3><ul><li>True, to change directory in PowerShell you make use of the CMDlet <strong>Set-Location</strong>.</li><li>True, to list the contents of a directory you use <strong>Get-ChildItem</strong>.</li><li>True, to output something to the shell you use <strong>Write-Host</strong>.</li><li>True, to create a new directory you use <strong>New-Item -ItemType Directory</strong></li></ul><p><strong>“Booooo</strong>” you may say… “too convoluted…”</p><p>Credit: MemGenerator.net</p><p>Well hold on a bit… you may be surprised to learn that the good people who wrote PowerShell were thinking of you all along. They were taking into consideration the admins who are used to other systems like Linux/Unix or other languages like the original Windows Command prompt (CMD) or Bash. So for very many of the most used CMDlets, the peeps over in the PowerShell department added aliases, meaning…:</p><ul><li>You can still use <strong>cd</strong> to change directory</li><li>You can still use <strong>dir</strong> or <strong>ls</strong> to list the contents of a directory</li><li>You can still use <strong>echo</strong> to write to the shell</li><li>You can still use <strong>mkdir</strong> to create a new directory</li><li>You can even use commands like <strong>man</strong> to get help</li></ul><p>Additionally, any of your native Windows commands will also work. Things like <strong>ping</strong>, <strong>ipconfig</strong>, etc…. and the list goes on and on. You can even set your own aliases for any command you want, existing or self-written.</p><p>It is also easy as that pie we mentioned earlier to find out all you want to know about a specific PowerShell command or object by using some simple tricks.</p><ul><li>As mentioned above, use <strong>get-help &lt;command&gt;</strong>, or <strong>man &lt;command&gt;, </strong>or <strong>help &lt;command&gt; </strong>to get an in depth look at how to use the command you need</li><li>Use <strong>$Object | Get-Member</strong> or <strong>$Object | gm </strong>to find out all you want to know about the object you are attempting to use or manipulate</li><li>Use <strong>&lt;ModuleName&gt; | Get-Command</strong> or <strong>&lt;ModuleName&gt; | gc</strong> to get a list of all available CMDlets or functions in any PowerShell module</li></ul><p>So to get started, just open the PowerShell prompt and start typing commands you already know. You may be surprised how many of them work just as you would expect them to.</p><h3>DIY Modules and much, much more</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*YToNEc9-XIHLUGrO.jpg" /></figure><p>PowerShell is a fully Object-Oriented, functional language when used to script. This allows you to easily create reusable classes, functions, or even entire modules.</p><p>Modules can be compiled C# or simply a group of your own functions in standard PowerShell language saved in an uncompiled script file with a psm1 file extension. So to get started creating your own classes, functions or modules just write a PowerShell script and change the extension… that simple</p><p>Developing PowerShell automation has also improved recently with the advent of Microsoft’s <strong>Visual Studio Code </strong>which, together with the PowerShell extension, has officially replaced the unattractive and outdated PowerShell ISE (being deprecated as we speak). Being a light-weight, fully featured and robust IDE with a multitude of available extensions for just about any language, tool or personalization you can think of, <strong>VSCode </strong>has taken the development of PowerShell scripts and modules to a new level</p><p>Add to all this</p><ul><li>The fully object-oriented nature of PowerShell and its ability to run C# code natively</li><li>The wealth of third party modules that already exist together with a fully featured package management as of PowerShell 5.1</li><li>Full access to the entire .NET ecosystem (PowerShell is actually a built-in .NET dll)</li></ul><p>and it becomes clear that grouping your most commonly used tools and most frequent, repetitive and time-consuming tasks into a PowerShell module can</p><ul><li>Decrease time needed to develop new automation tools and scripts</li><li>Improve ease of system-wide administration, automation and auditing</li><li>Make your automation code far more efficient and readable, and…</li><li>Improve security and system/tool robustness… among other advantages…</li></ul><h3>The Shell of the Future</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*4XLTRev-TXorgQBg" /></figure><p>“But wait… I am not on Windows”</p><p>“I don’t like PowerShell because it locks me into a Windows environment”</p><p>“If only I could use it on all my non-Windows systems”</p><p>Stop! No need to continue. These statements are now outdated. Since its first release in June 2016, <strong>.NET Core</strong> has come a long way as Windows’ breach into the Open Source world. Along with it comes <strong>PowerShell Core 6.1 </strong>(latest version as of this writing) with full support for use on all non-Windows systems.</p><p>True, you may argue that it will be difficult to replace existing scripting on Linux (eg. bash) with PowerShell. Or you may say “Well Python is far more ubiquitous already”. But Python is not really a shell language although it can be used as such if done correctly. And bash is not really a great object oriented scripting language, although it can also be used in this way if done correctly.</p><p>PowerShell on the other hand is both a shell and a scripting language by definition, which is fully object oriented, without overly intricate syntaxes, and easily-written, plain-language, non-compiled code, so it really does cover all the necessary bases.</p><p>It will be interesting to see how much PowerShell Core will catch on, but it is not crazy to foresee a wealth of related tools being added to the Core ecosystem in the not too distant future.</p><h3>Let’s talk bottom line</h3><p>Whether you are just looking to automate some repetitive or time-consuming tasks, or you are a power user wanting to automate your private environment, or a sys-admin, IT or production engineer responsible for large-scale distributed systems, it is definitely worth your while to invest time in learning PowerShell. It may not replace all your other tools, but it will definitely make a worthwhile addition to your repertoire and may even surprise you by becoming one of your favorites….</p><h3>Have no fear of the big bad PowerShell… it is big, but not so bad after all</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2968a56c2fb0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloud-mind/whos-afraid-of-the-big-bad-powershell-2968a56c2fb0">Who’s afraid of the big bad PowerShell?</a> was originally published in <a href="https://medium.com/cloud-mind">Cloud Mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>