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 |
|---|---|---|---|---|---|
. "$PSScriptRoot/common.ps1"
$NETWORK="lnmp_backend"
if ($null -eq $(docker network ls -f name="lnmp_backend" -q)){
$NETWORK="bridge"
}
docker run -i ${tty} --rm `
--mount type=volume,src=lnmp_npm-cache-data,target=/tmp/node/.npm `
--mount type=volume,src=lnmp_npm-global-data,target=/tmp/node/npm `
--network ... | khs1994-docker/lnmp | bin/lnmp-npm.ps1 | PowerShell | apache-2.0 | 949 |
$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 = '94ff49a2d14a573adca56f8803e5cc86684d25c9cbb7f5fad64bc01fe2811175'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/59.0.1.2017121012/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
$packageName = 'firefox-nightly'
$softwareVersion = '60.0.1.2018021613-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/60.0.1.2018021613/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 817 |
function Add-VSCognitoUserPoolEmailConfiguration {
<#
.SYNOPSIS
Adds an AWS::Cognito::UserPool.EmailConfiguration resource property to the template. The email configuration.
.DESCRIPTION
Adds an AWS::Cognito::UserPool.EmailConfiguration resource property to the template.
The email configura... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSCognitoUserPoolEmailConfiguration.ps1 | PowerShell | apache-2.0 | 9,697 |
[CmdletBinding()]
param()
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
$serviceConnectionName = "random connection name"
$composeFilePath = "docker-compose.yml"
$applicationName = "fabric:/Application1"
$serverCertThumbprint = "random thumbprint"
$userName = "random user"
$password = "random password"
$conn... | aldoms/vsts-tasks | Tasks/ServiceFabricComposeDeploy/Tests/DeployPreview.ps1 | PowerShell | mit | 3,484 |
function Copy-DbaInstanceTrigger {
<#
.SYNOPSIS
Copy-DbaInstanceTrigger migrates server triggers from one SQL Server to another.
.DESCRIPTION
By default, all triggers are copied. The -ServerTrigger parameter is auto-populated for command-line completion and can be used to copy only specific... | alevyinroc/dbatools | functions/Copy-DbaInstanceTrigger.ps1 | PowerShell | mit | 9,277 |
$script:artifactsPath = (property artifactsPath $basePath\artifacts)
$script:prereleaseVersion = (property prereleaseVersion "pre{date}")
task OctoPack {
$octopusToolsPath = Get-RequiredPackagePath OctopusTools $basePath\$projectName
if([string]::IsNullOrWhiteSpace($version)){
$version = (Get-Date).ToString(... | Kennethtruyers/PowerTasks | PowerTasks/.Tasks/OctoPack.ps1 | PowerShell | mit | 559 |
param(
[Parameter(Mandatory = $false)]
[string]$certificateValidationMode = "None"
)
$cmdletsPaths = "$PSScriptRoot\..\..\Cmdlets"
. "$cmdletsPaths\Helpers\Write-Separator.ps1"
. "$cmdletsPaths\Helpers\Get-ProgressHash.ps1"
Write-Separator -Invocation $MyInvocation -Header
$scriptProgress = Get-ProgressHa... | Sarafian/ISHBootstrap | Source/Builders/DevelopFriendly/Set-CertificateValidationMode.ps1 | PowerShell | apache-2.0 | 1,977 |
Describe "Setting worksheet protection " {
BeforeAll {
$path = "TestDrive:\test.xlsx"
Remove-Item -path $path -ErrorAction SilentlyContinue
$excel = ConvertFrom-Csv @"
Product, City, Gross, Net
Apple, London , 300, 250
Orange, London , 400, 350
Banana, London , 300, 200
Orange, Paris, 6... | dfinke/ImportExcel | __tests__/ProtectWorksheet.tests.ps1 | PowerShell | apache-2.0 | 1,521 |
#
# Module manifest for module 'AzureRM'
#
# Generated by: Microsoft Corporation
#
# Generated on: 3/22/2018
#
@{
# RootModule
RootModule = "AzureRM.psm1"
# Version number of this module.
ModuleVersion = '2.3.0.1'
# Supported PSEditions
# CompatiblePSEditions = @()
... | ClogenyTechnologies/azure-powershell | src/StackAdmin/AzureRM/AzureRM.psd1 | PowerShell | apache-2.0 | 6,131 |
$packageName = 'kicad'
$installerType = 'exe'
$silentArgs = '/S'
$url = 'http://www2.futureware.at/~nickoe/kicad-product-r5891.351914d-i686.exe'
$checksum = 'c6db13d2a26e0a3027890a327a5758959e3e51a3'
$checksumType = 'sha1'
$url64 = 'http://www2.futureware.at/~nickoe/kicad-product-r5891.351914d-x86_64.exe'
$checksum64 =... | dtgm/chocolatey-packages | automatic/_output/kicad/2015.07.07.5891/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 946 |
Function Right($str,$qtd = 1){
return $str.substring($str.length - $qtd, $qtd)
}
Function PutFolderSlash($folder, [switch]$Slash = $false ){
if(!$folder){return $null}
$slashToUse = '\'
$slashToReplace = '/'
if($Slash){
$slashToUse = '/'
$slashToReplace = '\'
}
write-verbose "Current folde... | rrg92/CustomMSSQL | helpers/StringAndPaths.aux.ps1 | PowerShell | mit | 694 |
#requires -RunAsAdministrator
#requires -Version 4
$moduleName = 'Lability';
$repoRoot = (Resolve-Path "$PSScriptRoot\..\..\..\..").Path;
Import-Module (Join-Path -Path $RepoRoot -ChildPath "$moduleName.psm1") -Force;
Describe 'Src\Private\Get-DiskImageDriveLetter' {
InModuleScope $moduleName {
It 'Thro... | iainbrighton/Lability | Tests/Unit/Src/Private/Get-DiskImageDriveLetter.Tests.ps1 | PowerShell | mit | 1,418 |
Configuration Sample_xWebsite_FromConfigurationData
{
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
# Dynamically find the applicable nodes from configuration data
Node $AllNodes.where{$_.Role -eq "Web"}.NodeName
{
# Install the IIS role
... | phongdly/puppetlabs-dsc | lib/puppet_x/dsc_resources/xWebAdministration/Examples/Sample_xWebsite_NewWebsiteFromConfigurationData.ps1 | PowerShell | apache-2.0 | 1,667 |
# ----------------------------------------------------------------------------------
#
# 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... | seanbamsft/azure-powershell | src/ServiceManagement/Common/Commands.ScenarioTest/Resources/CredentialTests/Common.ps1 | PowerShell | apache-2.0 | 3,813 |
# Copyright (c) 2020 Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT License (MIT)
function Get-RsRestItem
{
<#
.SYNOPSIS
This function fetches a catalog item from the Report Server
.DESCRIPTION
This function fetches a catalog item from the Report Server... | SQLvariant/ReportingServicesTools | ReportingServicesTools/Functions/CatalogItems/Rest/Get-RsRestItem.ps1 | PowerShell | mit | 4,493 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
Context "Setup" {
BeforeAll {
$server = Connect-DbaInstan... | SirCaptainMitch/dbatools | tests/Get-DbaRegisteredServer.Tests.ps1 | PowerShell | mit | 3,373 |
$packageName = 'iiscrypto-commandline'
$toolsPath = (Split-Path -parent $MyInvocation.MyCommand.Definition)
$localFile = Join-Path $toolsPath "iiscryptocli.exe"
$localFile40 = Join-Path $toolsPath "iiscryptocli40.exe"
Get-ChocolateyWebFile $packageName $localFile 'https://www.nartac.com/Downloads/IISCrypto/IISCryptoCl... | skyguy94/chocolatey-packages | iiscrypto-cli/Tools/ChocolateyInstall.ps1 | PowerShell | mit | 439 |
$RepoRoot = Resolve-Path "${PSScriptRoot}..\..\..\.."
$EngDir = Join-Path $RepoRoot "eng"
$EngCommonDir = Join-Path $EngDir "common"
$EngCommonScriptsDir = Join-Path $EngCommonDir "scripts"
$EngScriptsDir = Join-Path $EngDir "scripts"
# Import required scripts
. (Join-Path $EngCommonScriptsDir SemVer.ps1)
. (Join-Path... | AsrOneSdk/azure-sdk-for-net | eng/common/scripts/common.ps1 | PowerShell | mit | 1,888 |
#region Initialize Cache
if (-not [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["operatorcategory"]) {
[Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["operatorcategory"] = @{ }
}
#endregion Initialize Cache
#region Tepp Data return
$ScriptBlock = {
param (
$commandN... | dsolodow/dbatools | internal/dynamicparams/operatorcategory.ps1 | PowerShell | mit | 2,098 |
<#
.Synopsis
Allows running processes and capturing output.
.DESCRIPTION
Allows running processes and capturing output.
.EXAMPLE
Start-ProcessWithCapture -FilePath 'git' -ArgumentList 'pull' -WorkingDirectory $Path -ErrorAction Stop
#>
function Start-ProcessWithCapture
{
[CmdletBinding()]
Param
(
... | MattHodge/MattHodgePowerShell | General/Start-ProcessWithCapture.ps1 | PowerShell | mit | 1,392 |
$ErrorActionPreference = 'Stop'
$Session = New-Object -ComObject 'Microsoft.Update.Session'
$Session.ClientApplicationID = 'Packer Windows Update Installer'
$UpdateSearcher = $Session.CreateUpdateSearcher()
Write-Output "Searching for Windows updates ..."
$SearchResult = $UpdateSearcher.Search("IsInstalled=0 and Type=... | StefanScherer/packer-windows | scripts/install-cumulative-update.ps1 | PowerShell | mit | 1,423 |
param (
[string]$BackupDirectory,
[string]$Target,
[string]$StripPath = $null,
[string]$DateTimeFormat = 'yyyyMMddHHmmss'
)
$ErrorActionPreference = 'Stop'
function parseDate($date) {
[DateTime]::ParseExact(
$date,
$DateTimeFormat,
[Globalization.Cultureinfo]::InvariantCult... | ForNeVeR/Reconstructor | Initialize-GitFromDirectoryBackup.ps1 | PowerShell | mit | 1,499 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 80d306fa-8bd4-4a8d-9f7a-bf40df95e661
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS
.LICENSEURI https://github.com/dsccommunity/SharePointDsc/blob/master/LICENSE
.PROJECTURI https://github.com/dsccommunity/S... | PowerShell/xSharePoint | SharePointDsc/Examples/Resources/SPWebAppClientCallableSettings/1-SetClientCallableSettings.ps1 | PowerShell | mit | 1,580 |
Configuration CHSDemo
{
Param(
)
Node Role {
}
}
| devrandorfer/ScorchDev | DSC/CHSDemo.ps1 | PowerShell | mit | 71 |
Add-Type -TypeDefinition @'
namespace xScheduledTask
{
public enum DaysOfWeek
{
Sunday = 1,
Monday = 2,
Tuesday = 4,
Wednesday = 8,
Thursday = 16,
Friday = 32,
Saturday = 64
}
}
'@
Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -... | jaredhaight/WindowsAttackAndDefenseLab | WindowsAttackAndDefenseLab/DSC/UserDesktopConfig/xComputerManagement/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1 | PowerShell | mit | 46,387 |
param(
[string] $environment
)
Write-Host "FR Manager Application Deploy Script"
Write-Host 'Environment:'
Write-Host $environment
if ($environment -eq "dev" ){
Write-Host "Environment set to dev"
Write-Host "Grabbing .env and swiftmailer config files"
Copy-Item ../config/dev.env ./.env
Copy-Ite... | lrespto/funrun-symfony2 | deploy.ps1 | PowerShell | mit | 3,190 |
function Enter-Server {
<#
.SYNOPSIS
Performs a login to a Cumulus server.
.DESCRIPTION
Performs a login to a Cumulus server.
This is the first Cmdlet to be executed and required for all other Cmdlets of this module. It creates service references to the routers of the application.
.OUTPUTS
This Cmdlet returns a h... | dfch/biz.dfch.PS.Cumulus.Utilities | Enter-Server.ps1 | PowerShell | apache-2.0 | 15,516 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-310-x64.7z'
$checksum = '0165eaeeb8d07f89e52df8c7370721bdef5e0818f2a19a28178f6c7c8dc69e16'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.310/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 789 |
function Get-TargetResource
{
# Ignoring this because we need to generate a stub credential to return up the current
# crawl account as a PSCredential
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
[CmdletBinding()]
[OutputType([System.Coll... | ferventcoder/puppetlabs-dsc | lib/puppet_x/dsc_resources/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/MSFT_SPSearchServiceApp.psm1 | PowerShell | apache-2.0 | 15,266 |
#
# Module manifest for module 'PSGet_AzureRM.Profile'
#
# Generated by: Microsoft Corporation
#
# Generated on: 2/5/2018
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '4.3.0'
# Supported PSEditions
# CompatiblePSEditions... | devigned/azure-powershell | src/ResourceManager/Profile/AzureRM.Profile.psd1 | PowerShell | apache-2.0 | 8,001 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | gregerts/debian-qpid-cpp | src/tests/run_msg_group_tests.ps1 | PowerShell | apache-2.0 | 3,765 |
Write-Host "Hello World In before_install!" | SaberZA/Prismatic | Prismatic.Test/Runner/before_install.ps1 | PowerShell | apache-2.0 | 46 |
$ErrorActionPreference = 'Stop';
$packageName= 'collectdwin'
$url = 'https://github.com/bloomberg/collectdwin/releases/download/v0.5.19/CollectdWin-x64-0.5.19.0.msi'
$url64 = 'https://github.com/bloomberg/collectdwin/releases/download/v0.5.19/CollectdWin-x64-0.5.19.0.msi'
$packageArgs = @{
packageNa... | kkzinger/chocolatey-packages-new | manual/collectdwin/tools/chocolateyinstall.ps1 | PowerShell | apache-2.0 | 830 |
<#
.SYNOPSIS
Import the Ugc Module into CMS
.DESCRIPTION
Import the Ugc Module into CMS
.EXAMPLE
& .\cms-import.ps1 -cmsUrl "http://localhost:81/"
.INPUTS
importType, cmsUrl, masterPublication, sitePublication, rootStructureGroup
.NOTES
Importing into existing publication by means of mapping a target p... | sdl/dxa-modules | installation/Ugc/scripts/cms-import.ps1 | PowerShell | apache-2.0 | 4,223 |
function Get-DbaProcess {
<#
.SYNOPSIS
This command displays SQL Server processes.
.DESCRIPTION
This command displays processes associated with a spid, login, host, program or database.
Thanks to Michael J Swart at https://sqlperformance.com/2017/07/sql-performance/find-database-co... | wsmelton/dbatools | functions/Get-DbaProcess.ps1 | PowerShell | mit | 10,124 |
Param (
[string]
$BuildOutput = (property BuildOutput 'BuildOutput')
)
# Removes the BuildOutput\modules (errors if Pester is loaded)
task CleanAll Clean,CleanModule
# Synopsis: Deleting the content of the Build Output folder, except ./modules
task Clean {
if (![io.path]::IsPathRooted($BuildOutput)) {
... | gaelcolas/SampleModule | .build/BuildHelpers/Clean.BuildHelpers.build.ps1 | PowerShell | mit | 1,005 |
# (C) 2015 Patrick Lambert - http://dendory.net
#
# This script connects to a SQL Server database, lists all tables, and saves the data to a series of CSV files
#
param([Parameter(Mandatory=$true)][string]$dbserver, [Parameter(Mandatory=$true)][string]$dbname, [Parameter(Mandatory=$true)][string]$userid, [Paramete... | dendory/sql2csv | sql2csv.ps1 | PowerShell | mit | 1,246 |
[CmdletBinding()]
param()
# Arrange.
. $PSScriptRoot\..\lib\Initialize-Test.ps1
$env:SECUREFILE_TICKET_10 = 'rsaticket10'
Invoke-VstsTaskScript -ScriptBlock {
# Act.
$actual = Get-VstsSecureFileTicket -Id '10'
# Assert.
Assert-IsNotNullOrEmpty $actual
Assert-AreEqual 'rsaticket10' $actual
Asse... | Microsoft/vso-task-lib | powershell/Tests/L0/Get-SecureFileTicket.ps1 | PowerShell | mit | 364 |
function New-ParameterSet {
param([scriptblock]$Params)
$runtimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary
$parameters = . $Params
foreach ($parameter in $parameters) {
$runtimeParameterDictionary.Add($parameter.Name, $parameter)
}
$r... | cezarypiatek/MaintainableSelenium | Src/Tools/SeleniumDriverInstaller.psm1 | PowerShell | mit | 23,628 |
$packageName = 'appcrashview'
$url = 'http://www.nirsoft.net/utils/appcrashview.zip'
$checksum = 'a6fc8d937aa028591dfb4d2673107876fa0c084d'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
Install-ChocolateyZipPackage... | dtgm/chocolatey-packages | automatic/_output/appcrashview/1.25/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 674 |
<#
/******************************************************************************
* VERITAS: Copyright (c) 2018 Veritas Technologies LLC.
* This software is licensed as described in the file LICENSE which is part of this repository
************************************************************************... | VeritasOS/arcus | BEArcus.WebApp/BEArcus.WebApp/Agent/AgentApp/BEMCLIScripts/Alerts.psm1 | PowerShell | apache-2.0 | 4,408 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = 'e90a7797efb3152e65536d1e246ad971abda69e5'
$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.07.15/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 925 |
try {
$packageName = 'opencodecs'
$fileType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)
$osBitness = Get-ProcessorBits
if ($osBitness -eq 64) {
$unPath = 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
} else {
$unPath = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'... | dtgm/chocolatey-packages | automatic/_output/opencodecs/0.85.17777/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 637 |
# 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
#
# Unless required by applicable law or agreed to in writi... | michael-wolfenden/CodeCampServer | scripts/Carbon/Service/Set-ServiceAcl.ps1 | PowerShell | bsd-3-clause | 2,083 |
<#
The MIT License (MIT)
Copyright (c) 2015 Objectivity Bespoke Software Specialists
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
t... | Invenis/PSCI | PSCI/Public/deploy/DSL/ServerRole.ps1 | PowerShell | mit | 8,189 |
$Title = "Removed VMs"
$Display = "Table"
$Author = "Alan Renouf"
$PluginVersion = 1.4
$PluginCategory = "vSphere"
# Start of Settings
# Set the number of days to show VMs removed for
$VMsNewRemovedAge = 5
# End of Settings
# Update settings where there is an override
$VMsNewRemovedAge = Get-vCheckSetting $Title "VM... | Sneddo/vCheck-vSphere | Plugins/60 VM/10 Removed VMs.ps1 | PowerShell | mit | 770 |
import-module au
$releases = 'https://www.ghisler.com/download.htm'
function global:au_SearchReplace {
@{
".\legal\verification.txt" = @{
"(?i)(setup:.+)\<.*\>" = "`${1}<$($Latest.URL32)>"
"(?i)(installer:.+)\<.*\>" = "`${1}<$($Latest.URL64)>"
"(?i)(chec... | jberezanski/chocolatey-coreteampackages | automatic/totalcommander/update.ps1 | PowerShell | apache-2.0 | 1,390 |
#
# Module manifest for module 'Azure'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/23/2012
#
@{
# Version number of this module.
ModuleVersion = '0.9.10'
# ID used to uniquely identify this module
GUID = 'D48CF693-4125-4D2D-8790-1514F44CE325'
# Author of this module
Author = 'Microsoft Corporation'... | devigned/azure-powershell | src/ServiceManagement/Sql/Commands.SqlDatabase/Microsoft.WindowsAzure.Commands.SqlDatabase.dll-Help.psd1 | PowerShell | apache-2.0 | 2,945 |
function New-DbaAgentAlertCategory {
<#
.SYNOPSIS
New-DbaAgentAlertCategory creates a new alert category.
.DESCRIPTION
New-DbaAgentAlertCategory makes it possible to create a Agent Alert category that can be used with Alerts.
It returns an array of the alert categories created .
... | Splaxi/dbatools | functions/New-DbaAgentAlertCategory.ps1 | PowerShell | mit | 4,133 |
Describe "BooleanParameterDCR Tests" -tags "CI" {
BeforeAll {
Function ParserTestSwitchCmdlet
{
[CmdletBinding()]
param([switch]$switchParam)
return $switchParam
}
Function ParserTestBoolCmdlet2
{
[CmdletBinding()]
... | bingbing8/PowerShell | test/powershell/enginecore/BooleanParameterDCR.Tests.ps1 | PowerShell | mit | 1,999 |
<#-------------Create Deployment Start------------------#>
Import-Module .\TestLibs\RDFELibs.psm1 -Force
$Subtests= $currentTestData.SubtestValues
$SubtestValues = $Subtests.Split(",")
$result = ""
$testResult = ""
$resultArr = @()
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConf... | iamshital/azure-linux-automation | remote-scripts/VNET-VERIFY-REMOTE-SSH-SCP-LOCAL-TO-VNET-ACCESS.ps1 | PowerShell | apache-2.0 | 7,967 |
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Persistence.psm1'
# Version number of this module.
ModuleVersion = '1.0.0.0'
# ID used to uniquely identify this module
GUID = '633d0f10-a056-41da-869d-6d2f75430195'
# Author of this module
Author = 'Matthew Graeber'
# Copyr... | yaoyi2008/PowerSploit | Persistence/Persistence.psd1 | PowerShell | bsd-3-clause | 993 |
Describe "Get-Member" -Tags "CI" {
It "Should be able to be called on string objects, ints, arrays, etc" {
$a = 1 #test numbers
$b = 1.3
$c = $false #test bools
$d = @(1,3) # test arrays
$e = "anoeduntodeu" #test strings
$f = 'asntoheusth' #test strings
Get-Member -InputObject $a | Should Not BeNullOrEmpty
... | KarolKaczmarek/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Member.Tests.ps1 | PowerShell | mit | 9,251 |
<#
My Function
#>
function Get-Function {
} | lerwine/PowerShell-Modules | src/PSDB/Erwine.Leonard.T.PSDB.psm1 | PowerShell | apache-2.0 | 45 |
################################################################
# Author: Andreas Sobczyk, CloudMechanic.net
#
# Get Empty classes from Management Packs
################################################################
## Get all management packs starting with Contoso.
$MPs = Get-SCOMManagementPack -name Contoso*... | AndreasSobczyk/CloudMechanic.net | OpsMgr/GetEmptyClasses.ps1 | PowerShell | mit | 807 |
$version = 'ghc-8.6.0.20180627'
$packageName = 'ghc'
$url = 'https://downloads.haskell.org/~ghc/8.6.1-alpha1/ghc-8.6.0.20180627-i386-unknown-mingw32.tar.xz'
$url64 = 'https://downloads.haskell.org/~ghc/8.6.1-alpha1/ghc-8.6.0.20180627-x86_64-unknown-mingw32.tar.xz'
$binRoot = $(Split-Pat... | Mistuke/GhcChoco | 8.6.1-alpha1/ghc/tools/chocolateyInstall.ps1 | PowerShell | mit | 1,410 |
Import-Module "$PSScriptRoot\modules\msbuild\Invoke-MsBuild.psm1"
$nuget = "$PSScriptRoot\nuget\nuget.exe"
properties {
$solutionDir = Resolve-Path "$PSScriptRoot\.."
}
task default -depends Package
task Package -depends Compile, Clean {
#& $nuget pack
}
task Compile -depends Version, Clean {
Write-Host "Ver... | Lavinski/Enexure.Fire.Data | build/Build.ps1 | PowerShell | mit | 1,591 |
Write-Host "Uninstall Chef..."
if(Test-Path "c:\windows\temp\chef.msi") {
Start-Process MSIEXEC.exe '/uninstall c:\windows\temp\chef.msi /quiet' -Wait
}
Write-Host "Cleaning Temp Files"
try {
Takeown /d Y /R /f "C:\Windows\Temp\*"
Icacls "C:\Windows\Temp\*" /GRANT:r administrators:F /T /c /q 2>&1
Remove-Item ... | 1digicoder/vm-builder | scripts/cleanup.ps1 | PowerShell | mit | 1,030 |
$packageName = 'firefox-nightly'
$softwareVersion = '58.0.1.2017101313-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.2017101313/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 817 |
function Get-CIisAppPool
{
<#
.SYNOPSIS
Gets a `Microsoft.Web.Administration.ApplicationPool` object for an application pool.
.DESCRIPTION
The `Get-CIisAppPool` function returns an IIS application pools as a `Microsoft.Web.Administration.ApplicationPool` object. Use the `Name` paramete... | pshdo/Carbon | Carbon/Functions/Get-IisAppPool.ps1 | PowerShell | apache-2.0 | 2,045 |
<#
Copyright 2014 ASOS.com Limited
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... | POSHChef/POSHChef | plugins/knife/node_create.ps1 | PowerShell | apache-2.0 | 2,305 |
param([String]$target="release", [String]$crosswalk="true") #Must be the first statement in your script
Function LogMessage
{
param( [string]$message)
$now = Get-Date -Format "dd/MM/yyyy hh:mm:ss"
Write-Host $now --- $message
}
# Take start time
if ($crosswalk -eq "true") {
LogMessage "Building $target with Cro... | efishman15/topteamer2 | build/build.ps1 | PowerShell | apache-2.0 | 4,450 |
<#
.SYNOPSIS
Deploys the DXA Media Manager Module in a DXA .NET Web Application
.EXAMPLE
.\web-install.ps1 -distDestination "c:\inetpub\wwwroot\mysite"
#>
[CmdletBinding( SupportsShouldProcess=$true, PositionalBinding=$false)]
Param(
#The file system path of the root folder of your DXA Web Application
[... | sdl/dxa-modules | installation/MediaManager/scripts/web-install.ps1 | PowerShell | apache-2.0 | 977 |
Push-Location $PSScriptRoot
[Environment]::CurrentDirectory = $PWD
$apiKey = $args[0]
$nugetPath = ".\packages\NuGet.exe"
foreach ($file in [System.IO.Directory]::EnumerateFiles(".\nuget", "*.nupkg")) {
try {
Write-Host "Pushing package $file to MyGet..."
$arguments = "push $file $apiKey -Source ... | nguerrera/corefxlab | package.ps1 | PowerShell | mit | 673 |
$ErrorActionPreference = 'Stop'
$packageArgs = @{
packageName = 'supertuxkart'
fileType = 'exe'
url = 'https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart/0.9.2/supertuxkart-0.9.2.exe/download'
checksum = 'd55e9af26d1adafc3432527925c54aa0e6... | octomike/chocolatey-coreteampackages | automatic/supertuxkart/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 536 |
# ----------------------------------------------------------------------------------
#
# 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/Resources/Commands.Resources.Test/ScenarioTests/RoleAssignmentTests.ps1 | PowerShell | apache-2.0 | 11,630 |
#This is a test
$var1 = "execution"
$var2 = "engine"
Write-Host "Hey"
| YOTOV-LIMITED/poshtools | PowerShellTools.Test/TestFile1.ps1 | PowerShell | apache-2.0 | 81 |
[CmdletBinding()]
param()
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
. $PSScriptRoot\MockVariable.ps1
#path to Utility.ps1 for SqlAzureDacpacDeployment task
. "$PSScriptRoot\..\Utility.ps1"
Register-Mock Add-AzureSqlDatabaseServerFirewallRule { throw "IPAddress mentioned is not a valid IPv4 address." } -... | dylan-smith/vso-agent-tasks | Tasks/SqlAzureDacpacDeploymentV1/Tests/L0UtilitySPNCreate.ps1 | PowerShell | mit | 1,887 |
ipmo xDSCResourceDesigner
$resProperties = @{
Name = New-xDscResourceProperty -Description 'Name of the PS Remoting Endpoint' `
-Name Name -Type String -Attribute Key
RunAsCred = New-xDscResourceProperty -Description 'Credential for Running under differ... | phongdly/puppetlabs-dsc | lib/puppet_x/dsc_resources/xPSDesiredStateConfiguration/ResourceDesignerScripts/New-PSSessionConfigurationResource.ps1 | PowerShell | apache-2.0 | 1,598 |
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'nuget.psm1'
# Version number of this module.
ModuleVersion = '2.0.0.0'
# ID used to uniquely identify this module
GUID = '76e6f9c4-7045-44c0-a557-17fab0835c12'
# Author of this module
Author = 'NuGet Team'
# Co... | anurse/NuGet | src/VsConsole/PowerShellHost/Scripts/NuGet.psd1 | PowerShell | apache-2.0 | 2,590 |
#################################################################################################################################
# Name : Configure-WinRM.ps1 #
# ... | asheniam/azure-quickstart-templates | 201-vm-winrm-windows/ConfigureWinRM.ps1 | PowerShell | mit | 4,990 |
# Let us see a failed configuration where there are credentials involved
Configuration UserDemo
{
param (
[pscredential] $Credential
)
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node S12R2-01
{
User UserDemo
{
UserName = $Credential.UserName
... | bgelens/Presentations | 052017_PSConfEU_DSCWorkshop/DEMOScripts/10-PlainTextCreds.ps1 | PowerShell | mit | 2,721 |
param($installPath, $toolsPath, $package, $project)
$analyzerPath = join-path $toolsPath "analyzers"
$analyzerFilePath = join-path $analyzerPath "NdapiAnalyzer.dll"
$project.Object.AnalyzerReferences.Remove("$analyzerFilePath") | felipebz/ndapi-analyzers | NdapiAnalyzers/NdapiAnalyzers/tools/uninstall.ps1 | PowerShell | mit | 232 |
<#
.Synopsis
Starts Procdump on a target machine.
.Description
Invokes proc dump on a target machine and creates dumps to a target location. Will create
dumps of all instances of the passed process names.
Uses PSAuthentication CredSSP to be able to write the dumps out to a network share.
... | randorfer/RunbookExample | Runbooks/RemoteProcDump/Invoke-RemoteProcDump.ps1 | PowerShell | mit | 5,303 |
<#
Produces this:
The workflow 'Test-ReservedWordAssignment' could not be started: The following errors were encountered while processing the workflow tree:
'DynamicActivity': The private implementation of activity '1: DynamicActivity' has the following validation error: Compiler error(s) encountered processing... | randorfer/RunbookExample | ErrorReproductionScripts/Test-ReservedWordAssignment.ps1 | PowerShell | mit | 2,296 |
data localizedData {
# Localized messages; culture="en-US"
ConvertFrom-StringData @'
ResourceIncorrectPropertyState = Resource property '{0}' is NOT in the desired state. Expected '{1}', actual '{2}'.
ResourceInDesiredState = Resource '{0}' is in the desired state.
Resourc... | VirtualEngine/RESONEAutomation | DSCResources/VE_ROAManagementPortal/VE_ROAManagementPortal.psm1 | PowerShell | mit | 6,828 |
## =====================================================================
## Title : Remove-IADObject
## Description : Delete the specified object(s) in Active Directory.
## Author : Idera
## Date : 8/11/2009
## Input : No Input
##
## Output : Nothing
## Usage :
##... | borkit/scriptdump | PowerShell/Working/IderaPowerShellScripts/Idera_ADPowerShellScripts/Remove-IADObject.ps1 | PowerShell | mit | 1,974 |
properties {
$base_directory = Resolve-Path ..
$publish_directory = "$base_directory\publish-net35"
$build_directory = "$base_directory\build"
$src_directory = "$base_directory\src"
$output_directory = "$base_directory\output"
$sln_file = "$src_directory\ESSSM.sln"
$target_config = "Release"
$framework_ve... | stanshillis/ESSSM | build/default.ps1 | PowerShell | mit | 2,158 |
function About {
<#
.SYNOPSIS
Display details about PoshBot.
.EXAMPLE
!about
#>
[PoshBot.BotCommand(
Permissions = 'view'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot
)
$path = "$PSScriptRoot/../../../PoshBot.psd1"
$manifes... | poshbotio/PoshBot | PoshBot/Plugins/Builtin/Public/About.ps1 | PowerShell | mit | 540 |
Invoke-DscResource -Name cRDSessionDeployment -Method Test -Property @{
SessionHost = 'RDS-02'
WebAccess = 'RDS-02'
Credential = Import-Clixml -Path (Join-Path -Path $PSScriptRoot -ChildPath 'administrator@DEMO.clixml')
} | nicholasdille/DSCTooling | Test_InvokeDscResource.ps1 | PowerShell | mit | 243 |
# **********TFS Rest Api will only return 256 records at a time**********
$rootTfsUri = "http://tfs:8080/tfs/Collection"
$allProjectsUri = "$rootTfsUri/_apis/projects?api-version=3.1&`$top=256"
$projectStats = @{}
function Get-MaxChangeset($Project, $LastChngset)
{
$projectUri = "$rootTfsUri/$($Project.name... | sameer-kumar/adhoc-posh | GetProjectsHistory.ps1 | PowerShell | mit | 2,197 |
Add-VisualStudioWorkload `
-PackageName 'visualstudio2019-workload-netweb' `
-Workload 'NetWeb' `
-VisualStudioYear '2019' `
-Preview $false `
-ApplicableProducts @('Community', 'Professional', 'Enterprise') `
-IncludeRecommendedComponentsByDefault
| jberezanski/ChocolateyPackages | visualstudio2019-workload-netweb/tools/ChocolateyInstall.ps1 | PowerShell | mit | 276 |
#Requires -Version 3
function Get-RubrikNotificationSetting
{
<#
.SYNOPSIS
Connects to Rubrik and retrieves the Notification settings.
.DESCRIPTION
The Get-RubrikNotificationSetting cmdlet will retrieve the Notification settings configured within a Rubrik Cluster
... | rubrikinc/PowerShell-Module | Rubrik/Public/Get-RubrikNotificationSetting.ps1 | PowerShell | mit | 2,652 |
function Export-DbaScript {
<#
.SYNOPSIS
Exports scripts from SQL Management Objects (SMO)
.DESCRIPTION
Exports scripts from SQL Management Objects
.PARAMETER InputObject
A SQL Management Object such as the one returned from Get-DbaLogin
.PARAMETER Path
Specifies t... | kozloski/dbatools | functions/Export-DbaScript.ps1 | PowerShell | mit | 16,519 |
function Get-PSWSUSUpdateSource {
<#
.SYNOPSIS
Gets configuration server from which to synchronize updates.
.EXAMPLE
Get-PSWSUSUpdateSource
.OUTPUTS
Microsoft.UpdateServices.Internal.BaseApi.UpdateServerConfiguration
.NOTES
Name: Get-PSWSUSUpdateSource
Author: Dubinsky Evgeny
DateCreated:... | proxb/PoshWSUS | Scripts/Get-PSWSUSUpdateSource.ps1 | PowerShell | mit | 1,146 |
function Replace-Content
{
param([Parameter(Position = 0)]$Path,[Parameter(Position=1,ValueFromPipeline=$true)][byte[]]$Item)
end{
[System.IO.File]::WriteAllBytes($Path,$Item)
}
}
function ConvertFrom-PDF
{
param([Parameter(Position = 0, Mandatory =$true)]$Path)
$psm1Path = Split-Path $PS... | xunilrj/sandbox | sources/Powershell/Modules/File/File.psm1 | PowerShell | apache-2.0 | 2,958 |
$packageName = 'dolphin'
$url = 'https://dl.dolphin-emu.org/builds/dolphin-master-5.0-6962-x64.7z'
$checksum = '{checksum}'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Install-ChocolateyZipPackage... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.6962/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 737 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-1299-x64.7z'
$checksum = 'f1523a223bb5a73a7d262f17f9aa6fd0721b1c22590e099e6edcee96efe53825'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.1299/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 790 |
##
## Screensaver management functions
##
function Enable-Screensaver {
<#
.Synopsis
Enable the screensaver
.Description
Use caffeine to enable the screensaver, if it has been installed
#>
which caffeine 2>&1 | out-null
if ($LastExitCode -eq 0) {
$caffeine = Get-Process caffeine -ErrorAction SilentlyContinue
i... | staceybellerose/PowerShellScripts | MyModules/ManageScreensaver/ManageScreensaver.psm1 | PowerShell | apache-2.0 | 983 |
$ErrorActionPreference = 'Stop'
$fileType = ''
$toolsDir = Split-Path $MyInvocation.MyCommand.Definition
#$embedded_path = gi "$toolsDir\*.$fileType"
#$embedded_path = if ((Get-ProcessorBits 64) -and $env:chocolateyForceX86 -ne 'true') {
#Write-Host "Installing 64 bit version"; gi "$toolsDir\*_x64.e... | kkzinger/chocolatey-packages-new | automatic/_template/tools/chocolateyInstallEmbededExe.ps1 | PowerShell | apache-2.0 | 989 |
$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 = '3d142be57d15dcaaf1f78a6915f384e8b2797046e4086c3939fc00319741d81e'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/59.0.1.2017112500/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
$errorActionPreference = 'Stop'
Set-StrictMode -Version 'Latest'
Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) `
-ChildPath 'CommonResourceHelper.psm1')
# Localized messages for verbose and error statements in this resource
$script:localizedData = ... | puppetlabs/puppetlabs-dsc | lib/puppet_x/dsc_resources/xPSDesiredStateConfiguration/DSCResources/MSFT_xWindowsProcess/MSFT_xWindowsProcess.psm1 | PowerShell | apache-2.0 | 48,913 |
function Invoke-DbaDiagnosticQueryScriptParser {
[CmdletBinding(DefaultParameterSetName = "Default")]
Param(
[parameter(Mandatory)]
[ValidateScript( {Test-Path $_})]
[System.IO.FileInfo]$filename,
[Switch]$ExcludeQueryTextColumn,
[Switch]$ExcludePlanColumn,
[Swit... | dsolodow/dbatools | internal/functions/Invoke-DbaDiagnosticQueryScriptParser.ps1 | PowerShell | mit | 2,773 |
<#
.SYNOPSIS
Generates a JSON object representing an Azure Pipelines Job Matrix.
See https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#parallelexec
.EXAMPLE
.\eng\scripts\Create-JobMatrix $context
#>
[CmdletBinding()]
param (
[Parameter(... | Azure/azure-sdk-for-python | eng/scripts/job-matrix/Create-JobMatrix.ps1 | PowerShell | mit | 1,202 |
# 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 ... | u2takey/kubernetes | cluster/gce/windows/k8s-node-setup.psm1 | PowerShell | apache-2.0 | 67,445 |
Describe "apply config from file" {
hab pkg install core/redis
Load-SupervisorService "core/redis" -Remote "alpha.habitat.dev"
Load-SupervisorService "core/redis" -Remote "beta.habitat.dev"
$new_port=2112
Set-Content redis_config.toml -Value "port = $new_port`nprotected-mode = `"no`""
hab confi... | habitat-sh/habitat | test/end-to-end/multi-supervisor/testcases/apply_config_from_file/run_test.ps1 | PowerShell | apache-2.0 | 1,007 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "Get-Verb" -Tags "CI" {
It "Should get a list of Verbs" {
Get-Verb | Should -Not -BeNullOrEmpty
}
It "Should get a specific verb" {
@(Get-Verb -Verb Add).Count | Should -Be 1
@(Ge... | Cowmonaut/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Verb.Tests.ps1 | PowerShell | mit | 2,477 |
# ----------------------------------------------------------------------------------
#
# 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... | jianghaolu/azure-powershell | src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ServerUpgradeTests.ps1 | PowerShell | apache-2.0 | 6,744 |
#
# Copyright="� Microsoft Corporation. All rights reserved."
#
configuration PrepareSharePointServer
{
param
(
[Parameter(Mandatory)]
[String]$DNSServer,
[Int]$RetryCount=30,
[Int]$RetryIntervalSec=60
)
Import-DscResource -ModuleName xComputerManagement, xDisk,cDisk,x... | spcrux/azure-quickstart-templates | sharepoint-three-vm/dsc/PrepareSharePointServer/PrepareSharePointServer.ps1 | PowerShell | mit | 1,343 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.