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
function Remove-BOMFromFile{ | |
param( | |
[Parameter(Mandatory)] | |
[ValidateScript({Test-Path -Path $_ -PathType Container})] | |
[String]$Path | |
) | |
foreach ($file in (Get-ChildItem -Path $Path -Include '*.hql' -Recurse)) | |
{ | |
if(Test-BOMInFile -File $file){ |
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 you receive the following error message in PowerShell or VSTS agent this script fixes it: | |
# ErrorMessage: The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again. | |
$registryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main' | |
$name = 'DisableFirstRunCustomize' | |
$value = 1 | |
New-Item -Path $registryPath.Substring(0,$registryPath.LastIndexOf('\')) | |
New-Item -Path $registryPath | |
New-ItemProperty -Path $registryPath -Name $name -PropertyType DWORD -Value $value |
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
# docker build -f Dockerfile -t datawarehous-insert-test . | |
# docker run -it --rm --env-file=env.azure datawarehous-insert-test | |
# env.azure has the connection details | |
FROM python:3.6-jessie | |
WORKDIR /usr/src/app | |
COPY install_ctds.sh requirements.txt ./ | |
RUN ["/bin/bash", "-c", "./install_ctds.sh"] | |
RUN pip install --no-cache-dir -r requirements.txt |
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
Register-PSRepository -Name PSGalleryInternal -SourceLocation https://dtlgalleryint.cloudapp.net/api/v2/ -InstallationPolicy Untrusted -PublishLocation https://dtlgalleryint.cloudapp.net/api/v2/package/ -ScriptPublishLocation https://dtlgalleryint.cloudapp.net/api/v2/package/ -ScriptSourceLocation https://dtlgalleryint.cloudapp.net/api/v2/items/psscript/ -PackageManagementProvider NuGet | |
Install-Module -Name AzureAD.Standard.Preview |
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
function Get-LogsParsed{ | |
param( | |
[Parameter(Mandatory,ValueFromPipeline=$true)] | |
[String]$Path | |
) | |
PROCESS{ | |
Import-Csv -Path $Path -Delimiter ';' -Header @( | |
'version-number' | |
,'request-start-time' |
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
$directoriesToMove = 'Backup' | |
$newDirectory = 'C:\target\directory' | |
(Get-ChildItem -Recurse -Path $directoriesToMove -Directory) | foreach{ | |
$newPath = $($_.FullName.Replace("$PWD", $newDirectory)); | |
$newPath = $newPath.Substring(0, $newPath.LastIndexOf('\')); | |
New-Item -Path $newPath -ItemType Directory | Out-Null; | |
Move-Item -Path $_.FullName -Destination $newPath} |
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
#Requires -RunAsAdministrator | |
# Pre-requisites | |
Install-Module PowerShellGet -Force # to install additional packages | |
Import-Module PowerShellGet -MinimumVersion 2.2.0 | |
# Doesn't work because PowerShellGet doesn't support SemVer 2.0 yet. https://github.com/PowerShell/PowerShellGet/issues/222 | |
Install-Package NuGet.Core,NuGet.ProjectModel | |
# Instead run. Recommmend copy as installs additional libraries already cover by NETStandard 2.0 |
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
#Requires -Modules Az | |
param( | |
[Parameter(Mandatory)] | |
[String]$StorageAccountName, | |
[Parameter(Mandatory)] | |
[String]$ContainerName, | |
[Parameter(Mandatory = $false)] | |
[String]$BlobFilter, |
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)] | |
[String[]]$Branches | |
) | |
$newLineChar = [Environment]::NewLine | |
Write-Output $newLineChar | |
[String[]]$commitCountMsgs = @() | |
[String[]]$scriptOutputLines = @() |