tag:blogger.com,1999:blog-2328222207349876984.post7988275951138744338..comments2024-03-02T15:36:45.785-08:00Comments on SQL Tact: Start/Stop Group of Azure VM'sUnknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2328222207349876984.post-66721014234603833542014-01-30T21:02:09.388-08:002014-01-30T21:02:09.388-08:00Huh, so, an educational rabbit hole this is.
I thi...Huh, so, an educational rabbit hole this is.<br />I think " or ' would be functionally fine, but because many special characters are valid (though rare) in email addresses, including a backtick, we DO want single quotes. Thanks for bringing it up, Paulo!whttps://www.blogger.com/profile/04313158818403554742noreply@blogger.comtag:blogger.com,1999:blog-2328222207349876984.post-36435801002474259462014-01-30T20:50:49.714-08:002014-01-30T20:50:49.714-08:00Good catch Paulo, Drew's right. I've chang...Good catch Paulo, Drew's right. I've changed it. Idea is that we want just a case insensitive comparison, that's all that we need there.<br />And you're also right about the single quotes, because we want to compare, not escape, any special characters in the email address, though rare.<br />Thanks Paulo!<br />whttps://www.blogger.com/profile/04313158818403554742noreply@blogger.comtag:blogger.com,1999:blog-2328222207349876984.post-21253031773426586842014-01-30T20:39:14.524-08:002014-01-30T20:39:14.524-08:00The use of -match versus -eq was based on a mistak...The use of -match versus -eq was based on a mistaken statement I had provided to the author regarding the case sensitivity of -match. -eq would be preferable to avoid the unlikely yet 100% possible greedy matches against other users on the same Azure service.<br /><br />Single quotes versus double quotes is a small-scale religious argument in PowerShell, mostly because PowerShell users come from a number of different backgrounds with differing syntaxes. They do have different functions in PowerShell, but in this instance, there is no practical difference. If your background is SQL, then single quotes may be more familiar for you to use with strings. As long as you understand the differences between the two marks in PowerShell, you're generally fine either way.Drewhttps://www.blogger.com/profile/17274833108492725879noreply@blogger.comtag:blogger.com,1999:blog-2328222207349876984.post-55287873380316177762014-01-30T15:47:33.345-08:002014-01-30T15:47:33.345-08:00Any particular reason for using -match and double ...Any particular reason for using -match and double quotes with this?<br /><br />?{$_.ActiveDirectoryUserId -match "YourAzureAccount@hotmail.com" -and $_.SubscriptionName -match "Visual Studio Premium with MSDN" }<br /><br />Why not just this?<br /><br />?{$_.ActiveDirectoryUserId -eq 'YourAzureAccount@hotmail.com' -and $_.SubscriptionName -eq 'Visual Studio Premium with MSDN' }Paulo Morgadohttp://paulomorgado.net/noreply@blogger.com