conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix appveyor version script to look at correct file.\n" }, { "from": "human", "value": "$regex = New-Object System.Text.RegularExpressions.Regex('<MajorVersion>(\\d\\.\\d)</MajorVersion>')\n$m = $regex.Match((Get-Content src\\Salesforce.VisualStudio.Services\\Salesf...
powershell
chosen
[ { "from": "human", "value": "Add notes about rewriting history.\n" }, { "from": "gpt", "value": "git commit --amend\r\n-avoid if you've already pushed\r\n-change the commit message, or\r\n-change the snapshot with `add` or `rm`\r\n-warning: is a mini-rebase, changes the SHA\r\n\r\ngit rebase -i\...
powershell
chosen
[ { "from": "system", "value": "Use the application manifest in the Chocolatey package over the setup executable\n" }, { "from": "human", "value": "$packageName = 'Chocolatey Explorer'\n$installerType = 'exe'\n$url = 'http://chocolatey-explorer.jdibble.co.uk/setup.exe'\n$silentArgs = '/i /s'\n$val...
powershell
chosen
[ { "from": "system", "value": "Enable Bash-Like Tab-Complete With Powershell\n\nBecause:\n- I'm using powershell as my main shell even on linux\n- powershell's default tab-complete is frustrating\n- Bash's tab-complete is like a quick 'ls' and is very helpful\n" }, { "from": "human", "value": "Se...
powershell
chosen
[ { "from": "system", "value": "Use RepoRoot instead of repoDir\n" }, { "from": "human", "value": "[CmdletBinding(PositionalBinding=$false)]\nparam (\n [switch]$release = $false)\n\nSet-StrictMode -version 2.0\n$ErrorActionPreference = \"Stop\"\n\ntry {\n . (Join-Path $PSScriptRoot \"build-u...
powershell
chosen
[ { "from": "system", "value": "Remove auth params for doc generation\nAuthentication and repo management should be moved to another script...\n" }, { "from": "human", "value": "param($username, $password, [switch]$Buildserver)\r\n\r\n$PSScriptRoot = split-path -parent $MyInvocation.MyCommand.Def...
powershell
chosen
[ { "from": "system", "value": "Fix hash for chocolate package install\n\n" }, { "from": "human", "value": "$ErrorActionPreference = 'Stop';\n$toolsDir = \"$(Split-Path -parent $MyInvocation.MyCommand.Definition)\"\n$url64 = 'https://certifytheweb.s3.amazonaws.com/downloads/CertifyTheWebSe...
powershell
chosen
[ { "from": "system", "value": "Check tag name to determine if it's time to deploy.\n" }, { "from": "human", "value": "if (($env:appveyor_repo_tag -eq \"True\") -and ($env:appveyor_repo_branch.StartsWith(\"v\"))) {\n write-output \"Deploying to PyPI...\"\n Invoke-Expression \"twine upload -u...
powershell
chosen
[ { "from": "system", "value": "Fix windows install script to set Path for the user\n\nOtherwise the path will be set for the session only\n\nSigned-off-by: Jose Cortes <90db7b580b32d49369f56eb8df8e548917a57096@datawire.io>\n" }, { "from": "human", "value": "param\r\n(\r\n $Path = \"C:\\telepre...
powershell
chosen
[ { "from": "system", "value": "Rewrite to use $TESTDRIVE which does auto cleanup\n" }, { "from": "human", "value": "# Tests related to TFS item 1370133 [PSUpgrade] Need -NoNewline parameter on Out-File, Add-Content and Set-Content\n# Connect request https://connect.microsoft.com/PowerShell/feedb...
powershell
chosen
[ { "from": "system", "value": "Update of the powershell script\n" }, { "from": "human", "value": "# params\r\n$location = \"LOCATION\"\r\n$ResourceGroupName = \"GEN-KEYVAULT-RESOURCEGROUP-NAM\"\r\n$KeyVaultName = \"GEN-KEYVAULT-NAME\"\r\n$KeyName = \"GEN-KEYVAULT-ENCRYPTION-KEY\"\r\n\r\n#Connect ...
powershell
chosen
[ { "from": "system", "value": "Fix for missing package version due to an non-working meta data extractor\n" }, { "from": "human", "value": "[OutputType([void])]\nparam(\n\t[Parameter()]\n\t$config = \"Release\"\n)\n\nRemove-Item *.nupkg\n\n$nuspecFiles = get-childitem FubarDev.FtpServer*\\*.nuspe...
powershell
chosen
[ { "from": "system", "value": "Add 'converge' alias for running chef-client.\n" }, { "from": "human", "value": "# Use the Git and posh-git from GitHub for Windows.\n# See <http://stackoverflow.com/a/12524788>\n. (Resolve-Path \"$env:LOCALAPPDATA\\GitHub\\shell.ps1\")\n. $env:github_posh_git\\prof...
powershell
chosen
[ { "from": "system", "value": "Upgrade to Dolphin VM v7.0.31\n" }, { "from": "human", "value": "\n# Powershell script to pull the VM files from GitHub into the current folder.\n# Edit the following to match the version of the VM that is compatible with this image\n\nparam \n(\n [string]$VMvers...
powershell
chosen
[ { "from": "system", "value": "Add nologo to publish script\n" }, { "from": "human", "value": "param([String]$Version=\"0.0.0\");\n\nForEach ($category in \"Core\", \"Modules\", \"Bundles\")\n{\n ForEach ($folder in (Get-ChildItem -Path $category -Directory))\n {\n dotnet pack $folde...
powershell
chosen
[ { "from": "system", "value": "Fix to stop script from failing if solution doesn't exist\n" }, { "from": "human", "value": "#\n# Filename: RemoveSolution.ps1\n#\nparam(\n[string]$SolutionName, #The unique CRM solution name\n[string]$CrmConnectionString, #The connection string as per CRM Sdk\n[in...
powershell
chosen
[ { "from": "system", "value": "Remove unneeded files after download.\n" }, { "from": "human", "value": "$ffmpeg = \"ffmpeg-20191118.0.0-d831edc\"\n$version = ($ffmpeg -split '-')[1]\n$rel32 = \"$ffmpeg-lgpl21-v142-static-md-x86\"\n$rel64 = \"$ffmpeg-lgpl21-v142-static-md-x64\"\n$wc = New-Object S...
powershell
chosen
[ { "from": "human", "value": "Add PowerShell script to start Docker stack\n\nThis commit adds a PowerShell script that mirrors the existing `deploy_stack.*` scripts.\n\nIt also checks that docker is installed and returns a readable error if not found (the alternative is a rather cryptic PowerShell error).\n\...
powershell
chosen
[ { "from": "system", "value": "Fix ensconce function when used with pipe operator.\n" }, { "from": "human", "value": "$deployToolsDir = Split-Path ((Get-Variable MyInvocation -Scope 0).Value.MyCommand.Path)\n\nif (Test-Path variable:\\OctopusParameters)\n{\n foreach($kp in $OctopusParameters....
powershell
chosen
[ { "from": "system", "value": "Update registry image, use C:/registry volume\n" }, { "from": "human", "value": "if (!(Test-Path C:\\vagrant\\registry-v2)) {\n mkdir -p C:\\vagrant\\registry-v2\n}\ndocker run --restart=always -d -p 5000:5000 -v \"C:\\vagrant\\registry-v2:C:\\data\" sixeyed/regist...
powershell
chosen
[ { "from": "system", "value": "Format output from json to return to hyper-v driver\n" }, { "from": "human", "value": "#Requires -Modules VagrantMessages\n\nparam(\n [Parameter(Mandatory=$true)]\n [string]$VmId\n)\n\ntry {\n $VM = Hyper-V\\Get-VM -Id $VmId\n Hyper-V\\Get-VMHardDiskDriv...
powershell
chosen
[ { "from": "system", "value": "Remove updating linux docker engine" }, { "from": "human", "value": "param(\n [string]$name\n)\n\nif (! $name) {\n $name = \"dev\"\n}\n\n# ensure that we are running as administrator\nif (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:...
powershell
chosen
[ { "from": "system", "value": "Use different database for IATA code.\n" }, { "from": "human", "value": "\n$req_query_iata\n\n$Fields = @{\"iatacode\" = \"$req_query_iata\"}\n$WebResponse = Invoke-RestMethod -Uri \"http://www.airlinecodes.co.uk/airlcoderes.asp\" -Method Post -Body $Fields -Verbose...
powershell
chosen
[ { "from": "system", "value": "Add stub to load user files.\n" }, { "from": "human", "value": "#!/usr/local/bin/pwsh\n#Terminate on powershell error in function or cmd-let. External\n#commands still need to be checked with $LastExitCode, $? checks\n#both, $Error contains a full set of last errors...
powershell
chosen
[ { "from": "human", "value": "Add script for release build\n" }, { "from": "gpt", "value": "$msbuild = \"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe\"\r\n\r\ncd ..\r\nInvoke-Expression ($msbuild + \" BuildSample.sln /p:Configuration=Release /t:Clean\")\r\nInvoke-Expression ($m...
powershell
chosen
[ { "from": "system", "value": "Add java and python dev tools section\n" }, { "from": "human", "value": "## Download Chocolatey Package Manager\nif(-not $env:ChocolateyInstall -or -not (Test-Path \"$env:ChocolateyInstall\"))\n{\n\tiex ((new-object net.webclient).DownloadString('http://chocolatey.o...
powershell
chosen
[ { "from": "system", "value": "Tweak node based on Microsoft's version\n" }, { "from": "human", "value": "## This configuration file uses BoxStarter to configure the system\r\n## and Chocolatey to install necessary packages\r\n\r\n## Development Tools - Node.JS & Yarn\r\n\r\nchoco install nvm\r\n...
powershell
chosen
[ { "from": "system", "value": "Fix release notes path in build\n" }, { "from": "human", "value": "$env:TGSVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo(\"$env:APPVEYOR_BUILD_FOLDER/artifacts/ServerHost/Tgstation.Server.Host.dll\").FileVersion\n\nWrite-Host \"TGS Version: $env:TGS...
powershell
chosen
[ { "from": "system", "value": "Switch to using my docker image\n" }, { "from": "human", "value": "trap [Management.Automation.CommandNotFoundException] {\n Write-Error 'Docker cannot be found. Make sure it is installed and added to the path.'\n Start-Process -FilePath 'https://docs.docker.com/d...
powershell
chosen
[ { "from": "system", "value": "Add Unit Test for Get-Host\n" }, { "from": "human", "value": "Describe \"Get-Host\" {\n It \"Should return a type of InternalHost for Get-Host cmdlet\" {\n\n\t(Get-Host).GetType().Name | Should Be InternalHost\n\n }\n\n It \"Should have $ host variable be e...
powershell
chosen
[ { "from": "human", "value": "Add a script to decode kubernetes secret.\n\nChange-Id: Ie668ecccb93d3c7e235df16cfce746a8334e01d5\n" }, { "from": "gpt", "value": "# Copyright (c) 2019 Google LLC.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file e...
powershell
chosen
[ { "from": "system", "value": "Handle environment not being present initially in script\n" }, { "from": "human", "value": "<#\n .DESCRIPTION\n Create a docker compose .env file\n#>\n$scriptPath = Split-Path -parent $PSCommandPath\n$envFilePath = Resolve-Path \"$scriptPath\\..\\.env\"\n$getEnvCo...
powershell
chosen
[ { "from": "human", "value": "Add script to download test files from GH folder via build\n" }, { "from": "gpt", "value": "[CmdletBinding()]\nparam (\n [Parameter(Mandatory=$false)][string]$githubTestFilesFolderUri,\n [Parameter(Mandatory=$false)][string]$githubBuildFilesFolderUri\n)\n\nif(!...
powershell
chosen
[ { "from": "human", "value": "Add helper script for pulling in latest from subtree dependencies\n" }, { "from": "gpt", "value": "<#\n .DESCRIPTION\n Pull the latest from the projects that are git subtrees.\n#>\n\ngit subtree pull --prefix lib/killrvideo-docker-common git@github.com:KillrVideo/k...
powershell
chosen
[ { "from": "system", "value": "Update to deployment script for 7-zip\n" }, { "from": "human", "value": "function ZipFile\n{\n\tparam(\n\t\t[String]$sourceFile,\n\t\t[String]$zipFile\n\t)\n\n\tset-alias sz \"C:\\Program Files\\7-Zip\\7z.exe\" \n\tsz a -tzip -r $zipFile $sourceFile | Out-Null\n}\n...
powershell
chosen
[ { "from": "system", "value": "Fix security vulnerability in npm lodash used in PackageVSTS cake.build task\n\n* https://nodesecurity.io/advisories?search=lodash&version=3.10.1\n" }, { "from": "human", "value": "npm i -g tfx-cli\ntfx extension create --manifest-globs vss-extension.json" }, {...
powershell
chosen
[ { "from": "human", "value": "Add PowerShell script to upload VSIX to MyGet feed" }, { "from": "gpt", "value": "$artifactsSearchPattern = \"./*.vsix\"\n$artifactsCollection = (Get-ChildItem $artifactsSearchPattern -Recurse)\n\n$vsixMyGetUploadEndpoint = \"https://www.myget.org/F/nanoframework-dev...
powershell
chosen
[ { "from": "system", "value": "Test properly for atom and code availability\n" }, { "from": "human", "value": "chcp 65001 | out-null\n\nfunction prompt {\n '[' + $env:username + '@' + $env:computername + ' ' + $pwd + \"]`r`n$ \"\n}\n\nfunction .. {\n Set-Location ..\n}\nfunction ... {\n ...
powershell
chosen
[ { "from": "system", "value": "Use net6.0 as framework for code coverage\n" }, { "from": "human", "value": "# Framework to use when generating coverage. Must be a \"real\" framework, i.e. not netstandard.\n$framework = \"netcoreapp3.1\";\n# The file path passed to coverlet...\n$coverletWantedOutp...
powershell
chosen
[ { "from": "human", "value": "Add PS script for electron-winstaller packaging\n" }, { "from": "gpt", "value": "<#\nPackage script for electron-winstaller\n\nThe NPM package electron-winstaller allows developers to\nbuild Windows installers for Electron apps using Squirrel\n(https://github.com/ele...
powershell
chosen
[ { "from": "system", "value": "Clean up a little code\n" }, { "from": "human", "value": "$hostname = $(get-childitem -path env:computername).value\n$ipaddress = $(ipconfig | where {$_ -match 'IPv4.+\\s(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})' } | out-null; $Matches[1])\n\n$puppet = 'C:\\Progra...
powershell
chosen
[ { "from": "system", "value": "Fix bug in version script.\n" }, { "from": "human", "value": "param([String]$oldVersion=\"\", [String]$newVersion=\"\")\niex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/StephenCleary/BuildTools/18aed44c432381eaa11329d82f63dfaf835d21...
powershell
chosen
[ { "from": "system", "value": "Update default version of Microsoft.PowerShell.SDK to 6.2.3\n" }, { "from": "human", "value": "if (!($DefaultFunctionMemory))\n{\n New-Variable -Name DefaultFunctionMemory -Value 512 -Option Constant\n}\n\nif (!($DefaultFunctionTimeout))\n{\n New-Variable -Nam...
powershell
chosen
[ { "from": "system", "value": "Print the cmake build command.\n" }, { "from": "human", "value": "$ErrorActionPreference = \"Stop\"\n\n$BUILD_MODE = $Env:BUILD_MODE\n$VS_PLATFORM = $Env:VS_PLATFORM\n\nif(!$BUILD_MODE) {$BUILD_MODE = \"Debug\"}\nif(!$VS_PLATFORM) {$VS_PLATFORM = \"Win32\"}\n\n# Use...
powershell
chosen
[ { "from": "human", "value": "Add first PowerShell script for copying in Windows 8/8.1/10 .\n\nHopefully works on WIndows 7 with PowerShell 4.\n" }, { "from": "gpt", "value": "[CmdletBinding()]\nParam(\n [Parameter(Mandatory=$false)]\n [switch]$force,\n [Parameter(Mandatory=$true)]\n ...
powershell
chosen
[ { "from": "system", "value": "Add $RPROMPT support similar to zsh\n" }, { "from": "human", "value": "function Get-GitBranch\r\n{\r\n\t$branch = git branch -a 2> $null | Where-Object {$_ -match \"^\\*\"}\r\n\tif ($branch -eq $null) {\r\n\t\treturn $null;\r\n\t}\r\n\t\r\n\t$branch = $branch.Substr...
powershell
chosen
[ { "from": "system", "value": "Build script now clears build output folder before building.\n" }, { "from": "human", "value": "$scriptDir = $MyInvocation.MyCommand.Path | split-path\n$outputDir = \"$scriptDir\\BuildOutput\"\n\nmd $outputDir -f | out-null\n\ngci $scriptDir -include Regalo.Core.csp...
powershell
chosen
[ { "from": "system", "value": "Update install root for package\n" }, { "from": "human", "value": "$packageName = 'PneumaticTube.portable' \n$url = 'https://github.com/hartez/PneumaticTube/releases/download/1.0.0/PneumaticTube.zip' \n\ntry { \n $binRoot = \"$env:systemdrive\\tools\"\n if($env:ch...
powershell
chosen
[ { "from": "system", "value": "Copy all the files from sdl develop libraries\n\n" }, { "from": "human", "value": "#Download SDL\nStart-FileDownload \"https://www.libsdl.org/release/SDL2-devel-2.0.5-VC.zip\" -FileName \"${env:Temp}\\sdl2.zip\"\n\nAdd-Type -AssemblyName System.IO.Compression.FileSy...
powershell
chosen
[ { "from": "system", "value": "Add slnf support to powershell local framework script\n" }, { "from": "human", "value": "# Run this script to use a local copy of osu-framework rather than fetching it from nuget.\n# It expects the osu-framework directory to be at the same level as the osu directory...
powershell
chosen
[ { "from": "system", "value": "Fix path to nuspec ps\n" }, { "from": "human", "value": "$root = $env:APPVEYOR_BUILD_FOLDER\n$versionStr = $env:APPVEYOR_BUILD_VERSION\n\nWrite-Host $root\nWrite-Host \"Setting .nuspec version tag to $versionStr\"\n\n$content = (Get-Content $root\\source\\IdentitySe...
powershell
chosen
[ { "from": "system", "value": "Add npm build and open shortcuts\n" }, { "from": "human", "value": "# Install into $HOME\\Documents\\WindowsPowerShell\n\nSet-Alias g git\nSet-Alias n npm\n\nfunction ns {npm start}\nfunction ncb {npm run clean; npm run build}\nfunction nr {Param($task) npm run $tas...
powershell
chosen
[ { "from": "system", "value": "Make sure repo is not dirty.\n" }, { "from": "human", "value": "Write-Host \"\"\nWrite-Host \"Pulling the latest:\" -ForegroundColor Green\ngit pull\n\n# if(git status --porcelain | Where-Object {$_ -match '^\\?\\?'}){\n# throw \"Untracked files exist\"\n# ...
powershell
chosen
[ { "from": "system", "value": "Remove -Confirm flag from test\n" }, { "from": "human", "value": "function Start-Test\r\n{\r\n Import-Module -Name (Join-Path $TestDir 'RivetTest') -ArgumentList 'ForcePop' \r\n Start-RivetTest\r\n}\r\n\r\nfunction Stop-Test\r\n{\r\n Stop-RivetTest\r\n R...
powershell
chosen
[ { "from": "system", "value": "Fix powershell null comparison warning\n" }, { "from": "human", "value": "$pacname = $args[0]\nif ($pacname -eq $null)\n{\n $pacname = (Get-PackageName)\n}\nadb shell monkey -p $pacname -c android.intent.category.LAUNCHER 1\n# adb shell am start -n \"$pacname/com...
powershell
chosen
[ { "from": "system", "value": "Fix 'UnitTests' task to invoke Pester just once\n" }, { "from": "human", "value": "#Requires -Modules 'InvokeBuild'\nParam (\n [string]$BuildOutput = \"$PSScriptRoot\\BuildOutput\",\n\n [string[]]$Dependency = @('Coveralls','Pester','PsScriptAnalyzer')\n)\n\nF...
powershell
chosen
[ { "from": "system", "value": "Remove module loading from vlan script\n" }, { "from": "human", "value": "#Requires -Modules VagrantMessages\n\nparam (\n [parameter (Mandatory=$true)]\n [string]$VmId,\n [parameter (Mandatory=$true)]\n [int]$VlanId\n)\n\n# Include the following modules\...
powershell
chosen
[ { "from": "human", "value": "Add patch version number script\n" }, { "from": "gpt", "value": "param(\n [Parameter(Mandatory=$true)]\n [string]\n $projectFile,\n\n [Parameter(Mandatory=$true)]\n [string]\n $version \n)\n\ntrap \n{ \n write-output $_ \n exit 1 \n} \n\nif...
powershell
chosen
[ { "from": "system", "value": "build: Change location to script's directory\n" }, { "from": "human", "value": "sv version $env:APPVEYOR_BUILD_NUMBER\nsv version 9999.0.$version-nightly\n.\\build-version.ps1 $version\n" }, { "from": "gpt", "value": "$scriptpath = $MyInvocation.MyComman...
powershell
chosen
[ { "from": "system", "value": "Fix invalid PSAvoidUsingCmdletAliases rule name in settings\n" }, { "from": "human", "value": "# The PowerShell Script Analyzer will generate a warning\n# diagnostic record for this file due to a bug -\n# https://github.com/PowerShell/PSScriptAnalyzer/issues/472\n@{...
powershell
chosen
[ { "from": "system", "value": "Add expID as a parameter\n" }, { "from": "human", "value": "#\n#\nparam (\n\t[string] $drive = \"Y\",\n [string] $solutionPath = \"LongTest2\",\n\t[string] $solutionName = \"LongTest2\",\n\t[int] $machines = 1,\n\t[int] $numberOfMethods = 100\n\t)\n\n# http://or...
powershell
chosen
[ { "from": "system", "value": "Support other version bump types\n" }, { "from": "human", "value": "$me = $MyInvocation.MyCommand.Definition;\n\nfunction Update-Version\n{\n param([string] $path)\n\n $xml = [xml](Get-Content $path)\n $versionAttr = $xml.DocumentElement['Metadata']['Identity'].A...
powershell
chosen
[ { "from": "system", "value": "Use default script for self signing.\n" }, { "from": "human", "value": "$cert = New-SelfSignedCertificate -DnsName (\"localtest.me\",\"*.localtest.me\") -CertStoreLocation cert:\\LocalMachine\\My\n$rootStore = Get-Item cert:\\LocalMachine\\Root\n$rootStore.Open(\"Re...
powershell
chosen
[ { "from": "system", "value": "Refactor run-tests.ps1 to use selected scripts instead testnames\n" }, { "from": "human", "value": "<#\n.SYNOPSIS\nThis script invokes all pester tests.\n#>\n\nparam(\n [string[]]$SelectedTests\n)\n\n$srcDir = Split-Path $PSScriptRoot -Parent;\n$pester = (Get-Ite...
powershell
chosen
[ { "from": "human", "value": "Add settings for Stroustrup style.\n\nThis is a copy of OTBS with just the PlaceOpenBrace.OnSameLine set to $false.\n" }, { "from": "gpt", "value": "# Inspired by http://eslint.org/docs/rules/brace-style#stroustrup\n@{\n IncludeRules = @(\n 'PSPlaceOpenBrac...
powershell
chosen
[ { "from": "human", "value": "Add PS script for DB creation\n" }, { "from": "gpt", "value": "#Variables\n$Image= \"mcr.microsoft.com/mssql/server:2017-CU9-ubuntu\"\n$Container = \"HomebankDevSqlServer\"\n$Password = \"H0mebankPassw0rd!\"\n$Database = \"Homebank\"\n\n#The first item is the header...
powershell
chosen
[ { "from": "system", "value": "Add the -pre suffix if not from master\n" }, { "from": "human", "value": "$root = (split-path -parent $MyInvocation.MyCommand.Definition)\n$lib = \"$root\\.package\\lib\\45\\\"\nIf (Test-Path $lib)\n{\n\tRemove-Item $lib -recurse\n}\nnew-item -Path $lib -ItemType di...
powershell
chosen
[ { "from": "human", "value": "Add a script to find Program IDs usable in COM\n" }, { "from": "gpt", "value": "# Source: https://blogs.msdn.microsoft.com/powershell/2009/03/20/get-progid/\nfunction Get-ProgID {\n #.Synopsis\n # Gets all of the ProgIDs registered on a system\n #.Descript...
powershell
chosen
[ { "from": "system", "value": "Add Microsoft Azure Storage Explorer to o365/azure setup\n" }, { "from": "human", "value": "#Script Name: New-EasyDevWorkstation.ps1\n#Purpose: Quick and clean way to setup a simple developer workstation. Tested only for Windows 10\n#Author Nissan Dookeran\n#Date 23...
powershell
chosen
[ { "from": "system", "value": "Add Invoke-Expression Pester Unit Test\n" }, { "from": "human", "value": "Describe \"Invoke-Expression\" {\n\n Context \"Should execute the invoked command validly\" {\n\n\tIt \"Should return the echoed text\" {\n\t (Invoke-Expression -command \"echo pestertes...
powershell
chosen
[ { "from": "system", "value": "Add status to query and message\n" }, { "from": "human", "value": "# Based on a conversation at the Seattle SWUG about using the API\n# to clean up non-up interfaces, this has been written/provided.\n\nImport-Module SwisPowerShell\n\n$OrionServer = 'localhost'\n$Use...
powershell
chosen
[ { "from": "human", "value": "Add a script to install vscode extensions\n" }, { "from": "gpt", "value": "# Script to install extensions for Visual Studio Code\n\n# Install golang extensions\ncode --install-extension lukehoban.go\n\n# Install Python extensions\ncode --install-extension freakypie.c...
powershell
chosen
[ { "from": "system", "value": "Improve running of tests during CI build.\n" }, { "from": "human", "value": "$testProjects = Get-ChildItem test/HTTPlease*.csproj -File -Recurse\n\nForEach ($testProject In $testProjects) {\n\tdotnet test $testProject\n}\n" }, { "from": "gpt", "value": "...
powershell
chosen
[ { "from": "human", "value": "Add setting preset for Allman-style formatting\n" }, { "from": "gpt", "value": "@{\n IncludeRules = @(\n 'PSPlaceOpenBrace',\n 'PSPlaceCloseBrace',\n 'PSUseConsistentWhitespace',\n 'PSUseConsistentIndentation',\n 'PSAlignAssignme...
powershell
chosen
[ { "from": "system", "value": "Update message in Test case for WriteHost Rule\n" }, { "from": "human", "value": "Import-Module PSScriptAnalyzer\nSet-Alias ctss ConvertTo-SecureString\n$writeHostMessage = [Regex]::Escape(\"File 'AvoidUsingWriteHost.ps1' uses Write-Host. This is not recommended be...
powershell
chosen
[ { "from": "human", "value": "Add new Power Shell script\n" }, { "from": "gpt", "value": "<#\n\n.SYNOPSIS\n\nMonitors a Window's Service and indicates if it is running.\n\n.EXAMPLE\n\nPS > Check-Service \nGets the number of handles allocated by all the processes running on the host.\n\n#>\nparam(...
powershell
chosen
[ { "from": "human", "value": "Deploy multiple App Service Plans and loadbalance across them using Azure Front Door\n" }, { "from": "gpt", "value": "# Deploy multiple App Service Plans and loadbalance across them using Azure Front Door\n\n$location = 'australiaeast'\n$loc = 'aue'\n$rg = 'appservic...
powershell
chosen
[ { "from": "system", "value": "Revert \"Improve speed pulling images\"\n\nThis reverts commit 9784b2c6c97f0b05e4eed946a115efa27dfff243.\n" }, { "from": "human", "value": "$ErrorActionPreference = 'Stop';\n$files = \"\"\nWrite-Host Starting build\n\nWrite-Host Disable Windows Defender\nSet-MpPrefe...
powershell
chosen
[ { "from": "system", "value": "Add management of missing environment variable when building on my own PC\n" }, { "from": "human", "value": "$root = (split-path -parent $MyInvocation.MyCommand.Definition)\n$lib = \"$root\\.package\\lib\\45\\\"\nif (Test-Path $lib)\n{\n\tRemove-Item $lib -recurse\n...
powershell
chosen
[ { "from": "human", "value": "Add version for Office 365 and/or Azure Developer workstation\n" }, { "from": "gpt", "value": "#Script Name: New-EasyDevWorkstation.ps1\n#Purpose: Quick and clean way to setup a simple developer workstation. Tested only for Windows 10\n#Author Nissan Dookeran\n#Date ...
powershell
chosen
[ { "from": "human", "value": "Scale up/down Event Hubs example\n" }, { "from": "gpt", "value": "$rg = 'hellomessaging-rg'\n$location = 'australiaeast'\n$eventhubNamespace = 'hellomessaging-hub'\n\n$ErrorActionPreference = 'Stop'\n\nGet-AzEventHubNamespace -ResourceGroupName $rg -NamespaceName $ev...
powershell
chosen
[ { "from": "human", "value": "Add Azure Policy Compliance Data script\n" }, { "from": "gpt", "value": "\n<#PSScriptInfo\n\n.VERSION 1.0\n\n.GUID f2d5adaf-ed37-4dcc-96d5-2ac72b770cf8\n\n.AUTHOR Francois-Xavier Cat\n\n.COMPANYNAME\n\n.COPYRIGHT\n\n.TAGS\n\n.LICENSEURI\n\n.PROJECTURI\n https://gi...
powershell
chosen
[ { "from": "system", "value": "Add ipmo Docker completion modules\n" }, { "from": "human", "value": "sv DESKTOP (Join-Path $HOME Desktop) -Option ReadOnly, AllScope\nsv DOWNLOADS (Join-Path $HOME Downloads) -Option ReadOnly, AllScope\nsv PROFILEDIR (Split-Path $PROFILE) -Option ReadOnly, AllScope...
powershell
chosen
[ { "from": "system", "value": "Add tests for command name matching\n" }, { "from": "human", "value": "Describe \"NativeLinuxCommands\" {\n It \"Should return a type of System.Object for hostname cmdlet\" {\n (hostname).GetType().BaseType | Should Be 'System.Object'\n (hostname).G...
powershell
chosen
[ { "from": "human", "value": "Add script to decode strings from DFM\n" }, { "from": "gpt", "value": "<#\n.SYNOPSIS\n Create .NET string from DFM-encoded string.\n#>\nparam (\n [string]$String\n)\n\n$chars = $String.Split(@('#'), 'RemoveEmptyEntries') | % { [char] [int]$_ }\nNew-Object Syste...
powershell
chosen
[ { "from": "system", "value": "Check Domain and Application Directory contexts for credentials when validating SMB creds\n" }, { "from": "human", "value": "Param(\r\n [Parameter(Mandatory=$true)]\r\n [string]$username,\r\n [Parameter(Mandatory=$true)]\r\n [string]$password\r\n)\r\n\r\...
powershell
chosen
[ { "from": "system", "value": "Remove Windows Defender, keep TrustedInstaller\n" }, { "from": "human", "value": "Write-Host Downloading debloat zip\n$url=\"https://github.com/StefanScherer/Debloat-Windows-10/archive/master.zip\"\n(New-Object System.Net.WebClient).DownloadFile($url, \"$env:TEMP\\d...
powershell
chosen
[ { "from": "human", "value": "Add sample script to create volume and Containers\n" }, { "from": "gpt", "value": "# Docker volume für PostgresDB\ndocker volume create PostgresDBVolume\n\n# Postgres DB container\ndocker run --name Postgres -d `\n -e POSTGRES_PASSWORD=P@ssw0rd! `\n -e PGDATA=...
powershell
chosen
[ { "from": "system", "value": "Update build script for pushing packages to NuGet.org\n" }, { "from": "human", "value": "param([Parameter(Mandatory=$true)][string]$Version) \n\ncd ..\\.nuget\n.\\NuGet.exe push ..\\artifacts\\Okra.Core.$Version.nupkg\n.\\NuGet.exe push ..\\artifacts\\Okra.MEF.$Vers...
powershell
chosen
[ { "from": "system", "value": "Fix lib path references to be relative to calling path\nHopefully...\n" }, { "from": "human", "value": "mkdir -Force lib | Out-Null\n\n\"Looking for Hearthstone Deck Tracker install...\"\n$HDTPath = \"$Env:LOCALAPPDATA\\HearthstoneDeckTracker\"\nif(Test-Path $HDTPa...
powershell
chosen
[ { "from": "human", "value": "Add Parse TSQL powershell script\n\n" }, { "from": "gpt", "value": "#requires -version 5.0\n#requires -modules dbatools,pester\n\n<#\n.Synopsis\n Ensure that some SQL Scripts in a directory would parse so there was some guarantee that they were valid T-SQL.\n\n.OUT...
powershell
chosen
[ { "from": "system", "value": "CI: Update build script for Windows\n\nDisable serial and USB backends.\n\nSigned-off-by: Paul Cercueil <a027184a55211cd23e3f3094f1fdc728df5e0500@crapouillou.net>\n" }, { "from": "human", "value": "\n$COMPILER=$Env:COMPILER\n$ARCH=$Env:ARCH\n\n$src_dir=$pwd\n\nmkdir...
powershell
chosen
[ { "from": "system", "value": "Fix build script to terminate on errors\n" }, { "from": "human", "value": "# Restore our NuGet packages\nnuget sources Add -Name CitiesSkylines -Source $env:NUGET_CSL_URL -UserName $env:NUGET_CSL_USERNAME -Password $env:NUGET_CSL_PASSWORD -Verbosity quiet -NonIntera...
powershell
chosen
[ { "from": "human", "value": "Add PS script for scheduled tasks\n" }, { "from": "gpt", "value": "<#\n.SYNOPSIS\n Le script permet de modifier l'ensemble des quotas de manière automatique.\n\n.DESCRIPTION\n Liste l'ensemble des tâches planifiées des serveurs sous forme de fichier\n CSV.\n...
powershell
chosen
[ { "from": "system", "value": "Use script path to relative paths\n\nThis enables the script to run from anywhere\n" }, { "from": "human", "value": "dotnet --version\n\n$buildExitCode=0\n\nWrite-Output \"*** Restoring packages\"\ndotnet restore\n$buildExitCode = $LASTEXITCODE\nif ($buildExitCode -...
powershell
chosen
[ { "from": "system", "value": "Remove call to nuget restore in build script" }, { "from": "human", "value": "gci **\\*.sln -recurse -Exclude Master.sln | foreach { nuget restore $_;msbuild $_ /t:Rebuild /p:platform=\"any cpu\" /p:Configuration=\"Debug\" /p:OutDir=$(\"$(PWD)\\Output\\\" + $_.Bas...
powershell
chosen
[ { "from": "system", "value": "Sort runTests.ps1 from newest to oldest in Windows tests too.\n" }, { "from": "human", "value": "# Copyright(c) 2017 Google Inc.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n# use this file except in compliance with the ...
powershell
chosen
[ { "from": "system", "value": "Allow pulling from other image category\n" }, { "from": "human", "value": "$BASEPATH_HEADERS = '.\\assets\\headers\\';\n$BASEPATH_POSTS = '.\\_posts\\';\n\nForEach ($post in Get-ChildItem $BASEPATH_POSTS*.md) { \n $safeName = $post.Name.Replace(\".md\",\"\");\n ...
powershell
chosen
[ { "from": "system", "value": "Fix NugetRestore.ps1 to not look for packages.config\n\nFixes #946\n" }, { "from": "human", "value": "$NuGetExe = \"$PSScriptRoot\\NuGet.exe\"\n\n& $NuGetExe install xunit.runner.console -version 2.0.0 -OutputDirectory \"$PSScriptRoot\\..\\..\\packages\"\n& $NuGetEx...
powershell
chosen
[ { "from": "system", "value": "Switch to freeSSHD instead of Openssh\n" }, { "from": "human", "value": "## Download Chocolatey Package Manager\nif(-not $env:ChocolateyInstall -or -not (Test-Path \"$env:ChocolateyInstall\"))\n{\n\tiex ((new-object net.webclient).DownloadString('http://chocolatey.o...
powershell
chosen