I always forget how to do this, and Aleksandar Nikolić posted a really beautiful answer on Powershell.com
For a file:
1-split (Get-Content .\test.txt | Out-String) | 2Where-Object { $_ -eq "test" } | Measure-Object | 3Select-Object -exp count
For a string:
1$html.content -split …
Read MoreEarlier this week, I was trying to determine people's feelings about Microsoft Connect by looking through Twitter. A few scrolls down, and I came upon this
@Ms_Alaina My problem is I sometimes stumble upon a Connect item I filed in 2008, and have no idea when it was closed as fixed.
— Aaron Bertrand (@AaronBertrand) …
Read MoreThe other week, I was introduced to Trello for the first time by this tweet and I fell in love.
In case you missed it, here’s my Trello of upcoming “How Stack Overflow does X” blog posts, please vote or suggest! https://t.co/6E8JRb4RSu
— Nick Craver (@Nick_Craver) February 1, 2016
Basically, Nick uses Trello to gauge …
Read MoreIn my previous blog post "Can We Get These 3 SQLPS Issues Fixed before SQL Server 2016 RTMs?", Aaron Nelson and I asked the SQL and PowerShell community to help upvote 3 SQL Connect items. The items addressed three problems with SQL Server's PowerShell module, SQLPS.
- It took 3-5 seconds to load
- It changed …
Read MoreIn tonight's PowerScripting Podcast, I shared a few things about SQL Server on Linux, and talked a bit about SQLPS. All after a lengthy intro about my tech life and Cajun culture ;) You can watch the whole thing, skip to 28 minutes to the podcast intro, or skip to around 59 minutes for the SQL/Linux/SQLPS portion.
Or …
Read MoreYES WE CAN! Microsoft responded and fixed these 3 major issues in SQL Server Management Studio March 2016 Refresh. Read more at "WE DID IT! Microsoft Fixed Those 3 SQLPS Issues in SQL Server 2016".
I'll be honest, I don't use the SQLPS module even though I'm the perfect candidate. I've been a SQL Server DBA …
Read More- You know what's scary as hell? When one node of an important cluster loses its trust relationship with the domain and you see the error "the trust relationship between this workstation and the primary domain failed". That happened to me late last year with one of my SQL Server 2008 R2 nodes. The scary part …
Read More I'll be presenting some sessions about SQL Server and PowerShell at the PowerShell Conference EU in Hanover, Germany on April 20-22! You should join me, because the speaker and session lineup is amaaazing! Register at psconf.eu.
Recently, I wanted to access the
System.Windows.Forms.Integration.ElementHost
type, which uses theSystem.Windows.Forms.Integration
namespace.When I tried to load that namespace, PowerShell complained that The assembly 'System.Windows.Forms.Integration' could not be found.
I read up and found that the …
Read MoreThis post builds on some previous post titled Use base64 for Images in WPF-based PowerShell Forms.
Show-WpfIconExample.ps1, which can be found below and on github, demonstrates how to overlay the default PowerShell toolbar icon with an image that's been transformed to a base64 string to …
Read More