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
$my_variable = "this is the value of my_variable" | |
if (Test-Path variable:my_variable) { | |
Write-Host $my_variable -ForegroundColor Magenta -BackgroundColor Yellow | |
} | |
else { | |
Write-Host 'Variable $my_variable does not exist.' -ForegroundColor Yellow -BackgroundColor Magenta | |
} | |
#note: my_non_existent_variable doesn't exist, so will go to else statement |
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
$msbuild = "C:\Windows\Microsoft.Net\Framework\v4.0.30319\MSBuild.exe" | |
$MsBuilExists = Test-Path $msbuild | |
If ($MsBuilExists -ne $true) {write-host "msbuild does not exist at this location. Install Visual Studio 2015 (Community Edition should be adequate)"} | |
$buildFile = "C:\Users\Richie\Documents\ssis_guy\build_ssis.proj" | |
& $msbuild $buildFile |
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
Microsoft Visual Studio 2017 Version 15.0.26430.6. | |
Copyright (C) Microsoft Corp. All rights reserved. | |
Some errors occurred during migration. For more information, see the migration report: | |
C:\Users\Richie\Documents\ssis_guy\UpgradeLog3.htm | |
========== Rebuild All: 0 succeeded, 0 failed, 0 skipped ========== | |
Build succeeded. | |
0 Warning(s) | |
0 Error(s) |
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
cls | |
Set-Location "/home/richie/sqltoolservice/" | |
$Assem = ( | |
"Microsoft.SqlServer.Management.Sdk.Sfc", | |
"Microsoft.SqlServer.Smo", | |
"Microsoft.SqlServer.ConnectionInfo" | |
); |
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
cls | |
Set-Location "/home/<whatisyourlinuxuser>/sqltoolservice/" | |
$Assem = ( | |
"Microsoft.SqlServer.Management.Sdk.Sfc", | |
"Microsoft.SqlServer.Smo", | |
"Microsoft.SqlServer.ConnectionInfo" | |
); |
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 Connect-AzureRmSubscription ( | |
$AzureSubscriptionId, | |
$AzureSubscriptionUsername, | |
$AzureSubscriptionPassword | |
) { | |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials | |
if ($null -eq $AzureSubscriptionId -or $null -eq $AzureSubscriptionUsername -or $null -eq $AzureSubscriptionPassword) { | |
throw "The variable set for Azure Subscription information has not been added or the SubscriptionId, SubscriptionName, AzureSubscriptionUsername and AzureSubscriptionPassword variables have not been set for this environment" |
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-FrequencyIntervalValue { | |
[CmdletBinding()] | |
param | |
( | |
[string[]] | |
[ValidateNotNullorEmpty()] | |
$Freq | |
) | |
[int]$Value = 0 | |
if (($Freq -contains "Sunday") -eq $True) {$Value = $Value + 1} |
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-DaysofWeek { | |
[CmdletBinding()] | |
param | |
( | |
[System.Collections.Generic.List[Int]] | |
[ValidateNotNullorEmpty()] | |
$Enum | |
) | |
$daysofWeek = New-Object "System.Collections.Generic.List[String]" | |
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
$range = 1, 2, 4, 8, 16, 32, 62, 64, 65, 127 | |
$numbers = New-Object "System.Collections.Generic.List[Int]" | |
$numbers = $range | |
$target = 65 | |
Function Get-SumUp { | |
[CmdletBinding()] | |
param | |
( |
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
$x = '<?xml version="1.0" encoding="utf-8"?> | |
<Notification> | |
<SendEmail>OnFailure</SendEmail> | |
<SendEventLog>Never</SendEventLog> | |
<SendPage>Never</SendPage> | |
<SendNetSend>Never</SendNetSend> | |
</Notification>' | |
$missingVariables = @() | |
$SendEmail = "Never" | |
# $SendEventLog = "Sometimes" |
OlderNewer