This file contains hidden or 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
[cmdletbinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string[]]$servers, | |
[ValidateScript({ | |
if(-Not ($_ | Test-Path )) { | |
throw "Folder does not exist" | |
} | |
return $true |
This file contains hidden or 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
Param( | |
[Parameter(Mandatory=$true)] | |
[string] $PackageName, | |
[string] $PackageVersion = "0.0.0", | |
[string] $PackageDestination | |
) | |
Clear-Host | |
<# | |
NOTES: You really should use: |
This file contains hidden or 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
Param( | |
[Parameter(Mandatory=$true)] | |
[string] $PackageName, | |
[string] $PackageVersion = "0.0.0" | |
) | |
Clear-Host | |
#use this to retain what we have packagesList previously so we dont have to find it again | |
$packagesList = @{} |
This file contains hidden or 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
Param( | |
[Parameter(Mandatory=$true)] | |
[string] $PackageName, | |
[string] $PackageVersion = "0.0.0" | |
) | |
Clear-Host | |
#use this to retain what we have packagesList previously so we dont have to find it again | |
$packagesList = @{} | |
$sep = "*" * 80 |
This file contains hidden or 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
Clear-Host | |
#use this to retain what we have packagesList previously so we dont download again | |
$packagesList = @{} | |
$installed = @{} | |
$alreadyInstalled = @{} | |
function VersionCompare($version1, $version2) { | |
$version1 = $version1 -split "-", 2 | |
$version2 = $version2 -split "-", 2 |
This file contains hidden or 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
<# | |
Notice: | |
- That when there are special characters in the password, that it defaults to wrapping the password with " | |
- Except when already wrapped with single quotes, and a " is placed in the middle | |
- When a " or ' and the password is not wrapped, then the " is replaced with "" and the password is wrapped with "" | |
- This all depends upon the builder as well. Each connection string builder can havedifferent special characters. | |
- I highly suggest using the appropriate connection string builder for the appropriate provider. | |
- Derived https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbconnectionstringbuilder?view=net-5.0 | |
- System.Data.EntityClient.EntityConnectionStringBuilder | |
- System.Data.Odbc.OdbcConnectionStringBuilder |
This file contains hidden or 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
IF OBJECT_ID('dbo.fn_trigger_event_types') IS NOT NULL BEGIN | |
DROP FUNCTION dbo.fn_trigger_event_types | |
END | |
GO | |
CREATE FUNCTION dbo.fn_trigger_event_types (@parent_type INT) RETURNS XML | |
BEGIN RETURN | |
(SELECT [trigger_event_type].type_name, | |
dbo.fn_trigger_event_types([trigger_event_type].type) | |
FROM sys.trigger_event_types AS [trigger_event_type] |
This file contains hidden or 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 [master] | |
GO | |
IF EXISTS (SELECT 1 FROM sys.server_triggers WHERE name = 'block_control_trigger') BEGIN | |
DROP TRIGGER [block_control_trigger] ON ALL SERVER | |
END | |
GO | |
CREATE TRIGGER [block_control_trigger] | |
ON ALL SERVER |
This file contains hidden or 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
@rem bat file to ease use of the script | |
@%~d0 | |
@cd "%~dp0" | |
powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile ^ | |
-file "%~dpn0.ps1" ^ | |
-SolutionPath "path to .sln" ^ | |
-NuspecPath "path to .nuspec" ^ | |
-NugetSource "http://nuget.server.com" ^ |
This file contains hidden or 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
Clear-Host | |
# https://docs.microsoft.com/en-us/nuget/reference/nuget-exe-cli-reference | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Install-Package NuGet.CommandLine -Scope CurrentUser -Force | |
$package = Get-Package NuGet.CommandLine |