code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
function Get-LabDscModule {
<#
.SYNOPSIS
Locates the directory path of the ResourceName within the specified DSC ModuleName.
#>
[CmdletBinding()]
[OutputType([System.String])]
param (
[Parameter(Mandatory)]
[System.String] $ModuleName,
[Parameter()]
[System.Strin... | VirtualEngine/Lab | Src/Private/Get-LabDscModule.ps1 | PowerShell | mit | 1,338 |
<#
.EXAMPLE
This example adds a new user profile sync connection to the specified user
profile service app
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount,
[Parameter(Mandatory = $true)]
... | BrunoReboul/SharePointDsc | Modules/SharePointDsc/Examples/Resources/SPUserProfileSyncConnection/1-Example.ps1 | PowerShell | mit | 1,109 |
<#
.SYNOPSIS
Creates a Windows Azure Website (PHP) with settings:
- Always on: true
- 64bit: true
Add app settings:
WEBSITE_TIME_ZONE = Central Europe Standard Time
.DESCRIPTION
Creates a new PHP website.
.EXAMPLE
.\create-php-website.ps1 -WebSiteName "myWebSiteName" [-ServicePlan] "S... | goto10hq/AzurePowerShellScripts | create-php-website.ps1 | PowerShell | mit | 2,832 |
$script:DSCModuleName = 'xSQLServer'
$script:DSCResourceName = 'MSFT_xSQLServerPermission'
#region HEADER
# Unit Test Template Version: 1.1.0
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResou... | Arturas-K/xSQLServer | Tests/Unit/MSFT_xSQLServerPermission.Tests.ps1 | PowerShell | mit | 15,229 |
enum Selector {
FullCertificate
SubjectPublicKeyInfo
} | indented-automation/Indented.Net.Dns | Indented.Net.Dns/enum/Selector.ps1 | PowerShell | mit | 62 |
param(
[Parameter(Mandatory = $false)]
[string] $Rebuild = 'true',
[Parameter(Mandatory = $false)]
[string] $Configuration = 'Debug',
[Parameter(Mandatory = $false)]
[string] $SourceLink = 'true',
[Parameter(Mandatory = $false)]
[string] $GenerateReport = 'true'
)
$coveragePath = [System.IO.Path]::GetF... | validide/mobile-detect | _build/test.ps1 | PowerShell | mit | 2,090 |
[CmdletBinding(DefaultParameterSetName = 'None')]
param
(
[String] [Parameter(Mandatory = $true)]
$DeploymentEnvironmentName,
[String] [Parameter(Mandatory = $true)]
$ScriptPath,
[String] [Parameter(Mandatory = $true)]
$ScriptArguments
)
Write-Verbose "Entering script RunAzurePowerShell.ps1"
... | lukehoban/vso-agent-tasks | Tasks/AzurePowerShell/RunAzurePowerShell.ps1 | PowerShell | mit | 672 |
<#
.SYNOPSIS
powershell script to invoke azure rm invoke-azurermvmssvmruncommand command with output on azure vm scaleset vms
.DESCRIPTION
powershell script to invoke azure rm invoke-azurermvmssvmruncommand command with output on azure vm scaleset vms
Invoke-AzureRmVmssVMRunCommand -ResourceGroup... | jagilber/powershellScripts | azurerm/azure-rm-vmss-run-command.ps1 | PowerShell | mit | 14,960 |
#Requires -Version 3.0
function Remove-MrSavedCredential {
[CmdletBinding(SupportsShouldProcess,
ConfirmImpact='Medium')]
param (
[Parameter(Mandatory,
ValueFromPipelineByPropertyName)]
[string]$Target
)
PROCESS {
if ($PSCmdlet.ShouldProce... | mikefrobbins/PowerShell | MrToolkit/Public/Remove-MrSavedCredential.ps1 | PowerShell | mit | 433 |
#region Info
<#
#################################################
# modified by : Joerg Hochwald
# last modified : 2016-04-13
#################################################
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2012-2016, NET-Experts <... | jhochwald/MyPowerShellStuff | Profile/functions/Set-FolderDate.ps1 | PowerShell | mit | 15,225 |
#region Info
<#
#################################################
# modified by : Joerg Hochwald
# last modified : 2016-04-03
#################################################
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2012-2016, NET-Experts <... | jhochwald/MyPowerShellStuff | Modules/ToolBox/Public/Disable-IEESEC.ps1 | PowerShell | mit | 15,549 |
# --------------------------------------------------------------
# Copyright © Microsoft Corporation. All Rights Reserved.
# Microsoft Corporation (or based on where you live, one of its affiliates) licenses this sample code for your internal testing purposes only.
# Microsoft provides the following sample code AS... | JMesser81/SDN | SDNExpress/scripts/CloudGatewayFailover.ps1 | PowerShell | mit | 5,197 |
Get-Help out* | Out-File “c:\temp\outinfo.txt” | jclosure/PSToolBox | Help.ps1 | PowerShell | mit | 54 |
<#
.Synopsis
When run on an EC2 instance it will return the region that the instance is in
.OUTPUTS
Region name in string
.EXAMPLE
Get-MyAWSRegion
#>
function Get-MyAWSRegion
{
[OutputType([String])]
$metadata = Invoke-RestMethod 'http://169.254.169.254/latest/dynamic/instance-identity/document'... | ansarada/AWSPSAX | Functions/Get-MyAWSRegion.ps1 | PowerShell | mit | 444 |
#
# e2e.ps1
#
function Get-RelativePath([string] $filePath)
{
$root = Join-Path $(Get-Location) "test\"
return Join-Path $root $filePath
}
[string] $backupfilePath = @(Get-RelativePath 'workingDir\Backup')
### Import Module
Remove-Module jinga -ErrorAction Ignore
Import-Module @(Join-Path... | anupkumarsharma/Jinga | test/e2e.ps1 | PowerShell | apache-2.0 | 6,006 |
Param (
[Parameter(ParameterSetName='ContainerNative')]
[Switch]$RunNative,
[Parameter(ParameterSetName='ContainerPowerShell')]
[Switch]$CreateContainerImageUsingPowerShell,
[Parameter(ParameterSetName='ContainerPowerShell')]
[string]$InternetVirtualSwitchName = 'Virtual Switch'
)
$containerImageName = 'j... | ducke/windows-server-container | jdk-1.6.0.80/HybridInstaller.ps1 | PowerShell | apache-2.0 | 4,277 |
# Copyright 2011 Ryan J. Geyer
# 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... | rgeyer/cookbooks_windows | cookbooks/db_mssql/powershell_providers/certificate/create.ps1 | PowerShell | apache-2.0 | 2,016 |
param(
[string] $branchName = "master",
[string] $InstallDir = "",
[string] $user = '',
[string] $plainPassword = ''
)
cls
if(-not(Get-Module -name teamCity))
{
Import-Module -Name ".\teamCity"
}
if(-not(Get-Module -name jarvisUtils))
{
Import-Module -Name ".\jarvisUtils"
}... | ProximoSrl/Jarvis.ConfigurationService | Tools/Setup/Setup.ps1 | PowerShell | apache-2.0 | 2,184 |
$packageName = 'awscli'
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$url = 'https://s3.amazonaws.com/aws-cli/AWSCLI32-1.11.163.msi'
$checksum = '55a430c2d61c100a6536df3dacbfc2292acbe5c930b82b06e4c70b54dc309fc4'
$checksumType = 'sha256'
$url64 = 'https://s3.amazonaws.com/aws-cli/AWSCLI64-1.11.163.msi'
$... | dtgm/chocolatey-packages | automatic/_output/awscli/1.11.163/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 984 |
# 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 | Test/Security/Test-ProtectAcl.ps1 | PowerShell | apache-2.0 | 2,635 |
$packageName = 'stellar'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://github.com/stellarchat/desktop-client/releases/download/v2.4/StellarDesktopWin32-v2.4.zip'
$checksum = 'fe71c3f56e6850b1fc3e1f5334229ae0ae97fdec339c729fd8b51a0ea75e8032'
$checksumType = 'sha256'
$url64 = 'htt... | dtgm/chocolatey-packages | automatic/_output/stellar/2.4/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,296 |
function New-VSDocDBDBClusterParameterGroup {
<#
.SYNOPSIS
Adds an AWS::DocDB::DBClusterParameterGroup resource to the template. The AWS::DocDB::DBClusterParameterGroup Amazon DocumentDB (with MongoDB compatibility resource describes a DBClusterParameterGroup. For more information, see DBClusterParamete... | scrthq/Vaporshell | VaporShell/Public/Resource Types/New-VSDocDBDBClusterParameterGroup.ps1 | PowerShell | apache-2.0 | 17,396 |
function Enable-DbaFilestream {
<#
.SYNOPSIS
Enables FileStream on specified SQL Server instances
.DESCRIPTION
Connects to the specified SQL Server instances, and Enables the FileStream feature to the required value
To perform the action, the SQL Server instance must be restarted. ... | alevyinroc/dbatools | functions/Enable-DbaFilestream.ps1 | PowerShell | mit | 6,795 |
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $msbuildEngine,
[string] $configuration = "Debug",
[switch] $prepareMachine,
[bool] $buildStage1 = $True,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
. $PSScriptRoot\common\tools.ps1
Set-StrictMode -Version 2.0
$ErrorActionP... | Microsoft/msbuild | eng/cibuild_bootstrapped_msbuild.ps1 | PowerShell | mit | 4,083 |
#This script is only tested against and should only run on 2012R2 systems.
#There are caveats and issues upgrading from WMF 3 to 5 on 2008R2/Win7 that
#this script does not consider due to classroom environment being 2012R2.
#Modifiable variables are below. Update these as needed to match the WMF
#you want to have ins... | joshsamuelson/pltraining-classroom | files/install_wmf5.ps1 | PowerShell | apache-2.0 | 1,188 |
[cmdletbinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1
Register-Mock Get-LocalizedString { $OFS = " " ; "$args" }
# Act/Assert.
Assert-Throws {
# Act.
$splat = @{
'vsTestVersion' = 'vsTestVersion'
'testAssembly' = ''
'testFiltercriteria' = 'testFiltercriteria'
'run... | dylan-smith/vso-agent-tasks | Tests-Legacy/L0/VsTestV1/ThrowsIfAssembliesNotProvided.ps1 | PowerShell | mit | 816 |
<#
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
#>
<#
.SYNOPSIS
Update the offer.
.DESCRIPTION
Update the offer.
.PARAMETER Name
Name of an offer.
.PARAMETER MaxSubscriptionsPerAccount
Maximum s... | ClogenyTechnologies/azure-powershell | src/StackAdmin/Azs.Subscriptions.Admin/Module/Azs.Subscriptions.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Set-AzsOffer.ps1 | PowerShell | apache-2.0 | 7,733 |
<#
.SYNOPSIS
Get a list of modules from an Azure Automation account.
.DESCRIPTION
Get the listing of modules in a given Azure Automation account including
details such as module version number, date last modified and size.
.PARAMETER ResourceGroupName
The resource group name where the Automation acco... | jefffanjoy/DemoCode | Scripts/Azure Automation/Get-AutomationModuleDetails.ps1 | PowerShell | mit | 2,352 |
#
# Module manifest for module 'TableDiffTools'
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'TableDiffTools.psm1'
# Version number of this module.
ModuleVersion = '0.0.0.1'
# ID used to uniquely identify this module
GUID = '2f6a55dc-0eb2-4c1c-9bbb-2fe421114695'
# Author... | melvinlee/TableDiffTools | TableDiffTools.psd1 | PowerShell | mit | 2,580 |
#Requires -Version 2.0
# Windows 7 and later is requires.
function Main
{
[CmdletBinding()]
Param
(
[string]
$modulepath = ($env:PSModulePath -split ";" | where {$_ -like ("{0}*" -f [environment]::GetFolderPath("MyDocuments"))}),
[string]
$project = "",
[bool]
... | guitarrapc/WindowsCredentialVault | WindowsCredentialVault/Tools/install.ps1 | PowerShell | mit | 13,022 |
# Shim to properly invoke Bash from "RUN" commands on Windows
$ErrorActionPreference = 'Stop';
$ProgressPreference = 'SilentlyContinue';
$output = Start-Process -FilePath C:\msys64\usr\bin\bash.exe -PassThru -Wait -NoNewWindow -ArgumentList "-c","'$args'"
If($output.Exitcode -ne 0)
{
Throw "bash errored"
} | livepeer/go-livepeer | docker/run.ps1 | PowerShell | mit | 319 |
# requires -Version 4.0
# requires -Modules ActiveDirectory
<#
.NOTES
Created on: 10/4/2019
Created by: Andy Simmons
Organization: St. Luke's Health System
FileName: Copy-ADGroupMember.ps1
.SYNOPSIS
Copies members from one AD security group into another.
.PARAMETER SourceGroup
Group f... | andysimmons/playground | Copy-ADGroupMember.ps1 | PowerShell | mit | 3,538 |
[CmdletBinding()]
param
(
[Parameter()]
[string]
$SharePointCmdletModule = (Join-Path -Path $PSScriptRoot `
-ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" `
-Resolve)
)
$script:DSCModuleName = 'SharePointDsc'
$script:DSCResourceName = 'SPService... | PowerShell/xSharePoint | tests/Unit/SharePointDsc/SharePointDsc.SPService.Tests.ps1 | PowerShell | mit | 13,385 |
Import-Module $PSScriptRoot\..\ci.psm1 -Scope Local
Describe "CI" {
It "invokes a native executable" {
$version = Invoke-Process {
dotnet --version
}
}
It "gets the PrtgAPI version" {
$version = Get-CIVersion
$version.File.ToString() -match "\d+\.\d+\.\d+" | S... | lordmilko/PrtgAPI | build/CI/Tests/CI.Tests.ps1 | PowerShell | mit | 505 |
[CmdletBinding()]
param (
[System.String[]] $Format = 'Html',
[System.String] $Path = '~\Desktop',
[System.Management.Automation.SwitchParameter] $PassThru
)
Import-Module PScribo -Force -Verbose:$false
$example5 = Document -Name 'PScribo Example 5' {
<#
Rather than specifying styling options... | iainbrighton/PScribo | Examples/Example05.ps1 | PowerShell | mit | 1,234 |
function Set-Credential {
[CmdletBinding()]
param(
[Parameter(Mandatory,ParameterSetName='CredentialName')]
[ValidateNotNullOrEmpty()]
[string]
$Name
,
[Parameter(Mandatory,ParameterSetName='CredentialFile')]
[ValidateNotNullOrEmpty()]
[... | nicholasdille/PowerShell | Support/DefaultCredentials.ps1 | PowerShell | mit | 5,211 |
#example 1:
New-AddressList -Name 'All Sales Users' `
-RecipientContainer contoso.com/Sales `
-IncludedRecipients MailboxUsers
#example 2:
New-AddressList -Name MobileUsers `
-RecipientContainer contoso.com `
-RecipientFilter {
HasActiveSyncDevicePartnership -ne $false
}
#example 3:
New-AddressList -Name MobileU... | mikepfeiffer/ex-2010-ps-cookbook | Chapter5/CreatingAddressLists.ps1 | PowerShell | mit | 454 |
#example 1:
Get-MailboxAutoReplyConfiguration dave
#example 2:
Set-MailboxAutoReplyConfiguration dave -AutoReplyState Disabled
#example 3:
Set-MailboxAutoReplyConfiguration dave `
-AutoReplyState Scheduled `
-StartTime 2/11/2013 `
-EndTime 2/17/2013 `
-ExternalMessage "I will be out of the office this week"
#e... | mikepfeiffer/ex-2013-ps-cookbook | Chapter 3/ManagingAutomaticRepliesandOutofOfficeSettingsforaUser.ps1 | PowerShell | mit | 601 |
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
function Add-RegCreateType
{
[CmdletBinding()]
[Alias()]
[OutputType()]
Param()
Write-Verbose -Message 'Adding RegCreate definit... | MSAdministrator/PSRegistry | PSRegistry/Private/Add-RegCreateType.ps1 | PowerShell | mit | 794 |
#
# This script controls the Roslyn build process. This encompasess everything from build, testing to
# publishing of NuGet packages. The intent is to structure it to allow for a simple flow of logic
# between the following phases:
#
# - restore
# - build
# - sign
# - pack
# - test
# - publish
#
# Each of t... | cston/roslyn | build/scripts/build.ps1 | PowerShell | apache-2.0 | 31,494 |
# Tests for Install-Package intellisense
function Test-TabExpansionForInstallPackageShowSuggestionsForPackageId {
# Act
$suggestions = TabExpansion 'Install-Package ' ''
# Assert
Assert-True ($suggestions.Count -eq 30)
}
function Test-TabExpansionForInstallPackageShowSuggestionsForPackage... | grendello/nuget | test/EndToEnd/tests/TabExpansionTest.ps1 | PowerShell | apache-2.0 | 7,436 |
#requires -Version 1.0
#region Info
<#
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2016, Quality Software Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the fol... | jhochwald/NETX | Profile/functions/unique.ps1 | PowerShell | bsd-3-clause | 14,434 |
$commandname = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
BeforeAll {
$createsql = "EXEC master.dbo.sp_addlinkedserver @server ... | SirCaptainMitch/dbatools | tests/Copy-DbaLinkedServer.Tests.ps1 | PowerShell | mit | 2,973 |
function Get-TDSensorHistoryData
{
<#
.SYNOPSIS
Retrieves sensor data history from Telldus Live!
.DESCRIPTION
This command will retrieve the sensor history data of the specified sensor.
.PARAMETER DeviceID
The DeviceID of the sensor which data you want to retrieve.
.PARAMETER ... | DollarUnderscore/powershell-tellstick-module | source/Public/Get-TDSensorHistoryData.ps1 | PowerShell | mit | 3,439 |
function Locate-TestVersionAndVsRoot([string] $Version)
{
if ([string]::IsNullOrWhiteSpace($Version))
{
#Find the latest version
$regPath = "HKLM:\SOFTWARE\Microsoft\DevDiv\vstf\Servicing"
if (-not (Test-Path $regPath))
{
$regPath = "HKLM:\SOFTWARE\Wow6432Node\Micros... | azureautomation/vso-agent-tasks | Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 | PowerShell | mit | 33,536 |
$packageName = 'combofix'
$url = 'http://download.bleepingcomputer.com/sUBs/ComboFix.exe'
$checksum = '78819e1a06dba2ef2d98cc799c5b5d8542c66964'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "ComboFix.exe"
try {
Get-ChocolateyWebFile -... | dtgm/chocolatey-packages | automatic/_output/combofix/15.6.18.1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 646 |
[cmdletbinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1 -Legacy
. $PSScriptRoot\..\..\..\Tasks\PublishSymbols\LegacyIndexHelpers.ps1
$global:tempFileCount = 0
Register-Mock Get-TempFileName { "SomeDrive:\TempDir\TempFile$($global:tempFileCount++ ; $global:tempFileCount).txt" }
Register-Mock ... | jwendl/vso-agent-tasks | Tests/L0/PublishSymbols-Legacy/Add-SourceServerStream.SpeciallyHandlesPdbsWithSpaces.ps1 | PowerShell | mit | 1,478 |
<#
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... | mingzhang888/webcommander | powershell/BrokerRDS/brokerEntitleApplication.ps1 | PowerShell | mit | 3,374 |
Set-AzureSubscription -SubscriptionName "Visual Studio Ultimate with MSDN" -CurrentStorageAccount "herovsduck"
.\New-AzureWebsitewithDB.ps1 -WebSiteName "herovsduck" -Location "East US" -StorageAccountName "herovsduck" -ClientIPAddress "71.164.128.6"
| LearnVisualStudio/HeroVsRobot | PublishScripts/setup.ps1 | PowerShell | mit | 253 |
Describe "Nginx" {
Context "Path" {
It "Nginx" {
$nginxPath = Join-Path (Join-Path "C:\tools\" (Get-Item C:\tools\nginx*).Name) "nginx"
"$nginxPath -v" | Should -ReturnZeroExitCode
}
}
Context "Service" {
$nginxService = Get-Service -Name nginx
$nginx... | mattgwagner/New-Machine | .github-actions/images/win/scripts/Tests/Nginx.Tests.ps1 | PowerShell | mit | 739 |
#Requires -Version 3
#Requires -Module ActiveDirectory, DnsServer
function Get-DnsZonesForAclCheck
{
<#
.SYNOPSIS
Retrieve the subset of DNS zones where scavenging could be enabled.
.EXAMPLE
Get-DnsZonesForAclCheck
#>
[CmdletBinding()]
# setup variables
$DnsServer = (G... | kingsleyck/DnsScavengingPrep | DnsScavengingPrep.psm1 | PowerShell | mit | 8,103 |
<#
.Notes
ChangeLog:
13/09/2016: Modified script to allow to run from TeamCity, added Jekyll build steps and pushed to verbose.
#>
Import-Module AWsPowerShell
$VerbosePreference = 'Continue'
$ErrorAction = 'Stop'
Push-Location
Set-Location $PSScriptRoot
Write-Verbose "Starting Jekyll ... | lukemgriffith/JekyllBlog_Config | DeploySiteToS3.ps1 | PowerShell | mit | 1,075 |
# Copyright (c) 2010 RightScale 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,
# di... | raphael/cookbooks_public_windows | cookbooks/db_sqlserver/powershell_providers/database/backup.ps1 | PowerShell | mit | 4,615 |
Function New-NgCrudServiceExplicitTsToString([string]$entity, [string]$baseUrl, [bool]$create, [bool]$read, [bool]$update, [bool]$delete, [bool]$list, [bool]$filter) {
$entityCapital = (ConvertTo-CapitalCamelCase $entity)
$entityLowerCamel = (ConvertTo-LowerCamelCase $entity)
$entityLowerKebab = (ConvertTo-KebabCas... | brianwoelfel/BoxTurtlePs | BoxTurtlePs/Private/Angular/Service/New-NgCrudServiceExplicitTsToString.ps1 | PowerShell | mit | 3,259 |
function Get-EXRDefaultAppRegistration
{
[CmdletBinding()]
param (
)
Process
{
$File = ($env:APPDATA + "\Exch-Rest\appReg.cfg")
if((Test-Path -Path $File)){
return Import-Clixml -Path $file
}
}
} | gscales/Exch-Rest | functions/Client/Get-EXRDefaultAppRegistration.ps1 | PowerShell | mit | 211 |
$powerShellPaths = @{
"HKLM:\SOFTWARE\Microsoft\PowerShell\*\PowerShellEngine" = "PowerShellVersion";
"HKLM:\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\*" = "SemanticVersion"
}
Write-Verbose "Getting installed powershell versions from: `r`n`t$($powerShellPaths.Keys -join "`r`n`t")"
$installedVe... | mbsj/PowerShell | dot-source/VerifyPowerShell.ps1 | PowerShell | mit | 4,023 |
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
###################################################################... | letsar/RestLess | build/build.ps1 | PowerShell | mit | 6,783 |
Get-EC2ImageByName -Name "Windows_Server-2012-R2_RTM-Korean-64Bit-Base-2016.07.13"
Get-EC2Image | Out-GridView
Get-EC2Image -Filter @{ Name="owner-alias"; Values="amazon"} | Out-GridView
Get-EC2Image -Filter @{ Name="platform"; Values="windows"} | Out-GridView
Get-EC2Image -ImageId "ami-000bc16e" | jiyongseong/AzureCommon | azure_and_aws/vm_and_ec2/getting_images/ec2.ps1 | PowerShell | mit | 312 |
Get-Module WorkdayApi | Remove-Module -Force
Import-Module "$PsScriptRoot\..\WorkdayApi.psd1" -Force
Import-Module "$PsScriptRoot\Invoke-WorkdayRequestHelper.psm1" -Force -DisableNameChecking
Describe Get-WorkdayIntegrationEvent {
InModuleScope WorkdayApi {
# Echo Request
Mock Invoke-WorkdayReque... | treestryder/powershell_module_workdayapi | source/tests/Get-WorkdayIntegrationEvent.Tests.ps1 | PowerShell | mit | 1,033 |
Write-Host "Check nanoserver"
docker run mongo:nano-enterprise mongod.exe -version
| StefanScherer/dockerfiles-windows | mongo/3.4/enterprise/test.ps1 | PowerShell | mit | 83 |
function Set-WFDataGridView
{
<#
.SYNOPSIS
This function helps you edit the datagridview control
.DESCRIPTION
This function helps you edit the datagridview control
.PARAMETER DataGridView
Specifies the DataGridView Control
.PARAMETER AlternativeRowColor
Specifies the color of the alternative row colo... | lazywinadmin/WinFormPS | WinFormPS/Public/Set-WFDataGridView.ps1 | PowerShell | mit | 5,446 |
# AWS CloudFormation Windows HPC Template
#
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/ap... | awslabs/aws-cfn-windows-hpc-template | publish.ps1 | PowerShell | apache-2.0 | 3,734 |
@{
RootModule = 'PowerShellGet-Test-Binary-Module.dll'
ModuleVersion = '1.0.0.3'
CmdletsToExport = '*'
GUID = '95ee4cf1-d508-45a8-9680-203b71453f98'
DotNetFrameworkVersion = '4.5.1'
Author = 'Matthieu Maitre'
Description = 'Example of PowerShellGet Binary Module'
CompanyName = 'None'
... | mmaitre314/PowerShellGet-Test-Binary-Module | Module/PowerShellGet-Test-Binary-Module.psd1 | PowerShell | apache-2.0 | 673 |
$packageName = 'firefox-nightly'
$softwareVersion = '59.0.1.2018011112-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/59.0.1.2018011112/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 817 |
# Copyright 2016 Philipp Serr (episource)
#
# 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... | episource/my-chocolatey | _modules/choco-factory/add-checksum.ps1 | PowerShell | apache-2.0 | 11,657 |
$ErrorActionPreference = "Stop"
function Get-ValueOrGitOrDefault {
Param(
[String]$Value,
[String]$GitConfigKey,
[String]$Default,
[String]$GitCommand = "git"
)
if ([string]::IsNullOrWhitespace($Value)) {
if (-not (Get-Command $GitCommand -ErrorAction SilentlyContinue) -or
... | dbroeglin/Forge | Forge/Get-ValueOrGitOrDefault.ps1 | PowerShell | apache-2.0 | 470 |
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If it's not then please replace this with with your hosting url.
# Direct URL of source PDF file.
$SourceFileUrl = "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/pdf-to-excel/sample.pdf"
# Comma-separ... | bytescout/ByteScout-SDK-SourceCode | Cloud API Server/PDF To Excel API/PowerShell/Convert PDF To XLSX From URL/ConvertPdfToXlsxFromUrl.ps1 | PowerShell | apache-2.0 | 1,418 |
Import-Module poshspec -Verbose:$false -ErrorAction Stop
describe 'Services' {
context 'Critical Services 1' {
service server status { should be running }
service workstation status { should be running }
}
}
describe 'asdf' {
context 'Critical Services 2' {
service eventlog status... | devblackops/watchmen | TestArtifacts/OVFModules/OVF.Example2/Diagnostics/Simple/critical.services.tests.ps1 | PowerShell | apache-2.0 | 403 |
$pkg_name = "health-check-performance-14"
$pkg_origin = "habitat-testing"
$pkg_maintainer = "The Habitat Maintainers <humans@habitat.sh>"
$pkg_version = "0.0.0"
| habitat-sh/habitat | test/fixtures/health-check-performance/health-check-performance-14/x86_64-windows/plan.ps1 | PowerShell | apache-2.0 | 161 |
Function global:Get-AssemblyInfo()
{
param([switch]$Recurse)
if($Recurse){
get-childitem * -Recurse -include *.dll,*.exe | foreach-object { "{0}\{1}`t{2}" -f $_.Directory, $_.Name, [System.Diagnostics.FileVersionInfo]::GetVersionInfo($_).FileVersion }
} else{
get-childitem * -include *.... | iamkarlson/dotfiles | powershell/autorun/get-AssemblyInfo.ps1 | PowerShell | bsd-2-clause | 450 |
# Script.Template 1.0.17052.2
#
# Copyright (C) 2016-2017 github.com/trondr
#
# All rights reserved.
#
# License: New BSD (https://github.com/trondr/Script.Template/blob/master/LICENSE.md)
param ($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8, $arg9)
Set-StrictMode -Version Latest
#########################... | trondr/Script.Template | src/Examples/SetWallPaperWithText/SetWallPaperWithText.ps1 | PowerShell | bsd-3-clause | 4,596 |
<#
.SYNOPSIS
Returns one or more Sitecore user sessions using the specified criteria.
.DESCRIPTION
The Get-Session command returns one or more Sitecore user sessions using the specified criteria.
The Identity parameter specifies the Sitecore user to get. You can specify a user by its l... | ostat/Console | Documentation/Get-Session.ps1 | PowerShell | mit | 2,120 |
Import-Module AU
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"
$releases = 'https://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/'
$padUnderVersion = '1.9.8'
function global:au_BeforeUpdate { Get-RemoteFiles -Purge -NoSuffix -FileNameBase $Latest.PackageName }
function global:au_Sear... | jberezanski/chocolatey-coreteampackages | automatic/universal-usb-installer/update.ps1 | PowerShell | apache-2.0 | 1,134 |
############################################################################################################################################
# Script that allows to do a massive deletion of Office 365 users. The users are read from a CSV file.
# The csv file only needs a column that stores the account principal name ... | CompartiMOSS/SharePoint-PowerShell | SharePoint/Utils/PS_RemoveOffice365Users.ps1 | PowerShell | mit | 2,027 |
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... | openiddict/openiddict-samples | eng/common/performance/performance-setup.ps1 | PowerShell | apache-2.0 | 6,511 |
Describe "Measure-Object" -Tags "CI" {
$testObject = 1,3,4
It "Should be able to be called without error" {
{ Measure-Object | Out-Null } | Should Not Throw
}
It "Should be able to call on piped input" {
{ $testObject | Measure-Object } | Should Not Throw
}
It "Should be able to count the n... | bingbing8/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/Measure-Object.Tests.ps1 | PowerShell | mit | 8,496 |
<#
.DESCRIPTION
This script fails over SQL Always On Availability Group inside a Classic Azure virtual machine
Pre-requisites
The script below assumes that the SQL Availability Group is hosted in a classic Azure VM
and that the name of restored virtual machine in Step-2 is SQLAzureVM-Tes... | neudesic/azure-quickstart-templates | demos/azmgmt-demo/nestedtemplates/scripts/ASR-SQL-FailoverAGClassic.ps1 | PowerShell | mit | 4,349 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/... | zhencui/azure-powershell | src/ServiceManagement/Sql/Commands.SqlDatabase.Test/TestScripts/Database/DeleteDatabase.ps1 | PowerShell | apache-2.0 | 3,323 |
# Psake (https://github.com/psake/psake) build script
FormatTaskName "-------- {0} --------"
Framework 4.0x86
Properties {
# tools
$script:nuget = $psake.build_script_dir + "\..\NuGet\NuGet.exe"
$script:xunit = $psake.build_script_dir + "\..\XUnit\xunit.console.clr4.exe"
$script:xunit_x86 = $psake.build_script_di... | EddieGarmon/Simple.Owin | Build/Psake/build_script.ps1 | PowerShell | mit | 12,990 |
param([switch]$GetModuleStepDetails)
if ($GetModuleStepDetails) { return (@{RunLevel = 1; Critical = $false}) }
Import-Module (Join-Path $ModuleHelpersFolder "Stats.psm1") -ArgumentList $PowerShellConsoleConstants.UserFolders.AppSettingsFolder -Force | paulmarsy/Console | Custom Consoles/PowerShell/ModuleInitialization/3 - Load Default Modules/Stats.ps1 | PowerShell | mit | 251 |
$ErrorActionPreference = "Stop"
if ($env:APPVEYOR -ne "True")
{
Write-Output "$PSCommandPath should only be run in the Appveyor-ci environment."
exit 1
}
#
# Enable TCP/IP connections to SQL Server.
# See https://www.appveyor.com/docs/services-databases/#enabling-tcpip-named-pipes-and-setting-instance-alias
#... | zillow/ctds | appveyor/before_test.ps1 | PowerShell | mit | 1,496 |
Add-Type -AssemblyName System.IO.Compression.FileSystem
$modsPath = "C:\Users\" + [Environment]::UserName + "\OneDrive\Apps\Curse OneDrive Updater Daemon\mods"
$tempPath = "C:\Users\" + [Environment]::UserName + "\OneDrive\Apps\Curse OneDrive Updater Daemon\temp"
$wowPath = "C:\Program Files (x86)\World of Warcraft\I... | phroph/CurseOneDriveUpdater | bin/install_mods.ps1 | PowerShell | mit | 605 |
function Set-VstsProject {
Param(
[string]$Name,
[string]$Description,
[Parameter(Mandatory=$True, Position=0)]
[string]$Instance,
[Parameter(Mandatory=$True,Position = 1,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[string]$Id
)
if(!($Name... | vercellone/PoshVSTS | scripts/Public/VSTS/Project/Set-VstsProject.ps1 | PowerShell | mit | 633 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 3d207c12-4ac1-4341-9c18-930d11d2a129
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/xFailOverCluster/blob/main/LICENSE
.PROJECTURI https://github.c... | PowerShell/xFailOverCluster | source/Examples/Resources/xClusterPreferredOwner/2-xClusterPreferredOwner_RemovePreferredOwnerConfig.ps1 | PowerShell | mit | 1,951 |
# run all the tests.
$testsRun = 0;
$testsFailed = 0;
$folder = "";
dir . *.pre -recurse | % {
if ($_.Directory.Name -ne $folder) {
$folder = $_.Directory.Name;
write-host $folder.replace("_", " ")... -foregroundcolor "white"
}
pre $_.FullName
$testsRun = $testsRun + 1;
$actualFil... | secretGeek/pre | tests/run_tests.ps1 | PowerShell | mit | 1,214 |
$ErrorActionPreference = 'Stop'
Update-SessionEnvironment
Uninstall-VsCodeExtension -extensionId "ms-vscode.PowerShell"
| pascalberger/chocolatey-packages | automatic/vscode-powershell/tools/chocolateyUninstall.ps1 | PowerShell | mit | 122 |
# .ExternalHelp psPAS-help.xml
function Remove-PASOnboardingRule {
[CmdletBinding(SupportsShouldProcess)]
param(
[parameter(
Mandatory = $true,
ValueFromPipelinebyPropertyName = $true
)]
[string]$RuleID
)
BEGIN { }#begin
PROCESS {
#Create URL for request
$URI = "$Script:BaseURI/api/AutomaticOnbo... | pspete/psPAS | psPAS/Functions/OnboardingRules/Remove-PASOnboardingRule.ps1 | PowerShell | mit | 579 |
$packageName = '{{PackageName}}'
$fileType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)
$unPath = 'HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
$unPathWow = 'HKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
try {
if ((Get-ItemProperty $unPath\$packageName)) {
$unString = (Ge... | maharishi/chocolatey-packages | automatic/lmms/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 920 |
<#
This file exists to combine simple user input (Invoke-Vester), simple
user test authoring (*.Vester.ps1), and properly scoped inventory objects
into a single test session that loops through all necessary combinations.
It is called by Invoke-Vester via the Invoke-Pester command.
https://wahlnetwork.github.io/Vester... | haberstrohr/Vester | Vester/Private/Template/VesterTemplate.Tests.ps1 | PowerShell | apache-2.0 | 5,645 |
. .\Utils.ps1
. .\TestUtils.ps1
Describe 'Check-GVM-API-Version' {
Context 'API offline' {
$Script:GVM_AVAILABLE = $true
$Script:GVM_API_NEW_VERSION = $false
Mock Get-GVM-API-Version
Mock Invoke-API-Call { throw 'error' } -parameterFilter { $Path -eq 'app/Version' }
Check... | flofreud/posh-gvm | Utils.Tests.ps1 | PowerShell | apache-2.0 | 34,409 |
function Add-VSOpsWorksStackChefConfiguration {
<#
.SYNOPSIS
Adds an AWS::OpsWorks::Stack.ChefConfiguration resource property to the template. Describes the Chef configuration.
.DESCRIPTION
Adds an AWS::OpsWorks::Stack.ChefConfiguration resource property to the template.
Describes the Chef ... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSOpsWorksStackChefConfiguration.ps1 | PowerShell | apache-2.0 | 3,296 |
function Add-VSCognitoUserPoolInviteMessageTemplate {
<#
.SYNOPSIS
Adds an AWS::Cognito::UserPool.InviteMessageTemplate resource property to the template. The message template to be used for the welcome message to new users.
.DESCRIPTION
Adds an AWS::Cognito::UserPool.InviteMessageTemplate ... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSCognitoUserPoolInviteMessageTemplate.ps1 | PowerShell | apache-2.0 | 4,651 |
function Get-DbaSqlRegistryRoot {
<#
.SYNOPSIS
Uses SQL WMI to find the Registry Root of each SQL Server instance on a computer
.DESCRIPTION
Uses SQL WMI to find the Registry Root of each SQL Server instance on a computer
.PARAMETER ComputerName
The target computer. This is not a SQL Server service, though if you... | SirCaptainMitch/dbatools | functions/Get-DbaSqlRegistryRoot.ps1 | PowerShell | mit | 4,000 |
<# Notes:
Authors: Jason Helmick and Melissa (Missy) Janusko
The bulk of this DC, DHCP, ADCS config is authored by Melissa (Missy) Januszko.
Currently on her public DSC hub located here:
https://github.com/majst32/DSC_public.git
Goal - Create a Domain Controller, Populute with OU's Groups and Users.
One Serve... | jdhitsolutions/PS-AutoLab-Env | Standalone/Archive/Deprecated-POC-DC-Client-Servers-CORE/DC-Client-Servers-Core.psd1 | PowerShell | mit | 4,651 |
$packageName = 'speedfan'
$installerType = 'EXE'
$url = 'http://www.almico.com/speedfan450.exe'
$silentArgs = '/S'
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
try {
Install-ChocolateyPackage $packageName $installer... | dtgm/chocolatey-packages | automatic/_output/speedfan/4.50.20143011/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 499 |
########################################################################
#
# Linux on Hyper-V and Azure Test Code, ver. 1.0.0
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
# Licensed under the Apache License, Version 2.0 (the ""License"");
# you may not use this file except in compliance with the Lice... | bogdancarpusor/lis-test | WS2008R2/lisa/setupscripts/RemoveFloppyDisk.ps1 | PowerShell | apache-2.0 | 3,408 |
function Find-GitHubRepository {
<#
.Synopsis
This function searches for repositories on GitHub.
.Parameter Sort
Optional. Choose the property to sort on, for GitHub repository search results:
- Default: Best match
- Stars: Sort by the number of stars the repositories have
- For... | pcgeek86/PSGitHub | Functions/Public/Find-GitHubRepository.ps1 | PowerShell | mit | 1,966 |
Remove-VisualStudioWorkload `
-PackageName 'visualstudio2022-workload-xamarinbuildtools' `
-Workload 'XamarinBuildTools' `
-VisualStudioYear '2022' `
-Preview $false `
-ApplicableProducts @('BuildTools')
| jberezanski/ChocolateyPackages | visualstudio2022-workload-xamarinbuildtools/tools/ChocolateyUninstall.ps1 | PowerShell | mit | 227 |
# Parameter help description
Param([string]$rg_name,[string]$region = 'westeurope',[string]$firmware_name,[string]$firmware_path)
$firmware_path = Join-Path $firmware_path $firmware_name
#--- create resource group
Write-Host 'create Resource Group'
az group create -n $rg_name -l $region
### Storage
#--- create stora... | totosan/DevOpsIoT | IoTSolution/Deployments/CLI2Deployment.ps1 | PowerShell | mit | 3,975 |
# Represents a person on a chat network
class Person {
[string]$Id
# The identifier for the device or client the person is using
[string]$ClientId
[string]$Nickname
[string]$FirstName
[string]$LastName
[string]$FullName
[string]ToString() {
return "$($this.id):$($this.NickNa... | poshbotio/PoshBot | PoshBot/Classes/Person.ps1 | PowerShell | mit | 555 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.