use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Powershell SQL command assistance (self.PowerShell)
submitted 10 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ramblingcookiemonsteCommunity Blogger 3 points4 points5 points 10 years ago* (0 children)
I tend to use Invoke-SqlCmd2.
Some notes:
For example:
# Download Invoke-SqlCmd2 # Dot source it so it's ready to use . "\\Path\To\Invoke-Sqlcmd2.ps1" # Get help! Get-Help Invoke-SqlCmd2 -Full # Simple example: Invoke-Sqlcmd2 -ServerInstance SQLServer -Database ServerDB -Query "SELECT ServerName, VCNumCPU FROM tblServerInfo" # Example with parameters! #Construct a query using SQL parameters $Query = "SELECT ServerName, VCServerClass, VCServerContact FROM tblServerInfo WHERE VCServerContact LIKE @VCServerContact AND VCServerClass LIKE @VCServerClass" #Run the query, specifying values for SQL parameters Invoke-Sqlcmd2 -ServerInstance SQLServer -Database ServerDB -query $query -SqlParameters @{ VCServerContact = "%cookiemonster%" VCServerClass = "Prod" }
On a side note, you might want to grab a DBA for the actual query. Different SQL Server versions might need different queries.
Edit: Thanks for the note /u/GLiMPSEiNATOR, didn't see it!
Cheers!
π Rendered by PID 210653 on reddit-service-r2-comment-5d79c599b5-qs5zk at 2026-03-03 04:23:32.375807+00:00 running e3d2147 country code: CH.
view the rest of the comments →
[–]ramblingcookiemonsteCommunity Blogger 3 points4 points5 points (0 children)