&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Articles from December 2016 on PowerShell.org - Welcome Automaters!</title><link>https://powershell.org/articles/2016/12/</link><description>Recent content in Articles from December 2016 on PowerShell.org - Welcome Automaters!</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://powershell.org/articles/2016/12/index.xml" rel="self" type="application/rss+xml"/><item><title>UPDATE / Tug: The Open-Source DSC Pull Server</title><link>https://powershell.org/articles/2016-12-19-update-tug-the-open-source-dsc-pull-server/</link><guid>https://powershell.org/articles/2016-12-19-update-tug-the-open-source-dsc-pull-server/</guid><pubDate>Mon, 19 Dec 2016 17:25:49 +0000</pubDate><description>&lt;p&gt;If you haven&amp;rsquo;t taken a look at &lt;a href="https://github.com/powershellorg/tug"&gt;Tug&lt;/a&gt;, now&amp;rsquo;s a great time. Eugene Bekker has been doing a ton of heavy lifting, taking my .NET Core proof-of-concept code and turning it into a formal ASP.NET MVC project.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>If you haven&rsquo;t taken a look at<a href="https://github.com/powershellorg/tug">Tug</a>, now&rsquo;s a great time. Eugene Bekker has been doing a ton of heavy lifting, taking my .NET Core proof-of-concept code and turning it into a formal ASP.NET MVC project.</p><p>Tug is nominally cross-platform. Basically, it&rsquo;s n ASP.NET Core application that can run under any Web server that supports ASP.NET Core, which includes Windows, Windows Nano Server, and even Linux. Tug knows the DSC protocol, so it receives requests from Local Configuration Managers (LCMs) on DSC target nodes.<br>
Tug has no &ldquo;brains&rdquo; to deal with those request, though. Instead, it implements a provider layer, and calls upon a provider to deal with requests. A very simple provider is currently implemented, which runs PowerShell commands in response to LCM requests. So, short story, if you can write a PowerShell advance function, you can make your pull server behave in whatever way you want. Store data in SQL Server, if you like, for example.<br>
Because of some hitches in .NET Core 1.0, that run-PowerShell-commands trick doesn&rsquo;t work well. so to do that you really have to target full .NET, which limits you to running Pull server on Windows Server or Windows Server Core. That should be fine for most folks.<br>
But you can also write Tug providers in full .NET - meaning you can use (say) EF Framework to manipulate target node data.<br>
Presently, Tug doesn&rsquo;t implement the Report Server functionality - it&rsquo;s stubbed out, and that&rsquo;s coming next. And if you&rsquo;re thinking, &ldquo;will Tug be able to ____,&rdquo; the answer is, &ldquo;yes - if you write a provider layer that lets it do ____, which can include writing PowerShell commands (functions) that do ____.&rdquo; Tug isn&rsquo;t intended to lock you into one operational mode. Do you want to store client data in SQL Server, and assemble MOFs on-the-fly? You can program Tug to do that. Do you want to store everything in XML files? You an program Tug to do that. Want to use client certificate authentication for nodes? You can program Tug to do that. Because everyone wants something a little different from their Pull server, Tug&rsquo;s designed to let you code up whatever model you prefer.<br>
Tug&rsquo;s an open-source project on GitHub, licensed under MIT, which means you can use it for whatever you want. We&rsquo;ve got a<a href="https://github.com/PowerShellOrg/tug/blob/master/TODO.md">brainstorming document</a> with ideas, and if you&rsquo;d like to contribute, that&rsquo;s a place to start. **And please, contribute. **If you can&rsquo;t, but you follow someone in the community who might be able to, please draw their attention to the project.</p>]]></content:encoded></item><item><title>The Key to Understanding PowerShell – on Windows or Linux</title><link>https://powershell.org/articles/2016-12-15-the-key-to-understanding-powershell-on-windows-or-linux/</link><guid>https://powershell.org/articles/2016-12-15-the-key-to-understanding-powershell-on-windows-or-linux/</guid><pubDate>Thu, 15 Dec 2016 15:22:12 +0000</pubDate><description>&lt;p&gt;I&amp;rsquo;ve listened to a few of my Windows-friendly compatriots attempting to explain PowerShell to their Linux colleagues, and it hasn&amp;rsquo;t always gone well. The problem, I think, is that a lot of Windows folks don&amp;rsquo;t actually know why PowerShell exists in the first place. Let me explain.&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>I&rsquo;ve listened to a few of my Windows-friendly compatriots attempting to explain PowerShell to their Linux colleagues, and it hasn&rsquo;t always gone well. The problem, I think, is that a lot of Windows folks don&rsquo;t actually know why PowerShell exists in the first place. Let me explain.</p><p>PowerShell _does not exist to automate administrative tasks. _Re-read that a few times until it really sinks in. You see, you start going at the Linux guys with this &ldquo;automation&rdquo; argument, and they&rsquo;re all like, &ldquo;yeah, man, we&rsquo;ve had that for always.&rdquo; The existence of PowerShell on Linux makes no sense if the point of PowerShell is simply automation. In fact, PowerShell <em>as an automation mechanism</em> also _makes no sense on Windows. _Keep in mind that all PowerShell does is built on WMI/CIM and .NET Framework; there was nothing stopping you from using those things in the first place. You didn&rsquo;t <em>need</em> PowerShell.<br>
The point of PowerShell is that .NET Framework is a terrible surface for systems administrators. Getting anything done correctly in .NET requires you to <em>write an application</em> of some size, compile it, and run it. .NET wasn&rsquo;t designed with ad-hoc, system-level &ldquo;scripting&rdquo; in mind; it&rsquo;s an application development framework. An empty .NET project starts with dozens of lines of code and configuration; that&rsquo;s the bare minimum to even start writing code. For admins, it&rsquo;s too much. Heck, it&rsquo;s sometimes too much for _developers, _which is why some of them like PowerShell as a &ldquo;.NET immediate window&rdquo; so much - they can just bang out a one-liner, hit Enter, and get results.<br>
I&rsquo;ll argue that all operating systems rely on APIs for command-and-control. If you want to tell Windows to shut down, you need an API to do it. In modern times, that API comes via WMI/CIM or .NET, for the most part. In Linux, if you want to configure Apache to listen to a different port, you need an API. That API comes in the form of a text file. I&rsquo;ll also argue that, from a systems administration perspective, all APIs suck. In Windows, you&rsquo;re forced to learn this vast and complex .NET Framework, which is only marginally consistent within itself, and which requires a (relative) ton of code to make do anything. In Linux, you&rsquo;re forced to learn regular expressions and text parsing, along with a bunch of poorly-interconnected command-line tools that have improbable names invented by Dungeons &amp; Dragons geeks in the 1960s and 1970s. &ldquo;Grep,&rdquo; as an API for systems administration, was never a good idea - it&rsquo;s just what got the job done when your main configuration surface was a bunch of text files.<br>
The <em><strong>entire point of PowerShell</strong></em> is nothing more, nor less, than to wrap a more-consistent, <em>administrator-friendly</em> API around those other sucky APIs. PowerShell is an abstraction layer, and that&rsquo;s it. Do you know how to conquer up a ServiceController reference in .NET, and ask it to restart a surface? Me neither, nor do I care to learn - I&rsquo;ll just run Restart-Service, which does all that under the hood. Do you know how to pull a daemon list on Linux, retrieve just the httpd daemon, and restart it? You might, but I don&rsquo;t, and I don&rsquo;t care to learn that either - I&rsquo;ll run Restart-Daemon (which will exist someday, I swear it).<br>
On Windows, PowerShell doesn&rsquo;t replace .NET. We all know that. It makes .NET easier for an admin to use in the context of administration. On Linux, PowerShell doesn&rsquo;t replace grepsedawk and all the text files - it simply makes them easier, and more consistent, to use for administration. The point of PowerShell is that it allows us to deal in deterministic data structures (objects) without having to be text-parsing experts. It wraps poorly designed underlying APIs into something with a consistent, admin-focused surface. That&rsquo;s it.<br>
PowerShell does not posit that, on Linux, grepsedawk is a bad idea. PowerShell simply suggests that those tools, and their friends, are a lot harder to learn and use than they should be. PowerShell&rsquo;s value-add is not automation - you can do that without PowerShell. PowerShell&rsquo;s value-add is _better productivity as you automate, _and that&rsquo;s something anyone should be able to wrap their minds around.</p>]]></content:encoded></item><item><title>PowerShell Gotchas</title><link>https://powershell.org/articles/2016-12-05-powershell-gotchas/</link><guid>https://powershell.org/articles/2016-12-05-powershell-gotchas/</guid><pubDate>Mon, 05 Dec 2016 00:28:59 +0000</pubDate><description>&lt;p&gt;You can certainly find a number of articles around that present PowerShell pitfalls that can easily trip you up if you are not careful. I took a different approach in my three-part series, &lt;em&gt;A Plethora of PowerShell Pitfalls&lt;/em&gt;.&lt;br&gt;
The first two parts are presented in quiz format, together covering the top 10 &amp;ldquo;gotchas&amp;rdquo;. They will help you test your awareness to see if you even realized the danger and did not know you&amp;rsquo;ve been skirting those traps for awhile. After you&amp;rsquo;ve had an opportunity to consider the conundrums presented, I then go into detailed explanations for why they happen and how to fix them.&lt;br&gt;
The third and final part is a compendium of all the common &amp;ldquo;gotchas&amp;rdquo; that I put together after reviewing all the other lists out there. The more than 35 entries in the list cover, I believe, a good 98% of the issues you would likely encounter. Yes, there are more esoteric pitfalls as well, but I ran out of web page&amp;hellip; 🙂&lt;br&gt;
Part 1: &lt;a href="https://www.simple-talk.com/sysadmin/powershell/a-plethora-of-powershell-pitfalls/"&gt;Pesky Parameter Problems&lt;/a&gt;&lt;br&gt;
Part 2: &lt;a href="https://www.simple-talk.com/sysadmin/powershell/a-plethora-of-powershell-pitfalls-part-2/"&gt;A Portion of Potential Puzzles&lt;/a&gt;&lt;br&gt;
Part 3: &lt;a href="https://www.simple-talk.com/sysadmin/powershell/the-poster-of-the-plethora-of-powershell-pitfalls/"&gt;The Compendium&lt;/a&gt;&lt;/p&gt;</description><content:encoded>&lt;![CDATA[<p>You can certainly find a number of articles around that present PowerShell pitfalls that can easily trip you up if you are not careful. I took a different approach in my three-part series,<em>A Plethora of PowerShell Pitfalls</em>.<br>
The first two parts are presented in quiz format, together covering the top 10 &ldquo;gotchas&rdquo;. They will help you test your awareness to see if you even realized the danger and did not know you&rsquo;ve been skirting those traps for awhile. After you&rsquo;ve had an opportunity to consider the conundrums presented, I then go into detailed explanations for why they happen and how to fix them.<br>
The third and final part is a compendium of all the common &ldquo;gotchas&rdquo; that I put together after reviewing all the other lists out there. The more than 35 entries in the list cover, I believe, a good 98% of the issues you would likely encounter. Yes, there are more esoteric pitfalls as well, but I ran out of web page&hellip; 🙂<br>
Part 1:<a href="https://www.simple-talk.com/sysadmin/powershell/a-plethora-of-powershell-pitfalls/">Pesky Parameter Problems</a><br>
Part 2:<a href="https://www.simple-talk.com/sysadmin/powershell/a-plethora-of-powershell-pitfalls-part-2/">A Portion of Potential Puzzles</a><br>
Part 3:<a href="https://www.simple-talk.com/sysadmin/powershell/the-poster-of-the-plethora-of-powershell-pitfalls/">The Compendium</a></p>
]]></content:encoded></item></channel></rss>