Comments posted to this topic are about the item Stairway to SQL PowerShell Level 9: Objects For Everyone
Well rounded post:-). The SQL Server Provider and the SQLPS.exe may be mentioned as it simplifies the coding.
Whoa. This is way beyond me. I need to go back to the beginning of the series. Thanks.
Though I like the combination of PowerShell and SMO, I still believe many basic stuff, such as create db, table, user etc are better-handled via t-sql.
I somehow consider PS (with the help of .net) as a command-line equivalent of SSIS platform, where we can have a better logic to manipulate t-sql modules and beyond.
One area I extremely wish to see in this series is using PS to execute parallel-type of functions, this is very important when handling hundreds or even thousands of sql server instances.
Good comments. The series is meant to introduce you to PowerShell and SQL but not to imply that PS and SMO are the replacements for SSMS or TSQL. SMO emits TSQL so there really is no replacement for it. PowerShell in combination with SMO or TSQL is a powerful combination to manage a SQL server.
As for the parallel execution, I will see what I can do to inject this into the remaining levels.
Is this code appropriate for 2023? An update would be great.
I am happy to update the article. I will work with the publishers.
Most of the code will still work as it is, but the way you get the assemblies with Add-Type is different today. But if you import-module dbatools or import-module sqlserver you should be able to execute all the New-Object stuff and do what is there in the code blocks without issue.
Viewing 7 posts - 1 through 6 (of 6 total)