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 Split-String {
[CmdletBinding()]
param (
[Parameter(
Position = 0)]
[ValidateNotNullOrEmpty()]
[String]$Pattern = $(throw "$($MyInvocation.MyCommand.Name) : " `
+ "Cannot bind null or empty value to the parameter `"Pattern`""),
[Parameter(
... | copdips/PSScripts | Text/Split-String.ps1 | PowerShell | mit | 615 |
function Dismount-DSCPullServerESEDatabase {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[DSCPullServerESEConnection] $Connection
)
[void] [Microsoft.Isam.Esent.Interop.Api]::JetCloseDatabase(
$Connection.SessionId,
$Connection.DbId,
[Microsoft.Isam.Esent.Int... | bgelens/DSCPullServerAdmin | DSCPullServerAdmin/private/Dismount-DSCPullServerESEDatabase.ps1 | PowerShell | mit | 877 |
& {
Function myExit($code){
if($code -is [int] -and $code -ne 0){
throw $Error[0]
}else{
break
}
}
Function writeErrorTip($msg){
Write-Host $msg -BackgroundColor Red -ForegroundColor White
}
Function writeLogoLine($msg){
Write-Host $msg -BackgroundColor White -ForegroundColor Dark... | tboox/xmake | scripts/getpb.ps1 | PowerShell | apache-2.0 | 3,256 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-59.0a1.en-US.win32.installer.exe'
$checksum = '52ecf925ba50ba234f17558c24b114247647257ffa9a2be6bad54e39319edb85'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/59.0.1.2017123012/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-59.0a1.en-US.win32.installer.exe'
$checksum = '319f65652d3cd9996fc2ea1f9edb082ddaa4f43faa8e27529bc8084ff45f7a6e'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/59.0.1.2017123112/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
[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'] = '392b6db6-0c02-407c-a2da... | rshestakou/aspnet-core-bluemix-research | src/AspNetCoreBluemixResearch.Web/Properties/PublishProfiles/Bluemix-publish.ps1 | PowerShell | apache-2.0 | 774 |
import-module au
$releases = 'https://technet.microsoft.com/en-us/sysinternals/bb842062.aspx'
function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*url\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(?i)(^\s*url64bit\s*=\s*)('.*')" = "`$1'$($La... | lennartb-/chocolatey-coreteampackages | automatic/sysinternals/update.ps1 | PowerShell | apache-2.0 | 1,355 |
function Add-VSEC2SpotFleetEbsBlockDevice {
<#
.SYNOPSIS
Adds an AWS::EC2::SpotFleet.EbsBlockDevice resource property to the template. Describes a block device for an EBS volume.
.DESCRIPTION
Adds an AWS::EC2::SpotFleet.EbsBlockDevice resource property to the template.
Describes a block dev... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSEC2SpotFleetEbsBlockDevice.ps1 | PowerShell | apache-2.0 | 10,201 |
param (
[Parameter(Mandatory=$false)][int] $NumberOfDaysToReport = 7,
[Parameter(Mandatory=$true)][string] $SMTPHost,
[Parameter(Mandatory=$true)][string] $ReportSender,
[Parameter(Mandatory=$true)][string] $ReportRecipient,
[Parameter(Mandatory=$false)][string] $ReportSubject = "Auswertung",
[Parameter(Mandatory... | noSpamProxy/Reports | Get-RejectionReport (Database)/Get-RejectionReport.ps1 | PowerShell | apache-2.0 | 21,906 |
#requires -Version 3.0 -RunAsAdministrator
<#
.SYNOPSIS
Configure Storage Sense for Windows 10
.DESCRIPTION
Configure Storage Sense for Windows 10
.EXAMPLE
PS C:\> .\Set-StorageSense.ps1
.NOTES
Version 1.0.3
Use Set-StorageSense Version 1.0 from Jaap Brasser
.LINK
https://github.c... | jhochwald/PowerShell-collection | Windows10-Bootstrapper/sources/$OEM$/$1/scripts/PowerShell/Set-StorageSense.ps1 | PowerShell | bsd-3-clause | 9,753 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "New-Object" -Tags "CI" {
It "Support 'ComObject' parameter on platforms" {
if ($IsLinux -or $IsMacOs ) {
{ New-Object -ComObject "Shell.Application" } | Should -Throw -ErrorId "NamedParameterN... | Cowmonaut/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 | PowerShell | mit | 7,683 |
function Get-DbaPfDataCollectorCounter {
<#
.SYNOPSIS
Gets Performance Counters.
.DESCRIPTION
Gets Performance Counters.
.PARAMETER ComputerName
The target computer. Defaults to localhost.
.PARAMETER Credential
Allows you to login t... | SirCaptainMitch/dbatools | functions/Get-DbaPfDataCollectorCounter.ps1 | PowerShell | mit | 4,972 |
Function Get-UnityreplicationInterface {
<#
.SYNOPSIS
Information about replication interfaces in the storage system. These interfaces are used in remote replication connections and sessions for replication data transfer.
.DESCRIPTION
Information about replication interfaces in the storage ... | equelin/Unity-Powershell | Tools/Functions/Result_UnityVSA_41/Get-UnityreplicationInterface.ps1 | PowerShell | mit | 2,341 |
param($installPath, $toolsPath, $package, $project)
$extId = "JScriptIntelliSenseParaExtension.Microsoft.039ee76c-3c7f-4281-ad23-f6528ab18623"
$extManager = [Microsoft.VisualStudio.Shell.Package]::GetGlobalService([Microsoft.VisualStudio.ExtensionManager.SVsExtensionManager])
$copyOverParaFile = $false
try {
... | paulbatum/PushFrenzy | packages/jQuery.1.6.3/Tools/install.ps1 | PowerShell | mit | 914 |
[CmdletBinding()]
param(
[PSCredential] $Credential,
[Parameter(Mandatory=$False, HelpMessage='Tenant ID (This is a GUID which represents the "Directory ID" of the AzureAD tenant into which you want to create the apps')]
[string] $tenantId
)
<#
This script creates the Azure AD applications needed for this... | Azure-Samples/active-directory-dotnet-daemon | AppCreationScripts/Configure.ps1 | PowerShell | mit | 14,676 |
<#
.SYNOPSIS
A CloudStack/CloudPlatform Service Offering Listing Scriptlet.
.DESCRIPTION
List all Service Offerings of a CloudStack Cloud.
.EXAMPLE
CloudStackListServiceOfferings.ps1
#>
# Writen by Jeff Moody (fifthecho@gmail.com)
#
# 2013/5/17 v1.0 created
Import-Module CloudStackClient
$parameters = Impo... | fifthecho/CloudStack-PowerShell | CloudStackListServiceOfferings.ps1 | PowerShell | apache-2.0 | 7,470 |
<#
.DESCRIPTION
This example shows how to ensure that the SQL Agent
failsafe operator FailsafeOp does not exist.
#>
Configuration Example
{
Import-DscResource -ModuleName 'SqlServerDsc'
node localhost
{
SqlAgentFailsafe 'Remove_FailsafeOp'
{
Ensure = '... | nabrond/xSQLServer | source/Examples/Resources/SqlAgentFailsafe/2-RemoveFailsafe.ps1 | PowerShell | mit | 467 |
$packageName = 'shareenum'
$url = 'https://download.sysinternals.com/files/ShareEnum.zip'
$checksum = '1da9e32a877b9d02464dfd6d3c63d8f8269a58d3'
$checksumType = 'sha1'
$url64 = "$url"
$checksum64 = "$checksum"
$checksumType64 = "checksumType"
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Instal... | dtgm/chocolatey-packages | automatic/_output/shareenum/1.60/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,189 |
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
###################################################################... | sebgod/TestStack.BDDfy | deploy.ps1 | PowerShell | mit | 4,829 |
<#
.SYNOPSIS
Parses parameters of the package
.EXAMPLE
Get-PackageParameters "/Shortcut /InstallDir:'c:\program files\xyz' /NoStartup" | set r
if ($r.Shortcut) {... }
Write-Host $r.InstallDir
.OUTPUTS
[HashTable]
#>
function Get-PackageParameters {
[CmdletBinding()]
param(
[string]... | jberezanski/chocolatey-coreteampackages | extensions/chocolatey-core.extension/extensions/Get-PackageParameters.ps1 | PowerShell | apache-2.0 | 1,133 |
# ----------------------------------------------------------------------------------
#
# 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... | AzureAutomationTeam/azure-powershell | src/ResourceManager/Billing/Commands.Billing.Test/ScenarioTests/EnrollmentAccountTests.ps1 | PowerShell | apache-2.0 | 2,137 |
########################################################################
#
# 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... | ilenghel/lis-test | WS2008R2/lisa/setupscripts/NET_LIVEMIG.ps1 | PowerShell | apache-2.0 | 7,338 |
Function Get-ServiceStateEvent {
<#
.SYNOPSIS
Finds all events related to a service state change in the event log.
.DESCRIPTION
Finds all events related to a service state change in the event log.
.PARAMETER Computername
Name of the computer to query
... | proxb/PowerShell_Scripts | Get-ServiceStateEvent.ps1 | PowerShell | mit | 3,028 |
param($AppInsightsKey, $Timestamp, $Hostname, $Port, $EncodedInstallScript)
Write-Output "Running on $(Get-Date)"
$BinaryName = 'OctopusDeployNuGetFeed.exe'
$InstallDir = 'C:\OctopusDeployNuGetFeed'
$AppFilePath = Join-Path $InstallDir $BinaryName
if (Test-Path $AppFilePath) {
& $AppFilePath stop
& $AppFileP... | paulmarsy/OctopusNuGetDeploymentFeed | Provisioning/install.ps1 | PowerShell | mit | 1,490 |
<#
.DESCRIPTION
Creates a new Azure Analysis Services Server
.NOTES
Created by Mark Vaillancourt, Microsoft, 2017-01-14
.PARAMETER
$resourceGroupName
Name of the Resource Group to which the server
$subscriptionID
The Subscription ID of the Azure Subscription to which t... | markvsql/ALittleHelpWithBigDataPublic | ALittleHelpWithBigData/Runbooks/Child/ChildNewAzureAnalysisServicesServer.ps1 | PowerShell | mit | 3,025 |
import-module nupkg
$script:ns = 'http://schemas.microsoft.com/developer/msbuild/2003'
$script:types = @"
using System.Xml;
public class Csproj {
public System.Xml.XmlDocument Xml {get;set;}
public string Path {get;set;}
public string FullName { get { return Path; } }
public string Name {get;set;}
... | qbikez/ps-csproj | src/csproj/functions/csproj-utils.ps1 | PowerShell | mit | 13,305 |
param($installPath, $toolsPath, $package, $project)
Write-Host 'Setting up BuildTools...'
$solutionPath = (Get-Item $installPath).Parent.Parent.FullName
$targetsPath = "$solutionPath\.buildtools\BuildTools.targets"
# Make the path to the targets file relative...
$projectUri = new-object Uri('file://' + $project.Full... | WouterDemuynck/BuildTools | src/BuildTools.MSBuildTasks/Install.ps1 | PowerShell | mit | 1,660 |
[CmdletBinding()]
param()
# For more information on the VSTS Task SDK:
# https://github.com/Microsoft/vsts-task-lib
#Login-AzureRmAccount
$resourceGroupName = "mpn-rg-ddos"
$groups = "Release Management"
$users = "m345@familie-vandergaag.nl, mdamadm"
$role = "Contributor"
$action = "Users"
$failonError = $true
Wri... | maikvandergaag/msft-vsts-extensions | azuredevops/azurerbac/azurerbac/run-local.ps1 | PowerShell | mit | 471 |
#Requires -Version 3.0
Param(
[string] $ResourceGroupLocation = 'West US',
[string] $ResourceGroupName = 'dscPullServer',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerName = $ResourceGroupName.ToLowerInvariant() + '-stageartifacts',
[string] $TemplateFile = '..\Templ... | sebastus/ARM | DSCPullServer/DSCPullServer/Scripts/Deploy-AzureResourceGroup.ps1 | PowerShell | mit | 4,575 |
$root = Split-Path $MyInvocation.MyCommand.Path -Parent
Write-Verbose "Loading 'default.ps1'..."
Write-Verbose "root=$root"
include '.\Modules\Psake-Utils\psake-tasks.ps1'
properties {
Write-Verbose "Applying properties from 'default.ps1'..."
$projectName = 'ChocolateyNodeJS.extension'
}
if (Test-Path ".\... | vc3/ChocolateyNodeJS.extension | default.ps1 | PowerShell | mit | 605 |
#!/usr/bin/env powershell
function New-CardSection
{
[CmdletBinding()]
[OutputType('[PSCustomObject]')]
param
(
[Parameter()] [PSCustomObject[]] $Activity,
[Parameter()] [PSCustomObject[]] $Fact,
[Parameter()] [PSCustomObject[]] $Image,
[Parameter()] [String] $Title,
[Parameter()] [Switch] $StartGroup... | dizzi90/PoSh-MSTeams | Function/New-CardSection.ps1 | PowerShell | mit | 959 |
Import-Module PSScriptAnalyzer
$violationName = "PSAvoidUsingDeprecatedManifestFields"
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$violations = Invoke-ScriptAnalyzer $directory\TestBadModule\TestDeprecatedManifestFields.psd1 | Where-Object {$_.RuleName -eq $violationName}
$noViolations = Invoke-Scrip... | korygill/PSScriptAnalyzer | Tests/Rules/AvoidUsingDeprecatedManifestFields.tests.ps1 | PowerShell | mit | 755 |
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If it's not then please replace this with with your hosting url.
# HTML template
$Template = [IO.File]::ReadAllText(".\invoice_template.html")
# Data to fill the template
$TemplateData = [IO.File]::ReadAllText(".\invoice... | bytescout/ByteScout-SDK-SourceCode | Cloud API Server/HTML To PDF API/PowerShell/Generate PDF Invoice From HTML Template/GeneratePdfInvoiceFromHtmlTemplate.ps1 | PowerShell | apache-2.0 | 1,678 |
$packageName = 'firefox-nightly'
$softwareVersion = '55.0.1.2017031611-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-UninstallRe... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/55.0.1.2017031611/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 820 |
Param (
[string]$command
)
$scriptName = 'compose.ps1'
function executeWarning ($expression) {
$error.clear()
Write-Host "[$(date)] $expression"
try {
Invoke-Expression $expression
if(!$?) { Write-Host "[$scriptName] `$? = $?"; exit 1 }
} catch { Write-Host $_.Exception | format-list -force; e... | Semprini/cbe | .cdaf/customLocal/compose.ps1 | PowerShell | apache-2.0 | 914 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
Describe "Base.Tests" -Tags "Base.Tests" {
Mock Export-ModuleMember { return $null; }
. "$here\$sut"
Context "#CLOUDTCL-1880-Test-BaseModule" {
# Context wide constants
$... | dfensgmbh/biz.dfch.PS.Appclusive.Client | it/Base.Tests.ps1 | PowerShell | apache-2.0 | 10,390 |
# Copyright (c) 2020 The Orbit Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
$conan = Get-Command conan -ErrorAction Stop
function conan_disable_public_remotes() {
$remotes = "bintray", "conan-center"
foreach ($remote in $remote... | google/orbit | third_party/conan/configs/install.ps1 | PowerShell | bsd-2-clause | 3,489 |
<# VE_XD7VDAController\VE_XD7VDAController.Resources.psd1 #>
ConvertFrom-StringData @'
MissingDeliveryController = Citrix XenDesktop 7.x delivery controller '{0}' is missing and will be added.
AdditionalDeliveryController = Citrix XenDesktop 7.x delivery controller '{0}' is present and will be removed.
A... | VirtualEngine/XenDesktop7 | DSCResources/VE_XD7VDAController/VE_XD7VDAController.Resources.psd1 | PowerShell | mit | 866 |
function Get-ChoiceValue {
[CmdletBinding()]
param(
[string]$Title,
[string]$Message,
[array]$Options
)
$optionArray = [System.Management.Automation.Host.ChoiceDescription[]] @()
$Options | ForEach-Object {
Write-Verbose "Adding $($_) options"
$optionArray +... | dotnetzero/script | src/functions/Get-ChoiceValue.ps1 | PowerShell | mit | 442 |
function submit_symbols {
param($buildname, $buildid, $filetype, $sourcedir, $contacts)
$request = `
"BuildId=$buildid $filetype
BuildLabPhone=7058786
BuildRemark=$buildname
ContactPeople=$contacts
Directory=$sourcedir
Project=TechnicalComputing
Recursive=yes
Stat... | gilbertw/PTVS | Build/BuildReleaseHelpers.psm1 | PowerShell | apache-2.0 | 8,472 |
param(
[string]$app,
[string]$testDir,
[string]$teamApiKey,
[string]$user,
[string]$devices,
[string]$series,
[string]$locale,
[string]$userDefinedLocale,
[string]$testCloudLocation,
[string]$parallelization,
[string]$optionalArgs,
[string]$publishNUnitResults
)
Writ... | cwoolum/vso-agent-tasks | Tasks/XamarinTestCloud/XamarinTestCloud.ps1 | PowerShell | mit | 5,432 |
$depsFolder = pwd
$installFolder = "$depsFolder\install\"
Function Install($sourceFolder, $file)
{
$source = $sourceFolder + $file
$destination = $installFolder + $file
$destinationFolder = Split-Path $destination -Parent
mkdir -Force $destinationFolder > $null
copy $source $destination -Recurse -F... | chanchett/ds3_c_sdk | win32/deps/run_install_dot_bat_instead.ps1 | PowerShell | apache-2.0 | 1,730 |
Start-AutoRestCodeGeneration -ResourceProvider "notificationhubs/resource-manager" -AutoRestVersion "latest" | jamestao/azure-sdk-for-net | src/SDKs/NotificationHubs/Management.NotificationHubs/generated.ps1 | PowerShell | mit | 109 |
Param(
[string]$sourcePath = $null,
[string]$binariesPath = $null
)
set-strictmode -version 2.0
$ErrorActionPreference="Stop"
try
{
[Void][Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem')
write-host "Verify Toolset binaries folder"
# Files whech are deployed but ... | amcasey/roslyn | build/scripts/check-toolset-insertion.ps1 | PowerShell | apache-2.0 | 4,432 |
<#
Copyright 2011-2016 Roman Kuzmin
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 d... | TraGicCode/NugetPackageUpdateChecker | Invoke-Build.ps1 | PowerShell | mit | 17,976 |
Function Set-IBFixedAddress{
[CmdletBinding(DefaultParameterSetName='byObject',SupportsShouldProcess=$True,ConfirmImpact="High")]
Param(
[Parameter(Mandatory=$False,ValueFromPipelinebyPropertyName=$True,ParameterSetName='byRef')]
[ValidateScript({If($_){Test-IBGridmaster $_ -quiet}})]
... | murrahjm/Infoblox-Classy | ModuleParts/Cmdlets/Set-IBFixedAddress.ps1 | PowerShell | mit | 3,228 |
#*******************************************************************************
# Author: Mick Pletcher
# Date: 25 November 2013
#
# Program: Check Build
#*******************************************************************************
Clear-Host
#Declare Global Memory
$app = ,@()
Set-Variable... | MicksITBlogs/PowerShell | VerifyBuild.ps1 | PowerShell | mit | 2,680 |
$PackageName = 'neo4j-community'
# Per-package parameters
$downloadUrl = 'http://neo4j.com/artifact.php?name=neo4j-community-3.2.0-alpha07-windows.zip'
$md5Checksum = '134681a6d6e34c0e33ff7370ae7f01cf'
$neozipSubdir = 'neo4j-community-3.2.0-alpha07'
# major.minor.update.build
# Build is always 14
$privateJavaVersion = ... | glennsarti/neo4j-community-chocolatey | neo4j-community-3.2.0-alpha07/tools/chocolateyInstall.ps1 | PowerShell | mit | 12,043 |
configuration vRemoteDesktopAdmin {
param (
[Parameter()]
[ValidateSet('Present','Absent')]
[System.String] $Ensure = 'Present',
## Configuration Network Level Authentication
[Parameter()]
[ValidateSet('Secure','NonSecure')]
[System.String] $UserAuthenticatio... | VirtualEngine/VirtualEngineLab | DSCResources/vRemoteDesktopAdmin/vRemoteDesktopAdmin.schema.psm1 | PowerShell | mit | 2,373 |
$PackageName = 'neo4j-community'
# Per-package parameters
$downloadUrl = 'http://neo4j.com/artifact.php?name=neo4j-community-2.3.12-windows.zip'
$md5Checksum = '33874a5e61c701e45c8fbbb9798089a7'
$neozipSubdir = 'neo4j-community-2.3.12'
$neoServerApiJarSuffix = '2.3.12'
# major.minor.update.build
# Build is always 14
$p... | glennsarti/neo4j-community-chocolatey | neo4j-community-2.3.12/tools/chocolateyInstall.ps1 | PowerShell | mit | 11,579 |
function Get-ITGlueConfigurations {
[CmdletBinding(DefaultParameterSetName="index")]
Param (
[Parameter(ParameterSetName="index")]
[Parameter(ParameterSetName="show")]
[Nullable[Int]]$id,
[Parameter(ParameterSetName="index")]
[String]$filter_name = "",
[Paramete... | CalebAlbers/IT-Glue-API-PowerShell-Wrapper | ITGlueAPI/Resources/Configurations.ps1 | PowerShell | mit | 2,528 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 355eb49c-b71a-4d92-adf0-9a2dbd0b7918
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT Copyright the DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/NetworkingDsc/blob/main/LICENSE
.PROJECTURI https://githu... | PlagueHO/xNetworking | source/Examples/Resources/NetAdapterAdvancedProperty/1-NetAdapterAdvancedProperty_JumboPacket_Config.ps1 | PowerShell | mit | 983 |
$DSCResourceName = 'BMD_cFSRMClassificationProperty'
$DSCModuleName = 'cFSRMClassificationProperty'
$Splat = @{
Path = $PSScriptRoot
ChildPath = "..\..\DSCResources\$DSCResourceName\$DSCResourceName.psm1"
Resolve = $true
ErrorAction = 'Stop'
}
$DSCResourceModuleFile = Get-Item -Path (Join-Path @Spla... | PlagueHO/cFSRMClassifications | Tests/Unit/BMD_cFSRMClassificationProperty.Tests.ps1 | PowerShell | mit | 21,059 |
#
# Install.ps1
#
# Download SQL Server installer and perform installation according to a generated config file.
Exit
$location = "$env:USERPROFILE\Downloads"
Set-Location $location
#SQL Server 2016
@"
[OPTIONS]
ACTION="Install"
FEATURES=SQLENGINE
INSTANCENAME="MSSQLSERVER"
SQLCOLLATION="Latin1_General_CI_AS"
SQLSVC... | eidias/Gallery | PowerShell/SqlServer/Install.ps1 | PowerShell | mit | 1,481 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 4f057a4f-0d4a-4d1f-aaf1-8080718428e0
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/ActiveDirectoryCSDsc/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/ActiveDirectoryCSDsc
.I... | PlagueHO/xAdcsDeployment | Examples/Resources/AdcsWebEnrollment/1-AdcsWebEnrollment_InstallWebEnrollment_Config.ps1 | PowerShell | mit | 1,450 |
# A standard For Loop
For ($i=0; $i -le 5; $i++)
{
$vmName = “test_” + $i
New-VM -Name $vmName -VM “base” -Datastore "NVMe_203" -LinkedClone -ReferenceSnapShot “base” -VMHost $vmhost
}
# Cleanup
Get-VM | Where-Object {$_.Name -like '*test*'} | Remove-VM -DeletePermanently -Confirm:$false
# Oh no, it cre... | jpsider/Invoke-Automation | Powercli/VMWorld2021/vmw21_for.ps1 | PowerShell | mit | 1,066 |
$WarningPreference = 'silentlycontinue'
$Accounts = Get-AzureAccount
Write-Verbose ("{0} Accounts retreived" -f $accounts.count)
Foreach ($account in $accounts)
{
$Subs = $account.subscriptions
Write-Verbose "Processing subscription [($subs-$($subs.count)]"
Foreach ($sub in $subs)
{
# skip null su... | doctordns/AzureHelper | AzureHelper/Get-tflAllAzureSubscription.ps1 | PowerShell | cc0-1.0 | 1,119 |
$version = "0.1"
$installFolder = "$env:APPDATA\withps"
function Write-Help {
Write-Host "Syntax: with program"
Write-Host "-h, -help: Display this message"
Write-Host "-v, -version: Display the currently installed version of withPS"
Write-Host "-u, -update: Updates withPS"
Write-Host "-i, -ins... | Acader/withPS | with.ps1 | PowerShell | apache-2.0 | 3,588 |
<#
.SYNOPSIS
Returns the Reddit API Type Name of reddit Objects
.DESCRIPTION
Determines the Object Type and returns the Reddit APY Type Name
.PARAMETER RedditObject
The Reddit Object to be used to determing the TypeName
.EXAMPLE
PS C:\> Get-RedditApiTypeNa... | markekraus/ConnectReddit | API/Get-RedditApiTypeName.ps1 | PowerShell | apache-2.0 | 1,451 |
function Start-WorkflowInstance {
<#
.SYNOPSIS
Creates Workflow Instances based on a Workflow Definitions from Activiti.
.DESCRIPTION
Creates Workflow Instances based on a Workflow Definitions from Activiti.
.OUTPUTS
.INPUTS
See PARAMETER section for a description of input parameters.
.EXAMPLE
Start-WorkflowIns... | dfensgmbh/biz.dfch.PS.Activiti.Client | src/Start-WorkflowInstance.ps1 | PowerShell | apache-2.0 | 13,227 |
function Create-DefaultsFile()
{
$file = "$($Context.MakeDirectory)\Defaults.ps1"
$defaults=@{}
if($Context.NuGetSource) { $defaults.Add('NuGetSource', $Context.NuGetSource) }
if($Context.NuGetConfig) { $defaults.Add('NuGetConfig', $Context.NuGetConfig) }
$defaults = ($defaults.GetEnumerator() | %{ "`t'$($_.Key... | Suremaker/PsMake | psmake/ext/psmake.scaffold.ps1 | PowerShell | bsd-2-clause | 2,458 |
#example 1:
Start-Transcript -Path c:\logfile.txt
Stop-Transcript
| mikepfeiffer/ex-2010-ps-cookbook | Chapter2/LoggingShellSessionstoaTranscript.ps1 | PowerShell | mit | 68 |
<#
To publish after build:
Publish-Module -Path $FullPublishPath -NuGetApiKey $NuGetApiKey -Repository PSGallery
#>
$ScriptRoot = $PSScriptRoot
$ReleaseNotes = "New functions for getting schedules/events, a generic function to call any endpoint and a function that can take a backup. Other various enhancements... | AWahlqvist/powershell-tellstick-module | build.ps1 | PowerShell | mit | 3,555 |
Import-Module "./NuGetMetadata.psm1"
$filePath = @{
test = "./test/test.zip"
relative = "./test/test.zip"
nupkg = "./test/example.nupkg"
nonExistent = "./non-existent.file"
notZipFile = "./test/test.txt"
NugetConfig = "./test/NuGet.Config"
}
$filePath['absolute'] = (Resolve-Pat... | SpiderUnicorn/nuget-license-information | NuGetMetadata.Tests.ps1 | PowerShell | mit | 4,558 |
<#
.SYNOPSIS
Returns one or more task schedule items using the specified criteria.
.DESCRIPTION
The Get-TaskSchedule command returns one or more task schedule items, based on name/database filter, path or simply converting a Sitecore item.
.PARAMETER Item
Task item to be converted.... | ostat/Console | Documentation/Get-TaskSchedule.ps1 | PowerShell | mit | 5,217 |
<#
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
#>
#
# Module manifest for module 'Azs.Network.Admin'
#
# Generated by: Microsoft
#
# Generated on: 3/8/2018
#
@{
# Script module or binary module file associa... | AzureAutomationTeam/azure-powershell | src/StackAdmin/Azs.Network.Admin/Module/Azs.Network.Admin/Azs.Network.Admin.psd1 | PowerShell | apache-2.0 | 5,393 |
Trace-VstsEnteringInvocation $MyInvocation
$global:ErrorActionPreference = 'Continue'
$global:__vstsNoOverrideVerbose = $true
try {
Import-VstsLocStrings "$PSScriptRoot\task.json"
Import-Module -Name "$PSScriptRoot\ps_modules\RemoteDeployer\RemoteDeployer.psm1"
. "$PSScriptRoot\Utility.ps1"
# Get... | dylan-smith/vso-agent-tasks | Tasks/PowerShellOnTargetMachinesV3/PowerShellOnTargetMachines.ps1 | PowerShell | mit | 3,825 |
# Helper script for those who want to run psake without importing the module.
# Example:
# .\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)]
[string]$buil... | nerdamigo/NEventStore | build/psake.ps1 | PowerShell | mit | 1,637 |
# ----------------------------------------------------------------------------------
#
# 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... | nemanja88/azure-powershell | src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/SubscriptionTests.ps1 | PowerShell | apache-2.0 | 1,065 |
$here = Split-Path -Path $MyInvocation.MyCommand.Path -Parent;
$testRoot = Split-Path -Path $here -Parent;
$moduleRoot = Split-Path -Path $testRoot -Parent;
Import-Module "$moduleRoot\PScribo.psm1" -Force;
InModuleScope 'PScribo' {
Describe "DocumentOption" {
$pscriboDocument = Document 'Test' { }
... | iainbrighton/PScribo | Tests/Unit/DocumentOption.Tests.ps1 | PowerShell | mit | 3,483 |
function Get-VMWindowsPartition
{
param(
[Parameter(Mandatory=$True)]
$View
)
$result = @{}
$scsi = $view.Config.Hardware.Device | where { $_.DeviceInfo.Label -match "SCSI Controller" }
$deviceList = $view.Config.Hardware.Device | where { $_.ControllerKey -eq $scsi.Key }
... | cedricdo/PS | VM/Get-VMWindowsPartition.ps1 | PowerShell | mit | 1,532 |
Param()
# import class and function
$ScriptPath = $PSScriptRoot
$DlibDotNetRoot = Split-Path $ScriptPath -Parent
$ScriptPath = Join-Path $DlibDotNetRoot "nuget" | `
Join-Path -ChildPath "BuildUtils.ps1"
import-module $ScriptPath -function *
$OperatingSystem="centos"
$Distribution="centos"
$Di... | takuya-takeuchi/DlibDotNet | nuget/BuildCentOS7.ps1 | PowerShell | mit | 2,338 |
function Method
{
[bool]$eq = 1 -eq 2
[bool]$notEq = 1 -ne 2
[bool]$or = 1 -eq 2 -or 2 -eq 1
[bool]$and = 1 -eq 2 -and 2 -eq 1
[bool]$gt = 1 -gt 2
[bool]$lt = 1 -lt 2
[bool]$ge = 1 -ge 2
[bool]$le = 1 -le 2
[int]$plus = 1 + 1
[int]$minus = 1 - 1
[int]$bor = 1 -bor 1
} | codeconverter/sdk | src/CodeConverter.Test/Languages/PowerShellToCSharp/PowerShell/Operators.ps1 | PowerShell | mit | 282 |
[CmdletBinding()]
param(
[string]$tridionInstallLocation = "C:\Program Files (x86)\Tridion\",
[string]$iisWebsiteName = "SDL Tridion",
[string]$name = "CodeMirror"
)
$ErrorActionPreference = "Stop"
Write-Host "********************************************************************"
Write-Host "* Tridion GUI... | buildingblocks/tridion-mirror | node-module/lib/install.ps1 | PowerShell | mit | 7,251 |
Describe "Initial Startup" {
BeforeAll {
$windowMain = & (Join-Path $PSScriptRoot "..\Mapping\MainWindow.ps1")
$testData = Get-TestProperties
}
It "Playnite can be started and window is opened" {
Start-Process (Join-Path $testData.InstallPath "PlayniteUI.exe")
... | JosefNemec/Playnite | tests/UI/Startup.Tests.ps1 | PowerShell | mit | 1,004 |
#ValidationTags#Messaging,FlowControl,Pipeline,CodeStyle#
function New-DbaAgentJob {
<#
.SYNOPSIS
New-DbaAgentJob creates a new job
.DESCRIPTION
New-DbaAgentJob makes is possible to create a job in the SQL Server Agent.
It returns an array of the job(s) created
.PARAMETER SqlInstance
SQL Server instance. You must... | SirCaptainMitch/dbatools | functions/New-DbaAgentJob.ps1 | PowerShell | mit | 18,211 |
function Get-DecryptedObject {
<#
.SYNOPSIS
Internal function.
This function is heavily based on Antti Rantasaari's script at http://goo.gl/wpqSib
Antti Rantasaari 2014, NetSPI
License: BSD 3-Clause http://opensource.org/licenses/BSD-3-Cla... | dsolodow/dbatools | internal/functions/Get-DecryptedObject.ps1 | PowerShell | mit | 9,057 |
function install_vim($name)
{
$ver = $name -replace "^Official\s*", ""
if ($ver -eq "latest")
{
$url1 = 'ftp://ftp.vim.org/pub/vim/pc/vim80w32.zip'
}
else
{
$url1 = 'ftp://ftp.vim.org/pub/vim/pc/vim80-' + $ver + 'w32.zip'
}
$url2 = 'ftp://ftp.vim.org/pub/vim/pc/vim80rt.zip'
$zip1 = $Env:APPVEY... | lambdalisue/vital-Vim-Buffer-Anchor | .ci/install.ps1 | PowerShell | mit | 1,617 |
<#
.SYNOPSIS
download sysinternals utilities
.LINK
[net.servicePointManager]::Expect100Continue = $true;[net.servicePointManager]::SecurityProtocol = [net.SecurityProtocolType]::Tls12;
invoke-webRequest "https://raw.githubusercontent.com/jagilber/powershellScripts/master/sysinternals-exe-download.ps1" -out... | jagilber/powershellScripts | sysinternals-exe-download.ps1 | PowerShell | mit | 1,355 |
$packageName = ".Net 3.5"
Write-Host "Installing $packageName" -ForegroundColor Green
Import-Module ServerManager
Add-WindowsFeature "NET-Framework-Features"
Write-Host "Finished installing $packageName" -ForegroundColor Green | sparerd/vagrant | SharedScripts/Windows/DotNet/install_dotnet_35_for_server.ps1 | PowerShell | mit | 227 |
# MIT License
# Copyright (c) 2017 Maurice CGP Peters
# 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, me... | MCGPPeters/Concha | build/build.psm1 | PowerShell | mit | 3,353 |
function Get-BashVersion {
$version = bash -c 'echo ${BASH_VERSION}'
return "Bash $version"
}
function Get-DotnetVersionList {
$sdkRawList = Run-Command "dotnet --list-sdks"
$sdkVersionList = $sdkRawList | ForEach-Object { Take-Part $_ -Part 0 }
return ".NET SDK " + [string]::Join(" ", $sdkVersionL... | mattgwagner/New-Machine | .github-actions/images/macos/software-report/SoftwareReport.Common.psm1 | PowerShell | mit | 16,390 |
# https://www.saotn.org/windows-server-2012-r2-disk-cleanup-dism/
# analyze the size of the Component Store (WinSxS folder)
dism.exe /online /Cleanup-Image /AnalyzeComponentStore
# removes superseded and unused system files from a system
dism.exe /online /Cleanup-Image /StartComponentCleanup
# all superseded versio... | jsk01/Powershell | DISM windows update cleanup.ps1 | PowerShell | mit | 443 |
Param([string]$password)
.\build.ps1
.\publishToLocalPi.ps1 -password $password | Patrickkk/Tests | RestberryPiApi/buildAndPublish.ps1 | PowerShell | apache-2.0 | 79 |
configuration ConfigureSPVM
{
param
(
[Parameter(Mandatory)] [String]$DNSServer,
[Parameter(Mandatory)] [String]$DomainFQDN,
[Parameter(Mandatory)] [String]$DCName,
[Parameter(Mandatory)] [String]$SQLName,
[Parameter(Mandatory)] [String]$SQLAlias,
[Parameter(Manda... | Yvand/AzureRM-Templates | Templates/DTL-SharePoint-AllVersions-light/dsc/ConfigureSPVM.ps1 | PowerShell | apache-2.0 | 40,830 |
$packageName = 'cpu-z.portable'
$url = 'http://download.cpuid.com/cpu-z/cpu-z_1.77-en.zip'
$checksum = 'd41a7ea019b18e44d3e97b72cf78536ef64a883bc6bedbf9a636a33f828da0dd'
$checksumType = 'sha256'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile32 = Join-Path $toolsDir "cpuz_x32.exe"
$... | dtgm/chocolatey-packages | automatic/_output/cpu-z.portable/1.77/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 782 |
$packageName = 'combofix'
$url = 'https://download.bleepingcomputer.com/sUBs/ComboFix.exe'
$checksum = '3faeea290ccc4db855e23a977930de4ce5ec2c49321d861a045ad413027a169a'
$checksumType = 'sha256'
$toolsDir = Split-Path -parent $MyInvocation.MyCommand.Definition
$installFile = Join-Path $toolsDir "ComboFix.exe"
Get-Choc... | dtgm/chocolatey-packages | automatic/_output/combofix/17.8.4.1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 719 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
if(get-module Boxstarter.TestRunner){Remove-Module Boxstarter.TestRunner}
Resolve-Path $here\..\..\Boxstarter.Common\*.ps1 |
% { . $_.ProviderPath }
Resolve-Path $here\..\..\Boxstarter.Bootstrapper\*.ps1 |
% { . $_.ProviderPath }
Resolve-Path $here\..\..... | cam1985/boxstarter | tests/TestRunner/Publish-BoxstarterPackage.Tests.ps1 | PowerShell | apache-2.0 | 6,709 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
## SSH Remoting cmdlet tests
##
Describe "SSHTransport switch parameter value" -Tags 'Feature' {
BeforeAll {
$TestCasesSSHTransport = @(
@{scriptBlock = {New-PSSession -HostName localhost -UserNam... | Cowmonaut/PowerShell | test/powershell/engine/Remoting/SSHRemotingCmdlets.Tests.ps1 | PowerShell | mit | 2,583 |
#
# .SYNOPSIS
# Downloads the swagger specification from the EMS API and writes it to a file (or stdout).
#
param
(
[Parameter( Mandatory = $true )]
[string] $Endpoint,
[Parameter( Mandatory = $true )]
[string] $UserName,
[Parameter( Mandatory = $true )]
[SecureString] $Password,
[Paramet... | ge-flight-analytics/EmsApi.Client | src/Dto/Get-EmsApiSwaggerSpec.ps1 | PowerShell | mit | 1,324 |
# Delete all containers
Write-Host "Deleting all running containers in the local Docker Host"
docker rm $(docker ps -a -q) -f
$eShopImagesToDelete = docker images --filter=reference="eshop/*" -q
If (-Not $eShopImagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local D... | andrelmp/eShopOnContainers | cli-windows/delete-vs-and-eshop-images.ps1 | PowerShell | mit | 2,044 |
$packageName = 'smsniff.install'
$installerType = 'exe'
$url = 'http://www.nirsoft.net/utils/smsniff_setup.exe'
$checksum = '808faf3a442f2c77d9536ae5ce241f4f58a73c35'
$checksumType = 'sha1'
$silentArgs = '/S'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packageName" `
-File... | dtgm/chocolatey-packages | automatic/_output/smsniff.install/2.16/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 603 |
Configuration UpdateServicesConfig
{
Import-DscResource -ModuleName UpdateServicesDsc
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node $AllNodes.NodeName
{
WindowsFeature UpdateServices
{
Ensure = 'Present'
Name = 'UpdateServices'
}
... | mgreenegit/UpdateServicesDsc | Tests/Integration/UpdateServicesConfig.ps1 | PowerShell | mit | 3,806 |
function Export-DbaPfDataCollectorSetTemplate {
<#
.SYNOPSIS
Exports a new Data Collector Set XML Template.
.DESCRIPTION
Exports a Data Collector Set XML Template from Get-DbaPfDataCollectorSet. Exports to "$home\Documents\Performance Monitor Templates" by default.
.PARAMETER ComputerN... | alevyinroc/dbatools | functions/Export-DbaPfDataCollectorSetTemplate.ps1 | PowerShell | mit | 3,819 |
# ----------------------------------------------------------------------------------
#
# 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/... | zhencui/azure-powershell | tools/Installer/generate.ps1 | PowerShell | apache-2.0 | 4,477 |
$scriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
$solutionDir = Join-Path $scriptRoot '..' -Resolve
$outDir = Join-Path $solutionDir 'out' -Resolve
$projectDir = Join-Path $solutionDir 'Module'
$modulePath = Join-Path $outDir Module
$hasBuild = Test-Path $modulePath
if (-not $hasBuild)
{
throw "Modul... | igoravl/tfscmdlets | Tests/_TestSetup.ps1 | PowerShell | mit | 814 |
function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $cryptoProvi... | MicrosoftLearning/20486-DevelopingASPNETMVCWebApplications | Allfiles/20486C/Mod11/LabFiles/PhotoSharingApplication_11_begin/packages/jQuery.1.10.2/Tools/common.ps1 | PowerShell | mit | 14,518 |
$projectJsonFileLocation = "src/StatsN/project.json"
$newVersion = $env:APPVEYOR_REPO_TAG_NAME
if($newVersion -eq $null)
{
$newVersion = "1.0.0-${env:APPVEYOR_BUILD_NUMBER}"
}
if($newVersion -eq $null)
{
return
}
Write-Host "$projectJsonFileLocation will be update with new version '$newVersion'"
$json = (Get-Conte... | TryStatsN/StatsN | update-projectjson.ps1 | PowerShell | mit | 470 |
@{
ModuleToProcess = 'Microsoft.PowerShell.ScheduledJob.dll'
ModuleVersion = '1.1.0.0'
GUID = '50cdb55f-5ab7-489f-9e94-4ec21ff51e59'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = '© Microsoft Corporation. All rights reserved.'
PowerShellVersion = '3.0'
CLRVersion = '4.0'
Ty... | kmosher/PowerShell | src/Modules/Windows-Full/PSScheduledJob/PSScheduledJob.psd1 | PowerShell | mit | 973 |
# Written by Midas van Oene
# Contact: Midas.van.Oene@gmail.com
# Repository: https://github.com/midasvo/CSV2SSIS
$package = "\path\to\Package.dtsx"
$SSISWorkingDirectory = "\path\to\SSISWorkingDirectory"
$MonitoringDirectory = "\path\to\MonitoringDirectory"
$filter = '*.*' # Wildcard filter ... | midasvo/AUTOCSV2SSIS | CSV2SSIS.ps1 | PowerShell | mit | 4,812 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.