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 |
|---|---|---|---|---|---|
<#
Copyright (c) 2012-2014 VMware, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribu... | vmware/webcommander | powershell/Broker/brokerAddLicense.ps1 | PowerShell | mit | 2,760 |
function Get-DbaClientAlias {
<#
.SYNOPSIS
Creates/updates a sql alias for the specified server - mimics cliconfg.exe
.DESCRIPTION
Creates/updates a SQL Server alias by altering HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client
.PARAMETER ComputerName
The target computer where the alias will be ... | SirCaptainMitch/dbatools | functions/Get-DbaClientAlias.ps1 | PowerShell | mit | 4,319 |
function Start-DbaXESession {
<#
.SYNOPSIS
Starts Extended Events sessions.
.DESCRIPTION
This script starts Extended Events sessions on a SQL Server instance.
.PARAMETER SqlInstance
The target SQL Server instance or instances. You must have sysadmin access and server version mu... | wsmelton/dbatools | functions/Start-DbaXESession.ps1 | PowerShell | mit | 8,529 |
<#
.SYNOPSIS
Get-ASEPImagePathLaunchStringStack.ps1
Requires logparser.exe in path
Pulls frequency of autoruns based on ImagePath, LaunchString and Publisher tuple
where ImagePath is not 'File not found'
This script expects files matching the pattern *autorunsc.txt to be in the
current working directory.
.NOTES
DATADI... | jvaldezjr1/Kansa | Analysis/asep/Get-ASEPImagePathLaunchStringPublisherStack.ps1 | PowerShell | apache-2.0 | 928 |
function New-PSItem {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Justification='Does not change system state')]
param()
$totalArgs = $args.Count
if($args[-1] -is [array]) {
$script:PSItemHeader=$args[-1]
$totalArgs-=1
}
... | dfinke/ImportExcel | Examples/New-PSItem.ps1 | PowerShell | apache-2.0 | 575 |
<###############################################################################
The MIT License (MIT)
Copyright (c) 2016-2017 Daiki Sakamoto
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 Softwar... | buildlet/Utilities | Projects/Utilities/Templates/PowerShellModuleTestInitialize.Template.ps1 | PowerShell | mit | 4,134 |
[CmdletBinding()]
param (
[string]$ProjectPath = (Resolve-Path -Path (Join-Path -Path $PSModuleRoot -ChildPath 'bin\projects\dbatools\dbatools.sln')),
[ValidateSet('ps3', 'ps4', 'Release', 'Debug')]
[string]$MsbuildConfiguration = "Release",
[Parameter(HelpMessage = 'Target to run instead of build')]
... | dsolodow/dbatools | bin/build-project.ps1 | PowerShell | mit | 2,712 |
Start-AutoRestCodeGeneration -ResourceProvider "postgresql/resource-manager" -AutoRestVersion "latest"
| yaakoviyun/azure-sdk-for-net | src/SDKs/PostgreSQL/Management.PostgreSQL/generate.ps1 | PowerShell | mit | 103 |
$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... | kozloski/dbatools | tests/Export-DbaExecutionPlan.Tests.ps1 | PowerShell | mit | 1,066 |
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[System.String]
$Name,
[Parameter()]
[System.Management.Automation.PSCredential]
$InstallAccount,
[Pa... | puppetlabs/puppetlabs-dsc | lib/puppet_x/dsc_resources/SharePointDsc/DSCResources/MSFT_SPPublishServiceApplication/MSFT_SPPublishServiceApplication.psm1 | PowerShell | apache-2.0 | 4,207 |
$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... | kozloski/dbatools | tests/Get-DbaXESessionTemplate.Tests.ps1 | PowerShell | mit | 1,288 |
<#
.SYNOPSIS
Get the PSCredential objects from the Windows Credential Manager vault.
.DESCRIPTION
This cmdlet uses the native unmanaged Win32 api to retrieve all entries
from the Windows Credential Manager vault. The entries are of type
PSCredential. To get the full credential e... | claudiospizzi/SecurityFever | SecurityFever/Functions/Vault/Get-VaultCredential.ps1 | PowerShell | mit | 1,972 |
[CmdletBinding()]
param()
Import-VstsLocStrings "$PSScriptRoot\module.json"
# Dot-source all script files in this folder
Find-VstsFiles -LiteralDirectory $PSScriptRoot -LegacyPattern "*.ps1" | ForEach { . $_ }
Export-ModuleMember -Function Connect-ServiceFabricClusterFromServiceEndpoint
Export-ModuleMember -Function ... | vithati/vsts-tasks | Tasks/Common/ServiceFabricHelpers/ServiceFabricHelpers.psm1 | PowerShell | mit | 544 |
$ProvisionToolPath = "$env:windir\temp\ProvisionScript"
if(!(Test-Path $ProvisionToolPath))
{
New-Item $ProvisionToolPath -ItemType directory | Out-Null
}
$logpath = $ProvisionToolPath+"\InstallADKLog.txt"
#ADK 1809 (17763)
$adkurl = "https://go.microsoft.com/fwlink/?linkid=2026036"
$adkpath = "c:\adksetup.exe"
In... | Nepomuceno/azure-quickstart-templates | sccm-technicalpreview/scripts/InstallADK.ps1 | PowerShell | mit | 1,642 |
<#
.SYNOPSIS
Unit test for DSC_SqlDatabaseMail DSC resource.
#>
BeforeAll {
$script:dscModuleName = 'SqlServerDsc'
$script:dscResourceName = 'DSC_SqlDatabaseMail'
try
{
Import-Module -Name DscResource.Test -Force -ErrorAction 'Stop'
}
catch [System.IO.FileNotFoundException]... | johlju/xSQLServer | tests/Unit/DSC_SqlDatabaseMail.Tests.ps1 | PowerShell | mit | 53,712 |
param($installPath, $toolsPath, $package, $project)
Write-Host "installPath:" "${installPath}"
Write-Host "toolsPath:" "${toolsPath}"
Write-Host " "
if ($project) {
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
# Create paths and list them
$projectPath = (Get-Item $project.Properties.Item("FullPath").Value).FullN... | lars-erik/Umbraco-CMS | build/NuSpecs/tools/install.ps1 | PowerShell | mit | 5,414 |
<#
### Task
Add ednpoint for Web traffic to an existing VM.
Add ACL to default RDP endpoint to allow traffic from a single IP only.
### Details
Endpoints control access to your VMs. By creating Endpoints you can open ports on your VM.
Access Control Lists can be used for fine-grained control over... | newventuresoftware/passing-azure-70-532 | powershell/asm/vm/vm-change-default-endpoints-acl.ps1 | PowerShell | mit | 2,148 |
<#
.Synopsis
This function will gather basic computer information
.Description
This function will gather basic computer information
From multiple computers and provide error logging information
.Parameter ComputerName
This parameter supports multiple computer names to gather
Data from. This parameter is Mandatory
.Exa... | EmpressDeIT/PowerShell | PST_Scripts/Mod9/WithView.ps1 | PowerShell | mit | 2,414 |
@{
AllNodes = @(
@{
NodeName = 'localhost'
Role = 'LocalNetworkS2SGateway'
AzureNetworkIP = 'vnet.public.ip.address'
AzureIPv4Subnet = '10.0.0.0/24:100'
AzureNetworkSharedSecret = 'SECRET'
};
)
} | mgreenegit/xRemoteAccess | Examples/ConfigurationData.psd1 | PowerShell | mit | 262 |
#Get Current Directory
$Here = Split-Path -Parent $MyInvocation.MyCommand.Path
#Get Function Name
$FunctionName = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -Replace ".Tests.ps1"
#Assume ModuleName from Repository Root folder
$ModuleName = Split-Path (Split-Path $Here -Parent) -Leaf
if( -not (Get-Module -Name $... | pspete/PoShPACLI | Tests/Remove-PVSafeGWAccount.Tests.ps1 | PowerShell | mit | 1,366 |
$uid = "e8d34963-8a5c-4d62-8778-0d47ee0f22fa"
$pwd = $env:spipwd
$tenantId = "1a92889b-8ea1-4a16-8132-347814051567"
$secPwd = ConvertTo-SecureString $pwd -AsPlainText -Force
$credentials = New-Object System.Management.Automation.PSCredential ($uid, $secPwd)
Add-AzurermAccount -ServicePrincipal -Tenant $tenantId... | SkillsFundingAgency/das-commitments | src/SFA.Powershell/AzureSqlBuild.ps1 | PowerShell | mit | 2,930 |
$packageName = '{{PackageName}}'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "iepv.exe"
$chocTempDir = Join-Path $Env:Temp "chocolatey"
$tempDir = Join-Path $chocTempDir "$packageNam... | maharishi/chocolatey-packages | automatic/iepv.portable/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 961 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-58.0a1.en-US.win32.installer.exe'
$checksum = 'd0ac3f34ace4224a242f7a40708c8aaf1d5438e768f5fdb45afa279e39cda5ed'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/58.0.1.2017110116/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = '409a37c7597565bdf9eddbe60c09e7942b78facc'
$checksumType = 'sha1'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvrt.exe"
try {
Get-Chocolat... | dtgm/chocolatey-packages | automatic/_output/kvrt/2016.03.25.1342/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 931 |
# Builds the Windows binary.
#
# From a fresh 64-bit Windows 10 install, prepare the system as follows:
#
# 1. Install Git:
#
# http://git-scm.com/download/win
#
# 2. Install Python 2.7.10:
#
# https://www.python.org/downloads/
#
# 3. Append ";C:\Python27;C:\Python27\Scripts" to the "Path" environment var... | charleswhchan/compose | script/build-windows.ps1 | PowerShell | apache-2.0 | 1,908 |
$packageName = 'gtksharp'
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$url = 'http://download.xamarin.com/GTKforWindows/Windows/gtk-sharp-2.12.38.msi'
$checksum = '862138a743a1be6e557f32c6c2bdc99c80225362a1e096686ca6fd30f2287d3d'
$checksumType = 'sha256'
$validExitCodes = @(0)
Install-ChocolateyPackag... | dtgm/chocolatey-packages | automatic/_output/gtksharp/2.12.38/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 666 |
$packageName = 'firefox-nightly'
$softwareVersion = '57.0.1.2017090912-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/57.0.1.2017090912/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 817 |
Set-PSDebug -Strict
#we need elevation for this script
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process pow... | fabsenet/mysetup | configure_powershell.ps1 | PowerShell | apache-2.0 | 2,816 |
Param(
[string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY,
[string] $CoreRootDirectory,
[string] $BaselineCoreRootDirectory,
[string] $Architecture="x64",
[string] $Framework="net5.0",
[string] $CompilationMode="Tiered",
[string] $Repository=$env:BUILD_REPOSITORY_NAME,
[string] $Branc... | mavasani/roslyn-analyzers | eng/common/performance/performance-setup.ps1 | PowerShell | apache-2.0 | 6,265 |
<#
.DESCRIPTION
This example shows how to ensure that the server role named
AdminSqlforBI is present on instance sqltest.company.local\DSC and logins
CONTOSO\Mark and CONTOSO\Lucy are not members of this role.
#>
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]... | bozho/xSQLServer | source/Examples/Resources/SqlRole/5-MembersToExcludeInServerRole.ps1 | PowerShell | mit | 894 |
function Test-RemovingPackageFromProjectDoesNotRemoveIfInUse {
# Arrange
$p1 = New-ClassLibrary
$p2 = New-ClassLibrary
Install-Package Ninject -Project $p1.Name
Assert-Reference $p1 Ninject
Install-Package Ninject -Project $p2.Name
Assert-Reference $p2 Ninject
U... | atheken/nuget | test/EndToEnd/tests/uninstall.ps1 | PowerShell | apache-2.0 | 30,081 |
<#
.SYNOPSIS
For settting the .NET framework version to all projects in the solution
.PARAMETER TargetFrameworkVersion
.NET framework version that you want to target
.EXAMPLE
.\Set-TargetFramework.ps1 -TargetFrameworkVersion v4.6.1
#>
param(
[Parameter(Mandatory = $true)]
[ValidatePattern("^v\d\.\... | LaserSrl/Orchard | src/Tools/Set-TargetFramework.ps1 | PowerShell | bsd-3-clause | 1,202 |
#
# Module manifest for module 'Azure.Storage'
#
# Generated by: Microsoft Corporation
#
# Generated on: 7/6/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '1.0.5.4'
# Supported PSEditions
# CompatiblePSEditions = @(... | AzureAutomationTeam/azure-powershell | src/StackAdmin/Storage/Commands.Storage/Azure.Storage.psd1 | PowerShell | apache-2.0 | 7,277 |
param($installPath, $toolsPath, $package, $project)
$modules = Get-ChildItem $ToolsPath -Filter *.psm1
$modules | ForEach-Object { import-module -name $_.FullName }
@"
========================
Chocolatey
========================
Welcome to Chocolatey, your local machine repository built on the NuGet infrast... | Apteryx0/choco | nuget/chocolatey/tools/init.ps1 | PowerShell | apache-2.0 | 1,434 |
param([string]$buildFolder, [string]$email, [string]$username, [string]$personalAccessToken, [string]$repoName)
Write-Host "- Set config settings...."
git config --global user.email $email
git config --global user.name $username
git config --global push.default matching
Write-Host "- Copy contents of dist folder into... | johnnyreilly/globalize-so-what-cha-want-typescript | pushStatic.ps1 | PowerShell | mit | 1,374 |
#
# Module manifest for module 'Azure'
#
# Generated by: Microsoft Corporation
#
# Generated on: 6/16/2016
#
@{
# Version number of this module.
ModuleVersion = '0.9.10'
# ID used to uniquely identify this module
GUID = '977ACCE0-7F27-404E-903D-B5861B18D53A'
# Author of this module
Author = 'Microsoft Corporation'
... | yoavrubin/azure-powershell | src/ResourceManager/Scheduler/Commands.Scheduler/Microsoft.Azure.Commands.Scheduler.dll-Help.psd1 | PowerShell | apache-2.0 | 3,004 |
# Write-Warning [-Message] <string> [<CommonParameters>]
Function Write-Warning
{
[cmdletbinding()] Param ( [Parameter(Mandatory=$false)][string] $Message )
try {
$var = (Snif-WriteVerb -the_write_verbs_bound_parameters:$PSBoundParameters -write_noun:"WARNING" )
}
catch [Exception]{
... | pratom/master | nucleus/neutrons/write-commandlets/Write-Warning.ps1 | PowerShell | mit | 570 |
<#
.SYNOPSIS
Creates a new build pipeline.
.DESCRIPTION
Creates build pipeline files and scaffolds base structure, to the target module.
.PARAMETER Module
The name of a module, or the parent path of a module manifest.
.NOTES
This scaffolding script is inspired by The PowerShell Build Pipeline as proposed by xainey (... | RedeployAB/PSScaffold | PSScaffold/Public/New-PSBuildPipeline.ps1 | PowerShell | mit | 2,269 |
param
(
# Path to .jpg thumbnails
[Parameter(Mandatory=$true)]
[ValidateScript({Test-Path $_})]
[String]
$JpgFilePath
)
Write-Verbose -Message "This is SetAdPhoto and the path is: $JpgFilePath"
"This is SetAdPhoto and the path is: $JpgFilePath"
$File = Get-ChildItem -Path $JpgFilePath
$SamA... | mrhvid/AzureAutomationTest | Set-ADPhoto.ps1 | PowerShell | mit | 948 |
#Requires -RunAsAdministrator
# Add provider for packages
Install-PackageProvider -Name NuGet -Force
# Install new module
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Force
| christianjaeckle/Powershell-Scripts | Module PSScriptAnalyzer/Install PSScriptAnalyzer.ps1 | PowerShell | mit | 191 |
BeforeDiscovery {
$rootpath = $PSScriptRoot
if (-not (Get-Module -List AutomatedLab.Common)) { Install-Module -Name AutomatedLab.Common -Force -SkipPublisherCheck -AllowClobber }
if (-not (Get-Module -List PSFramework)) { Install-Module -Name PSFramework -Force -SkipPublisherCheck -AllowClobber }
... | AutomatedLab/AutomatedLab | Tests/Integration/Get-LabConfigurationItem.tests.ps1 | PowerShell | mit | 2,074 |
#Requires -Version 5
#Requires -RunAsAdministrator
# Informationen unter: https://technet.microsoft.com/library/dn927162.aspx
#$Installed = Get-Package | Where-Object -Property ProviderName -NotMatch '(msu|msi|Programs)'
#$Online = Get-Package | Where-Object -Property ProviderName -NotMatch '(msu|msi|Programs)' | % ... | Velocet/PowerShell | Velocet/Initialize/Initialize-PSPackageManagement.ps1 | PowerShell | mit | 9,394 |
function Disable-DbaTraceFlag {
<#
.SYNOPSIS
Disable a Global Trace Flag that is currently running
.DESCRIPTION
The function will disable a Trace Flag that is currently running globally on the SQL Server instance(s) listed
.PARAMETER SqlInstance
Allows you to specify a comma se... | sqlpadawan/dbatools | functions/Disable-DbaTraceFlag.ps1 | PowerShell | mit | 3,784 |
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved.
# Licensed under the MIT License (MIT)
Describe "Write-RsFolderContent" {
Context "Write-RsFolderContent with min parameters"{
$folderName = 'SutWriteRsFolderContentMinParameters' + [guid]::NewGuid()
New-RsFolder -Path / -FolderName ... | warren2600/ReportingServicesTools | Tests/CatalogItems/Write-RsFolderContent.Tests.ps1 | PowerShell | mit | 5,700 |
Configuration Main
{
Param (
[String]$DomainName = 'Contoso.com',
[PSCredential]$AdminCreds,
[Int]$RetryCount = 15,
[Int]$RetryIntervalSec = 60
)
Import-DscResource -ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName xActiveDirectory
Import-DscResource -ModuleName xStorage
[PSCredential]... | brwilkinson/3VMDomain-VS | 3VMDomain/DSC/vmdscDC1Configuration.ps1 | PowerShell | mit | 1,897 |
Param (
[switch]$Publish
)
$Publish = $false;
$ErrorActionPreference = "Stop"
$global:ExitCode = 1
function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true)]
[array] $Messages,
[Parameter()] [ValidateSet("Error", "Warn", "Info")]
[string] $Level = "Inf... | ozzy-ext/db.test | NuGet.Local/NuGetPackage.ps1 | PowerShell | mit | 11,506 |
Set-AzureSubscription -CurrentStorageAccountName "portalvhds2ymt8451rzdv8" -SubscriptionName "Visual Studio Ultimate with MSDN"
$svcname = "teau-sf-"+$(Get-Random -minimum 10000 -maximum 99999)
$adminUser="stufox"
$adminpassword="pass@word1"
$location="SouthEast Asia"
$vm1name = "teauvm1"
$vmimage = (Get-... | stufox/Powershell | Azure-DSC-DemoSetup - SE Asia.ps1 | PowerShell | apache-2.0 | 1,007 |
echo '启动容器...';
if (!${PSScriptRoot}) {
${PSScriptRoot} = Split-Path -Parent $MyInvocation.MyCommand.Definition
}
. ${PSScriptRoot}/start-machine.ps1;
if (-not $?){
exit $?;
}
$backPwd = pwd;
cd "${rootPath}/../";
dc restart;
cd $backPwd.Path;
| aogg/docker_lamp | powerShell/restart-compose.ps1 | PowerShell | apache-2.0 | 285 |
#
# Module manifest for module 'Az.MarketplaceOrdering'
#
# Generated by: Microsoft Corporation
#
# Generated on: 3/9/2018
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.5.0'
# Supported PSEditions
CompatiblePSEditions ... | AzureAutomationTeam/azure-powershell | src/ResourceManager/MarketplaceOrdering/Commands.MarketplaceOrdering/Az.MarketplaceOrdering.psd1 | PowerShell | apache-2.0 | 4,700 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-57.0a1.en-US.win32.installer.exe'
$checksum = '662d50839ef5ddfdf59750ea656b776dbe04e79bb0ed3cd9c4274a89789e4073'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/57.0.1.2017091000/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
function Add-VSS3BucketVersioningConfiguration {
<#
.SYNOPSIS
Adds an AWS::S3::Bucket.VersioningConfiguration resource property to the template. Describes the versioning state of an Amazon S3 bucket. For more information, see PUT Bucket versioning: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBuc... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSS3BucketVersioningConfiguration.ps1 | PowerShell | apache-2.0 | 2,759 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "Get-TraceSource" -Tags "Feature" {
It "Should output data sorted by name" {
$expected = (Get-TraceSource | Sort-Object Name)
Get-TraceSource | Should -Be $expected
}
}
| TravisEz13/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/Get-TraceSource.Tests.ps1 | PowerShell | mit | 275 |
$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... | alevyinroc/dbatools | tests/Remove-DbaAgentAlertCategory.Tests.ps1 | PowerShell | mit | 1,882 |
# Install Bazel pre-reqs on Windows
# https://docs.bazel.build/versions/master/install-windows.html
# https://docs.bazel.build/versions/master/windows.html
# Install MSYS2 and packages
choco install msys2 --version 20180531.0.0 --no-progress --package-parameters "/NoUpdate"
C:\tools\msys64\usr\bin\bash.exe -l -c "pacma... | sarunint/angular | .circleci/windows-env.ps1 | PowerShell | mit | 2,904 |
Describe "Get-Date DRT Unit Tests" -Tags "CI" {
It "Get-Date with all parameters returns proper results" {
$date = [datetime]::Now + ([timespan]::new(0,0,30))
$result = Get-Date -Date $date -Year 1973 -Month 2 -Day 22 -Hour 15 -Minute 40 -Second 10 -Millisecond 200
$result.GetType() | Should... | bingbing8/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 | PowerShell | mit | 4,705 |
function Export-DbaInstance {
<#
.SYNOPSIS
Exports SQL Server *ALL* database restore scripts, logins, database mail profiles/accounts, credentials, SQL Agent objects, linked servers,
Central Management Server objects, server configuration settings (sp_configure), user objects in systems database... | kozloski/dbatools | functions/Export-DbaInstance.ps1 | PowerShell | mit | 26,641 |
rm "bin\release\" -Recurse -Force
dotnet pack --configuration Release --include-symbols -p:SymbolPackageFormat=snupkg
$package=(ls .\bin\Release\*.nupkg).FullName
dotnet nuget push $package --source "https://api.nuget.org/v3/index.json"
$ver = ((ls .\bin\release\*.nupkg)[0].Name -replace '.*(\d+\.\d+\.\d+)\.nupkg','$1'... | btcpayserver/btcpayserver | BTCPayServer.PluginPacker/PushNuget.ps1 | PowerShell | mit | 453 |
function Remove-DbaDbMailAccount {
<#
.SYNOPSIS
Removes database mail account(s).
.DESCRIPTION
Removes the database mail account(s) that have passed through the pipeline.
If not used with a pipeline, Get-DbaDbMailAccount will be executed with the parameters provided
and the ... | wsmelton/dbatools | functions/Remove-DbaDbMailAccount.ps1 | PowerShell | mit | 5,469 |
function Get-ComputerDiskDrive
{
param(
[Parameter(Mandatory=$True,ValueFromPipeline=$True)]
$ComputerName
)
Get-WmiObject Win32_diskDrive -ComputerName $ComputerName | % {
if($_.InterfaceType -eq "IDE")
{
$int = "IDE/SATA"
}
else
{
$int = $_.Inter... | cedricdo/PS | Computer/Get-ComputerDiskDrive.ps1 | PowerShell | mit | 677 |
Function New-OutputHeadersHtmlBody
{
[cmdletbinding()]
param(
$outputHeaders
)
$emailBody = ''
foreach ($headerKey in $outputHeaders.Keys)
{
$header = $outputHeaders[$headerKey]
$emailBody += '<th align="left" style="border: 1px solid #CCCCCC; background-col... | HiltonGiesenow/PoShMon | src/Functions/PoShMon.MessageFormatters.Html.Monitoring/New-OutputHeadersHtmlBody.ps1 | PowerShell | mit | 405 |
###########Define Variables########
param
(
[parameter(mandatory=$true)][string]$buildDefName,
[parameter(mandatory=$true)][string]$buildDefID,
[parameter(mandatory=$true)][string]$artifactPathVarName,
#[parameter(mandatory=$false)][string]$useArtifactVariableValue,
[parameter(mandatory=$false)][st... | grawcho/vso-agent-tasks | Tasks/GetBuildArtifacts/GetBuildArtifacts.ps1 | PowerShell | mit | 6,176 |
#requires -Version 5
$computers = 'OHSQL1016'
$OutputPath = 'D:\DSCLocal'
$cim = New-CimSession -ComputerName $computers
#requires -Version 5
[DSCLocalConfigurationManager()]
Configuration LCM_Push
{
Param(
[string[]]$ComputerName
)
Node $ComputerName
{
Settings
{
... | randorfer/RunbookExample | PowerShellModules/cSQLConfig/1.4.1/Examples/SQLPushStandAlone.ps1 | PowerShell | mit | 4,862 |
Function Get-PortRole {
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true,HelpMessage = 'Please provide an ID of an IO Module - 0 to 3')]
[ValidateSet(0,1,2,3)]
[Int]$IOModuleID
)
Switch ($IOModuleID) {
0 {$Role = "front-end"}
1 {$Role = "back-end"}
2 {$Role = "wan-com"}
3 {$Rol... | equelin/VPLEX-Powershell | VPLEX-Powershell/Private/Get-PortRole.ps1 | PowerShell | mit | 359 |
##################################################################################
#
#
# Script name: Import-SPSite.ps1
#
# Author: niklas.goude@zipper.se
# Homepage: www.powershell.nu
# Company: www.zipper.se
#
##################################################################################
param([st... | borkit/scriptdump | PowerShell/Working/SharePoint/MOSS2007/powershell.nu_moss2007_script_collection/Import-SPSite.ps1 | PowerShell | mit | 1,343 |
# clearing the console window
cls
# REST requests to collect data from the web
# defining the RESTful URL where we want to fetch our data from
$urlString = "http://pokeapi.co/api/v2/pokemon/"
# To keep things simple, we create a list of params we want to fetch data for
# In this case we need to provide IDs to fetch... | Akaino/Powershell | Useful Scripts/RestApi.ps1 | PowerShell | mit | 2,193 |
function Set-DbaCmConnection {
<#
.SYNOPSIS
Configures a connection object for use in remote computer management.
.DESCRIPTION
Configures a connection object for use in remote computer management.
This function will either create new records for computers that have no connection reg... | dsolodow/dbatools | functions/Set-DbaCmConnection.ps1 | PowerShell | mit | 13,495 |
$ModuleName = "VSCETabCompletion"
$ModulePath = "C:\Program Files\WindowsPowerShell\Modules"
$TargetPath = "$($ModulePath)\$($ModuleName)"
if(!(Test-Path $TargetPath)) { md $TargetPath | out-null}
$FilesToCopy = dir -ErrorAction ignore *.psm1, *.psd1
$FilesToCopy | ForEach {
Copy-Item -Verbose -Path $_.Ful... | dfinke/VSCETabCompletion | InstallModule.ps1 | PowerShell | apache-2.0 | 368 |
$packageName = '{{PackageName}}'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'md5'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "par2.exe"
Install-ChocolateyZipPackage -PackageName "$packageName" `
-Url "... | maharishi/chocolatey-packages | automatic/par2cmdline/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 543 |
$packageName = '{{PackageName}}'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$installerType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packageName" `
-FileType "$installerType" `
-SilentAr... | maharishi/chocolatey-packages | automatic/stunnel/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 544 |
$Groups = Get-DistributionGroup
$Exports = @()
foreach ($Group in $Groups) {
$GroupEmail = $Group.PrimarySmtpAddress
$Members = $Group | Get-DistributionGroupMember
foreach ($Member in $Members) {
$MemberEmail = $Member.PrimarySmtpAddress
if ($MemberEmail) {
$Exports += new-ob... | gruberjl/powershell | Export-DistributionGroupMembers/Export-DistributionGroupMembers.ps1 | PowerShell | apache-2.0 | 525 |
<#############################################################################
The DoPx module provides a rich set of commands that extend the automation
capabilities of the DigitalOcean (DO) cloud service. These commands make it
easier to manage your DigitalOcean environment from Windows PowerShell. When
used with th... | KirkMunro/DoPx | helpers/Invoke-DoPxObjectAction.ps1 | PowerShell | apache-2.0 | 5,647 |
$packageName = 'pan'
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$url = 'https://drive.google.com/uc?export=download&id=0Bxjl408XUVptSE01WUVWRzU1OGM'
$checksum = '82058c82dea2a033785d9912ceee9d39018e44170fe48905cbb259ff42820ed8'
$checksumType = 'sha256'
$validExitCodes = @(0)
Install-ChocolateyPacka... | dtgm/chocolatey-packages | automatic/_output/pan/0.140.214/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 462 |
# Returns the BIOS Status
# Statuses include: "OK", "Degraded", and "Pred Fail" (an element, such as a SMART-enabled hard disk drive, may be functioning properly but predicting a failure in the near future). Nonoperational statuses include: "Error", "Starting", "Stopping", and "Service". The latter, "Service", could ap... | vmwaresamples/AirWatch-samples | Windows-Samples/Sensors/bios_status.ps1 | PowerShell | bsd-3-clause | 687 |
function Get-DbaPlanCache {
<#
.SYNOPSIS
Provides information about adhoc and prepared plan cache usage
.DESCRIPTION
Checks adhoc and prepared plan cache for each database, if over 100 MB you should consider using Remove-DbaQueryPlan to clear the plan caches or turning on "optimize for adho... | wsmelton/dbatools | functions/Get-DbaPlanCache.ps1 | PowerShell | mit | 3,549 |
#
# Uninstalling Windows Service with provided name
#
param([string] $serviceName)
$service = Get-WmiObject -Class Win32_Service -Filter "Name = '$serviceName'" -ErrorAction Stop
$id = $service | select -expand ProcessId;
if($id)
{
( Get-Process -Id $id).Kill()
}
if($service)
{
$result = $service.delete... | jarzynam/rescuer | src/Continuous.WindowsService/Continuous.WindowsService/Scripts/UninstallService.ps1 | PowerShell | mit | 380 |
#Importing module from current location
Import-Module C:\scripts\mod3\DiskInfo.psm1
#Remove module and re-import during testing
Remove-Module Diskinfo;Import-Module C:\scripts\mod3\DiskInfo.psm1
#Putting the module in its proper place
$Path=$env:PSModulePath -split ";"
$Path[0]
$ModulePath=$Path[0] + "\diskInfo"
... | kidchenko/playground | powershell-advanced-tools-and-scripting-with-powershell/Mod8/Launch.ps1 | PowerShell | mit | 447 |
param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... | CslaGenFork/CslaGenFork | tags/Rules sample v.2.0.0/packages/Microsoft.Bcl.Build.1.0.0-rc/tools/Uninstall.ps1 | PowerShell | mit | 655 |
function Set-ExcelRange {
[CmdletBinding()]
[Alias("Set-Format")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '',Justification='Does not change system state')]
param(
[Parameter(ValueFromPipeline = $true,Position=0)]
[Alias("Address"... | DarkLite1/ImportExcel | Public/Set-ExcelRange.ps1 | PowerShell | apache-2.0 | 10,352 |
$scriptPath = ($PSScriptRoot)
$magicNumberScript = Join-Path ((get-item $scriptPath ).parent.FullName) ("ps\magicnumber.ps1")
$miscScript = Join-Path ((get-item $scriptPath ).parent.FullName) ("ps\misc.ps1")
# tools
. $magicNumberScript
. $miscScript
$mn = [PSCustomObject] (Get-MagicNumber 1 2 3 4 56789 "combinate... | pkudrel/PsAutomationHelpers | tests/magicnumber.tests.ps1 | PowerShell | mit | 416 |
# ----------------------------------------------------------------------------------
#
# 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/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.ps1 | PowerShell | apache-2.0 | 33,899 |
# ----------------------------------------------------------------------------------
#
# 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/StackAdmin/Azs.Network.Admin/Tests/src/Quota.Tests.ps1 | PowerShell | apache-2.0 | 6,433 |
function Install-ChocolateyPath {
param(
[string] $pathToInstall,
[System.EnvironmentVariableTarget] $pathType = [System.EnvironmentVariableTarget]::User
)
Write-Debug "Running 'Install-ChocolateyPath' with pathToInstall:`'$pathToInstall`'";
$originalPathToInstall = $pathToInstall
#get the PATH vari... | modulexcite/chocolatey | src/helpers/functions/Install-ChocolateyPath.ps1 | PowerShell | apache-2.0 | 1,744 |
[guid]::NewGuid().Guid | tee guid.txt | guitarrapc/DSCSample | PowerShellSessionVol3/guid/guid.ps1 | PowerShell | mit | 40 |
# This script will download and install Dividat Driver as a Windows service.
## Configuration ##########################################
$releaseUrl = "https://dist.dividat.com/releases/driver2/"
$channel = "master"
$installDir = "C:\Program Files\dividat-driver"
#######################################################... | pukkamustard/driver | install.ps1 | PowerShell | mit | 1,219 |
$env:PATH+= ";$HOME/.poetry/bin"
| airtonix/dotfiles | ps/profile/parts/init.python.ps1 | PowerShell | mit | 34 |
Param (
[alias("nl")]
[switch]
$NoLinks,
[alias("v")]
[switch]
$Verbose,
[alias("m")]
[switch]
$MD5,
[alias("f")]
[switch]
$Force,
[alias("d")]
[switch]
$DryRun
)
<#
.SYNOPSIS
Get-Chi... | benzenwen/win-manta | mupload.ps1 | PowerShell | mit | 9,273 |
Param( [Parameter(Mandatory)] [String] $isoUrl,
[String] $provider = 'hyperv',
[String] $os = 'windows-10.21H2',
[String] $locale = 'pl-PL',
[String] $winrmTimeout = '10m',
... | a4099181/packer-officeVM | build.ps1 | PowerShell | mit | 2,740 |
function GenerateNumberExtensionsSourceCode($quantity)
{
$quantityName = $quantity.Name;
$units = $quantity.Units;
@"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by \generate-code.bat.
//
// Changes to this file will be ... | BrandonLWhite/UnitsNet | UnitsNet/Scripts/Include-GenerateNumberExtensionsSourceCode.ps1 | PowerShell | mit | 4,979 |
Function Get-Vegetable {
[cmdletbinding()]
[OutputType("PSTeachingTools.PSVegetable")]
[alias("gveg")]
Param(
[Parameter(
Position = 0,
ValueFromPipeline,
ValueFromPipelineByPropertyName
)]
[string]$Name,
[switch]$RootOnly
)
... | jdhitsolutions/PSTeachingTools | code/Get-Vegetable.ps1 | PowerShell | mit | 1,837 |
#region:TestFileHeader
param (
[Boolean]$UseExisting
)
if (-not $UseExisting) {
$moduleBase = $psscriptroot.Substring(0, $psscriptroot.IndexOf("\test"))
$stubBase = Resolve-Path (Join-Path $moduleBase "test*\stub\*")
if ($null -ne $stubBase) {
$stubBase | Import-Module -Force
}
Import-... | indented-automation/Indented.Net.Dns | Indented.Net.Dns/test/1.unit/class/1.MessagePart/DnsQuestion.tests.ps1 | PowerShell | mit | 2,232 |
git config --global credential.helper wincred
$whatAreYourEditsAbout = read-host "What were your edits about?"
cd c:\docToGit
.\DocxToGit c:\github\lisasbook\ "When Doctor Becomes Patient v 2" .docx
cd c:\github\lisasbook\
git add .
git commit -m $whatAreYourEditsAbout
git push
| Sobieck00/DocxToTxtToGithub | covertDocxAndCommitToGit.ps1 | PowerShell | mit | 284 |
function Initialize-OctoVsts {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true, Position=0)]
[string]$VstsInstance,
[Parameter(Mandatory=$true, Position=1)]
[string]$VstsProject,
[Parameter(Mandatory=$true, Position=2)]
[string]$VstsAccessToken,
[Para... | kleinux/OctoVsts | Code/Modules/Initialize-OctoVsts.psm1 | PowerShell | mit | 627 |
param([string]$HostName, [string]$UserName2007, [boolean]$Fix, [boolean]$Verbose, [boolean]$Recurse, [string]$UserName2010)
#
# Update the path below to match the actual path to the EWS managed API DLL.
#
Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebService... | erll/Powershell-Scripts | Find_Boke_Message.orig.ps1 | PowerShell | mit | 18,422 |
#requires -Version 3
function Remove-RubrikHost
{
<#
.SYNOPSIS
Delete host by specifying the host ID.
.DESCRIPTION
The Remove-RubrikHost cmdlet is used to remove a host registered with the Rubrik cluster.
.NOTES
Written by Chris Wahl for community usage
Twitter: @ChrisWah... | rubrikinc/PowerShell-Module | Rubrik/Public/Remove-RubrikHost.ps1 | PowerShell | mit | 2,757 |
<#
.SYNOPSIS
Return a SharePoint resource as a PsCustomObject
.PARAMETER Url
The Url of the JSON resource.
.EXAMPLE
PS> Get-PsCustomObject -Url 'http://contoso.intranet.com/_vti_bin/listdata.svc/TheList(1)''
.OUTPUT
PsCustomObject
#>
Function Get-PsCustomObject {
Param(
[Parameter(Mandatory=$True,Positi... | craibuc/PsSharePoint | Functions/Get-PsCustomObject.ps1 | PowerShell | mit | 834 |
function Capture-After {
& "c:\share\tools\XStudio.exe" /after /beforepath c:\output\snapshot /o c:\output
}
function Build-Image {
& "c:\share\tools\XStudio.exe" c:\output\snapshot.xappl /o c:\share\output\image.svm /component /uncompressed /l c:\share\tools\license.txt
}
function Send-Keystroke{
param(
... | turboapps/turbome | microsoft/office/captureBuildScript.ps1 | PowerShell | apache-2.0 | 5,304 |
$ErrorActionPreference = 'Stop';
$packageArgs = @{
packageName = $env:ChocolateyPackageName
softwareName = 'X2Go Client*'
fileType = 'exe'
silentArgs = '/S'
validExitCodes= @(@(0))
}
$uninstalled = $false
[array]$key = Get-UninstallRegistryKey @packageArgs
if ($key.Count -eq 1) {
$key | % {
... | octomike/chocolatey-coreteampackages | automatic/x2go/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 835 |
$pkg_name="visual-cpp-redist-2013"
$pkg_origin="core"
$pkg_version="12.0.30501"
$pkg_description="Run-time components that are required to run C++ applications that are built by using Visual Studio 2013."
$pkg_upstream_url="http://www.microsoft.com/en-us/download/details.aspx?id=40784"
$pkg_license=@("Microsoft Softwar... | be-plans/be | visual-cpp-redist-2013/plan.ps1 | PowerShell | apache-2.0 | 1,170 |
# powershell v2 compatibility
$psVer = $PSVersionTable.PSVersion.Major
if ($psver -ge 3) {
function Get-ChildItemDir {Get-ChildItem -Directory $args}
} else {
function Get-ChildItemDir {Get-ChildItem $args}
}
$packageName = '{{PackageName}}'
$typName = 'QrCodeGenerator'
$packageSearch = 'KeePass Password Safe'
$ur... | dtgm/chocolatey-packages | automatic/keepass-plugin-qrcodegen/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 2,860 |
# 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 ... | MattHubble/carbon | Carbon/MSMQ/Reset-MsmqQueueManagerID.ps1 | PowerShell | apache-2.0 | 2,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.