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 |
|---|---|---|---|---|---|
$ErrorActionPreference = 'Stop';
$packageName = '{{PackageName}}'
$softwareName = 'Software Ideas Viewer*'
$installerType= 'EXE'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /NOMSG=1' # Inno Setup
$validExitCodes = @(0)
$uninstalled = $false
[array]$key = Get-UninstallRegistryKey -SoftwareName $sof... | abejenaru/chocolatey-packages | automatic/software-ideas-viewer/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 1,098 |
$packageName = '{{PackageName}}'
$installerType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$chocTempDir = Join-Path $Env:Temp "chocolatey"
$tempDir = Join-Path $chocTempDir "$packageName"
if (![System.IO.Directory]::Exists($tempDir)) {[S... | maharishi/chocolatey-packages | automatic/pstpassword.install/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,050 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-4.0-9102-x64.7z'
$checksum = 'c50f04c426597d6b73cd4702e656e821e07f0df1'
$checksumType = 'sha1'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
In... | dtgm/chocolatey-packages | automatic/_output/dolphin/4.0.9102/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 761 |
Param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
# Include the following modules
$Dir = Split-Path $script:MyInvocation.MyCommand.Path
. ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1"))
$vm = Hyper-V\Get-VM -Id $VmId -ErrorAction "Stop"
$networks = Hyper-V\Get-VMNetworkAdapter -VM $vm
foreach... | PatrickLang/vagrant | plugins/providers/hyperv/scripts/get_network_config.ps1 | PowerShell | mit | 1,205 |
$packageName = 'kicad'
$installerType = 'exe'
$silentArgs = '/S'
$url = 'http://www2.futureware.at/~nickoe/kicad-product-r6097.b384c94-i686.exe'
$checksum = '23ded3b8ee5033098a203215184af8a88a946020'
$checksumType = 'sha1'
$url64 = 'http://www2.futureware.at/~nickoe/kicad-product-r6097.b384c94-x86_64.exe'
$checksum64 =... | dtgm/chocolatey-packages | automatic/_output/kicad/2015.08.17.6097/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 946 |
@{
GUID="eb74e8da-9ae2-482a-a648-e96550fb8733"
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="© Microsoft Corporation. All rights reserved."
ModuleVersion="1.0.1.0"
FunctionsToExport = @('Compress-Archive', 'Expand-Archive')
DotNetFrameworkVersion = 4.5
CmdletsToExport = @()
AliasesToExp... | GoogleCloudPlatform/google-cloud-powershell | third_party/ArchiveCmdlets/Microsoft.PowerShell.Archive.psd1 | PowerShell | apache-2.0 | 448 |
$ErrorActionPreference = 'Stop'
$packageArgs = @{
packageName = 'unchecky'
fileType = 'exe'
softwareName = 'unchecky'
checksum = '7343662791ebe9bdf1bcfd833d56a35d6018e050fdeb3f70807db1c8f13d2ecd'
checksumType = 'sha256'
url = 'https://unchecky.com/files/unchecky_setup.exe'
... | octomike/chocolatey-coreteampackages | automatic/unchecky/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 531 |
function Stop-DbaAgentJob {
<#
.SYNOPSIS
Stops a running SQL Server Agent Job.
.DESCRIPTION
This command stops a job then returns connected SMO object for SQL Agent Job information for each instance(s) of SQL Server.
.PARAMETER SqlInstance
The target SQL Server instance or inst... | alevyinroc/dbatools | functions/Stop-DbaAgentJob.ps1 | PowerShell | mit | 5,021 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Parame... | dsolodow/dbatools | tests/Get-DbaFeature.Tests.ps1 | PowerShell | mit | 1,094 |
<#
.SYNOPSIS
Autonance DSL task to wait for a Windows computer.
.DESCRIPTION
The WindowsComputerWait task is part of the Autonance domain-specific
language (DSL). The task will wait until the specified Windows computer
is reachable using WinRM. A user account can be specified wi... | claudiospizzi/Autonance | Autonance/Functions/Task/WindowsComputerWait.ps1 | PowerShell | mit | 3,266 |
Function New-DockerFile {
[CmdletBinding()]
<#
.SYNOPSIS
This function will help you create a new Dockerfile
.PARAMETER Path
This parameter indicates the location where yo want your dockerile to be generated
.PARAMETER From
Which docker image should be used at first to build your own one.
.PARAMETER Maintener
... | fabiendibot/Pestener | 0.0.1.0/Functions/New-DockerFile/New-DockerFile.ps1 | PowerShell | mit | 2,465 |
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][str... | ericstj/corefxlab | eng/common/post-build/symbols-validation.ps1 | PowerShell | mit | 7,989 |
properties {
$zipFileName = "Json60r8.zip"
$majorVersion = "6.0"
$majorWithReleaseVersion = "6.0.8"
$version = GetVersion $majorWithReleaseVersion
$signAssemblies = $false
$signKeyPath = "C:\Development\Releases\newtonsoft.snk"
$buildDocumentation = $false
$buildNuGet = $true
$treatWarningsAsErrors ... | jstammers/EDMSuite | packages/Json60r8/Source/Build/build.ps1 | PowerShell | mit | 11,049 |
function Expand-DbaDbLogFile {
<#
.SYNOPSIS
This command will help you to automatically grow your transaction log file in a responsible way (preventing the generation of too many VLFs).
.DESCRIPTION
As you may already know, having a transaction log file with too many Virtual Log Files (VLF... | wsmelton/dbatools | functions/Expand-DbaDbLogFile.ps1 | PowerShell | mit | 30,465 |
function Get-ExternalNode {
<#
.SYNOPSIS
Retrieves one or more entities from the ExternalNode entity set.
.DESCRIPTION
Retrieves one or more entities from the ExternalNode entity set.
You can retrieve one ore more entities from the entity set by specifying
Id, Name or other properties.
.INPUTS
The Cmdlet can eith... | dfensgmbh/biz.dfch.PS.Appclusive.Client | src/Get-ExternalNode.ps1 | PowerShell | apache-2.0 | 20,075 |
$moduleName = 'POSHOrigin_ActiveDirectoryDNS'
$modulePath = Join-Path -Path (Split-Path -Parent $MyInvocation.MyCommand.Path | Split-Path -Parent) -ChildPath $moduleName
$manifestPath = Join-Path -Path $modulePath -Child "$moduleName.psd1"
$manifestExists = (Test-Path -Path $manifestPath)
Describe 'Module manifest' {
... | devblackops/POSHOrigin_ActiveDirectoryDNS | Tests/Manifest.Tests.ps1 | PowerShell | apache-2.0 | 1,511 |
<#
.SYNOPSIS
Test the au updating of changed packages, as well as the install and uninstall of those packages.
.DESCRIPTION
This script uses git to get all the packages that have changed since it diverged from the
master branch and runs those packages through au updating (only if they are automatic packages),
... | octomike/chocolatey-coreteampackages | scripts/Test-RepoPackage.ps1 | PowerShell | apache-2.0 | 21,716 |
function Out-UnmanagedDll
{
[CmdletBinding()] Param (
[Parameter(Mandatory = $True)]
[String]
$FilePath
)
$Path = Resolve-Path $FilePath
if (! [IO.File]::Exists($Path))
{
Throw "$Path does not exist."
}
$FileBytes = [System.IO.File]::ReadAllB... | FuzzySecurity/PowerShell-Suite | Bypass-UAC/Yamabiko/Out-UnmanagedDll.ps1 | PowerShell | bsd-3-clause | 1,686 |
function Check-VTFile {
<#
.SYNOPSIS
Submit SHA256 hash of a file to Virus Total and retrieve the scan report if the hash is known.
.PARAMETER Path
Path to file.
.DESCRIPTION
Author: Ruben Boonen (@FuzzySec)
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
... | FuzzySecurity/PowerShell-Suite | Check-VTFile.ps1 | PowerShell | bsd-3-clause | 3,149 |
$commandname = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$commandname Integration Tests" -Tag "IntegrationTests" {
BeforeAll {
Get-DbaProcess -SqlInstance $script:instance2 -Program 'dba... | SirCaptainMitch/dbatools | tests/Test-DbaLinkedServerConnection.Tests.ps1 | PowerShell | mit | 1,257 |
try {
$ErrorActionPreference = "Stop";
#cd $PSScriptRoot
#Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile nuget.exe
#.\nuget.exe install MySQL.Data -Version 6.10.6 -outputdirectory $PSScriptRoot
#$mySQLDataDLL = "$PSScriptRoot\MySql.Data.6.10.6\lib\net452\MySQL.Data.dll... | DariuszPorowski/VSTS-MySQL-Toolkit-Win | Tasks/RunMySqlScript/ps_modules/MySql/MySql.psm1 | PowerShell | mit | 3,465 |
<#
.SYNOPSIS
Returns the library item or path to the library where scripts for a particular integration point should be located for a specific module.
.DESCRIPTION
The Get-SpeModuleFeatureRoot command returns library item or path to the library where scripts for a particular integration point s... | ostat/Console | Documentation/Get-SpeModuleFeatureRoot.ps1 | PowerShell | mit | 2,119 |
<#
.Synopsis
DSC Configuration Template for DSC Resource Integration tests.
.DESCRIPTION
To Use:
1. Copy to \Tests\Integration\ folder and rename <ResourceName>.config.ps1 (e.g. MSFT_xFirewall.config.ps1)
2. Customize TODO sections.
.NOTES
#>
# TODO: Modify ResourceName (e.g. MSFT_xFirewall_config)
#... | aultt/xSQLServer | Tests/Integration/integration_config_template.ps1 | PowerShell | mit | 776 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "InvokeOnRunspace method argument error handling" -tags "Feature" {
BeforeAll {
$command = [System.Management.Automation.PSCommand]::new()
$localRunspace = $Host.Runspace
}
It "Null argument exception should ... | TravisEz13/PowerShell | test/powershell/Host/HostUtilities.Tests.ps1 | PowerShell | mit | 2,625 |
function Get-SecretOptionsPath {
$boxstarterScriptPath = join-Path $Boxstarter.LocalRepo "BoxstarterScripts"
if(!(Test-Path $boxstarterScriptPath)) {
mkdir $boxstarterScriptPath | Out-Null
}
return Join-Path $boxstarterScriptPath $env:ComputerName-$env:username-Options.xml
} | fhchina/boxstarter | Boxstarter.TestRunner/Get-SecretOptionsPath.ps1 | PowerShell | apache-2.0 | 299 |
param($installPath, $toolsPath, $package, $project)
##
## Inserts a new or updates an existing dependentAssembly element for a specified assembly
##
Function AddOrUpdateBindingRedirect([System.IO.FileInfo] $file, [System.Xml.XmlElement[]] $assemblyConfigs, [System.Xml.XmlDocument] $config)
{
$name = [System.IO.Pat... | anjumrizwi/episerver | cms/packages/EPiServer.Logging.Log4Net.2.0.0/tools/Install.ps1 | PowerShell | mit | 13,745 |
Smc.exe -disable -ntp | scrasmussen/ProsaicOeuvre | src/windowsBin/ssp.ps1 | PowerShell | mit | 21 |
Function Get-PVSafeActivity {
<#
.SYNOPSIS
Produces a list of activities of all the Safe Owners of the specified
Safe(s).
.DESCRIPTION
Exposes the PACLI Function: "INSPECTSAFE"
.PARAMETER safePattern
The full name or part of the name of the Safe(s) to include in the report.
Alternatively, a wildcard can be... | pspete/PoShPACLI | PoShPACLI/Functions/Safes/Get-PVSafeActivity.ps1 | PowerShell | mit | 6,129 |
param([string]$ProjectRoot = $PsScriptRoot)
$zipsCache = @{};
$exitCode = 0;
function Cleanup()
{
try
{
foreach ($extractedZip in $zipsCache.Values)
{
Remove-Item -Recurse -Force $extractedZip;
}
}
catch [System.Exception]
{
Write-Host $_;
}
}
functi... | michaelmarriott/LabyrinthRipper.Mobile | www/FetchRequirements.ps1 | PowerShell | mit | 2,999 |
#
# Module manifest for module 'ProfileCaddie'
#
# Generated by: Michael Willis
#
# Generated on: 2/10/2017
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'ProfileCaddie.psm1'
# Version number of this module.
ModuleVersion = '1.0.0'
# Supported PSEditions
# CompatiblePSEditio... | Xainey/ProfileCaddie | ProfileCaddie/ProfileCaddie.psd1 | PowerShell | mit | 4,039 |
function Invoke-DbaDbClone {
<#
.SYNOPSIS
Clones a database schema and statistics
.DESCRIPTION
Clones a database schema and statistics.
This can be useful for testing query performance without requiring all the space needed for the data in the database.
Read more:
... | dsolodow/dbatools | functions/Invoke-DbaDbClone.ps1 | PowerShell | mit | 10,496 |
Remove-Module nvm -Force -ErrorAction SilentlyContinue
Import-Module ./nvm.psd1
Describe "Get-NodeVersions" {
InModuleScope nvm {
Context "Local versions" {
It "Gets known versions" {
$tmpDir = [system.io.path]::GetTempPath()
Mock Get-NodeInstallLocation { Join-P... | aaronpowell/ps-nvmw | nvm.tests.ps1 | PowerShell | mit | 22,844 |
# General Utility Functions
function Invoke-NullCoalescing {
$result = $null
foreach($arg in $args) {
if ($arg -is [ScriptBlock]) {
$result = & $arg
} else {
$result = $arg
}
if ($result) { break }
}
$result
}
Set-Alias ?? Invoke-N... | michaelklotz/posh-git | Utils.ps1 | PowerShell | mit | 903 |
..\..\packages\FluentMigrator.1.6.1\tools\Migrate.exe --db=mysql --target=..\bin\will-blog.dll --configPath=..\Web.config -c=MainDb -t=rollback;
pause; | willbush/will-blog | will-blog/Migrations/Invoke-DevDbRollback.ps1 | PowerShell | mit | 151 |
function Disconnect-PSWSUSServer {
<#
.SYNOPSIS
Disconnects session against WSUS server.
.DESCRIPTION
Disconnects session against WSUS server.
.NOTES
Name: Disconnect-PSWSUSServer
Author: Boe Prox
DateCreated: 27Oct2010
.LINK
h... | proxb/PoshWSUS | Scripts/Disconnect-PSWSUSServer.ps1 | PowerShell | mit | 749 |
<#
.SYNOPSIS
Retrieves info from one or more computers.
.PARAMETER computername
The computer name(s) to retrieve the info from.
.PARAMETER logfile
The path and filename of a text file where failed computers will be logged. Defaults to c:\retries.txt.
.EXAMPLE
Get-ADComputer –filter * | Select @{label='computername';exp... | pratom/master | electrons/lib/computer/computer_get_info.ps1 | PowerShell | mit | 2,244 |
cls
Write-Host "Starting script ..."
$test = "x"+$PSScriptRoot
if ($test -eq "x") {
Write-Host "Settting location"
Set-Location "C:\git\azure-scripts"
}
. .\CommonFunctions-1.0.ps1
loginAndSetStorageAccount -Subscription "Visual Studio Premium with MSDN"
# $vms = Get-AzureRmVM -ResourceG... | henrikring/azure-scripts | StartOrStopAllVMsInResourceGroup.ps1 | PowerShell | cc0-1.0 | 476 |
$packageName = 'cyberduck.install'
$installerType = 'exe'
$silentArgs = '/S'
$url = 'https://update.cyberduck.io/windows/Cyberduck-Installer-6.2.6.26405.exe'
$checksum = '4c67de32d5a3af639c9b5ec1a249ab5c8603cbad596b8ca390df0988fcf9e869'
$checksumType = 'sha256'
$validExitCodes = @(0)
Install-ChocolateyPackage -Package... | dtgm/chocolatey-packages | automatic/_output/cyberduck.install/6.2.6.26405/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 656 |
@{
AllNodes = @(
@{
NodeName = 'localhost'
PSDscAllowPlainTextPassword = $true
PSDscAllowDomainUser = $true
}
)
}
| saltstack/salt | tests/integration/files/file/base/HelloWorld.psd1 | PowerShell | apache-2.0 | 174 |
@{
Description = 'Provides an unattended installation environment supporting automatic reboots, suspension of update services and logging'
# Script module or binary module file associated with this manifest.
ModuleToProcess = './boxstarter.bootstrapper.psm1'
# Version number of this module.
ModuleVersion = '2.6.... | cam1985/boxstarter | Boxstarter.Bootstrapper/Boxstarter.bootstrapper.psd1 | PowerShell | apache-2.0 | 1,599 |
$packageName = 'firefox-nightly'
$softwareVersion = '53.0.1.2016123114-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/53.0.1.2016123114/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 820 |
#
# Module manifest for module 'Microsoft.Azure.Commands.DataLakeAnalytics'
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/19/2015
#
@{
# Version number of this module.
ModuleVersion = '1.0.0'
# ID used to uniquely identify this module
GUID = 'eca73aa1-a68f-4ceb-9775-70759316a5... | pomortaz/azure-powershell | src/ResourceManager/DataLakeAnalytics/AzureRM.DataLakeAnalytics.psd1 | PowerShell | apache-2.0 | 2,645 |
# Copyright 2021 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | googleprojectzero/sandbox-attacksurface-analysis-tools | NtObjectManager/Win32SecurityFunctions.ps1 | PowerShell | apache-2.0 | 6,052 |
function Add-VSCodeBuildProjectProjectSourceVersion {
<#
.SYNOPSIS
Adds an AWS::CodeBuild::Project.ProjectSourceVersion resource property to the template. A source identifier and its corresponding version.
.DESCRIPTION
Adds an AWS::CodeBuild::Project.ProjectSourceVersion resource property t... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSCodeBuildProjectProjectSourceVersion.ps1 | PowerShell | apache-2.0 | 4,499 |
# 设置快捷方式
Set-PSReadLineOption -EditMode Emacs
# 引入 posh-git
Import-Module posh-git
# 引入 oh-my-posh
Import-Module oh-my-posh
# 设置 PowerShell 主题
Set-PoshPrompt -Theme robbyrussel
# 设置 Tab 键补全
# Set-PSReadlineKeyHandler -Key Tab -Function Complete
# 设置 Ctrl+d 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key "Tab" -F... | wybosys/wybosys | Microsoft.PowerShell_profile.ps1 | PowerShell | bsd-3-clause | 1,067 |
# ----------------------------------------------------------------------------------
#
# 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... | chef-partners/azure-powershell | src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineProfileTests.ps1 | PowerShell | apache-2.0 | 19,527 |
param($installPath, $toolsPath, $package, $project)
function PopulateAppConfigWithDummyData($project)
{
Write-Host "Scanning app.config and merging in sample data."
$xml = New-Object xml
# Find the App.config file and create it if it doesn't yet exist.
$config = $project.ProjectItems | where {$_.Name -e... | DbTestMonkey/DbTestMonkey | src/DbTestMonkey.Providers.SqlServer/tools/install.ps1 | PowerShell | mit | 6,802 |
Get-ChildItem cert:\LocalMachine\My | Where-Object { $_.Subject -match "CN=::if APP_COMPANYID::APP_COMPANYID::else::OpenFL_Example::end::" } | Remove-Item
New-SelfSignedCertificate -Type Custom -Subject "CN=::if APP_COMPANYID::APP_COMPANYID::else::OpenFL_Example::end::" -KeyUsage DigitalSignature -FriendlyName OpenFLDi... | openfl/lime | templates/winrt/scripts/newcertificate.ps1 | PowerShell | mit | 917 |
$id = "gtksharp"
$kind = "MSI"
$silent = "/Q"
$url = "http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.25.msi"
Install-ChocolateyPackage $id $kind $silent $url
| dtgm/chocolatey-packages | automatic/_output/gtksharp/2.12.25/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 180 |
# run tests
# run tests
$output = (.\packages\Fixie.1.0.0.33\lib\net45\fixie.console.exe .\src\GraphQL.Tests\bin\debug\GraphQL.Tests.dll --xUnitXml .\fixie-results.xml) -join "`r`n"
$testResult = $LASTEXITCODE
if ($testResult -eq 0)
{
Write-Host $output
}
# upload results to AppVeyor
$wc = New-Object 'System.Net.W... | dNetGuru/graphql-dotnet | test.ps1 | PowerShell | mit | 521 |
Start-AutoRestCodeGeneration -ResourceProvider "azsadmin/resource-manager/update" -AutoRestVersion "latest" -SdkRootDirectory $PSScriptRoot | shahabhijeet/azure-sdk-for-net | src/AzureStack/Admin/UpdateAdmin/Update.Admin/generate.ps1 | PowerShell | mit | 139 |
#region localizeddata
if (Test-Path "${PSScriptRoot}\${PSUICulture}")
{
Import-LocalizedData `
-BindingVariable LocalizedData `
-Filename MSFT_xVMSwitch.strings.psd1 `
-BaseDirectory "${PSScriptRoot}\${PSUICulture}"
}
else
{
#fallback to en-US
Import-LocalizedData `
-BindingV... | VirtualEngine/Lab | DSCResources/xHyper-V/DSCResources/MSFT_xVMSwitch/MSFT_xVMSwitch.psm1 | PowerShell | mit | 23,759 |
# ----------------------------------------------------------------------------------
#
# 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... | rohmano/azure-powershell | src/ResourceManager/Billing/Commands.Billing.Test/ScenarioTests/InvoicesTests.ps1 | PowerShell | apache-2.0 | 3,195 |
function Invoke-TlsRestMethod {
<#
Internal utility that mimics invoke-RestMethod
but enables all tls available version
rather than the default, which on a lot
of standard installations is just TLS 1.0
#>
$currentVersionTls = [Net.ServicePointManager]::SecurityProtocol
$currentSupportabl... | alevyinroc/dbatools | internal/functions/Invoke-TlsRestMethod.ps1 | PowerShell | mit | 772 |
[CmdletBinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
. $PSScriptRoot\..\Select-VSVersion.ps1
Register-Mock Write-Warning
Register-Mock Get-VSPath { "Some resolved location" } -- -Version '14.0'
# Act.
$actual = Select-VSVersion -PreferredVersion '12.0'
# Assert.
Assert-WasCalle... | jotaylo/vsts-tasks | Tasks/VSBuildV1/Tests/Select-VSVersion.FallsForwardFrom12.ps1 | PowerShell | mit | 422 |
$logPath ='C:\TEMP\yardi_log_files\ex180309'
$combinedLogs = "$logPath\combined_files.log"
New-Item -ItemType file $combinedLogs –force
Get-Content "$logPath\ex*.log" | Add-Content $combinedLogs | jsk01/Powershell | Combine Logs Files into one file.ps1 | PowerShell | mit | 198 |
& {
$unary = [Management.Automation.Language.TokenFlags]::UnaryOperator
$info = Get-SteroidsAST
$tokenCount = $info.TokenList.Count
# we need a minimum of three tokens for this test
if ($tokenCount -ge 3)
{
for ($i=1; $i -lt $tokenCount-1; $i++)
{
$token = $info.TokenList[$i]
$... | lweniger/PowerShell | Modules/downloaded/powershellgallery/ISESteroids/Fixer/Spaces/OperatorAdjustSpace/OperatorAdjustSpace.ps1 | PowerShell | mit | 1,102 |
@{
# Use Severity when you want to limit the generated diagnostic records to a
# subset of: Error, Warning and Information.
# Uncomment the following line if you only want Errors and Warnings but
# not Information diagnostic records.
Severity = @('Error', 'Warning')
# Use IncludeRules when you ... | vScripter/windows-docker-files | vester-ws-nano/PSScriptAnalyzerSettings.psd1 | PowerShell | mit | 1,748 |
$headers=@{}
$headers.Add("content-type", "application/x-www-form-urlencoded")
$response = Invoke-RestMethod -Uri 'http://mockbin.com/har' -Method POST -Headers $headers -ContentType 'application/x-www-form-urlencoded' -Body 'foo=bar&hello=world'
| Mashape/httpsnippet | test/fixtures/output/powershell/restmethod/application-form-encoded.ps1 | PowerShell | mit | 247 |
# Copyright © 2011 - Present RealDimensions Software, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | sideeffffect/choco | src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 | PowerShell | apache-2.0 | 10,292 |
<#
.SYNOPSIS
Creates a deployment package bundle for a PowerShell script or script project that can be published separately to an
AWS Lambda Function.
.DESCRIPTION
PowerShell scripts and script projects are deployed to AWS Lambda as a .NET Core package bundle.
For standalone script files this ... | thedevopsmachine/aws-lambda-dotnet | PowerShell/Module/Public/New-AWSPowerShellLambdaPackage.ps1 | PowerShell | apache-2.0 | 8,098 |
<#
.SYNOPSIS
Remove a StatusCake Maintenance Window
.DESCRIPTION
Deletes a StatusCake Maintenance Window using the supplied ID or name. If the series switch is not provided then the next window scheduled under the ID will be removed.
The entire series of windows can be removed if the series switch is provid... | Oliver-Lii/statuscake-helpers | StatusCake-Helpers/Public/MaintenanceWindows/Remove-StatusCakeHelperMaintenanceWindow.ps1 | PowerShell | apache-2.0 | 3,260 |
<#
DESCRIPTION:
Where SAN storage is used, ensure multipathing software is installed and Dual Paths are present and functioning.
This only checks that known software is installed. A manual check must be done to ensure it is configured correctly.
REQUIRED-INPUTS:
ProductNames - List o... | My-Random-Thoughts/Server-QA-Checks | checks/drives/c-drv-06-san-storage.ps1 | PowerShell | apache-2.0 | 3,188 |
# Adapted from Microsoft's SQL Server Express sample:
# https://github.com/Microsoft/mssql-docker/blob/master/windows/mssql-server-windows-express/start.ps1
param(
[Parameter(Mandatory=$false)]
[string]$sa_password,
[Parameter(Mandatory=$false)]
[string]$data_path
)
# start the service
Write-Verbose ... | sixeyed/docker-windows-workshop | _archive/part-5/db/Initialize-Database.ps1 | PowerShell | apache-2.0 | 1,823 |
# Source: https://github.com/pypa/python-packaging-user-guide/blob/master/source/code/install.ps1
# Sample script to install Python and pip under Windows
# Authors: Olivier Grisel and Kyle Kastner
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
$BASE_URL = "https://www.python.org/f... | cmeeren/latexdiffcite | ci/appveyor-bootstrap.ps1 | PowerShell | bsd-2-clause | 3,074 |
param
(
)
$project_short_name = "QuickBooksOnline"
$project_name = "$($project_short_name)Access"
# Folder structure:
# \build - Contains all code during the build process
# \build\artifacts - Contains all files during intermidiate bulid process
# \build\output - Contains the final result of the build process
# \rel... | rachmann/qboAccess | .build.ps1 | PowerShell | bsd-3-clause | 3,844 |
function Delete-MachineGroupFromProvider
{
param([string]$machineGroupName)
Write-Verbose "[Azure Resource Manager]Deleting resource group $machineGroupName from Azure provider" -Verbose
Remove-AzureResourceGroup -ResourceGroupName $machineGroupName -Force -ErrorAction Stop -Verbose
Write-Host (Get-Loc... | robrich/vso-agent-tasks | Tasks/PerformActionOnMachineGroup/AzureHelper.ps1 | PowerShell | mit | 5,062 |
# Build the application.
cmake .. -G "Visual Studio 14 2015"
msbuild libds3.sln /p:Configuration=Release
# Copy dependencies into output directory
Copy-Item deps\install -Destination output -Recurse -force
Copy-Item src\Release\* -Destination output\bin -force
Copy-Item src\Release\ds3.lib -Destination output\lib\ds3... | DenverM80/ds3_c_sdk | win32/run_package_dot_bat_instead.ps1 | PowerShell | apache-2.0 | 808 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
# here : /branch/tests/Poshbox.Test
. "$here\..\TestCommon.ps1"
Describe "AddConsoleAppender" {
It "adds console appender to root logger on load of PoshBox" {
$appenders = @([log4net.LogManager]::GetAllRepositories()[0].Root.Appenders)
... | ghostsquad/AetherLog | tests/ConsoleAppender.Tests.ps1 | PowerShell | apache-2.0 | 397 |
param ($name)
Import-Module .\JsLibraryPackaging.psm1
New-BowerLibrary $name | abadi199/DNN-JavaScript-Libraries | NewBowerLibrary.ps1 | PowerShell | mit | 81 |
echo "New style OS tests are not backported for this branch"
| strapdata/elassandra | .ci/os.ps1 | PowerShell | apache-2.0 | 61 |
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
# Relaunch as an elevated process:
Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
exit
}
$AppPr... | HonzaKral/elasticsearch | .ci/os.ps1 | PowerShell | apache-2.0 | 1,439 |
function Get-GitHubReleaseAsset {
<#
.SYNOPSIS
This command gets the github
.DESCRIPTION
This command gets the assets of a release via the following 2 Parameter:
1. releaseid -- the release id
2. id -- the asset id
.PARAMETER Owner
the Owner of the repo to retrieve the rel... | pcgeek86/PSGitHub | Functions/Public/Releases/Get-GitHubReleaseAsset.ps1 | PowerShell | mit | 2,782 |
function Invoke-vROAction {
<#
.SYNOPSIS
Invoke a vRO Action
.DESCRIPTION
Invoke a vRO Action
.PARAMETER Id
The id of the action requesting an action by id will return additional information
.PARAMETER Name
The name of the action
.PARAMETER Category
The category that the... | jakkulabs/PowervRO | src/Functions/Public/actions-service/Invoke-vROAction.ps1 | PowerShell | mit | 2,999 |
$file = ".\.version"
$nuspecFile = ".\Source\Koshu.nuspec"
$koshuFile = ".\Source\Koshu\Koshu.psm1"
$installFile = ".\install.ps1"
$currentVersion = get-content $file
write-host "Current version: $currentVersion" -fore yellow
$version = read-host "New version"
new-item -itemtype file -value $version -path $file -forc... | kristofferahl/Koshu | bump-version.ps1 | PowerShell | mit | 1,600 |
#
# Swaggy Jenkins
# Jenkins API clients generated from Swagger / Open API specification
# Version: 1.1.2-pre.0
# Contact: blah@cliffano.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
<#
.SYNOPSIS
No summary available.
.DESCRIPTION
No description available.
.PARAMETER Nodes
No description a... | cliffano/swaggy-jenkins | clients/powershell/generated/src/PSOpenAPITools/Model/PipelineRunImpllinks.ps1 | PowerShell | mit | 4,475 |
##Set-StrictMode -version latest
#$modulesPath = (Split-Path -parent $MyInvocation.MyCommand.Path).Replace("\tests", "\modules\")
#Import-Module (Join-Path $modulesPath global_config.psm1) -Force
#
# Describe "package_structure" {
#
# It "checks to see if tools\install.ps1 exists" {
# #Write-Host $packag... | newrelic/nuget-azure-web-sites | nuget.test/tests/package_structure.Tests.ps1 | PowerShell | mit | 1,488 |
$PackageName = 'neo4j-community'
# Per-package parameters
$downloadUrl = 'http://neo4j.com/artifact.php?name=neo4j-community-3.3.0-alpha04-windows.zip'
$md5Checksum = '2a3595bd1d1c355899fdcffee7147f37'
$neozipSubdir = 'neo4j-community-3.3.0-alpha04'
# major.minor.update.build
# Build is always 14
$privateJavaVersion = ... | glennsarti/neo4j-community-chocolatey | neo4j-community-3.3.0-alpha04/tools/chocolateyInstall.ps1 | PowerShell | mit | 12,077 |
<#
.SYNOPSIS
SCCM Uninstall program for Adobe Flash Professional Creative Cloud
.DESCRIPTION
Remove the following component(s) from Window 7 x64 systems:
- Adobe Flash Professional CC
.NOTES
FileName: AdobeCC_FlashProfessional_Uninstall.ps1
Author: Jerry Senff
Update... | jrsenff/Sccm-PowerShell-Scripts | Adobe Creative Cloud - Flash Professional/AdobeCC_FlashProfessional_Uninstall.ps1 | PowerShell | mit | 2,193 |
Function Get-PackagesDirectory {
param (
[ValidateNotNullOrEmpty()]
[string]
$SolutionDirectory = $(Get-SolutionDirectory)
)
return [System.IO.Path]::Combine($SolutionDirectory, "packages")
}
| OpenMagic/BuildMagic | source/Get-PackagesDirectory.ps1 | PowerShell | mit | 228 |
ConvertFrom-StringData @'
getTeamInfo=Getting network team information for {0}.
foundTeam=Found a network team with name {0}.
teamMembersExist=Members in the network team {0} exist as per the configuration.
teamNotFound=Network team with name {0} not found.
lbAlgoDifferent=Load Balancing Al... | randorfer/RunbookExample | PowerShellModules/xNetworking/2.8.0.0/DSCResources/MSFT_xNetworkTeam/en-US/MSFT_xNetworkTeam.psd1 | PowerShell | mit | 1,587 |
function Get-SSGroupMembership {
<#
.SYNOPSIS
Get secret server group membership from database
.DESCRIPTION
Get secret server group membership from database
This command requires privileges on the Secret Server database.
Given the sensitivity of thi... | RamblingCookieMonster/SecretServer | SecretServer/Public/Get-SSGroupMembership.ps1 | PowerShell | mit | 4,751 |
$currentWorkingDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
. $currentWorkingDir\env.ps1
$currentWorkingDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$currentScriptName = $MyInvocation.MyCommand.Name
$nameWithoutExt = [IO.Path]::GetFileNameWithoutExtension($currentScriptName)
$TimeMark = ... | clovertrail/rocket | powershell/jenkins/vm_management_ARM/remove_vm.ps1 | PowerShell | apache-2.0 | 2,937 |
$packageName = 'graphicsmagick'
$installerType = 'EXE'
$silentArgs = '/SP /VERYSILENT'
$version = '1.3.20'
try {
$osBitness = Get-ProcessorBits
$file = (Get-ItemProperty -Path "hklm:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GraphicsMagick $version Q8 ($osBitness-bit)_is1").UninstallString
Uninstall-... | dtgm/chocolatey-packages | automatic/_output/graphicsmagick/1.3.20.20150107/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 542 |
# ----------------------------------------------------------------------------------
#
# 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... | praveennet/azure-powershell | src/ServiceManagement/RecoveryServices/Commands.RecoveryServices.Test/ScenarioTests/RecoveryServicesTests.ps1 | PowerShell | apache-2.0 | 46,878 |
function New-VSLakeFormationPermissions {
<#
.SYNOPSIS
Adds an AWS::LakeFormation::Permissions resource to the template. The AWS::LakeFormation::Permissions resource represents the permissions that a principal has on an AWS Glue Data Catalog resource (such as AWS Glue database or AWS Glue tables. When y... | scrthq/Vaporshell | VaporShell/Public/Resource Types/New-VSLakeFormationPermissions.ps1 | PowerShell | apache-2.0 | 13,524 |
<#
# Copyright (c) 2014 All Rights Reserved by the SDL Group.
#
# 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 appl... | beutepa/ISHBootstrap | Source/Server/Certificates/New-SelfSignedTrustedCertificate.ps1 | PowerShell | apache-2.0 | 2,449 |
$data=123
$securedata=$data | ConvertTo-SecureString -AsPlainText -Force
$newdata=456
$newsecuredata=$newdata | ConvertTo-SecureString -AsPlainText -Force
<#
.SYNOPSIS
Create a secret
#>
function Test_CreateSecret
{
$keyVault = Get-KeyVault
$secretname= Get-SecretName 'default'
$sec=Set-AzureKeyVau... | namratab/azure-powershell | src/ResourceManager/KeyVault/Commands.KeyVault.Test/Scripts/VaultSecretTests.ps1 | PowerShell | apache-2.0 | 11,323 |
$ErrorActionPreference = 'Stop';
$packageArgs = @{
packageName = $env:ChocolateyPackageName
softwareName = 'Blender'
fileType = 'msi'
silentArgs = '/quiet /norestart'
validExitCodes= @(0, 2010, 1641)
}
$uninstalled = $false
[array]$key = Get-UninstallRegistryKey @packageArgs
if ($key.Count -eq... | jberezanski/chocolatey-coreteampackages | automatic/blender/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 942 |
# e.g. .\PreparePSRelease.ps1 9.10.11 "Spring 2018" -Patch
#
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True, Position=0)]
[String]$Version,
[Parameter(Mandatory=$True, Position=1)]
[String]$Release,
[Parameter(Mandatory=$False, Position=2)]
[String]$Folder,
[Parameter(ParameterSetName="Major")]
[Switch]$Major,
[P... | arcadiahlyy/azure-powershell | tools/PreparePSRelease.ps1 | PowerShell | apache-2.0 | 1,096 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | split-path -parent
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\functions\$sut"
$PSBoundParameters.clear()
Import-module .\IdentityManager.psd1 -verbose:$false
Import-Module .\FIMmodule\FIMmodule.psd1 -Scope Global -... | torgro/IdentityManager | Tests/Get-IMPersonMembership.Tests.ps1 | PowerShell | mit | 1,009 |
<#
.SYNOPSIS
SCCM Uninstall program for Adobe FrameMaker 12 Creative Cloud
.DESCRIPTION
Remove the following component(s) from Window 7 x64 systems:
- Adobe FrameMaker 12
.NOTES
FileName: AdobeCC_FrameMaker12_Uninstall.ps1
Author: Jerry Senff
Updated: 02/26/2019
... | jrsenff/Sccm-PowerShell-Scripts | Adobe Creative Cloud - FrameMaker 12/AdobeCC_FrameMaker12_Uninstall.ps1 | PowerShell | mit | 2,216 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "Validate start of console host" -Tag CI {
BeforeAll {
$allowedAssemblies = @(
'Microsoft.ApplicationInsights.dll'
'Microsoft.Management.Infrastructure.dll'
'Microsoft.... | Cowmonaut/PowerShell | test/powershell/Host/Startup.Tests.ps1 | PowerShell | mit | 5,449 |
#requires -RunAsAdministrator
#requires -Module Pester
<#
.Synopsis
Run these tests after deploying the DscPush Workshop configurations to infrastructure.
The VMs will need to reboot a few times before the Test-DscConfiguration cmdlet comes back true.
.Parameter Credential
The admini... | devopsjesus/dscpush | deployButton.Tests.ps1 | PowerShell | mit | 2,440 |
$diff = join-Path ${env:ProgramFiles(x86)} "Beyond compare 2\bc2.exe"
$friendlyName = "xIisModule"
$resourceName = "MSFT_$friendlyName"
$classVersion = "1.0.0"
$scriptRoot = Split-Path $MyInvocation.MyCommand.Path
$originalModuleRoot = join-Path $scriptroot "..\.."
$originalModuleRootPath = Resolve-Path $originalModul... | remcoeissing/xWebAdministration | source/DSCResources/MSFT_xIisModule/xIisModuleDesigner.ps1 | PowerShell | mit | 2,293 |
function Edit-StringList
{
<#
.Synopsis
Edits a list of strings
.Description
Edits a list of strings.
#>
[OutputType([Windows.Controls.Grid], [string[]])]
param(
# Starting contents of a list
[string[]]$List,
# The name of the control
[string]$Na... | pratom/master | electrons/vendor/ISE/ShowUI/CommonControls/Edit-StringList.ps1 | PowerShell | mit | 5,664 |
Param ($Version = "1.0-dev")
$ErrorActionPreference = "Stop"
pushd $PSScriptRoot
src\build.ps1 $Version
src\test.ps1
doc\build.ps1
popd
| nano-byte/common | build.ps1 | PowerShell | mit | 150 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$root = "$here\..\..\.."
. "$root\src\scaffold\tools\build\scripts\deploy\functions\_user.ns.ps1"
Describe "New-LocalUser" {
$computerName = $env:computerName
$computer = [ADSI]"WinNT://$computerName"
try{
$user = $computer.children.Find("Tes... | cwpdevteam/NScaffold | test/scaffold/functions/_user.ns.Tests.ps1 | PowerShell | mit | 696 |
class DnsKEYRecord : DnsResourceRecord {
<#
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| FLAGS |
+--+--+--+--+--+--+--+--+--+--+--+... | indented-automation/Indented.Net.Dns | Indented.Net.Dns/class/2.RecordTypes/DnsKEYRecord.ps1 | PowerShell | mit | 2,646 |
function Edge
{
<#
.Description
This defines an edge between two or more nodes
.Example
Graph g {
Edge FirstNode SecondNode
}
Generates this graph syntax:
digraph g {
"FirstNode"->"SecondNode"
}
.Example
$fol... | KevinMarquette/PSGraph | PSGraph/Public/Edge.ps1 | PowerShell | mit | 6,646 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.