DataRows Everywhere

Shane O’Neill shows how to deal with .NET DataRows in Powershell:

Now I don’t know about you but when I query stuff in a SQL database, it’s to do something to/with the results. They could be a list of servers that I monitor, they could be a list of databases that I want to check the recovery model of, or it could be a list of tables that I want to see how much space they are using. The main point is that I want to do something with the results.

But for this simple case, I just want to list out the customer name from this table. Simple? Yes, but this is just a test case to prove a point.

So let’s PowerShell this!

The moral of the story is to Get-Member early and Get-Member often.

Related Posts

Testing Backups With dbatools

Constantine Kokkinos shows off a dbatools cmdlet to test the last full backup: This: Defines a list of two servers (PowerShell lists are as easy as “”,””) Pipes them to the Test-DbaLastBackup command. Which then: Gathers information about the last full backups for all of your databases on that instance. Restores the backups to the Destination with […]

Read More

Log Shipping With dbatools

Sander Stad shows off a few log shipping functions he created for dbatools: The entire log shipping functionality is now separated between 5 functions. Four of them are used internally and are not visible as a public function because you can easily break stuff if it’s not being used correctly. The main function, Invoke-DbaLogShipping, is […]

Read More

Categories

April 2017
MTWTFSS
« Mar May »
 12
3456789
10111213141516
17181920212223
24252627282930