PowerShell

PowerShell content for the modern Microsoft data platform: automation, dbatools, SSH-based remoting across Windows and Linux, container scripting, and the Pure Storage PowerShell SDK.

Open Source PowerShell – Play by Play

What’s going on here?

So last week you may have seen this picture on Twitter…it went a little crazy…and you may have been wondering what are we up to? Well, last week I had the pleasure of filming a Pluralsight Play By Play. A Play By Play is a course on Pluralsight but in a slightly different format than you may be used to. A Play By Play bring together industry experts to discuss and demonstrate an emerging technology. This Play by Play is on “Microsoft Open Source PowerShell – PowerShell on Linux and Mac” and is available now and is FREE! You do not have to be a subscriber!

Setting PowerShell as your default Linux shell

In this post we’re going set PowerShell as your default Linux shell.

What is a shell?

In Linux systems you’re given options, tons of options, you can set, reconfigure, add/remove almost anything that you want. And one of those options is your shell. The shell is the thing that you interact with when you’re typing commands at the command line. Different shells have different behaviors and characteristics. It’s a very personal choice. For ages I’ve been a fan of bash.

Getting Started With PowerShell on Linux

Getting PowerShell on Linux

Well it’s not just an announcement, you can actually get PowerShell on Linux and MacOS right now from GitHub – here!

Installing PowerShell

Once you’ve downloaded an installation file you can use RPM or apt to install the package. If you’re on a Mac…well just double click on the package!

yum install powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm

If you’re on Ubuntu, you’ll need a little more stuff read <a href="https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#ubuntu-1404">this</a>.

Running PowerShell

We’ll there’s really not much to that, just type **powershell** at the command prompt an you’re off and running!

Moving SQL Server data between filegroups – Part 2 – The implementation

In this post we are going to show the implementation of a PowerShell script using SMO to move data between filegroups on SQL Server. This article is the second of our two part series on “Moving SQL Server data between filegroups – Database Structures”, you can find the first article here.

The Challenge

Looking around on the web, I couldn’t find a solution to the problem of moving data between filegroups that I liked. Further, many of those solutions are T-SQL based, which I thought were very complex. So I went off to write it myself. The problem lends itself to an iterative solution and I felt that T-SQL was not the right tool for the job. Enter PowerShell, which give us the ability to easily iterate over sets of data with minimal code, couple that with the SQL Server Management Object model and we have the makings of an elegant solution.