Skip to content

Instantly share code, notes, and snippets.

View RichieBzzzt's full-sized avatar
🦆
Sirfetch'd

Richie Lee RichieBzzzt

🦆
Sirfetch'd
View GitHub Profile
$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
(
Function Get-DaysofWeek {
[CmdletBinding()]
param
(
[System.Collections.Generic.List[Int]]
[ValidateNotNullorEmpty()]
$Enum
)
$daysofWeek = New-Object "System.Collections.Generic.List[String]"
$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"
[xml] $x = '<Lunch>
<Sandwiches>
<Sandwich Include="Mixte">
<Filling>Ham and Emmantal Cheese</Filling>
</Sandwich>
<Sandwich Include="RoteDeBoeuf">
<Filling>Beef and Mustard Mayonnaise</Filling>
</Sandwich>
</Sandwiches>
</Lunch>'
@RichieBzzzt
RichieBzzzt / 1_truncateVdelete.sql
Last active September 1, 2017 13:49
Truncate VS Delete
USE tempdb
GO
-- Create table
CREATE TABLE TruncTable (ID INT, IntColumnOne INT, IntColumnTwo INT, IntColumnThree INT, UniqueColumn UNIQUEIDENTIFIER DEFAULT NEWID())
GO
CREATE CLUSTERED INDEX [TT_ID]
ON TruncTable (ID)
GO
#function is called by the primary function 'remove-partitions' below
# 'set partition' builds the partition names up and returns the name as a script persisting variable
Function set-partitions
{
[CmdletBinding()]
param(
[Parameter(Position=0,mandatory=$true)]
[Microsoft.AnalysisServices.Cube]
$cube,
[Parameter(Position=1,mandatory=$true)]
$OctopusURL = "" #Octopus URL
$APIKey = "" #Octopus APIKey
$projectname = "" #Name of the project
$nuGetPath = ""
$pkdex = Import-Csv ""
if (-not (Test-Path $NugetPath)) {
Write-Error "Cannot find nuget at path $NugetPath\nuget.exe"
throw
}
$NugetExe = "$NugetPath\nuget.exe"
function Get-DllVersionInfo
{
param
(
[Parameter(Position=0,mandatory=$true)]
[string] $Dll
)
if(!(Test-Path $Dll -PathType leaf))
{
Write-Error -message “The path to $Dll is either not accessible or does not exist”
<Target Name ="BuildMessage" Condition ="'$(RunBuildMessage)'=='1'">
<BuildStep
Name="BuildMessage"
Message="This is the build message..."
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildURI)" Condition="'$(IsDesktopBuild)' != 'true'">
<Output TaskParameter="Id" PropertyName="BuildMessageId" />
</BuildStep>
<Target
Name="BeforeCompile"
Condition="'$(BuildDefinition)'=='Database Main Sandbox'">
<CallTarget Targets="DoSomething"/>
</Target>