Blog Post

Shutting Off PowerShell Warnings–#SQLNewBlogger

,

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

Not really a SQL Server post, but I ran into this minor issue. While running a script, I saw this:

2019-09-19 16_47_13-? RestoreUnknownStripedBackup.ps1 - SitC 2018 - CreateProtectManageDB - Visual S

The warnings aren’t a big deal, and in fact, have no bearing on my script. At least, not on this script. Since I needed to give this to a customer as a PoC item, I didn’t want any weird warnings. As a result, I needed to suppress these. A little intellisense in VS Code gave me a hint, but what value to use for the parameter?

2019-09-19 16_47_46-? RestoreUnknownStripedBackup.ps1 - SitC 2018 - CreateProtectManageDB - Visual S

A quick search brought me to Server Fault, where I saw the value. I added the SilentlyContinue to my script and messages suppressed.

2019-09-19 16_48_11-? RestoreUnknownStripedBackup.ps1 - SitC 2018 - CreateProtectManageDB - Visual S

SQLNewBlogger

This is a helpful tip for me, and I think I showed you how I found an issue, researched, and solved it. It’s good to give a potential employer some confidence that you can work through issues and find answers.

This took me less than 10 minutes. I bet you could do the same thing in the same time. Write about how you solve a small issue and drop it on your blog.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating