This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import-AzurePublishSettingsFile $PubFile | |
$AzureSubName = "be-prod" | |
$AzureSubName = "be-dev" | |
$AzureSubName = "be-uat" | |
Set-AzureSubscription -SubscriptionName $AzureSubName | |
Select-AzureSubscription -SubscriptionName $AzureSubName | |
$CurrentSub = (Get-AzureSubscription | where-object { $_.IsCurrent -eq $true }).SubscriptionName | |
write-host "Current SubscriptionName: $CurrentSub" -foregroundcolor green |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
# SEND EMAILS Helper | |
#============================================================================== | |
function SendEmailAlert() | |
{ | |
PROCESS | |
{ | |
write-host "`nSending Email to Notification List with subject of: $EmailSubject`n" -foregroundcolor yellow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
# Log System Event Log | |
#============================================================================== | |
function LogSystemEventLog() | |
{ | |
param ([string]$eventid = "0001", [string]$eventsource = "adapter", [string]$eventmessage = "Default Message", [string]$loglevel = "Info") | |
PROCESS | |
{ | |
switch ($loglevel) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get-XMLObjectChild ([xml] $envXml) | |
{ | |
# try | |
#{ | |
$h=@{} | |
#$envXml.Environment.deploy.PSRemote.GetEnumerator() | %{$h[$_.name]=$_.value } | |
$envXml1 = $envXml.SelectNodes("Environment/deploy/PSRemote") | |
$envXml1 | |
$envXml1.GetEnumerator() | %{$h[$_.name]=$_.value } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ($i = 1; $i -le 100; $i++ ) | |
{write-progress -activity "Search in Progress" -status "$i% Complete:" -percentcomplete $i;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Verbose -Verbose:$ShowVerbose "BEGIN: log4net configuration definition" | |
$log = New-Log4Posh -Configuration "C:\Program Files\WindowsPowerShell\Modules\poshcat\log4posh\log4net.config" -Dll "C:\Program Files\WindowsPowerShell\Modules\poshcat\log4posh\log4net.dll" -Verbose:$ShowVerbose | |
$location = [System.Net.Dns]::GetHostName() | |
[log4net.NDC]::Push($location); | |
$location = Split-Path (Split-Path $myInvocation.MyCommand.path) -Leaf | |
[log4net.NDC]::Push($location); | |
$Log = [log4net.LogManager]::GetLogger($Host.GetType()) | |
Write-Verbose -Verbose:$ShowVerbose "END: log4net configuration definition" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get the Remote URL | |
$uri = Get-AzureWinRMUri -ServiceName $AzureServiceName -Name $AzVM | |
srvuser = "DOMAIN\USER" | |
$srvpass = "Password" | |
#create the credential for the remote service | |
$log.debug("Creating credential for the Remote Session..") | |
$passwordCred = ConvertTo-SecureString -AsPlainText $srvpass -Force | |
$credentials = New-Object System.Management.Automation.PSCredential ($srvuser, $passwordCred) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE LOGIN TableauReader WITH password='1231!#ASDF!a'; | |
CREATE USER TableauReader FROM LOGIN TableauReader; | |
CREATE ROLE db_execute | |
GRANT EXECUTE TO db_execute | |
exec sp_addrolemember 'db_execute', 'TableauReader' | |
EXEC sp_addrolemember 'db_ddladmin', 'TableauReader'; | |
EXEC sp_addrolemember 'db_datareader', 'TableauReader'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/ | |
#From: #https://gist.github.com/3694398 | |
$subscription = "[SubscriptionName]" #this the name from your .publishsettings file | |
$service = "[ServiceName]" #this is the name of the cloud service | |
$storageAccount = "[StorageAccountName]" #this is the name of the storage service | |
$slot = "production" #staging or production | |
$package = "[Fully Qualified Path to .cspkg]" | |
$configuration = "[Fully Qualified path to .cscfg]" | |
$publishSettingsFile = "[Path to .publishsettings file, relative is OK]" | |
$timeStampFormat = "g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer