From fedb6faca1eff58b627739e833eb99557b5af197 Mon Sep 17 00:00:00 2001 From: alexesprit Date: Mon, 30 Nov 2015 00:19:03 +0300 Subject: [PATCH] Get random reason easier --- powershell/smack_my_bitch_up.ps1 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/powershell/smack_my_bitch_up.ps1 b/powershell/smack_my_bitch_up.ps1 index 8b690bd..903bd5c 100644 --- a/powershell/smack_my_bitch_up.ps1 +++ b/powershell/smack_my_bitch_up.ps1 @@ -14,21 +14,19 @@ if (-not (QWINSTA | FINDSTR $env:USERNAME)) { $MY_NUMBER='+xxx' $HER_NUMBER='+xxx' -$REASONS= +$REASONS = 'Working hard', 'Gotta ship this feature', 'Someone fucked the system again' - -$RAND = Get-Random -Maximum $REASONS.Count - -$MSG="Late at work. $REASONS[$RAND]" +$reason = $REASONS | Get-Random +$message = "Late at work. $reason." $API_URL = "https://api.twilio.com/2010-04-01/Accounts/$env:TWILIO_ACCOUNT_SID/Messages" $BASE64AUTHINFO = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $env:TWILIO_ACCOUNT_SID,$env:TWILIO_AUTH_TOKEN))) $body = @{ From = $MY_NUMBER; To = $HER_NUMBER; - Body = $MSG; + Body = $message; } #Send a text message and Log errors