For those unfamiliar, PowerShell 7 is the latest major update to PowerShell, a cross-platform (Windows, Linux, and macOS) automation tool and configuration framework optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. PowerShell includes a command-line shell, object-oriented scripting language, and a set of tools for executing scripts/cmdlets and managing modules.
Do we have any PowerShell users on OSAlert? If so, why are you using it, and what for?
I suspect a number of PowerShell users around here. For myself, I use it a lot for admin work across a number of different systems and also for some automation of data export/imports. Very handy for accomplishing things from the cli. I haven’t really done anything with PowerShell on Linux nor looked at PowerShell 6 but it looks like 7 is bringing some interesting features. Definitely could use ForEach-Object -Parallel to speed things up.
I’m a Windows systems admin by day (free software fanatic by night). My team uses it for the occasional automation of administrative tasks, and in a Windows/AD environment, I find it to be well suited for that. I definitely feel like it’s an improvement over VBScript.
Will be PowerShell 7 in future Windows 10 versions be preinstalled?
Currently there is PowerShell 5.1.19041.1 there.
Same with .NET, where the newest preinstalled version is 4.8.4084.0. And the newest preinstalled C# Compiler v4.8.4084.0 which supports C# 5 and the newest preinstalled Visual Basic Compiler v14.8.4084, which supports Visual Basic 2012..
If .NET 5 will be preinstalled, too, when it is published? And what is with the Roslyn Compiler?
I expect PowerShell 7 to become preinstalled. PowerShell 6 basically changed from .NET to .NET Core which broke many modules, especially those related to UI (out-gridview, progressbars). Those modules now work because of using .NET Core 3.1 or because you can use -UseWindowsPowerShell
As for .NET 5: https://www.c-sharpcorner.com/article/future-of-dot-net/
I mostly use PowerShell for more advanced scripts where I can benefit from piping to select/filter(where)/loops and object-oriented features. For simpler things I still use batch/cmd. And of course everything related to managing/configuring Azure Devops, Office 365/SharePoint has been “use PowerShell” for a long time now
I’d never really used it much until I stumbled across a bunch of HowTos from the MS scripting guy. Now I’m using 5.1 for a lot of scripting and automation tasks, it’s quite useful for quickly scripting a fix.
For me the initial learning curve was a bit steep, it would probably be easier for newbies to start with PS from scratch without preconceived ideas, As far as I’m concerned I’m now a convert, as it’s far more useful and powerful than the alternatives on anything MS, I’m not going back. But I don’t have massive domains to manage, so I’m not the best person to discuss this with, if you had 50K users or millions of devices I bet your already using it, and if you are not then you should probably take a serious look!
For example, a common problem I have to address is a rogue sensor building a massive data file in a short period of time. In the old days I had to go through multiple steps to get it sorted / broken up as I’d run into all sorts of limits. Now it’s one script that works.
I’ve toyed around with 6 on Windows 10 IoT, but not deeply enough to bother making any real comparisons.
I use it extensively for web scraping, data normalization, and database upload. It’s an incredibly capable language that became even better once I figured out I could NuGet in C# libraries into user-space and have them just work. Bonus points for having prebuilt progress bars, Send-MailMessage for error notifications, and simple range and array creation shortcuts that can be passed as parameter values.
I have one PS Core 6.1 script that scrapes from an API using native PowerShell functions, normalizes the timezone of data using C# DateTimeOffset and TimeZoneInfo data types, normalizes the field names using RegEx search and replace, converts the data types and then upserts the results to an Oracle database using the ODP.NET Core drivers it procured from NuGet.
In others I’ve integrated PowerShell with Microsoft Access Database Engine to download Spreadsheet documents, query them like tables via Access SQL, normalize and then bulk upload that data to SQL Server far faster and more reliably than any other solution I’ve found.
I also use it for System Administration, but those sequences of commands are so short and concise I’m not sure I can really call them ‘scripts’.
Honestly, my only quibble with the language is that they changed the behavior of Write-Debug in v6.2.0-preview.3 and didn’t include support for an Action parameter to revert the behavior back for compatibility.
I use it to run test macros to validate our software. We have macros that launch other macros. One nice thing about Powershell is that you can spawn jobs and wait for them to complete. When we are running our test suite, we have close to 800 tests… and we run 6 in parallel at a time. Old test suite was kludgy and had to be run serial.
I’ve also used it to update our build environment. Used it to walk our source tree, recursively search for .vcxproj files, check them out, and update them from VC++2015 to VC++2017.
I sometimes think it should have been called .NET Shell because of the ease to create .NET objects (and COM objects for that matter).
I wrote a vagrant clone in powershell. Forgive me. ♂
I do use it a lot for cross-platform scripts, and for packaging my oss projects. Compared to bash, batch, etc. it makes more sense.
I’ve used PowerShell on and off for sysadmin tasks that hook into other Microsoft tools. For example:
* Modifying new SBS users once added (back in the days of SBS)
* Emailing log files at the tail end of another script
* Writing email metadata to SharePoint document libraries after they have been uploaded
* Changing user passwords on multiple workgroup PCs simultaneously
* Probing a remote server and automatically connecting to its shared printers
The big problem I have with PowerShell is that it is (needlessly?) complex. I’ve done quite a bit of Perl, bash, and batch file scripting, and generally find all of those easier to wrap my head around. I’m not sure why, exactly, but I suspect it has to do with the fidelity that is required to get anything done, versus the more forgiving nature of other scripting languages. Perhaps others can comment on this hypothesis.
In any case, I will usually try to avoid PowerShell unless there is something that really can’t be accomplished in a more convenient way.
HSTWB to make CF images for Amiga3.x uses it !