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 |
|---|---|---|---|---|---|
function Get-EXRAccessTokenADAL {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $true)]
[string]
$MailboxName,
[Parameter(Position = 1, Mandatory = $false)]
[string]
$ClientId,
[Parameter(Position = 2, Mandatory = $false)]
[s... | gscales/Exch-Rest | functions/oAuth/Get-EXRAccessTokenADAL.ps1 | PowerShell | mit | 5,738 |
function Get-DbaDbTrigger {
<#
.SYNOPSIS
Get all existing database triggers on one or more SQL instances.
.DESCRIPTION
Get all existing database triggers on one or more SQL instances.
.PARAMETER SqlInstance
The target SQL Server instance or instances.
.PARAMETER SqlCredent... | dsolodow/dbatools | functions/Get-DbaDbTrigger.ps1 | PowerShell | mit | 3,293 |
param([string]$SQLServerList=$(Throw `
"Paramater missing: -ListFile Filename"))
Function Get-CPUInfo{
[CmdletBinding()]
Param(
[parameter(Mandatory = $TRUE,ValueFromPipeline = $TRUE)] [String] $ComputerName
)
Process{
# Get Default SQL Server instance's Edition
... | abrichards5/ABRPowerShell | Scripts/sqlserverGetLicenseInfo.ps1 | PowerShell | apache-2.0 | 2,443 |
Function Set-ActiveExcelWorksheet
{
<#
.SYNOPSIS
Set the current active excel worksheet
.DESCRIPTION
The Set-ExcelWorkshet cmd-let always set the active excel worksheet to first one, unless define otherwise
.PARAMETER WorksheetName
Specifies the name of the worksheet
.EXAMPLE
PS C:\> Add-ExcelWorkshee... | tuanhtrng/EPSM | EPSM/ExcelWorksheet/Set-ActiveExcelWorksheet.ps1 | PowerShell | apache-2.0 | 980 |
<#
.SYNOPSIS
This PowerShell script module file provides a step to be used in a series of
executable PowerShell steps that is intended to be included in all main
PowerShell scripts that reside within the automation framework.
.DESCRIPTION
Note: This script module is NOT intended to be executed independent of another
P... | ChrisJaehnen/dev-tools-script-console | Context/Show/Show-ContextObjectOwnership.psm1 | PowerShell | apache-2.0 | 1,979 |
function Add-OxRepo {
<#
.SYNOPSIS
Adds a document and moniker to the given repo.
.DESCRIPTION
Adds a document and moniker to the given repo.
.EXAMPLE
# Simple use
Add-OxRepo -Repo \\bigi5-8\c\TestFileRepo -FilePath .\Doc1.docx -Moniker "ConformanceTest\CommentEx\GeneratedDocument.docx... | EricWhiteDev/OxRunner | OxRunner/OxRunnerCmdlets/Add-OxRepo.ps1 | PowerShell | apache-2.0 | 829 |
function Get-WebSiteText {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[string]$SiteUrl
)
# Make sure $SiteUrl is a valid Url
try {
$SiteUrlAsUriObj = [uri]$SiteUrl
}
catch {
Write-Error $_
$global:FunctionResult = "1"
return
... | pldmgg/misc-powershell | MyFunctions/Get-WebSiteText.ps1 | PowerShell | apache-2.0 | 7,696 |
$modulePath = Join-Path -Path (Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent) -ChildPath 'Modules'
# Import the Networking Common Modules
Import-Module -Name (Join-Path -Path $modulePath `
-ChildPath (Join-Path -Path 'NetworkingDsc.Common' `
-ChildPath 'NetworkingDsc.Common.psm1... | puppetlabs/puppetlabs-dsc | lib/puppet_x/dsc_resources/NetworkingDsc/DSCResources/MSFT_NetAdapterLso/MSFT_NetAdapterLso.psm1 | PowerShell | apache-2.0 | 6,769 |
#Connect-VIServer -Server $vCenter
Function Main()
{
Param(
[Parameter(Mandatory=$True,Position=0)][string]$scriptfile,[string]$global:GuestUser,[string]$global:GuestPassword
)
$filepath = [System.IO.Path]::GetDirectoryName($scriptfile)
$filename_temp = [System.IO.Path]::GetFileNameWithoutExtension($scriptfile)
Check... | frostvik/playground | getvmstats.ps1 | PowerShell | apache-2.0 | 2,898 |
$script:DSCModuleName = 'xSQLServer'
$script:DSCResourceName = 'MSFT_xSQLServerDatabasePermission'
#region HEADER
# Unit Test Template Version: 1.1.0
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath '... | Arturas-K/xSQLServer | Tests/Unit/MSFT_xSQLServerDatabasePermission.Tests.ps1 | PowerShell | mit | 17,294 |
function Get-POSHOriginConfig {
<#
.SYNOPSIS
Reads and processes a POSHOrigin configuration file.
.DESCRIPTION
Reads and processes a POSHOrigin configuration file and returns the result as one or more PowerShell custom objects containing the
required options that ... | devblackops/POSHOrigin | POSHOrigin/Functions/Get-POSHOriginConfig.ps1 | PowerShell | apache-2.0 | 2,688 |
$packageName = 'tinycad'
$installerType = 'EXE'
$silentArgs = '/S'
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
try {
$processor = Get-WmiObject Win32_Processor
$is64bit = $processor.AddressWidth -eq 64
if ($is64... | dtgm/chocolatey-packages | automatic/_output/tinycad/2.80.06.626/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 752 |
#
# SplitPluginAssembly.ps1
#
param(
[string]$regexType,
[string]$regex,
[string]$projectFilePath,
[string]$solutionFilePath
)
$ErrorActionPreference = "Stop"
Write-Verbose 'Entering SplitPluginAssembly.ps1' -Verbose
#Parameters
Write-Verbose "regexType = $regexType"
Write-Verbose "regex = $regex"
Write-Verbose... | WaelHamze/xrm-ci-framework | MSDYNV9/Xrm.Framework.CI/Xrm.Framework.CI.PowerShell.Scripts/SplitPluginAssembly.ps1 | PowerShell | mit | 1,027 |
param($installPath, $toolsPath, $package, $project)
$analyzerPath = join-path $toolsPath "analyzers"
$analyzerFilePath = join-path $analyzerPath "Analyzer_XamlAppTips.dll"
$project.Object.AnalyzerReferences.Remove("$analyzerFilePath") | ljw1004/blog | VSIX/dotnet-code-analyzer/Analyzer_XamlAppTips/tools/uninstall.ps1 | PowerShell | mit | 239 |
<#
DESCRIPTION:
Ensure autorun is disabled.
REQUIRED-INPUTS:
None
DEFAULT-VALUES:
None
DEFAULT-STATE:
Enabled
RESULTS:
PASS:
Autorun is disabled
WARNING:
FAIL:
Autorun is enabled
MANUAL:
NA:
APP... | My-Random-Thoughts/QA-Checks-v4 | checks/system/sys-11-autorun-disabled.ps1 | PowerShell | mit | 1,564 |
<#
.SYNOPSIS
This script creates a new Exchange 2016 lab environment in Microsoft Azure.
Thomas Stensitzki
THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
Version 1.0, 20... | Stephan2402/Stephan | Exchange2016/New-ExchangeLab.ps1 | PowerShell | mit | 11,818 |
function Post-Commit() {
param (
$ixBug,
$dtEventUtc,
$sPersonName,
$sMessage,
$sExternalUrl,
$sCommitRevision,
$sModuleName,
$sBranchName
)
Post-ExtendedEvent -sEventType "commit" `
-ixBug $ixBug `
... | jozefizso/FogBugz-ExtendedEvents | scripts/fogbugz-ee.ps1 | PowerShell | mit | 4,199 |
<#
.EXAMPLE
These two example shows how to run SQL script using Windows Authentication.
First example shows how the resource is run as account SYSTEM. And the second example shows how the resource is run with a user account.
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[... | PowerShell/xSQLServer | Examples/Resources/SqlScriptQuery/2-RunScriptUsingWindowsAuthentication.ps1 | PowerShell | mit | 1,641 |
$release = "https://github.com/icanki/spm/files/545961/spm.zip"
$localAppData = $env:LOCALAPPDATA
Write-Host "Creating directory..."
$appFolder = [System.IO.Directory]::CreateDirectory([System.IO.Path]::Combine($localAppData,"SPM"))
Get-ChildItem $appFolder.FullName | Remove-Item -Recurse -Force
Write-Host "Downloa... | icanki/spm | scripts/install.ps1 | PowerShell | mit | 1,375 |
Function demonstrate_isecreambasic
{
Add-IseMenu -Name "Get" @{
"Process" = { Get-Process }
"Service" = { Get-Service }
"Hotfix" = {Get-Hotfix}
}
Add-IseMenu -Name "Get1" -module SQLIse @{
"Process" = { Get-Process }
"Service" = { Get-Service }
"Hotfix" ... | pratom/master | electrons/vendor/ISE/ISECreamBasic/demonstrate_isecreambasic.ps1 | PowerShell | mit | 1,755 |
function Update-PowerShellConsoleVersion {
[CmdletBinding(DefaultParameterSetName="Patch")]
param(
[Parameter(ParameterSetName="Major", Mandatory=$false)][switch]$Major,
[Parameter(ParameterSetName="Minor", Mandatory=$false)][switch]$Minor,
[Parameter(ParameterSetName="Patch", Mandatory=... | paulmarsy/Console | Custom Consoles/PowerShell/Exports/Functions/Customisation Helpers/Update-PowerShellConsoleVersion.ps1 | PowerShell | mit | 2,023 |
<#
.DESCRIPTION
Parses a semver version string into its components and supports operations around it that we use for versioning our packages.
See https://azure.github.io/azure-sdk/policies_releases.html#package-versioning
Example: 1.2.3-beta.4
Components: Major.Minor.Patch-PrereleaseLabel.PrereleaseNumber
Example: 1... | brjohnstmsft/azure-sdk-for-net | eng/common/scripts/SemVer.ps1 | PowerShell | mit | 12,391 |
. $PSScriptRoot\..\..\Support\PowerShell\IntegrationTestSafe.ps1
Describe "Get-NotificationTrigger_IT" -Tag @("PowerShell", "IntegrationTest") {
It "can retrieve all triggers" {
$triggers = Get-Device -Id (Settings Device) | Get-NotificationTrigger
($triggers|where inherited -EQ $true).Count|Shou... | lordmilko/PrtgAPI | src/PrtgAPI.Tests.IntegrationTests/PowerShell/ObjectData/Get-NotificationTrigger.Tests.ps1 | PowerShell | mit | 1,661 |
function Write-DbaDbTableData {
<#
.SYNOPSIS
Writes data to a SQL Server table.
.DESCRIPTION
Writes a .NET DataTable to a SQL Server table using SQL Bulk Copy.
.PARAMETER SqlInstance
The target SQL Server instance or instances.
.PARAMETER SqlCredential
Login to the... | wsmelton/dbatools | functions/Write-DbaDbTableData.ps1 | PowerShell | mit | 33,706 |
#region Presentation Info
<#
PowerShell + SQL Server = Better Together
Presentation from SQL Saturday Birmingham 2019
Author: Mike F Robbins
Website: http://mikefrobbins.com
Twitter: @mikefrobbins
#>
#endregion
#region Safety to prevent the entire script from being run instead of a ... | mikefrobbins/Presentations | SQL Saturday Birmingham 2019/PowerShell + SQL Server = Better Together.ps1 | PowerShell | mit | 12,463 |
Import-Module .\TestLibs\RDFELibs.psm1 -Force
$result = ""
$testResult = ""
$resultArr = @()
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
if ($isDeployed)
{
$vm1added = $false
foreach ($VMdata in $allVMData)
{
if ($VMdata.RoleName -imatch $currentTestData.set... | xian123/azure-linux-automation | remote-scripts/NETWORK-LB-CUSTOMPROBE-OTHER-PORT-ONE-NODE-DOWN-TCP.ps1 | PowerShell | apache-2.0 | 32,413 |
$packageName = 'sketchupviewer'
$softwareName = "SketchUp Viewer"
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0,3010)
[array]$key = Get-UninstallRegistryKey -SoftwareName $softwareName
$key | ForEach-Object {
Uninstall-ChocolateyPackage -PackageName $packageName `
... | dtgm/chocolatey-packages | automatic/_output/sketchupviewer/17.0.18899/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 505 |
$ErrorActionPreference = 'Stop'
$fileName = 'AutoHotkey_1.1.26.01.zip'
$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
$zip_path = "$toolsPath\$fileName"
rm $toolsPath\* -Recurse -Force -Exclude $fileName
$packageArgs = @{
PackageName = 'autohotkey.portable'
FileFullPath = $zip_path
Destinat... | octomike/chocolatey-coreteampackages | automatic/autohotkey.portable/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 825 |
#https://www.virtualbox.org/manual/ch02.html#idm819
$toolsPath = Split-Path $MyInvocation.MyCommand.Definition
. $toolsPath\helpers.ps1
$cert = Get-ChildItem Cert:\CurrentUser\TrustedPublisher -Recurse | Where-Object { $_.Thumbprint -eq 'a88fd9bdaa06bc0f3c491ba51e231be35f8d1ad5' }
if (!$cert) {
$toolsPath = Spli... | chocolatey/chocolatey-coreteampackages | automatic/virtualbox/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 3,485 |
$BIN_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition
python3 ${BIN_DIR}\sysctl-tool $args
| wybosys/wybosys | bin/sysctl-tool.ps1 | PowerShell | bsd-3-clause | 106 |
try {
$packageName = 'mediainfo'
$installerType = 'exe'
# misuse 64-bit variable in auto pkg to overcome limitations of Ketarin/chocopkgup when using repos like sf.net
$url = 'http://sourceforge.net/projects/mediainfo/files/binary/mediainfo-gui/0.7.71/MediaInfo_GUI_0.7.71_Windows.exe/download'
$silentArgs = '/S'
... | dtgm/chocolatey-packages | automatic/_output/mediainfo/0.7.71/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 540 |
$packageName = 'sqlitebrowser'
$installerType = 'exe'
$url = 'https://github.com/sqlitebrowser/sqlitebrowser/releases/download/v3.4.0/sqlitebrowser-3.4.0-win32.exe'
$silentArgs = '/S'
$validExitCodes = @(0) #valid exit codes http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
$checksum = 'dc21c88a14d120c0473d... | dtgm/chocolatey-packages | automatic/_output/sqlitebrowser/3.4.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 558 |
# Collection of powershell build utility functions that we use across our scripts.
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
# Declare a number of useful variables for other scripts to use
[string]$repoDir = Resolve-Path (Join-Path $PSScriptRoot "..\..")
[string]$binariesDir = Join-Path $repoDir "Bina... | AnthonyDGreen/roslyn | build/scripts/build-utils.ps1 | PowerShell | apache-2.0 | 14,996 |
########################################################################
#
# Linux on Hyper-V and Azure Test Code, ver. 1.0.0
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
# Licensed under the Apache License, Version 2.0 (the ""License"");
# you may not use this file except in compliance with the Licen... | bogdancarpusor/lis-test | WS2012R2/lisa/setupscripts/FC_MultipathDetection.ps1 | PowerShell | apache-2.0 | 8,979 |
# .\UpdateChangeLog "2016.11.2" "3.1.0"
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True, Position = 0)]
[string]$ReleaseDate,
[Parameter(Mandatory = $True, Position = 1)]
[string]$ReleaseVersion,
[Parameter(Mandatory = $False, Position = 2)]
[string]$PathToRepo
)
<#
This function updat... | AzureAutomationTeam/azure-powershell | tools/UpdateChangeLog.ps1 | PowerShell | apache-2.0 | 10,642 |
$limit = (Get-Date).AddDays(-21)
$path = "D:\backup\OracleDB"
# Delete files older than the $limit.
Get-ChildItem -Path $path -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
# Delete any empty directories left behind after deleting the old files.
#Get-ChildIte... | lacteolus/PowerShell | DeleteOldFiles.ps1 | PowerShell | mit | 518 |
function Get-TVUser
{
<#
.SYNOPSIS
Get details of a Teamviewer user
.DESCRIPTION
Get details of a Teamviewer user
.PARAMETER Token
The Teamviewer API token generated on the Teamviewer Management console (https://login.teamviewer.com)
.PARAMETER UserID
The userID of a Teamviewer user... | Marcuzzo/PSTeamViewer | PSTeamViewer/public/Get-TVUser.ps1 | PowerShell | mit | 4,587 |
<#
.SYNOPSIS
Gets the links of a work item.
.PARAMETER Project
${HelpParam_Project}
.PARAMETER Collection
${HelpParam_Collection}
.INPUTS
Microsoft.TeamFoundation.WorkItemTracking.Client.Project
System.String
#>
Function Add-TfsWorkItemLink
{
Param
(
[Parameter(Position=0, Mandat... | egomesbrandao/tfscmdlets | src/PS/WorkItem/Add-TfsWorkItemLink.ps1 | PowerShell | mit | 1,892 |
function Copy-DbaSysDbUserObject {
<#
.SYNOPSIS
Imports all user objects found in source SQL Server's master, msdb and model databases to the destination.
.DESCRIPTION
Imports all user objects found in source SQL Server's master, msdb and model databases to the destination. ... | SirCaptainMitch/dbatools | functions/Copy-DbaSysDbUserObject.ps1 | PowerShell | mit | 6,055 |
[cmdletbinding()]
Param (
[Parameter(ParameterSetName="Servers",Mandatory=$true)]$servers,
[Parameter(ParameterSetName="Servers")]$path,
[Parameter(ParameterSetName="TCS")]$datacenter,
[Parameter(ParameterSetName="TCS")]$stack,
[Parameter(ParameterSetName="TCS")]$role,
[Parameter(ParameterSetNa... | abix-/powershell-practical | random scripts/windows-server/Deploy-Files.ps1 | PowerShell | mit | 9,407 |
<#
.SYNOPSIS
Add a synopsis here to explain the PSScript.
#>
Param(
)
$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$CompletedParameters = Write-StartingMessage -CommandName Invoke-HelloWorld
$Vars = Get-BatchAutomationVariable -Prefix 'HelloWorld' -Name 'EmailA... | randorfer/RunbookExample | Runbooks/HelloWorld/Invoke-HelloWorld.ps1 | PowerShell | mit | 1,143 |
param($installPath, $toolsPath, $package, $project)
$file = Join-Path (Join-Path $toolsPath 'jsmodels') 'jsmodels.cmd.exe' | Get-ChildItem
$project.ProjectItems.Item($file.Name).Delete() | ucdavis/JsModels.Net | tools/Uninstall.ps1 | PowerShell | mit | 188 |
param($installPath, $toolsPath, $package, $project)
$generatorsPaths = Join-Path (Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers" ) * -Resolve
foreach($generatorsPath in $generatorsPaths)
{
# Uninstall the language agnostic source generators.
if (Test-Path $generatorsPath)
{
foreach... | MarimerLLC/csla | Source/Csla.Generators/cs/Csla.Generators.CSharp/tools/uninstall.ps1 | PowerShell | mit | 1,459 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-4.0-9285-x64.7z'
$checksum = '00fa5a50e33c77f175d66c686e2b302c976be5c8'
$checksumType = 'sha1'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
In... | dtgm/chocolatey-packages | automatic/_output/dolphin/4.0.9285/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 761 |
# Copyright 2017 Google LLC.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | DinoChiesa/Edge-Powershell-Admin | PSApigeeEdge/Public/Clear-EdgeCache.ps1 | PowerShell | apache-2.0 | 2,050 |
<#-------------Create Deployment Start------------------#>
Import-Module .\TestLibs\RDFELibs.psm1 -Force
$result = ""
$testResult = ""
$resultArr = @()
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
if ($isDeployed)
{
try
{
$hs1VIP = $AllVMData.PublicIP
$hs1v... | FreeBSDonHyper-V/azure-freebsd-automation | remote-scripts/BVT-VERIFY-RESTART.ps1 | PowerShell | apache-2.0 | 2,275 |
$clientId = Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\TeamViewer' -Name ClientID
#Creating a Mail object
$msg = new-object Net.Mail.MailMessage
#Email structure
$msg.From = "demoscript@cinegy.com"
$msg.ReplyTo = "demoscript@cinegy.com"
$msg.To.Add("lewis-demo@cinegy.com")
$msg.subject = "Templated Cinegy Machine... | Cinegy/powershell | ScalingWithPowershell/Email-TVID/SendMachineTVID-Email.ps1 | PowerShell | apache-2.0 | 630 |
if (!${PSScriptRoot}) {
${PSScriptRoot} = Split-Path -Parent $MyInvocation.MyCommand.Definition
}
. ${PSScriptRoot}/common.ps1;
if (!$env:vmOrVirtualbox) { # 这是v1.12之前
. ${rootPath}/create-machine.ps1;
if (-not $?){
exit $?;
}
$status = dm status $hostName;
if ($status -eq... | aogg/docker_lamp | powerShell/start-machine.ps1 | PowerShell | apache-2.0 | 556 |
$packageName = 'sonarr'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://download.sonarr.tv/v2/master/latest/NzbDrone.master.exe'
$checksum = 'a6af467c31575ea006c58b43cd04be9116276414196b6b8791e99d796b8e1f66'
$checksumType = 'sha256'
$validExitCodes = @(0)
$scriptPa... | dtgm/chocolatey-packages | automatic/_output/sonarr/2.0.0.4689/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 863 |
# 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-kpfloatingpanel'
$packageSearch = 'KeePass Password Safe'
$url = 'https://... | dtgm/chocolatey-packages | automatic/_output/keepass-plugin-kpfloatingpanel/7.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 2,809 |
<#
.SYNOPSIS
Invokes salt calling the salt-call command passing the arguments passed to this script.
.DESCRIPTION
Convenience wrapper arounc the salt verb - salt-call that passes pillar values for:
- PROGRAM_FILES
- LAMINAR_DIR
- HOME_PATH
- VBOX_DIR
For details on SaltStack's salt-call, see: https:/... | trochford/Laminar | saltcall.ps1 | PowerShell | apache-2.0 | 2,963 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# 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... | hovsepm/azure-powershell | src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineExtensionTests.ps1 | PowerShell | apache-2.0 | 89,378 |
function Add-VSWAFv2WebACLRegexPatternSetReferenceStatement {
<#
.SYNOPSIS
Adds an AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement resource property to the template. **Note**
.DESCRIPTION
Adds an AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement resource property to the template.
**... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSWAFv2WebACLRegexPatternSetReferenceStatement.ps1 | PowerShell | apache-2.0 | 5,249 |
task PublishVersion {
[version] $sourceVersion = (Get-Metadata -Path $manifestPath -PropertyName 'ModuleVersion')
"##vso[build.updatebuildnumber]$sourceVersion"
# Do the same for appveyor
# https://www.appveyor.com/docs/build-worker-api/#update-build-details
}
| KevinMarquette/PSGraph | BuildTasks/PublishVersion.Task.ps1 | PowerShell | mit | 278 |
# 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-keeotp'
$typName = 'KeeOtp.plgx'
$packageSearch = 'KeePass Password Safe'
$... | dtgm/chocolatey-packages | automatic/_output/keepass-plugin-keeotp/1.3.9/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 3,299 |
Param(
[string] $Repository,
[string] $BranchName="master",
[string] $GdnFolder,
[string] $AzureDevOpsAccessToken,
[string] $PushReason
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0
$LASTEXITCODE = 0
# We create the temp directory where we'll store the sdl-config repository
$sdlDir = Join-Pa... | ErikSchierboom/roslyn | eng/common/sdl/push-gdn.ps1 | PowerShell | apache-2.0 | 1,799 |
<#
.Synopsis
Gets all recommendations from Trakt.TV.
.DESCRIPTION
Gets all recommendations from Trakt.TV.
.EXAMPLE
PS C:\> Get-TraktRecommendation -Movies
Description
-----------
This example shows how to retrieve all movie recommendations from Trakt.TV.
.EXAMPLE
PS C:\> Get-TraktRecomm... | juniinacio/Trakt-PowerShell | Trakt-PowerShell/Public/Get-TraktRecommendation.ps1 | PowerShell | mit | 2,176 |
# Need to import all the files first of course.
Set-Location $PSScriptRoot\..
$script:ModuleName = '<%= $PLASTER_PARAM_ModuleName %>'
$FoundError = $false
$Directories = ("private", "public")
foreach ($Directory in $Directories)
{
$AnalyzerResults = Invoke-ScriptAnalyzer -Path .\$script:ModuleName\$Directory -In... | jpsider/Invoke-Automation | Powershell/Plaster/FullModuleTemplate/tests/RunPSScriptAnalyzer.ps1 | PowerShell | mit | 908 |
try {
$artifactDirectory = $env:PIPELINE_WORKSPACE
Write-Host "Currect working directory $artifactDirectory"
$nupkg = Get-ChildItem -Path $artifactDirectory -Filter *.nupkg -Recurse | Select-Object -First 1
if($null -eq $nupkg) {
Throw "No NuGet Package could be found in the current directory"
... | dansiegel/Prism.Plugin.Popups | build/Process-Release.ps1 | PowerShell | mit | 1,048 |
choco upgrade chocolatey-visualstudio.extension --pre --source https://www.myget.org/F/jberezanski-chocolateypackages-dev/api/v2
<#
choco install stylecop-vsix -y --pre --source https://www.myget.org/F/jberezanski-chocolateypackages-dev/api/v2
choco install stylecop-vsix -ydv --pre --source https://www.myget.org/F/j... | jberezanski/ChocolateyPackages | tools/VS2017/vs2017tests.ps1 | PowerShell | mit | 23,266 |
function Method
{
[int]$i = 0
[int]$x = 1
switch ($i)
{
2 {
$x = 2
}
3 {
$x = 3
}
default {
}
}
} | codeconverter/sdk | src/CodeConverter.Test/Languages/CSharpToPowerShell/PowerShell/Switch.ps1 | PowerShell | mit | 135 |
<#
.SYNOPSIS
XOR-Encrypt.ps1 takes a string of text to be encrypted and a key. Each
byte of the input string will be XOR'd with a byte from the key. If
the key is not as long as the input string, the key will repeat.
.PARAMETER String
A required parameter, the string to be encrypted.
.PARAMETER key
A required paramet... | davehull/MCC | sets/1/XOR-Encrypt.ps1 | PowerShell | mit | 1,906 |
param([switch]$silent)
#------------ SET WINDOWS VERSION TO BUILD FOR: WIN32 OR WIN64 --------------
#$VSP_BUILD_ARCH = "Win32"
$VSP_BUILD_ARCH = "x64"
#------------------- SET THE VERSION OF VISUAL STUDIO ------------------------
# Allowed version: 10 (= 2010), 11 (= 2012), 12 (= 2013), 14 (= 2015), 15 (=2017... | BSeppke/vspkg | system/config.ps1 | PowerShell | mit | 866 |
[CmdletBinding(DefaultParameterSetName = 'None')]
param
(
[String] [Parameter(Mandatory = $true)]
$DatabasePublishProfilePath,
[String] [Parameter(Mandatory = $true)]
$DatabaseDacpacPath,
[String] [Parameter(Mandatory = $true)]
$DatabaseServerName,
[String] [Parameter(Mandatory = $true)]
... | brandonmartinez/mm-vsts-agent-tasks | Tasks/SqlPublishDatabaseProjectToServer/Publish-SqlDatabaseProjectToServer.ps1 | PowerShell | mit | 3,578 |
# TODO: run in PR/test mode (larger matrix) vs "all-in-one" artifact/packaging mode
# TODO: use dynamic matrix so PRs are multi-job and tag builds are one (consolidate artifacts)
# TODO: consider secure credential storage for inline upload on tags? Or keep that all manual/OOB for security...
# TODO: refactor libyaml/py... | anishathalye/pyyaml | packaging/build/appveyor.ps1 | PowerShell | mit | 5,577 |
If ($args[0] -eq "-h")
{
Write-Host "Usage:`n"
Write-Host "DbUp.ps1 [Database:Sample] [Server:(LOCAL)]"
[Environment]::Exit(1)
}
$db = $args[0]
If (-Not $db)
{
$db = "Sample"
}
$server = $args[1]
If (-Not $server)
{
$server = "(LOCAL)"
}
$scriptRoot = Split-Path -parent $MyInvocation.MyCommand.Definition
Add-Ty... | akornatskyy/sample-repository-net | build/DbUp.SqlServer.ps1 | PowerShell | mit | 667 |
Function Public () {
<#
.SYNOPSIS
This cmdlet configures nothing and does it remarkably well.
.DESCRIPTION
This cmdlet configures nothing and does it remarkably well.
It takes objects as input and it sets nothing to 42.
#>
Function Nested ($InputObject) {
Get-Item $InputObject
}
}
Fun... | MathieuBuisson/PSCodeHealth | Tests/TestData/TestHelp/ExternalHelp.psm1 | PowerShell | mit | 391 |
<#
.synopsis
This script will: Add the specified user/s to the Google MigratedGapp group. It will log output to a log file.
Version 1.0
.Description
The script can either create act on a single user at a time or multiple users using a CSV file.
The script has two input parameters: Target User email address... | brian-mac/ZPM | AddAsiatoGapps.ps1 | PowerShell | mit | 6,022 |
$packageName = 'firefox-nightly'
$softwareVersion = '58.0.1.2017102901-alpha' -Replace "^(\d+)\.(\d+)\.(\d+)[^-]+-([a-z]).*",'$1.$2$4$3'
$softwareName = "Nightly $softwareVersion*"
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)
[array]$key = Get-UninstallReg... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/58.0.1.2017102901/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 817 |
param ($instance, $cred)
Write-Host "CloudWatch" -ForegroundColor Yellow
Write-Verbose "InstanceId=$($instance.InstanceId)"
trap { break } #This stops execution on any exception
$ErrorActionPreference = 'Stop'
. .\ssmcommon.ps1
function CMApplyMetrics ($instance)
{
$doc = @"
{
"schemaVersion": "1.0",
"description... | padisetty/Samples | AWS/ssm/Old/cw new.ps1 | PowerShell | apache-2.0 | 3,868 |
#
# Copyright (c) Microsoft Corporation. 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 b... | OneGet/cmdlet-testsuite | scripts/uninstall-certificates.ps1 | PowerShell | apache-2.0 | 2,260 |
$psake.use_exit_on_error = $true
properties {
$baseDir = (Split-Path -parent $psake.build_script_dir)
if(Get-Command Git -ErrorAction SilentlyContinue) {
$versionTag = git tag | ? { $_ -match '^[0-9\.]*$' } | Select-Object -Last 1
$version = $versionTag + "."
$version += (git log $... | cam1985/boxstarter | BuildScripts/default.ps1 | PowerShell | apache-2.0 | 13,764 |
function Get-CurrentUser {
<#
.SYNOPSIS
Returns the domain and username of the currently logged in user.
#>
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$parts = $identity.Name -split "\\"
return @{Domain=$parts[0];Name=$parts[1]}
}
| mwrock/boxstarter | BoxStarter.Common/Get-CurrentUser.ps1 | PowerShell | apache-2.0 | 272 |
$packageName = 'dolphin'
$url = 'https://dl.dolphin-emu.org/builds/dolphin-master-5.0-5451-x64.7z'
$checksum = '26d620b48b79601ea019647e283051b55fb559b5cce2a3381e28f62eb1c0c6aa'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.5451/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 788 |
$packageName = '{{PackageName}}'
$fileType = 'exe'
$silentArgs = '/VERYSILENT'
$url = '{{DownloadUrl}}'
$url64bit = '{{DownloadUrlx64}}'
Install-ChocolateyPackage $packageName $fileType $silentArgs $url $url64bit
| ebugusey/chocolatey-coreteampackages | automatic/mpc-hc/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 217 |
<#
.SYNOPSIS
Packages and publishes Carbon packages.
#>
# Copyright 2012 Aaron Jensen
#
# 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
#
... | cloudoman/carbon | Publish-Carbon.ps1 | PowerShell | apache-2.0 | 3,595 |
# 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 in writing, software
# distributed... | pshdo/LibGit2.PowerShell | Tests/Test-GitBranch.Tests.ps1 | PowerShell | apache-2.0 | 1,607 |
task Clean-Packages {
Remove-Item -Force -Recurse $packagesDirectory;
CreateDirectory $packagesDirectory;
}
| dotnetzero/script | src/components/scripttasks/Clean-Packages.ps1 | PowerShell | mit | 116 |
# Variable is used in GitTabExpansion.ps1
$shortGitParams = @{
add = 'n v f i p e u A N'
bisect = ''
blame = 'b L l t S p M C h c f n s e w'
branch = 'd D l f m M r a v vv q t u'
checkout = 'q f b B t l m p'
cherry = 'v'
'cherry-pick' = 'e x r m n s S X'
clean = 'd f i n q e x X'
clo... | cmarcusreid/posh-git | src/GitParamTabExpansion.ps1 | PowerShell | mit | 12,454 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = '42018a16041da4b18f70cc09d010c6b75fd6c305'
$checksumType = 'sha1'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvrt.exe"
try {
Get-Chocolat... | dtgm/chocolatey-packages | automatic/_output/kvrt/2015.10.17/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 925 |
###############################################################################
##
## Description:
## Test disks works well when hot add scsi disks.
##
###############################################################################
##
## Revision:
## v1.0.0 - ldu - 08/31/2018 - Hot add scsi disk.
##
##
###############... | VirtQE-S1/ESX-LISA | testscripts/stor_hot_plug_scsi.ps1 | PowerShell | apache-2.0 | 4,390 |
# generated vars
$packageName = 'xonotic'
$url = 'http://dl.xonotic.org/xonotic-0.8.0.zip'
$checksum = 'bc368e116a2502362e1d4f07d8f8efab'
# static vars
$checksumType = 'md5'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
# $Env:ChocolateyInstall\helpers\functions
Install-ChocolateyZipPackage ... | dtgm/chocolatey-packages | automatic/_output/xonotic/0.8.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 608 |
<#
.EXAMPLE
This example shows how to create a new managed account in a local farm, using
the automatic password change schedule
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount,
[Parameter(Mandatory ... | BrunoReboul/SharePointDsc | Modules/SharePointDsc/Examples/Resources/SPManagedAccount/2-NewManagedAccountWithSchedule.ps1 | PowerShell | mit | 870 |
<#
.SYNOPSIS
Get-Loki.ps1
Integration with Loki scanner - https://github.com/Neo23x0/Loki
This module will deploy loki scanner to scan endpoints with yara rules and other indicators.
Please be aware that scan take a very long time and it's resourse intensive.
On my machine it takes about 10 Hours to scan Windows fo... | jvaldezjr1/Kansa | Modules/IOC/Get-Loki.ps1 | PowerShell | apache-2.0 | 1,971 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
. "$PSScriptRoot\..\internal\functions\Connect-SqlInstance.ps1"
Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Context "Validate parameters"... | kozloski/dbatools | tests/Stop-DbaService.Tests.ps1 | PowerShell | mit | 2,720 |
param (
[string] $VmId,
[string] $guest_service_interface = $null,
[string] $heartbeat = $null,
[string] $key_value_pair_exchange = $null,
[string] $shutdown = $null,
[string] $time_synchronization = $null,
[string] $vss = $null
)
# Include the following modules
$Dir = Split-Path $script:My... | jtopper/vagrant | plugins/providers/hyperv/scripts/set_vm_integration_services.ps1 | PowerShell | mit | 1,252 |
param (
$darcVersion = $null
)
$verbosity = "m"
. $PSScriptRoot\tools.ps1
function InstallDarcCli ($darcVersion) {
$darcCliPackageName = "microsoft.dotnet.darc"
$dotnetRoot = InitializeDotNetCli -install:$true
$dotnet = "$dotnetRoot\dotnet.exe"
$toolList = Invoke-Expression "& `"$dotnet`" tool list -g"
... | ptoonen/corefx | eng/common/darc-init.ps1 | PowerShell | mit | 1,103 |
$packageName = 'telegram.install'
$packageSearch = "Telegram Desktop*"
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Softwa... | dtgm/chocolatey-packages | automatic/_output/telegram.install/1.0.6/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 975 |
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string]$platform = $null,
[string] $projects,
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
[bool] $warnAsError = $true,
[bool] $nodeReuse = $true,
[switch][Alias('r')]$restore,... | poizan42/coreclr | eng/common/build.ps1 | PowerShell | mit | 5,085 |
$global:au_NoCheckChocoVersion = $true
try
{
Get-ChildItem -Path .\dotnet*-*-sdk* -Directory | ForEach-Object {
Push-Location $_
.\update.ps1 -AllVersionsAsStreams
Pop-Location
}
}
finally
{
Remove-Variable -Name au_NoCheckChocoVersion -Scope Global
Write-Warning "Do not add the ... | jberezanski/dotnetcore-chocolateypackages | tools/makeallsdks.ps1 | PowerShell | mit | 352 |
<#
.SYNOPSIS
Installs the PoShPRTG Module from github
.DESCRIPTION
This script installs the PoShPRTG Module from github.
It does so by ...
- downloading the specified branch as zip to $env:TEMP
- Unpacking that zip file to a folder in $env:TEMP
- Moving that co... | AndiBellstedt/PoShPRTG | install.ps1 | PowerShell | mit | 103,494 |
# -----------------------------------------------------------------------
# Copyright : GSoft @2014
# Model : Cross Site Publishing CMS
# File : Export-TermGroups.ps1.template
# Description : Export Portal Taxonomy
# -----------------------------------------------------------------------
# Define working... | GSoft-SharePoint/Dynamite-Components | Source/GSoft.Dynamite.Models.StandardPublishingCMS/Modules/Navigation/NAV_01/Export-TermGroups.template.ps1 | PowerShell | mit | 2,117 |
$projectRoot = Resolve-Path "$PSScriptRoot\.."
$script:ModuleName = '<%= $PLASTER_PARAM_ModuleName %>'
Describe "Basic function feature tests" -Tags Build {
}
| jpsider/Invoke-Automation | Powershell/Plaster/FullModuleTemplate/tests/Feature.Tests.ps1 | PowerShell | mit | 161 |
#
# Copyright (c) 2008-2010, Kenneth Bell
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, pu... | drebrez/DiscUtils | Tests/pstest.ps1 | PowerShell | mit | 10,554 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# IMPORTANT: Do not invoke this file directly. Please instead run eng/common/New-TestResources.ps1 from the repository root.
#Requires -Version 6.0
#Requires -PSEdition Core
using namespace System.Security.Cryptography
usin... | Azure/azure-sdk-for-java | sdk/attestation/test-resources-pre.ps1 | PowerShell | mit | 5,664 |
write-host $('=' * ($HOST.ui.rawui.buffersize.width - 1))
write-host $MyInvocation.MyCommand
write-host $('=' * ($HOST.ui.rawui.buffersize.width - 1))
write-host ''
write-host ''
& {
write-host '---------------------------------------'
write-host 'There should be a complete help file'
write-host ' get-h... | imfrancisd/PowerShell-Assert-Library | verify/AssertFunctions/Verify-Assert-PipelineCount-Help.ps1 | PowerShell | mit | 538 |
configuration ROWLab {
<#
.SYNOPSIS
Creates the RES ONE Workspace single node lab deployment.
#>
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '')]
param (
## RES ONE Workspace database server name/instance (equivalient to DBSERVER).
[Para... | VirtualEngine/RESONEWorkspace | DSCResources/ROWLab/ROWLab.schema.psm1 | PowerShell | mit | 8,688 |
function Push-Nuget($path, $csproj) {
$fullPathToCsprog = Join-Path -Path $path -ChildPath $csproj -resolve;
nuget pack $fullPathToCsprog -Prop Configuration=Release -IncludeReferencedProjects
get-childitem -Filter *.nupkg -name | foreach ($_) {
Write-Host "Pushing " $_ -backgroundcolor da... | martindevans/TopologicalSorting | push-all.ps1 | PowerShell | mit | 582 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "New-Archive" {
# arrange
$content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas ... | craibuc/Ps7z | Functions/New-Archive.Tests.ps1 | PowerShell | mit | 1,052 |
# Load the Helper Module
Import-Module -Name "$PSScriptRoot\..\Helper.psm1"
# Localized messages
data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData -StringData @'
VerboseGetTargetPresent = MIMEType is present
VerboseGetTargetAbsent = MIMEType is absent
'@
}
function Get-TargetResou... | devrandorfer/ScorchDev | PowerShellModules/xWebAdministration/1.12.0.0/DSCResources/MSFT_xWebConfigKeyValue/MSFT_xWebConfigKeyValue.psm1 | PowerShell | mit | 9,920 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.