code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
<#
This is designed for all paths you need configurations for.
#>
# The default path where dbatools stores persistent data
Set-DbaConfig -FullName 'Path.DbatoolsData' -Value "$env:AppData\PowerShell\dbatools" -Initialize -Validation string -Handler { } -Description "The path where dbatools stores persistent data on a... | SirCaptainMitch/dbatools | internal/configurations/settings/paths.ps1 | PowerShell | mit | 1,572 |
$lastcommit = git rev-parse HEAD
jekyll build
cd _site
"" >> .nojekyll
git add -A
git commit -m "commit($lastcommit)"
git push origin master
cd .. | mvsouza/mvsouza.github.io | buildCommitSite.ps1 | PowerShell | mit | 146 |
function Import-XLSX {
<#
.SYNOPSIS
Import data from Excel
.DESCRIPTION
Import data from Excel
.PARAMETER Path
Path to an xlsx file to import
.PARAMETER Sheet
Index or name of Worksheet to import
.PARAMETER Header
Replacement headers. Must match orde... | Samnor/Sheet-Conqueror | Modules/PSExcel/1.0/Import-XLSX.ps1 | PowerShell | mit | 5,392 |
$drives = Get-WmiObject win32_PerfFormattedData_PerfDisk_PhysicalDisk | ?{$_.name -ne "_Total"} | Select Name
$idx = 1
write-host "{"
write-host " `"data`":[`n"
foreach ($perfDrives in $drives)
{
if ($idx -lt $drives.Count)
{
$line= "{ `"{#DISKNUMLET}`" : `"" + $perfDrives.Name + "`" },"
write-h... | WZQ1397/zabbix | windows/windows/get_pdisks.ps1 | PowerShell | mit | 526 |
function Prepare-SAN-LUN-Detach-Remove {
<#
.Synopsis
This script creates batch files for remove of VMware datastores from ESXi hosts
.DESCRIPTION
This Script supports in the process of unmount/detach of SAN Luns from VMware ESXi hosts.
As this has to be done very, very carefully, this task is not fully auto... | rebneth/RobertEbneth.VMware.vSphere.Automation | Prepare-SAN-Lun-Detach.ps1 | PowerShell | mit | 14,795 |
Import-Module ActiveDirectory
$users = Import-Csv -Path C:\ScriptSources\AD_Update0215.csv
foreach ($user in $users)
{
$Manager = (get-aduser -filter "Userprincipalname -eq '$($user.Manager)'")
Get-ADUser -Filter "Userprincipalname -eq '$($user.Upn)'" -Search... | EmpressDeIT/PowerShell | ISE_Tabs/AD_BulkUpdate&Report.ps1 | PowerShell | mit | 2,284 |
# Helper script for those who want to run psake without importing the module.
# Example run from PowerShell:
# .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0"
# Must match parameter definitions for psake.psm1/invoke-psake
# otherwise named parameter binding fails
param(
[Parameter(Position=0,Mandatory=0)]
[... | khaos-one/sakebuild | content/SakeBuild.ps1 | PowerShell | mit | 1,965 |
function Set-GitHubToken {
<#
.Synopsis
Internal function that obtains the username and Personal Access Token from the user.
.Notes
Created by Trevor Sullivan <trevor@trevorsullivan.net>
#>
[CmdletBinding()]
param (
)
### Invoke the GitHub Personal Access Token screen
Invo... | lweniger/PowerShell | Modules/downloaded/powershellgallery/PSGitHub/0.13.9/Functions/Public/Set-GitHubToken.ps1 | PowerShell | mit | 981 |
<#
.SYNOPSIS
script to download all sf package versions to extract .man file into separate directory for parsing sf .etl files
.LINK
[net.servicePointManager]::Expect100Continue = $true;[net.servicePointManager]::SecurityProtocol = [net.SecurityProtocolType]::Tls12;
iwr https://raw.githubusercontent.com/jagilber/power... | jagilber/powershellScripts | serviceFabric/sf-download-cab.ps1 | PowerShell | mit | 2,267 |
[CmdletBinding()]
$myPath = Split-Path $script:MyInvocation.MyCommand.Path
$scriptsInOrder = Get-ChildItem ($myPath) -Directory | ForEach-Object { Get-ChildItem (($_.FullName) + "\*.ps1") -Recurse } | Where-Object {!$_.Name.StartsWith("~")} | Sort-Object
$scriptsInOrder | % {
$shortname = $_.Name.Replace(".ps1",... | DBHeise/VM_Setup | run.ps1 | PowerShell | mit | 744 |
# culture ="en-US"
ConvertFrom-StringData -StringData @'
AddingType = Adding MIMEType '{0}' for extension '{1}'.
RemovingType = Removing MIMEType '{0}' for extension '{1}'.
TypeExists = MIMEType '{0}' for extension '{1}' is present.
TypeNotPresent ... | remcoeissing/xWebAdministration | source/DSCResources/MSFT_xIisMimeTypeMapping/en-US/MSFT_xIisMimeTypeMapping.strings.psd1 | PowerShell | mit | 484 |
function Remove-Role {
<#
.SYNOPSIS
Remove a role.
.PARAMETER Name
The name of the role to remove.
.EXAMPLE
!remove-role itsm-modify
#>
[PoshBot.BotCommand(
Aliases = ('rr', 'remove-role'),
Permissions = 'manage-roles'
)]
[cmdletbinding()]
par... | poshbotio/PoshBot | PoshBot/Plugins/Builtin/Public/Remove-Role.ps1 | PowerShell | mit | 2,468 |
Describe "Issue 828: No NullReferenceExceptionin AlignAssignmentStatement rule when CheckHashtable is enabled" {
It "Should not throw" {
# For details, see here: https://github.com/PowerShell/PSScriptAnalyzer/issues/828
# The issue states basically that calling 'Invoke-ScriptAnalyzer .' with a certa... | PowerShell/PSScriptAnalyzer | Tests/Engine/SettingsTest/Issue828/Issue828.tests.ps1 | PowerShell | mit | 1,103 |
configuration Sample_cFSRMQuota
{
Import-DscResource -Module cFSRMQuotas
Node $NodeName
{
cFSRMQuota DUsers
{
Path = 'd:\Users'
Description = '5 GB Hard Limit'
Ensure = 'Present'
Size = 5GB
SoftLimit = $False
ThresholdP... | PlagueHO/cFSRMQuotas | Examples/Sample_cFSRMQuota.ps1 | PowerShell | mit | 2,419 |
#requires -Version 2.0
#region Info
<#
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2016, Quality Software Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the fol... | jhochwald/NETX | Profile/functions/Get-HostFileEntry.ps1 | PowerShell | bsd-3-clause | 15,029 |
$package = 'AdobeAIR'
try {
# http://forums.adobe.com/message/4677900
$airInstall = 'Adobe AIR\Versions\1.0'
$airPath = $Env:CommonProgramFiles, ${Env:CommonProgramFiles(x86)} |
% { Join-Path $_ $airInstall } |
? { Test-Path $_ } |
Select -First 1
$airSetup = Join-Path $airPath 'setup.ms... | michaelray/Iristyle-ChocolateyPackages | AdobeAIR/tools/chocolateyUninstall.ps1 | PowerShell | mit | 762 |
param($installPath, $toolsPath, $package, $project)
$analyzersFilesBasePath = Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers"
$styleCopDotJsonBasePath = Join-Path $analyzersFilesBasePath "stylecop.json"
$caDictionaryBasePath = Join-Path $analyzersFilesBasePath "dictionary.xml"
$releaseRulesetBasePath = J... | NaosProject/Naos.Build | Analyzers/tools/uninstall.ps1 | PowerShell | mit | 781 |
[CmdletBinding()]
param([switch]$NoNewProcess)
if (!$NoNewProcess) {
# Run the update in a separate process since it requires importing the module.
Write-Host "Launching new process."
& (Get-Command -Name powershell.exe -CommandType Application) -Command ". '$($MyInvocation.MyCommand.Path)' -NoNewProcess"
... | Microsoft/vso-task-lib | powershell/Docs/Update-Docs.ps1 | PowerShell | mit | 8,051 |
$currentPath = Split-Path $MyInvocation.MyCommand.Path
$msbuildFile = Join-Path $currentPath src\VersionTasks.msbuild
& "$(get-content env:windir)\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" $msbuildFile /t:Build
Write-Host "Press any key to continue . . ."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | martinbuberl/VersionTasks | ClickToBuild.ps1 | PowerShell | mit | 316 |
Register-DbaConfigValidation -Name "double" -ScriptBlock {
Param (
$Value
)
$Result = New-Object PSOBject -Property @{
Success = $True
Value = $null
Message = ""
}
try { [double]$number = $Value }
catch {
$Result.Message = "Not a double: $Value"
... | SirCaptainMitch/dbatools | internal/configurations/validation/double.ps1 | PowerShell | mit | 429 |
# Originally based on https://github.com/serilog/serilog/blob/dev/Build.ps1 - (c) Serilog Contributors
Push-Location $PSScriptRoot
if(Test-Path .\artifacts) {
echo "build: Cleaning .\artifacts"
Remove-Item .\artifacts -Force -Recurse
}
& dotnet restore --no-cache
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $f... | nblumhardt/influxdb-lineprotocol | Build.ps1 | PowerShell | apache-2.0 | 1,834 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-4.0-8137-x64.7z'
$checksum = 'c8b9dcaa72bdbd00c03a2c951680437c32154e1b'
$checksumType = 'sha1'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
In... | dtgm/chocolatey-packages | automatic/_output/dolphin/4.0.8137/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 761 |
# generated vars
$packageName = 'antidupl'
$url = 'https://sourceforge.net/projects/antidupl/files/bin/AntiDupl.NET-2.3.6.exe'
$checksum = '31558c2dcb18470803130417c83a2683371feab6'
# static vars
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$rarFile = Join-Path $toolsDi... | dtgm/chocolatey-packages | automatic/_output/antidupl/2.3.6/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,374 |
$p = @{
Name = "GistProvider"
NuGetApiKey = $NuGetApiKey
LicenseUri = "https://github.com/dfinke/OneGetGistProvider/blob/master/LICENSE"
Tag = "Gist","Github","PackageManagement","Provider"
ReleaseNote = "Updated to work with rename to PackageManagement"
ProjectUri = "https://github.com/dfink... | beni55/OneGetGistProvider | PublishToGallery.ps1 | PowerShell | apache-2.0 | 362 |
import-module au
$releases = 'https://www.bennewitz.com/bluefish/stable/binaries/win32/'
$softwareName = 'Bluefish*'
function global:au_BeforeUpdate { Get-RemoteFiles -Purge -NoSuffix }
function global:au_SearchReplace {
@{
".\legal\VERIFICATION.txt" = @{
"(?i)(^\s*location on\:?\s*)\<.*\>" = "`${1}<$re... | jberezanski/chocolatey-coreteampackages | automatic/bluefish/update.ps1 | PowerShell | apache-2.0 | 1,269 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "Tests for paths of submodules in module manifest" -tags "CI" {
$moduleName = 'ModuleA'
$moduleFileName = "$moduleName.psd1"
$submoduleName = 'ModuleB'
$submoduleFileName = "$submoduleName.psm1"
$moduleRootPath = Join... | JamesWTruher/PowerShell-1 | test/powershell/engine/Module/SubmodulePathInManifest.Tests.ps1 | PowerShell | mit | 2,506 |
# Publishes our build assets to nuget, myget, dotnet/versions, etc ..
#
# The publish operation is best visioned as an optional yet repeatable post build operation. It can be
# run anytime after build or automatically as a post build step. But it is an operation that focuses on
# build outputs and hence can't rely on... | abock/roslyn | eng/publish-assets.ps1 | PowerShell | mit | 5,317 |
function Move-BadInstall {
param(
[string] $packageName,
[string] $version = '',
[string] $packageFolder = ''
)
Write-Debug "Running 'Move-BadInstall' for $packageName version: `'$version`', packageFolder:`'$packageFolder`'";
#copy the bad stuff to a temp directory
$badPackageFolder = $badLibPa... | chocolatey/chocolatey | src/functions/Move-BadInstall.ps1 | PowerShell | apache-2.0 | 1,010 |
Param(
#
[ValidateNotNullOrEmpty()]
$ProductId
)
Function Get-TempPassword()
{
Param(
[int] $length=10,
[string[]] $sourcedata
)
For ($loop=1; $loop -le $length; $loop++)
{
$tempPassword+=($sourcedata | GET-RANDOM)
}
return $tempPassword
}
# Ensure Power... | rnithish/MyOpenGit | DevTestLabs/azure-devtestlab-master/Artifacts/windows-azurepowershell/StartChocolatey.ps1 | PowerShell | mit | 1,997 |
# @$mariadbVer MariaDBVer
# @$arch win32/winx64
# @$installSqlDir specify install.sql dir
Param(
[Parameter(mandatory=$false)][String]$mariadbVersion = $null,
[Parameter(mandatory=$false)][String]$mroongaVersion = $null,
[Parameter(mandatory=$false)][String[]]$platforms = $null
)
. ".\versions.ps1"
... | cosmo0920/PowerShell-for-Mroonga-building | powershell/install-mroonga.ps1 | PowerShell | mit | 1,394 |
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
#Based on NO DETECTION IN PRO
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'zip'
validExitCodes= @(0) #please insert other valid exit codes here
url = "https... | flcdrg/au-packages | mirth-administrator-launcher.portable/tools/chocolateyinstall.ps1 | PowerShell | mit | 1,244 |
[cmdletbinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string] $Itemspec = "$/",
[Parameter(Mandatory=$true)]
[ValidateSet("None", "Full", "OneLevel")]
[string] $Recursion = "None",
[Parameter(Mandatory=$false)]
[ValidateSet("true", "false")]
[string] $Del... | jessehouwing/vsts-tfvc-tasks | tf-vc-undo/v1/TfvcUndo.ps1 | PowerShell | mit | 1,572 |
$cmdLets = (Get-Module pscx).ExportedCmdlets.Keys
$functions = (Get-Module pscx).ExportedFunctions.Keys
$cmdLetsAndFunctions = $cmdLets + $functions | Select -uniq | Sort-Object
$nounsAndCommands = @{}
foreach ( $cmdLet in ($cmdLetsAndFunctions) ) {
$noun = $cmdLet.split('-')[1]
if ( ! $noun ) {
continue
... | Pscx/Pscx | Tools/generate-markdown-docs.ps1 | PowerShell | mit | 1,155 |
#
# Module manifest for module 'AzureRM.Consumption'
#
# Generated by: Microsoft Corporation
#
# Generated on: 4/25/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.1.0'
# Supported PSEditions
# CompatiblePSEditions ... | krkhan/azure-powershell | src/ResourceManager/Consumption/AzureRM.Consumption.psd1 | PowerShell | apache-2.0 | 4,340 |
<#
.Synopsis
.\install-scaleiosvm.ps1
.DESCRIPTION
install-scaleiosvm is the a vmxtoolkit solutionpack for configuring and deploying scaleio 2.0 svm´s
Copyright 2014 Karsten Bott
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the L... | bottkars/labbuildr | labbuildr/install-scaleiosvm.ps1 | PowerShell | apache-2.0 | 27,956 |
$packageName = 'hub'
$url = 'https://github.com/github/hub/releases/download/v2.2.9/hub-windows-386-2.2.9.zip'
$checksum = 'afa3024091677269504c0196f546c548'
$checksumType = 'md5'
$url64 = 'https://github.com/github/hub/releases/download/v2.2.9/hub-windows-amd64-2.2.9.zip'
$checksum64 = '418a4aba5a9c7cb6d7b36e0afce4fe... | dtgm/chocolatey-packages | automatic/_output/hub/2.2.9/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 865 |
$packageName = 'awscli'
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$url = 'https://s3.amazonaws.com/aws-cli/AWSCLI32-1.11.41.msi'
$checksum = 'f0d1c98a98368d52b557d910e57a79fa2b0a9e205fb19f534b84d06c844d9bd3'
$checksumType = 'sha256'
$url64 = 'https://s3.amazonaws.com/aws-cli/AWSCLI64-1.11.41.msi'
$c... | dtgm/chocolatey-packages | automatic/_output/awscli/1.11.41/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 985 |
function Get-TargetResource
{
[OutputType([Hashtable])]
param (
[ValidateSet("Present", "Absent")]
[string]$Ensure = "Present",
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$AgentName,
[ValidateSet("Started", "Stopped")]
[string]$State = "Star... | transcanada/teamcity-agent-dsc | TeamCityAgentDSC/DSCResources/cTeamCityAgent/cTeamCityAgent.psm1 | PowerShell | apache-2.0 | 9,269 |
function UrlExists($uri) {
try {
Get-WebHeaders $uri | Out-Null
}
catch {
if ($_ -match "unauthorized") { return $false }
throw $_
}
return $true;
}
function AddArchivePathToUrl($url) {
$newUrl = $url
$lix = $url.LastIndexOf("/")
if ($lix -ne -1) {
$new... | lennartb-/chocolatey-coreteampackages | automatic/php/tools/helpers.ps1 | PowerShell | apache-2.0 | 3,204 |
function Add-VSAppSyncGraphQLApiAdditionalAuthenticationProviders {
<#
.SYNOPSIS
Adds an AWS::AppSync::GraphQLApi.AdditionalAuthenticationProviders resource property to the template. A list of additional authentication providers for the GraphqlApi API.
.DESCRIPTION
Adds an AWS::AppSync::Gra... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSAppSyncGraphQLApiAdditionalAuthenticationProviders.ps1 | PowerShell | apache-2.0 | 1,858 |
Function Get-UnitycifsFilesystemParameters {
<#
.SYNOPSIS
Settings for a SMB (also known as CIFS) file system.. <br/> <br/> This resource type is embedded in the storageResource resource type.
.DESCRIPTION
Settings for a SMB (also known as CIFS) file system.. <br/> <br/> This resource type ... | equelin/Unity-Powershell | Tools/Functions/Result_UnityVSA_41/Get-UnitycifsFilesystemParameters.ps1 | PowerShell | mit | 2,062 |
<#
.EXAMPLE
This example adds a new user profile service application to the local farm
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount,
[Parameter(Mandatory = $true)]
[PSCredential]
... | ykuijs/xSharePoint | Modules/SharePointDsc/Examples/Resources/SPUserProfileServiceApp/3-SiteNamingConflictResolution.ps1 | PowerShell | mit | 1,436 |
[cmdletbinding()]
param()
<#
[CmdletBinding()]
param()
Trace-VstsEnteringInvocation $MyInvocation
try {
Import-VstsLocStrings "$PSScriptRoot\Task.json"
[string]$msBuildLocationMethod = Get-VstsInput -Name MSBuildLocationMethod
[string]$msBuildLocation = Get-VstsInput -Name MSBuildLocation
[string]$msBu... | vtbassmatt/vso-agent-tasks | Tests/L0/MSBuild/PassesArguments.ps1 | PowerShell | mit | 4,409 |
#Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'ArmTemplates',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageAccountResourceGro... | peterschen/ARM | old/04-Services/Scripts/Deploy-AzureResourceGroup.ps1 | PowerShell | mit | 5,416 |
function Get-DbaDbServiceBrokerService {
<#
.SYNOPSIS
Gets database service broker services
.DESCRIPTION
Gets database Sservice broker services
.PARAMETER SqlInstance
The target SQL Server instance or instances
.PARAMETER SqlCredential
Login to the target instance ... | wsmelton/dbatools | functions/Get-DbaDbServiceBrokerService.ps1 | PowerShell | mit | 4,281 |
param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=ne... | CslaGenFork/CslaGenFork | tags/Rules sample v.2.0.0/packages/Microsoft.Bcl.Build.1.0.0-rc/tools/Install.ps1 | PowerShell | mit | 1,032 |
# constants
if (Test-Path "$PSScriptRoot\constants.local.ps1") {
Write-Verbose "tests\constants.local.ps1 found."
. "$PSScriptRoot\constants.local.ps1"
} elseif ($env:CODESPACES -and ($env:TERM_PROGRAM -eq 'vscode' -and $env:REMOTE_CONTAINERS)) {
$script:instance1 = "dbatools1"
$script:instance2 = "dbat... | wsmelton/dbatools | tests/constants.ps1 | PowerShell | mit | 2,326 |
[cmdletbinding(SupportsShouldProcess=$true)]
param($publishProperties=@{}, $packOutput, $pubProfilePath)
# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327
try{
if ($publishProperties['ProjectGuid'] -eq $null){
$publishProperties['ProjectGuid'] = '5a318bef-15a8-41d0-981e... | MMA2017/ObisoftWeb | src/ObisoftWebCore/Properties/PublishProfiles/Obisoft Server-publish.ps1 | PowerShell | apache-2.0 | 774 |
# powershell v2 compatibility
$psVer = $PSVersionTable.PSVersion.Major
if ($psver -ge 3) {
function Get-ChildItemDir {Get-ChildItem -Directory $args}
} else {
function Get-ChildItemDir {Get-ChildItem $args}
}
$packageName = 'keepass-plugin-keecloud'
$typName = 'KeeCloud.plgx'
$packageSearch = 'KeePass Password Saf... | dtgm/chocolatey-packages | automatic/_output/keepass-plugin-keecloud/1.0.43/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 1,985 |
$packageName = 'lsasecretsview'
$url = 'http://www.nirsoft.net/toolsdownload/lsasecretsview.zip'
$checksum = '62aa19e9aa4bbf6b1a0104d71ea2b4d450162287'
$checksumType = 'sha1'
$url64 = 'http://www.nirsoft.net/toolsdownload/lsasecretsview-x64.zip'
$checksum64 = 'cde2e9a0c8fdd9ede970fdf07bc8570426fe6107'
$checksumType64 =... | dtgm/chocolatey-packages | automatic/_output/lsasecretsview/1.21/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 2,084 |
param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=5,
$MaxUpdatesPerCycle=500)
$Logfile = "C:\Windows\Temp\win-updates.log"
function LogWrite {
Param ([string]$logstring)
$now = Get-Date -format s
Add-Content $Logfile -value "$now $logstring"
Write... | tomswartz07/packer-windows | scripts/win-updates.ps1 | PowerShell | mit | 8,905 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
. "$PSScriptRoot\..\internal\functions\Get-PasswordHash.ps1"
Describe "$CommandName Unit Tests" -Tag UnitTests, Get-DbaLogin {
Context "Validate pa... | alevyinroc/dbatools | tests/Test-DbaLoginPassword.Tests.ps1 | PowerShell | mit | 1,893 |
#
# Swaggy Jenkins
# Jenkins API clients generated from Swagger / Open API specification
# Version: 1.1.2-pre.0
# Contact: blah@cliffano.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
<#
.Synopsis
Helper function to format debug parameter output.
.Example
$PSBoundParameters | Out-DebugP... | cliffano/swaggy-jenkins | clients/powershell/generated/src/PSOpenAPITools/Private/Out-DebugParameter.ps1 | PowerShell | mit | 1,103 |
ConvertFrom-StringData -StringData @'
GettingActionMessage = Getting FSRM File Screen Template Action for {1} "{0}".
ActionExistsMessage = FSRM File Screen Template Action for {1} "{0}" exists.
ActionNotExistMessage = FSRM File Screen Template Action for {1} "{0}" does not exist.
SettingActionMessage = ... | PlagueHO/cFSRM | DSCResources/DSR_FSRMFileScreenTemplateAction/en-US/DSR_FSRMFileScreenTemplateAction.strings.psd1 | PowerShell | mit | 1,825 |
function Add-AnnotatedContent
{
<#
.Synopsis
Concatenates files from a given folder into another file, annotating the
source folder and filenames in C# / SQL compatible comments.
.Description
Will accept a folder or list of folder via the pipeline. Always appends
to an existing file shoul... | Iristyle/Midori | tools/Files.psm1 | PowerShell | mit | 3,799 |
# Get the supplied parameters
$DACPACPackageStep = $OctopusParameters["DACPACPackageStep"]
$DACPACPackageName = $OctopusParameters["DACPACPackageName"]
$PublishProfile = $OctopusParameters["DACPACPublishProfile"]
$Report = Format-OctopusArgument -Value $OctopusParameters["Report"]
$Script = Format-OctopusArgument -Valu... | kchenery/octopus | Octopus.PS/Step Templates/SSDT DacPac Command.ps1 | PowerShell | mit | 1,711 |
workflow Stop-LingeringSession {
param (
[Parameter(Mandatory)]
[Int] $ProcessId,
[Parameter(Mandatory)]
[String] $Server,
[Parameter(Mandatory)]
[PSCredential] $Credential
)
try {
$Null = inlinescript {
$CimSession = New-CimSession -Co... | bgelens/Presentations | 052015_DUPSUG/WAPack-Integration/Stop-LingeringSession.ps1 | PowerShell | mit | 728 |
function Export-DbaUser {
<#
.SYNOPSIS
Exports users creation and its permissions to a T-SQL file or host.
.DESCRIPTION
Exports users creation and its permissions to a T-SQL file or host. Export includes user, create and add to role(s), database level permissions, object level permissions.
... | alevyinroc/dbatools | functions/Export-DbaUser.ps1 | PowerShell | mit | 23,037 |
# AD Module Check
Write-Host "Checking if the Active Directory Module is installed"
if ((Get-Module -name ActiveDirectory -ErrorAction SilentlyContinue | foreach { $_.Name }) -ne "ActiveDirectory")
{
Write-Host Active Directory Management has not been added to this session, adding it now...
Import-Module Activ... | HMcC-Tek/ActiveDirectory | massCreator.ps1 | PowerShell | mit | 5,827 |
using module PSNativeAutomation
class MainWindow : Window
{
[ListBox]$ListBoxGames
[ListView]$ListViewGames
[Menu]$PopupMenu
[UIObject]$TextFilter
[UIObject]$ButtonInstall
[UIObject]$ButtonMore
[UIObject]$ButtonSetupProgress
[UIObject]$ButtonPlay
[UIObject]$HyperlinkSt... | JosefNemec/Playnite | tests/Mapping/MainWindow.ps1 | PowerShell | mit | 4,593 |
$error.clear();
Set-StrictMode -Version:Latest
$GLOBAL:ErrorActionPreference = "Stop"
."$PSCommandPath.vars.ps1"
import-module -force -DisableNameChecking "$($SCRIPT:DIRECTORY_PATH_OF_pratom_ATOM_NUCLEUS_PROTONS)\protons.psm1"
import-module -force -DisableNameChecking "$($SCRIPT:DIRECTORY_PATH_OF_pratom... | pratom/master | nucleus/nucleus.psm1 | PowerShell | mit | 391 |
# Launch a console for the project.
param(
[switch]$Quick,
[switch]$Verbose
)
$project_root = Split-Path $PSScriptRoot
. $PSScriptRoot\Write-Status.ps1
Write-Status "Plush console"
# Set a global variable to indicate we want to set and update some useful console functions
$Global:plush_functions = ... | kbarnes3/Plush | scripts/Console.ps1 | PowerShell | mit | 720 |
Function Import-MDTModule {
$MDTModuleInstallLocation = "C:\Program Files\Microsoft Deployment Toolkit\Bin\MicrosoftDeploymentToolkit.psd1"
if (!(Get-Module MicrosoftDeploymentToolkit)) {
if (Test-Path $MDTModuleInstallLocation) {
Import-Module $MDTModuleInstallLocation
} else {
... | JohnForet/MDTApplicationTools | MDTApplicationTools.psm1 | PowerShell | mit | 20,875 |
Param (
[string]$OwnerTagName = "Owner"
)
#This section will be removed once Functions support modern PowerShell and Azure modules properly
#it's to a workaround inconsistent behaviour of auto load from 'modules' folder
Import-Module "D:\home\site\wwwroot\azuremodules\AzureRM.Profile.psd1" -Global;
Import-Mo... | itaysk/AzureGC | functions/noOwner/noOwner.ps1 | PowerShell | mit | 1,388 |
#region HEADER
$script:DSCModuleName = 'xExchange'
$script:DSCResourceName = 'MSFT_xExchJetstress'
# Unit Test Template Version: 1.2.4
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or `
... | IngoGege/xExchange | Tests/Unit/MSFT_xExchJetstress.tests.ps1 | PowerShell | mit | 2,054 |
<#
.SYNOPSIS
Builds all assets in this repository.
.PARAMETER Configuration
The project configuration to build.
#>
[CmdletBinding(SupportsShouldProcess)]
Param(
[Parameter()]
[ValidateSet('Debug', 'Release')]
[string]$Configuration,
[Parameter()]
[ValidateSet('minimal', 'normal', 'detailed', 'diagn... | AArnott/Nerdbank.GitVersioning | build.ps1 | PowerShell | mit | 1,526 |
function Get-Config ([string]$path) {
return (Get-Content -Path $path | Where { $_ -notmatch "^[\s]*//" }) -join ' ' | ConvertFrom-Json
}
function Build-Packages
{
param (
[Parameter(Mandatory=$false)]
[string]$Project
)
$config = Get-Config "NugetMaker.json"
$projects = $config.projects
# Remove previousl... | niaher/NugetMaker | package/tools/NugetMaker.psm1 | PowerShell | mit | 2,206 |
@{
AllNodes = @(
@{
NodeName = 'localhost'
}
);
Versions = @{
Kubectl = '1.8.0'
MiniKube = '0.22.3'
Kd = '0.4.0'
}
Paths = @{
Base = 'c:\winikube'
Bin = 'c:\winikube\bin'
Tmp = 'c:\winikube\tmp'
}
NATNetworkName = 'WiniKubeNAT'
NATSwitchName = 'WiniKubeNATSwitch'
NA... | CivicaDigital/winikube | config.psd1 | PowerShell | mit | 389 |
# Copyright (c) 2018-2020 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | projectcalico/calico | node/windows-packaging/CalicoWindows/confd/confd-service.ps1 | PowerShell | apache-2.0 | 1,527 |
function Push-Migration
{
Update-StoredProcedure -SchemaName 'rivet' -Name 'InsertMigration' -Definition @'
@ID bigint,
@Name nvarchar(241),
@Who nvarchar(50),
@ComputerName nvarchar(50)
as
begin
declare @AtUtc datetime2(7)
select @AtUtc = getutcdate()
insert into [rivet].[Migrations] ([ID],[Nam... | RivetDB/Rivet | Rivet/Migrations/00000000000003_RivetChangeStoredProcedureVarcharParametersToNVarchar.ps1 | PowerShell | apache-2.0 | 1,936 |
# - - - - - - - - - - - - - - - - - - - - - - - -
# Helper function
# Assigns Constructor script to Class
# - - - - - - - - - - - - - - - - - - - - - - - -
function Attach-PSClassConstructor {
param (
[psobject]$Class
, [scriptblock]$scriptblock = $(Throw "Constuctor scriptblock is required."... | ghostsquad/AetherClass | functions/Attach-PSClassConstructor.ps1 | PowerShell | apache-2.0 | 487 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = 'a363dee56a2b4263125590ee1bb5ced07963c684032d8ff228bff4f20b14debe'
$checksumType = 'sha256'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvr... | dtgm/chocolatey-packages | automatic/_output/kvrt/2017.03.24.0815/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 960 |
# The msi must remove all components.
# But the msi uninstall log may contain
# disallowing uninstallation of component: ...... since another client exists
# After msi uninstall, run this to remove
#
# https://stackoverflow.com/questions/26739524/wix-toolset-complete-cleanup-after-disallowing-uninst... | markuskramerIgitt/salt-windows-msi | remove_orpahned_salt_components.ps1 | PowerShell | apache-2.0 | 1,180 |
$packageName = 'adinsight'
$url = 'https://download.sysinternals.com/files/AdInsight.zip'
$checksum = '11e664c627c83808f7355d2e0d146b65faf9b6b3'
$checksumType = 'sha1'
$url64 = "$url"
$checksum64 = "$checksum"
$checksumType64 = "checksumType"
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Instal... | dtgm/chocolatey-packages | automatic/_output/adinsight/1.20/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 757 |
$projectRootPath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
$moduleRootPath = Join-Path -Path $projectRootPath -ChildPath 'DscResource.DocumentationHelper'
$modulePath = Join-Path -Path $moduleRootPath -ChildPath 'MofHelper.psm1'
Import-Module -Name $modulePath -Force
InModuleScope -ModuleNam... | PlagueHO/DscResource.Tests | Tests/Unit/MofHelper.Tests.ps1 | PowerShell | mit | 5,396 |
UnInstall-ChocolateyZipPackage wfn 'wfnInstall.zip' | dtgm/chocolatey-packages | manual/wfn/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 54 |
if ($IsLinux -or $IsMacOS) {
if (-not (Get-Command 'Get-Service' -ErrorAction SilentlyContinue)) {
function Get-Service {
Import-Clixml -Path (Join-Path $PSScriptRoot Get-Service.xml)
}
}
if (-not (Get-Command 'Get-CimInstance' -ErrorAction SilentlyContinue)) {
function G... | dfinke/ImportExcel | __tests__/Samples/Samples.ps1 | PowerShell | apache-2.0 | 2,060 |
function Enable-BoxstarterVM {
<#
.SYNOPSIS
Opens WMI ports and LocalAccountTokenFilterPolicy for Workgroup Hyper-V VMs
.DESCRIPTION
Prepares a Hyper-V VM for Boxstarter Installation. Opening WMI
ports if remoting is not enabled and enabling
LocalAccountTokenFilterPolicy if the VM is not in a domain so
that Boxstar... | fhchina/boxstarter | Boxstarter.HyperV/Enable-BoxstarterVM.ps1 | PowerShell | apache-2.0 | 9,087 |
[CmdletBinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1
. $PSScriptRoot\..\..\..\Tasks\PublishSymbols\IndexHelpers\SrcSrvIniContentFunctions.ps1
$provider = New-Object psobject -Property @{
CollectionUrl = 'Some collection URL'
CommitId = 'Some commit ID'
RepoId = 'So... | cwoolum/vso-agent-tasks | Tests/L0/PublishSymbols/New-TfsGitSrcSrvIniContent.FormatsContent.ps1 | PowerShell | mit | 2,421 |
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Miciah/origin | vendor/k8s.io/kubernetes/cluster/gce/windows/configure.ps1 | PowerShell | apache-2.0 | 5,775 |
$env:JAVA_HOME_PARENT = if ($env:JAVA_HOME_PARENT) {
$env:JAVA_HOME_PARENT
} elseif ($IsWindows) {
"$env:ProgramFiles\Java"
} else {
'/usr/lib/jvm/'
}
$env:JDK_HOME = if ($env:JDK_HOME) {
$env:JDK_HOME
} else {
(Get-ChildItem $env:JAVA_HOME_PARENT -Filter jdk* | Sort-Object @{ Expression = { ($_.Name -replace 'jd... | matt9ucci/PSProfiles | PSModules/Java/Java.psm1 | PowerShell | mit | 550 |
<#
.EXAMPLE
This example will enable TCP/IP protocol and set the custom static port to 4509.
When RestartService is set to $true the resource will also restart the SQL service.
#>
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
... | PaulFeaser/xSQLServer | Examples/Resources/xSQLServerNetwork/2-EnableTcpIpWithDynamicPort.ps1 | PowerShell | mit | 743 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID b5646852-132f-4f84-8057-b8e9e91e29b8
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/xFailOverCluster/blob/main/LICENSE
.PROJECTURI https://github.c... | PowerShell/xFailOverCluster | source/Examples/Resources/xClusterDisk/1-xClusterDisk_AddClusterDiskConfig.ps1 | PowerShell | mit | 1,293 |
function Get-PASAccountCredentials {
<#
.SYNOPSIS
Returns password for an account.
.DESCRIPTION
Returns password for an account identified by its AccountID.
Will not return SSH Keys.
Cannot be used if a reason for password access must be specified.
.PARAMETER AccountID
The ID of the account whose password will b... | zshehri/CTU | psPAS/Functions/Accounts/Get-PASAccountCredentials.ps1 | PowerShell | mit | 2,889 |
#Requires -RunAsAdministrator
# Install the provider
$myPath = Get-Location
$myDll = 'privacyIDEA-ADFSProvider.dll'
$myDllFullName = (get-item $myDll).FullName
function Gac-Util
{
param (
[parameter(Mandatory = $true)][string] $assembly
)
try
{
$Error.Clear()
[Reflection.Assem... | sbidy/privacyIDEA-ADFSProvider | privacyIDEAADFSProvider/Install/Install-ADFSProvider.ps1 | PowerShell | mit | 1,550 |
function Export-DbaXESessionTemplate {
<#
.SYNOPSIS
Exports an XESession XML Template.
.DESCRIPTION
Exports an XESession XML Template either from the dbatools repository or a file you specify. Exports to "$home\Documents\SQL Server Management Studio\Templates\XEventTemplate... | SirCaptainMitch/dbatools | functions/Export-DbaXESessionTemplate.ps1 | PowerShell | mit | 3,636 |
Function New-AGMLibGCVEfailover ([string]$filename,[int]$phase)
{
<#
.SYNOPSIS
Uses a pre-prepared CSV list of VMware VM Names to run mount jobs in phases
.EXAMPLE
New-AGMLibGCVEfailover -filename recoverylist.csv -vcenterid XXXXXX
This will load the contents of the file recoverylist.csv and ... | Actifio/AGMPowerLib | Public/New-AGMLibGCVEfailover.ps1 | PowerShell | mit | 6,207 |
function Get-IMSecurityGroup
{
<#
.Synopsis
Get a Security Group object from Identity Manager.
.DESCRIPTION
You can filter on DisplayName or ObjectID
.EXAMPLE
Get-IMSecurityGroup
Will output all security groups from Identity Manager
.EXAMPLE
Get-IMSecurityGroup -Displayname "Domain*"
Will oup... | torgro/IdentityManager | Functions/Get-IMSecurityGroup.ps1 | PowerShell | mit | 2,336 |
Start-AutoRestCodeGeneration -ResourceProvider "recoveryservicesbackup/resource-manager" -AutoRestVersion "v2" -SdkGenerationDirectory "$PSScriptRoot\recoveryservicesbackup\Generated" -ConfigFileTag "package-2021-12" -Namespace "Microsoft.Azure.Management.RecoveryServices.Backup"
Start-AutoRestCodeGeneration -Resource... | Azure/azure-sdk-for-net | sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/generate.ps1 | PowerShell | mit | 641 |
function Remove-TVDevice
{
<#
#>
[OutputType([bool])]
[CmdletBinding(
SupportsShouldProcess = $true
)]
param(
[Parameter(
Mandatory = $true
)]
[string] $Token,
[Parameter(
Mandatory = $true,
ValueFromPipeline = $true,
... | Marcuzzo/PSTeamViewer | PSTeamViewer/public/Remove-TVDevice.ps1 | PowerShell | mit | 1,689 |
Describe $($PSCommandPath -Replace ".Tests.ps1") {
BeforeAll {
#Get Current Directory
$Here = Split-Path -Parent $PSCommandPath
#Assume ModuleName from Repository Root folder
$ModuleName = Split-Path (Split-Path $Here -Parent) -Leaf
#Resolve Path to Module Directory
$ModulePath = Resolve-Path "$Here\..\... | pspete/psPAS | Tests/Get-EscapedString.Tests.ps1 | PowerShell | mit | 1,127 |
<#
.Description
Migrate Azure IaaS VM from one subscripiton to another subscription
.Example
.\Migrate-AzureVM.ps1 -SourceSubscriptionName "foo" -DestSubscritpionName "bar" -SourceCloudServiceName "foocs" -SourceVMName "foovm" -DestCloudServiceName "barcs" -DestStorageAccountName "barstorage" -DestLocationNa... | blrchen/AzureAutomationScripts | Migrate-AzureVM/Migrate-AzureVM.ps1 | PowerShell | mit | 9,037 |
# Simulate processes of analysis, sandbox and VM software that some malware will try to evade.
# This just spawns ping.exe with different names (wireshark.exe, vboxtray.exe, ...)
#
# This is the updated version with no system load at all. I might also add some more fake processes in future updates.
# Maintained by Phoe... | Aperture-Diversion/fake-sandbox | fsp.ps1 | PowerShell | mit | 2,128 |
properties {
$base_dir = resolve-path .
$parent_dir = resolve-path ..
$build_dir = "$base_dir\_build"
$tools_dir = "$parent_dir\tools"
$sln_file = "$base_dir\ServiceLogs.sln"
$run_tests = $false
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.e... | BclEx/System.Abstract | src.servicelogs/default.ps1 | PowerShell | mit | 1,950 |
#Create test AD accounts for lab/testing purposes
#
#preset variables for the script:
#
$date = Get-date -format M.d.yyyy
$ou="OU=LANDING,DC=DEFAULTDOMAIN,DC=COM"
$principlename = "@DEFAULT.com"
$description = "Test Account Generate $date"
$Number_of_users = "5000"
$company = "Test Company"
#Supported Nationalities:... | schm2055/PowerShell | AD_Generate_TestLab_Accounts.ps1 | PowerShell | cc0-1.0 | 4,755 |
Update-SessionEnvironment
$version = '0.16.1'
python -m pip install mkdocs==$version
| lennartb-/chocolatey-coreteampackages | automatic/mkdocs/tools/ChocolateyInstall.ps1 | PowerShell | apache-2.0 | 90 |
function Add-VSWAFByteMatchSetFieldToMatch {
<#
.SYNOPSIS
Adds an AWS::WAF::ByteMatchSet.FieldToMatch resource property to the template. **Note**
.DESCRIPTION
Adds an AWS::WAF::ByteMatchSet.FieldToMatch resource property to the template.
**Note**
This is **AWS WAF Classic** documentation. ... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSWAFByteMatchSetFieldToMatch.ps1 | PowerShell | apache-2.0 | 5,670 |
<#
.SYNOPSIS
Tests DataLakeStore Account trusted identity provider Lifecycle (Create, Update, Get, List, Delete).
#>
function Test-DataLakeStoreTrustedIdProvider
{
param
(
$location = "West US"
)
try
{
# Creating Account
$resourceGroupName = Get-ResourceGroupName
$accountName = Get-DataLakeStoreAccou... | seanbamsft/azure-powershell | src/ResourceManager/DataLakeStore/Commands.DataLakeStore.Test/ScenarioTests/AdlsTests.ps1 | PowerShell | apache-2.0 | 33,403 |
function Add-VSAppMeshRouteTcpRoute {
<#
.SYNOPSIS
Adds an AWS::AppMesh::Route.TcpRoute resource property to the template. An object that represents a TCP route type.
.DESCRIPTION
Adds an AWS::AppMesh::Route.TcpRoute resource property to the template.
An object that represents a TCP route t... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSAppMeshRouteTcpRoute.ps1 | PowerShell | apache-2.0 | 1,739 |
Import-Module "$PSScriptRoot\..\..\Publish\PSPlus\PSPlus.psd1" -Force
Describe "Windows.Diagnostics.ProcessControl" {
Context "When trying to do process related operations" {
It "Should be able to check if other process is 64 bits." {
$notepadNativePath = "$env:WINDIR\system32\notepad.exe"
... | r12f/PSPlus | PSPlus.Tests/Windows/PSPlus.Modules.Windows.Diagnostics.ProcessControl.tests.ps1 | PowerShell | bsd-2-clause | 2,713 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.