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
<# | |
.SYNOPSIS | |
Runs a select with on the specified table with the specified columns | |
and writes the result to a CSV file. | |
.DESCRIPTION | |
This function calls the connection passed as a parameter and sends a | |
SELECT command to it. The table on which the SELECT is run as well as | |
the selected columns are passed as a parameter. | |
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
# Database servername | |
$Servers = @('server1', 'server2') | |
# Datbase name | |
$DatabaseName = "Dbname" | |
# database select query | |
$sqlQuery = $("select top 5 * from sys.objects") | |
# Temporary file name with path | |
$csvPath = "$env:TEMP\" | |
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 | |
Import-Module -Name SqlPs #or SqlServer | |
Import-Module -Name ImportExcel | |
# Database servername | |
$ServerName = "Server" | |
# Datbase name | |
$DatabaseName = "AdventureWorksDW2017" | |
# database select query | |
$Query = "SELECT TOP (5) [DatabaseLogID],[PostTime],[DatabaseUser],[Event],[Schema],[Object] FROM [AdventureWorksDW2017].[dbo].[DatabaseLog]" |
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
#Docker for Windows requires Hyper-V. This needs to be disabled before you can run VirtualBox. | |
#And to start using Docker for Windows again, re-enable Hyper-V: | |
# Run from elevated prompt (admin privileges) | |
function SwitchDockerorVirtualBox{ | |
[CmdletBinding()] | |
param( | |
[switch]$Docker | |
) |
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
Set-ExecutionPolicy Bypass -Scope Process -Force; | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco -? | |
choco | |
choco feature enable -n allowGlobalConfirmation |
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
################################ Installation | |
Set-ExecutionPolicy Unrestricted | |
# Install Chocolatey | |
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
# Install Minikube (this also installs kubectl as a dependency) | |
choco install -y minikube -force | |
#choco install minikube kubernetes-cli | |
minikube config set WantUpdateNotification false |
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 | |
$MainFolder = 'E:\Learning\Documents\Phones\OnePlus 1+\Telegram\Telegram Documents\Zip\Zips' | |
$7zipExecutable = "C:\Program Files\7-Zip\7z.exe" | |
$shell=new-object -com shell.application | |
$CurrentLocation = $MainFolder #get-location # | |
$CurrentPath = $CurrentLocation.path | |
$Location = $shell.namespace($CurrentPath) | |
Set-Location $CurrentLocation |
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
Some Jenkinsfile examples |
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
# | |
# Script to start, stop, restart Jekyll Dev Environment container | |
# | |
# Set default parameter set | |
[cmdletbinding(DefaultParameterSetName='container')] | |
# Intialize parameters | |
param ( | |
[Parameter(Mandatory = $true)] |
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
# | |
# Script to start, stop, restart Jekyll Dev Environment container | |
# | |
# Set default parameter set | |
[cmdletbinding(DefaultParameterSetName='container')] | |
# Intialize parameters | |
param ( | |
[Parameter(Mandatory = $true)] |
OlderNewer