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 |
|---|---|---|---|---|---|
$ArgumentCompleter = @{
CommandName = @('Get-VaultCredential',
'Set-VaultCredential',
'Remove-VaultCredential'
);
ParameterName = 'Resource';
ScriptBlock = {
<#
.SYNOPSIS
Auto-complete the -Resource parameter value for Vault Powershell Cmdlets.
... | gildas/posh-vault | Posh-Vault.ArgumentCompleters.ps1 | PowerShell | mit | 2,605 |
$packageName = 'windows-tweaker.portable'
$url = 'https://tweaker.blob.core.windows.net/downloads/Windows_Tweaker_5.3.1-Portable.exe'
$checksum = '175bf480c139ce24c3e5578bacd8e5c6eb79f428'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$... | dtgm/chocolatey-packages | automatic/_output/windows-tweaker.portable/5.3.1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 698 |
# ----------------------------------------------------------------------------------
#
# 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/... | hungmai-msft/azure-powershell | src/ResourceManager/Storage/Commands.Management.Storage.Test/ScenarioTests/Common.ps1 | PowerShell | apache-2.0 | 3,957 |
function Get-ProtectedToken
{
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $true)]
[String]
$PlainToken
)
begin
{
$SecureEncryptedToken = Protect-String -String $PlainToken
return, $SecureEncryptedToken
}
}
| gscales/Exch-Rest | internal/functions/oauth/Get-ProtectedToken.ps1 | PowerShell | mit | 241 |
using namespace System.Net.Sockets
function Get-IPv6LinkLocalAddress {
[System.Net.Dns]::GetHostEntry([System.Net.Dns]::GetHostName()).AddressList | Where-Object IsIPv6LinkLocal
}
function Start-Listening {
param (
[ipaddress]$IPAddress = '127.0.0.1',
[uint16]$Port = 11000,
[int]$Backlog = 10
)
[IPEndPoint... | matt9ucci/PSProfiles | PSScripts/Socket/Server.ps1 | PowerShell | mit | 1,477 |
# run restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools
& dotnet restore 2>&1
if ($lastExitCode -ne 0) {
$host.SetShouldExit($lastExitCode)
}
# run tests
& dotnet test .\test\SemanticVersioning.Tests\SemanticVersioning.Tests.csproj -c Release 2>&... | adamreeve/semver.net | build/test.ps1 | PowerShell | mit | 390 |
write-host $('=' * ($HOST.ui.rawui.buffersize.width - 1))
write-host $MyInvocation.MyCommand
write-host $('=' * ($HOST.ui.rawui.buffersize.width - 1))
write-host ''
write-host ''
& {
$VerbosePreference = 'SilentlyContinue'
$DebugPreference = 'SilentlyContinue'
write-host '---------------------------------... | imfrancisd/PowerShell-Assert-Library | verify/AssertFunctions/Verify-Assert-NotFalse-Messages.ps1 | PowerShell | mit | 5,270 |
function Get-DbaXESessionTarget {
<#
.SYNOPSIS
Get a list of Extended Events Session Targets from the specified SQL Server instance(s).
.DESCRIPTION
Retrieves a list of Extended Events Session Targets from the specified SQL Server instance(s).
.PARAMETER SqlInstance... | sqlpadawan/dbatools | functions/Get-DbaXESessionTarget.ps1 | PowerShell | mit | 5,792 |
<#
.SYNOPSIS
Automated integration test for MSFT_xExchImapSettings DSC Resource.
This test module requires use of credentials.
The first run through of the tests will prompt for credentials from the logged on user.
#>
#region HEADER
[System.String] $script:moduleRoot = Split-Path -Parent (S... | IngoGege/xExchange | Tests/Integration/MSFT_xExchImapSettings.Integration.Tests.ps1 | PowerShell | mit | 3,664 |
#requires -v 3
$masterUrl="https://raw.githubusercontent.com/reyerstudio/devstrap/master"
$archiveUrl="https://github.com/reyerstudio/devstrap/archive"
function update($name) {
$json = (new-object net.webclient).DownloadString("$masterUrl/$name.json") | ConvertFrom-JSON
$lastVersion=$json.version
$a = @($last... | reyerstudio/devstrap | tools/update.ps1 | PowerShell | mit | 1,423 |
Function Set-ExcelCellValue
{
<#
.SYNOPSIS
Set the value of an excell cell
.DESCRIPTION
The Set-ExcelCellFormula cmd-let specifies the value of a cell
.PARAMETER CellAddress
Specify the address of the cell
.PARAMETER CellValue
Specify the value of the cell
.EXAMPLE
PS C:\> Set-ExcelCe... | tuanhtrng/EPSM | EPSM/ExcelCell/Set-ExcelCellValue.ps1 | PowerShell | apache-2.0 | 633 |
# Import the helper functions
Import-Module $PSScriptRoot\PSWSIISEndpoint.psm1 -Verbose:$false
Import-Module $PSScriptRoot\UseSecurityBestPractices.psm1 -Verbose:$false
# The Get-TargetResource cmdlet.
function Get-TargetResource
{
[OutputType([Hashtable])]
param
(
# Prefix of the WCF SVC File
... | ferventcoder/puppetlabs-dsc | lib/puppet_x/dsc_resources/xPSDesiredStateConfiguration/DSCResources/MSFT_xDSCWebService/MSFT_xDSCWebService.psm1 | PowerShell | apache-2.0 | 25,708 |
$packageName = 'firefox-nightly'
$softwareVersion = '58.0.1.2017102400-alpha' -Replace "^(\d+)\.(\d+)\.(\d+)[^-]+-([a-z]).*",'$1.$2$4$3'
$softwareName = "Nightly $softwareVersion*"
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)
[array]$key = Get-UninstallReg... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/58.0.1.2017102400/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 817 |
function New-DateColumn
{
<#
.SYNOPSIS
Creates a column object representing an Date datatype.
.DESCRIPTION
Use this function in the `Column` script block for `Add-Table`:
Add-Table 'Members' {
Date 'Birthday'
}
## ALIASES
* Date
.EXAMPLE... | RivetDB/Rivet | Rivet/Functions/Columns/New-DateColumn.ps1 | PowerShell | apache-2.0 | 2,498 |
<#
.SYNOPSIS
Tests redis cache.
#>
function Test-RedisCache
{
# Setup
# resource group should exists
$resourceGroupName = "MyResourceGroup"
$cacheName = "powershelltest"
$location = "North Central US"
# Creating Cache
$cacheCreated = New-AzureRmRedisCache -ResourceGroupName $resourceGroupN... | mayurid/azure-powershell | src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 | PowerShell | apache-2.0 | 11,770 |
ConvertFrom-StringData -StringData @'
GettingQuotaTemplateMessage = Getting FSRM Quota Template "{0}".
QuotaTemplateExistsMessage = FSRM Quota Template "{0}" exists.
QuotaTemplateDoesNotExistMessage = FSRM Quota Template "{0}" does not exist.
SettingQuotaTemplateMessage = Setting FSRM Quota Template... | puppetlabs/puppetlabs-dsc | lib/puppet_x/dsc_resources/FSRMDsc/DSCResources/DSR_FSRMQuotaTemplate/en-US/DSR_FSRMQuotaTemplate.strings.psd1 | PowerShell | apache-2.0 | 1,515 |
$TestDnsConnectionSuffix = [PSObject]@{
InterfaceAlias = 'xNetworkingLBA'
ConnectionSpecificSuffix = 'contoso.com'
RegisterThisConnectionsAddress = $true
UseSuffixWhenRegistering = $false
Ensure = 'Present'
}
configuration MSFT_xDnsConnectionSuffi... | tysonjhayes/xNetworking | Tests/Integration/MSFT_xDNSConnectionSuffix.config.ps1 | PowerShell | mit | 918 |
$ErrorActionPreference = "Stop"
$pyver = python --version
if($pyver -notmatch "3\.[5-9]") {
Write-Warning "Unexpected Python version, expected Python 3.5 or above: $pyver"
}
python -m venv .\venv --copies
& .\venv\Scripts\activate.ps1
python -m pip install --disable-pip-version-check -U pip
cmd /c "pip install -... | dwfreed/mitmproxy | dev.ps1 | PowerShell | mit | 494 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 80d306fa-8bd4-4a8d-9f7a-bf40df95e661
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS
.LICENSEURI https://github.com/dsccommunity/SharePointDsc/blob/master/LICENSE
.PROJECTURI https://github.com/dsccommunity/S... | PowerShell/xSharePoint | SharePointDsc/Examples/Resources/SPSearchCrawlRule/2-CertificateExample.ps1 | PowerShell | mit | 1,463 |
configuration ServiceConfiguration
{
Import-DscResource -ModuleName nPSDesiredStateConfiguration
nService Wecsvc
{
Name = 'Wecsvc'
StartupType = 'Automatic'
State = 'Running'
}
} | nanalakshmanan/DemosSept2015 | Debugging/ServiceConfiguration.ps1 | PowerShell | mit | 235 |
<#
.Synopsis
This Script is the masterscript that takes care of the deploymentscripts. Run this one AFTER New-NBHADForest.ps1.
The Script will Run:
1. New-NBHTSServer
2. New-NBHADStructure
3. Install the Search Service on RDS and Fileserver
4. Copy Repo folder from local server to Fileserver... | Nestil/Generic-Scripts-Public | Nes-serverdeployment/Default deployment/OneScripttoRuleThemAll.ps1 | PowerShell | mit | 8,744 |
Install-Module Pester
Install-Module platyPS | bielawb/EWS | build/Install.ps1 | PowerShell | mit | 44 |
param (
[string]$searchPattern,
[string]$outputDir,
[string]$dotCoverTargetExecutable,
[string]$dotCoverTargetArguments,
[string]$dotCoverFilters,
[string]$dotCoverAttributeFilters,
[string]$dotCoverAdditionalArgs
)
Write-Verbose "Entering script $MyInvocation.MyCommand.Name"
Write-Verbose ... | rodrigoff/dotcover-xunit-analysis-task | dotCoverXunitAnalysis/DotCoverAnalysis.ps1 | PowerShell | mit | 3,280 |
# Lists all AD users who haven't logged in 90 days
$time = (Get-Date).Adddays(-90); Get-ADUser -Filter {LastLogonTimeStamp -lt $time -and enabled -eq $true} -Properties LastLogonTimestamp | Select Name,@{Name="Last Logon";Expression={[DateTime]::FromFileTime($_.LastLogonTimestamp).ToString('yyyy-MM-dd hh:mm:ss')}}
... | dendory/scripts | inactive_users.ps1 | PowerShell | mit | 327 |
<#
.Synopsis
Convert a DateTime to the common object model (JSON)
E.g. {"Date": "2019-04-15T00:00:00+02:00"}
#>
[CmdletBinding()]
[OutputType([string])]
param(
[Parameter(Mandatory,ValueFromPipeline)][datetime]$InputObject
)
process {
# Support piped ($_) and parameter input ($InputObject)
if ($_) {$IN=$... | cawoodm/powowshell | core/adaptors/datetime.out.ps1 | PowerShell | mit | 560 |
<#PSScriptInfo
.VERSION 1.0
.GUID 4ac2de06-ee10-4f15-9ed8-a87d21b48766
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT (c) Microsoft Corporation. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/xActiveDirectory/blob/master/LICENSE
.PROJECTURI https://git... | jaredhaight/WindowsAttackAndDefenseLab | WindowsAttackAndDefenseLab/DSC/DomainConfig/xActiveDirectory/Examples/Resources/xADForestProperties/1-ReplaceForestProperties_Config.ps1 | PowerShell | mit | 1,449 |
function Get-IBCLIStatus
{
[CmdletBinding()]
param(
[Parameter(
ParameterSetName='NewStream',
Mandatory=$true,
Position=0,
HelpMessage='Enter the Hostname or IP Address of an Infoblox appliance.'
)]
[ValidateNotNullOrEmpty()]
... | rmbolger/Posh-IBCLI | Posh-IBCLI/Public/Get-IBCLIStatus.ps1 | PowerShell | mit | 6,143 |
[CmdletBinding()]
param()
if (!(Add-CapabilityFromRegistry -Name 'Xamarin.Android' -Hive 'LocalMachine' -View 'Registry32' -KeyName 'Software\Novell\Mono for Android' -ValueName 'InstalledVersion')) {
$vs15 = Get-VisualStudio_15_0
if ($vs15 -and $vs15.installationPath) {
# End with "\" for consistency ... | kasubram/vsts-agent | src/Misc/layoutbin/powershell/Add-XamarinAndroidCapabilities.ps1 | PowerShell | mit | 1,149 |
$script:SPDscUtilModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\SharePointDsc.Util'
Import-Module -Name $script:SPDscUtilModulePath
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[... | PowerShell/xSharePoint | SharePointDsc/DSCResources/MSFT_SPWebAppWorkflowSettings/MSFT_SPWebAppWorkflowSettings.psm1 | PowerShell | mit | 6,450 |
$packageName = 'bytecoin'
$url = 'https://sourceforge.net/projects/bytecoin-bcn/files/BytecoinWallet/bytecoinwallet-1.1.3.win64.zip/download'
$checksum = '5f2e201e3b9d3b242cc95edf7f930330a0d7ec676561f2fc3a2ce6d8af672215'
$checksumType = 'sha256'
$url64 = "$url"
$checksum64 = "$checksum"
$checksumType64 = "$checksumType... | dtgm/chocolatey-packages | automatic/_output/bytecoin/1.1.3/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 837 |
[CmdletBinding()]
Param
(
[Parameter()]
[string]$BuildConfig ="Debug"
)
$output = Join-Path (Get-Item $PSScriptRoot).Parent.FullName "src\Package\$BuildConfig"
Write-Verbose "The output folder is set to $output"
$resourceManagerPath = Join-Path $output "ResourceManager\AzureResourceManager"
$outputStack = Join... | AzureAutomationTeam/azure-powershell | tools/CleanupBuild.ps1 | PowerShell | apache-2.0 | 4,423 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-94-x64.7z'
$checksum = 'c3b67d28232525754196568661578b11413745ce2566695a8e961db15bbbbd14'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.M... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.94/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 788 |
@{
# Version number of this module.
ModuleVersion = '1.16.0.0'
# ID used to uniquely identify this module
GUID = 'b3239f27-d7d3-4ae6-a5d2-d9a1c97d6ae4'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this mod... | nzspambot/xWebAdministration | xWebAdministration.psd1 | PowerShell | mit | 1,833 |
Import-Module PSScriptAnalyzer
$nounViolationMessage = "The cmdlet 'Verb-Files' uses a plural noun. A singular noun should be used instead."
$verbViolationMessage = "The cmdlet 'Verb-Files' uses an unapproved verb."
$nounViolationName = "PSUseSingularNouns"
$verbViolationName = "PSUseApprovedVerbs"
$directory = Split-P... | korygill/PSScriptAnalyzer | Tests/Rules/UseSingularNounsReservedVerbs.tests.ps1 | PowerShell | mit | 1,771 |
#region HEADER
# Integration Test Config Template Version: 1.2.0
#endregion
$configFile = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'json')
if (Test-Path -Path $configFile)
{
<#
Allows reading the configuration data from a JSON file,
for real testing scenarios outside of the C... | bozho/xSQLServer | tests/Integration/DSC_SqlDatabase.config.ps1 | PowerShell | mit | 7,608 |
# 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 = 'keepass-plugin-keepasshttp'
$typName = 'KeePassHttp.plgx'
$packageSearch = 'KeePass Passwo... | dtgm/chocolatey-packages | automatic/_output/keepass-plugin-keepasshttp/1.8.4.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 2,854 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-4.0-8466-x64.7z'
$checksum = 'dcda55f3d9b12d1ea0e6466bae55bf0e06eb9d48'
$checksumType = 'sha1'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
In... | dtgm/chocolatey-packages | automatic/_output/dolphin/4.0.8466/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 761 |
param($installPath, $toolsPath, $package, $project)
$global:InstallMagicScript++
| mrward/nuget | test/EndToEnd/Packages/ReinstallAllPackagesInAllProjectsInvokeUninstallAndInstallScripts/files/MagicPackage.1.0.0/tools/install.ps1 | PowerShell | apache-2.0 | 82 |
function check-os {
$osname = (Get-WmiObject -Class win32_operatingsystem).caption
$osversion = (Get-WmiObject -Class win32_operatingsystem).version
$osarch = (Get-WmiObject -Class win32_operatingsystem).osarchitecture
if (!($osname -like "Microsoft Windows Server 2012 R2*") -and ($osversion -like "6.3*") -and ($... | happy-jo/Enterprise-WEC | event-channel.ps1 | PowerShell | mit | 2,493 |
<# MIT License
Copyright (c) 2018 fvanroie, NetwiZe.be
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, co... | fvanroie/PS_OPNsense | Public/Legacy/Backup-OPNsenseConfig.ps1 | PowerShell | mit | 5,155 |
param($installPath, $toolsPath, $package, $project)
#recursive search project for a given file name and return its project relative path
function Get-RelativeFilePath
{
param($projectItems, $fileName)
$match = $projectItems | ? { $_.Name -eq $fileName } |
Select -First 1
if ($null -ne $match) {... | Iristyle/AnalysisRules | tools/install.ps1 | PowerShell | mit | 9,977 |
param(
[Int32]$buildNumber=0,
[String]$branchName="localBuild",
[String]$gitCommitHash="unknownHash",
[Switch]$isMainBranch=$False)
cls
# '[p]sake' is the same as 'psake' but $Error is not polluted
remove-module [p]sake
# find psake's path
$psakeModule = (Get-ChildItem (".\Packages\psake*\tools\psake.psm1")).Fu... | BirchyBirch/GatewayCodeGen | build.ps1 | PowerShell | mit | 1,034 |
# Foreach - used often in our scripting for today
$services = Get-Service
ForEach ($service in $services) {
$service.Displayname
}
#For loop
For ($i=0;$i –lt 5;$i++) {
#do something
}
#Another way
1..5 | ForEach-Object -process {
Start calc
}
| kidchenko/playground | powershell-advanced-tools-and-scripting-with-powershell/Mod2/8For_Foreach.ps1 | PowerShell | mit | 257 |
param([string]$buildFolder, [string]$email, [string]$username, [string]$personalAccessToken)
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 "- Clone gh-pages branch...."
cd "$($buildFolder)\..\"
... | kirkchen/EFRepository | tools/pushDocs.ps1 | PowerShell | mit | 1,241 |
Function Get-TfsXamlBuildController
{
[CmdletBinding()]
[OutputType([Microsoft.TeamFoundation.Build.Client.IBuildController])]
Param
(
[Parameter(Position=0)]
[ValidateScript({$_ -is [string] -or $_ -is [Microsoft.TeamFoundation.Build.Client.IBuildController]})]
[ValidateNotNullOrEmpty()]
[Alias("Name")]
... | GersonDias/tfscmdlets | TfsCmdlets/TfsCmdlets/XamlBuild/Get-TfsXamlBuildController.ps1 | PowerShell | mit | 846 |
function Clear-JSMJobAttempt
{
[cmdletbinding(DefaultParameterSetName = 'All')]
param(
<#
[parameter(ParameterSetName = 'SpecificJobAttempt',Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[string]$JobName
,
[parameter(ParameterSetName = 'SpecificJobAttempt'... | exactmike/poshRSJobFlowManager | Functions/Clear-JSMJobAttempt.ps1 | PowerShell | mit | 834 |
Function Enable-EmailReminder {
#this function requires the PSScheduledJob module
[cmdletbinding(SupportsShouldProcess)]
[OutputType("None")]
Param(
[Parameter(Position = 0, HelpMessage = "What time do you want to send your daily email reminder?")]
[ValidateNotNullOrEmpty()]
[da... | jdhitsolutions/MyTasks | functions/emailfunctions.ps1 | PowerShell | mit | 11,490 |
<#
.SYNOPSIS
Get all audit events around the user sessions on the local system.
.DESCRIPTION
This function will show all user setting audit events by parsing the
Security event log:
- 1502: Computer Group Policy Changed
- 1503: User Group Policy Changed
#>
function Get-S... | claudiospizzi/SecurityFever | SecurityFever/Functions/SystemAudit/Get-SystemAuditGroupPolicy.ps1 | PowerShell | mit | 2,122 |
$pkg_name = "health-check-performance-02"
$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-02/x86_64-windows/plan.ps1 | PowerShell | apache-2.0 | 161 |
$packageName = '{{PackageName}}'
$fileType = 'exe'
$silentArgs = '/VERYSILENT'
$validExitCodes = @(0)
$unfile = "${Env:ProgramFiles}\ClipGrab\unins000.exe"
$unfilex86 = "${Env:ProgramFiles(x86)}\ClipGrab\unins000.exe"
if (Test-Path "$unfile") {$file = "$unfile"}
if (Test-Path "$unfilex86") {$file = "$unfilex86"}
if... | ebugusey/chocolatey-coreteampackages | automatic/clipgrab/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 483 |
import-module au
. "$PSScriptRoot\..\..\scripts\Set-DescriptionFromReadme.ps1"
$releases = 'http://download.nomacs.org/versions'
function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*packageName\s*=\s*)('.*')" = "`$1'$($Latest.PackageName)'"
"(?i)(^\s... | octomike/chocolatey-coreteampackages | automatic/nomacs.portable/update.ps1 | PowerShell | apache-2.0 | 1,671 |
# 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/Computer/Test-OSIs32Bit.ps1 | PowerShell | apache-2.0 | 1,248 |
@{
# Version number of this module.
moduleVersion = '2.24.0.0'
# ID used to uniquely identify this module
GUID = '9FECD4F6-8F02-4707-99B3-539E940E9FF5'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement... | puppetlabs/puppetlabs-dsc | lib/puppet_x/dsc_resources/xActiveDirectory/xActiveDirectory.psd1 | PowerShell | apache-2.0 | 2,453 |
$thisDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$dataSvcUtil = 'C:\Program Files (x86)\Microsoft WCF Data Services\5.6\bin\tools\DataSvcUtil.exe'
$serviceFile = "$thisDir\src\chocolatey.package.cleanup\infrastructure.app\webservices\ChocolateySubmittedFeedService.cs"
. $dataSvcUtil /out:"$s... | chocolatey/package-cleanup | GenerateDataServiceFile.ps1 | PowerShell | apache-2.0 | 536 |
function Add-FnGetAtt {
<#
.SYNOPSIS
Adds the intrinsic function "Fn::GetAtt" to a resource property
.DESCRIPTION
The Fn::GetAtt intrinsic function returns the value of an attribute from a resource in the template.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/U... | scrthq/Vaporshell | VaporShell/Public/Intrinsic Functions/Add-FnGetAtt.ps1 | PowerShell | apache-2.0 | 61,001 |
# .NET 5 and above use the configured TLS version in the operating system
# On the Windows Insiders versions, they changed the default to 1.3
# TLS 1.3 seems to cause issues with NuGet, so disable until they fix it and I validate.
New-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS... | dcjulian29/choco-packages | mydevices-devvm/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 807 |
function Start-Negotiate{
# param($s,$SK,$UA="Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
param($s,$SK,$UA="lol")
# make sure the appropriate assemblies are loaded
Add-Type -assembly System.Security;
Add-Type -assembly System.Core;
# try to ignore all errors
... | pierce403/EmpirePanel | data/agent/stager.ps1 | PowerShell | bsd-3-clause | 4,799 |
#Set-StrictMode -version latest
<#
install.Test.ps1
Unit / Integration tests used to validate the install script (install.ps1) for the nuget package.
#>
$modulesPath = (Split-Path -parent $MyInvocation.MyCommand.Path).Replace("\tests", "\modules\")
Import-Module (Join-Path $modulesPath global_config.psm1) -Force
$he... | newrelic/nuget-azure-cloud-services | nuget-test/tests/install.Tests.ps1 | PowerShell | mit | 1,100 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "Tee-Object" -Tags "CI" {
Context "Validate Tee-Object is correctly forking output" {
BeforeAll {
$testfile = Join-Path $TestDrive -ChildPath "testfile.txt"
$testvalue = "ф"
if ($IsWindows... | JamesWTruher/PowerShell-1 | test/powershell/Modules/Microsoft.PowerShell.Utility/Tee-Object.Tests.ps1 | PowerShell | mit | 3,668 |
#
## File: actparams.ps1
## Purpose: Sets the parameters required for the main PowerShell script
#
# This is the user we will connect to the Appliance with.
[string] $acthost = "172.24.16.192"
# This is the user we will connect to the Appliance with.
[string] $actuser = "admin"
# we need to choose only one ... | Actifio/powershell | enable-wflows/actparams.ps1 | PowerShell | mit | 774 |
##############################################################
# PowerShell Manager Script ver 0.2 06/07/2015 #
# Powershell Version 4.0 #
# If this script works it was written by Nathan Kewley #
# If this script does not work is was written by Michael Cho #
# ... | scriptersx/ConnectGroup | Active-Directory/set-adManager.ps1 | PowerShell | mit | 3,880 |
[cmdletbinding()]
Param (
$searchbase = "OU=Corporate,DC=domain,DC=wh",
$dc = "my-dc.domain.local",
$property = "msDS-SourceObjectDN"
)
Import-Module ActiveDirectory
Write-Host "Domain Controller:`t$dc"
Write-Host "Search Base:`t`t$searchbase"
Write-Host "Property:`t`t$property"
$users = Get-ADUser -filte... | abix-/powershell-practical | random scripts/active-directory/Get-ADUserProperty.ps1 | PowerShell | mit | 624 |
##############
## General ##
############
Import-Module .\Modules\Registry.psm1 -Force
Function Write-Log
{
param($Output, [string] $Log = '.\Clue.log')
#// Writes to the log file.
$TimeStamp = "$(Get-Date -format yyyyMMdd-HHmmss)"
if ($Output -eq $null) {Add-content $Log -value ('[' + $Tim... | clinthuffman/Clue | Source/Modules/General.psm1 | PowerShell | mit | 13,948 |
BeforeAll {
Import-Module (Join-Path $PSScriptRoot '..\Posh-IBWAPI\Posh-IBWAPI.psd1')
# setup fake profile export location
$fakeConfigFolder = 'TestDrive:\config'
$fakeConfigFile = 'TestDrive:\config\posh-ibwapi.json'
# setup fake profiles for mocking with
$fakePass1 = ConvertTo-Secu... | rmbolger/Posh-IBWAPI | Tests/Export-IBConfig.Tests.ps1 | PowerShell | mit | 7,651 |
#Wrapper over Get-WinEvent, that will call into a computer if required.
function Get-WinEvent
{
$resultArray = ""
try
{
if ($script:UsingComputerName)
{
if ($script:ThisCredential)
{
$resultArray = Microsoft.PowerShell.Diagnostics\Get-WinEvent @args -C... | PowerShell/xDscDiagnostics | source/Private/Get-WinEvent.ps1 | PowerShell | mit | 1,087 |
#region Initialize Cache
if (-not [Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["backupdevice"]) {
[Sqlcollaborative.Dbatools.TabExpansion.TabExpansionHost]::Cache["backupdevice"] = @{ }
}
#endregion Initialize Cache
#region Tepp Data return
$ScriptBlock = {
param (
$commandName,
... | dsolodow/dbatools | internal/dynamicparams/backupdevice.ps1 | PowerShell | mit | 2,055 |
<#
.SYNOPSIS
Gets an intrusion door.
.DESCRIPTION
Gets all intrusion door or a single intrusion door if an intrusion door id is specified.
If the result returns null, try the parameter "-Verbose" to get more details.
.EXAMPLE
Get-IntrusionDoor
.LINK
https://github.co... | erwindevreugd/PSDataConduIT | PSDataConduIT/Public/Get-IntrusionDoor.ps1 | PowerShell | mit | 4,064 |
#Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'fourdotnet',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerName = $Reso... | 4DotNet/PlanningPoker | src/PlanningPoker/Deployment/Deploy-AzureResourceGroup.ps1 | PowerShell | mit | 6,866 |
# Change to SteamCMD install directory
cd c:\steamcmd
# Update / Install the Server
./steamcmd +runscript scripts\csgo.txt
# Run the server with defaults
cd servers/csgo
./srcds -console -fork -usercon -game csgo +map de_dust2 +sv_lan 1 +rcon_password qj123 | beforan/quakejon-dedicated-servers | csgo.ps1 | PowerShell | mit | 262 |
#Requires -Version 5.0
class WebProxySettings {
[ValidateNotNullOrEmpty()]
[string]$Protocol
[ValidateNotNullOrEmpty()]
[string]$Server
[ValidateNotNullOrEmpty()]
[int]$Port
[bool]$Enabled = $true
WebProxySettings([string] $Protocol, [string]$Server, [int]$Port, [bool]$Enabled = $tr... | gkantsidis/WindowsPowerShell | MyModules/Environment/WebHost.ps1 | PowerShell | apache-2.0 | 1,794 |
If (Test-Path "./.nupkgs") {
Remove-Item "./.nupkgs"
}
| riganti/infrastructure | src/Infrastructure/Tools/deploy/CleanOldGeneratedPackages.ps1 | PowerShell | apache-2.0 | 56 |
<#
Author: Adam Richards
list services on host(s)
Dependencies:
. "$($workingDirectory)\lib\serverUserAndGroupReport.ps1"
. "$($workingDirectory)\lib\getUserCredentials.ps1"
. "$($workingDirectory)\lib\validateUserCredentials.ps1"
. "$($workingDirectory)\lib\createWorkbookFromCSV.ps1"
Syntax:
powershell thi... | abrichards5/ABRPowerShell | Scripts/serverUserAndGroupReport.ps1 | PowerShell | apache-2.0 | 6,483 |
$packageName = 'fontforge'
$packageSearch = "$packageName"
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)
$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$ahkFile = Join-Path $scriptPath "chocolateyUninstall.ahk"
$ahkExe = 'AutoHotKey'... | dtgm/chocolatey-packages | automatic/_output/fontforge/2016.10.04/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 1,288 |
<#
.SYNOPSIS
Warm up SharePoint IIS memory cache by viewing pages from Internet Explorer
.DESCRIPTION
Loads the full page so resources like CSS, JS, and images are included. Please modify lines 75-100
to suit your portal content design (popular URLs, custom pages, etc.)
Comments and suggestions always... | insentia/windows_sharepoint | files/SPBestWarmUp.ps1 | PowerShell | apache-2.0 | 5,963 |
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$adUser,
[Parameter(Mandatory=$True,Position=2)]
[string]$adPass,
[Parameter(Mandatory=$True,Position=3)]
[string]$domain
)
$adPassSecure = $adPass | ConvertTo-SecureString -AsPlainText -Force
$adCredential = New-Object System.Management.Au... | OSEHRA/VistA-in-the-Cloud | ps-scripts/configAD.ps1 | PowerShell | apache-2.0 | 536 |
<#
/api/instances/System::{id}/action/snapshotVolumes
POST Required:
snapshotDefs – a
list of combination
of “volumeId”
volume ID and
“snapshotName”
(optional field)
snapshot name.
For example: {
“snapshotDefs”: [ {“volumeId”:”2dd9132300000000”,
“snapshotName”:”snap1”},
{“volumeId”:”1234"}]}
return:
volumeIdList
snap... | bottkars/SIORestToolkit | SIORestToolkit/actions/SIOSnapshot.psm1 | PowerShell | apache-2.0 | 5,208 |
Set-ExecutionPolicy Bypass -Force
#Current Installer Script Path
[string]$InstallerScriptPath = ($pwd).path
# Auxiliary variables
$minimumRAM = 4294967296
$minimumCPUCores = 2
############
# Hardware #
############
# Validate hardware minimum requirements first
$hardwareSpecs = Get-WmiObject Win32_Comput... | OutSystemsExperts/PlatformOpsToolbox | InstallationValidator/Windows/Pre-requirements_Installator.ps1 | PowerShell | apache-2.0 | 22,774 |
function Add-VSCodeBuildProjectSource {
<#
.SYNOPSIS
Adds an AWS::CodeBuild::Project.Source resource property to the template. Source is a property of the AWS::CodeBuild::Project: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html resource that specifies t... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSCodeBuildProjectSource.ps1 | PowerShell | apache-2.0 | 13,624 |
$directory = Split-Path -Parent $MyInvocation.MyCommand.Path
$testRootDirectory = Split-Path -Parent $directory
Import-Module PSScriptAnalyzer
Import-Module (Join-Path $testRootDirectory "PSScriptAnalyzerTestHelper.psm1")
Describe "Invoke-Formatter Cmdlet" {
Context "When positional parameters are given" {
... | dlwyatt/PSScriptAnalyzer | Tests/Engine/InvokeFormatter.tests.ps1 | PowerShell | mit | 1,683 |
<#
.SYNOPSIS
You can add this to you build script to ensure that psbuild is available before calling
Invoke-MSBuild. If psbuild is not available locally it will be downloaded automatically.
#>
function EnsurePsbuildInstalled{
[cmdletbinding()]
param(
[string]$psbuildInstallUri = 'https://raw... | cmendible/aspnetcore-health | Build.ps1 | PowerShell | apache-2.0 | 2,276 |
$packageName = 'hpusbdisk'
$url = 'http://techshareroom.x10.mx/files/HPUSBDisk.exe'
try {
$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$nodePath = Join-Path $scriptPath 'HPUSBDisk.exe'
Get-ChocolateyWebFile "$packageName" "$nodePath" "$url"
Install-ChocolateyPath "$nodePath" 'Machine... | dtgm/chocolatey-packages | automatic/_output/hpusbdisk/2.2.3.20140614/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 543 |
# Loading config and utils
$scriptLocation = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)
. "$scriptLocation\config.ps1"
. "$scriptLocation\utils.ps1"
if (Test-Path $eventlogPath){
Remove-Item $eventlogPath -recurse -force
}
New-Item -ItemType Directory -Force -Path $eventlogPath
#expo... | costingalan/nova-ci | HyperV/scripts/export-eventlog.ps1 | PowerShell | apache-2.0 | 406 |
$ErrorActionPreference = 'Stop';
$packageName = 'thunderbird'
$uninstalled = $false
[array]$key = Get-UninstallRegistryKey -SoftwareName 'Mozilla Thunderbird*'
if ($key.Count -eq 1) {
$key | ForEach-Object {
$packageArgs = @{
packageName = $packageName
fileType = 'exe'
silentArgs = '-ms'... | jberezanski/chocolatey-coreteampackages | automatic/thunderbird/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 1,048 |
# Remove desktop shortcut
$desktop = $([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::DesktopDirectory))
$link = Join-Path $desktop "Kitematic.lnk"
If (Test-Path $link) {
Remove-Item "$link"
}
# Remove docker tray sym-link
$kitematicDir = Join-Path $env:ProgramFiles "Docker\Kitematic"
$k... | jberezanski/chocolatey-coreteampackages | automatic/docker-kitematic/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 439 |
# This is intended to be used inside Docker containers
git clone --recursive https://github.com/$env:fork/PowerShell.git -b $env:branch
Set-Location PowerShell
Import-Module ./build.psm1
Start-PSBootstrap -Package -NoSudo
Start-PSBuild -Crossgen
Start-PSPackage
| KarolKaczmarek/PowerShell | docker/unstable/bootstrap.ps1 | PowerShell | mit | 263 |
Start-AutoRestCodeGeneration -ResourceProvider "azsadmin/resource-manager/backup" -AutoRestVersion "latest" -SdkRootDirectory $PSScriptRoot
| yaakoviyun/azure-sdk-for-net | src/AzureStack/Admin/BackupAdmin/Backup.Admin/generate.ps1 | PowerShell | mit | 141 |
$packageName = 'superantispyware'
$installerType = 'EXE'
#$url = 'http://cdn.superantispyware.com/SUPERAntiSpyware.exe'
$url = 'http://cdn.superantispyware.com/SUPERAntiSpyware.exe'
$silentArgs = ''
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/lib... | dtgm/chocolatey-packages | automatic/_output/superantispyware/5.6.1032/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 460 |
$packageName = 'PandaFreeAntivirus'
$url = '{{DownloadUrl}}'
$pwd = "$(split-path -parent $MyInvocation.MyCommand.Definition)"
$au3 = Join-Path $pwd 'PandaFreeAntivirus.au3'
try {
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "$packageName"
if (![System.IO.Directory]::Ex... | octomike/chocolatey-coreteampackages | automatic/pandafreeantivirus/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 762 |
Add-Type -AssemblyName System.Security
$nuGetTempDirectory = Join-Path $Env:AGENT_BUILDDIRECTORY "NuGet\"
$tempNuGetConfigPath = Join-Path $nuGetTempDirectory "newNuGet.config"
function SaveTempNuGetConfig
{
[CmdletBinding()]
param(
[xml] $nugetConfig
)
if(-not (Test-Path -Path ($nuGe... | cwoolum/vso-agent-tasks | Tasks/NuGetInstaller/VsoNuGetHelper.ps1 | PowerShell | mit | 5,363 |
Push-Location
Set-Location HKLM:\SYSTEM\CurrentControlSet\Services\luafv
Set-ItemProperty . Start 4
Pop-Location | cchamberlain/cmdio | lib/ps/git-fix.ps1 | PowerShell | mit | 115 |
<#
.SYNOPSIS
Sets the version of all components used when building PrtgAPI
.DESCRIPTION
The Set-PrtgVersion cmdlet updates the version of PrtgAPI. The Set-PrtgVersion cmdlet allows the major, minor, build and revision components to be replaced with any arbitrary version. Typically the Set-PrtgVersion cmdlet is used to... | lordmilko/PrtgAPI | build/PrtgAPI.Build/Functions/Set-PrtgVersion.ps1 | PowerShell | mit | 2,440 |
function Assert-ROWComponent {
<#
.SYNOPSIS
Ensures that the RES ONE Workspace component is installed.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[ValidateSet('Agent','Console','RelayServer')]
[System.String] $Component
)
process {
if (-... | VirtualEngine/RESONEWorkspace | DSCResources/ROWCommon/Src/Assert-ROWComponent.ps1 | PowerShell | mit | 541 |
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build s... | heavenwing/Wyam | build.ps1 | PowerShell | mit | 4,024 |
$message = Get-NewResource message
[System.Web.HttpUtility]::UrlEncode($message) | rightscale/right_link | spec/chef/windows/test_cookbook/powershell_providers/encode/url_encode.ps1 | PowerShell | mit | 80 |
task default -depends Test
task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action {
"Test"
} -PostAction {"Post-Test"}
task Compile -depends Clean {
"Compile"
}
task Clean {
"Clean"
}
| psake/psake | specs/using_PreAndPostActions_should_pass.ps1 | PowerShell | mit | 204 |
#
# File: NuGet.psm1
#
# Author: Akira Sugiura (urasandesu@gmail.com)
#
#
# Copyright (c) 2015 Akira Sugiura
#
# This software is MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), t... | urasandesu/Gall | Nuspec/tools/Urasandesu.Gall/Urasandesu/Gall/NuGet.psm1 | PowerShell | mit | 1,699 |
<#
.SYNOPSIS
To Add all the needed Registry DACLS for Netwrix Windows Server Auditing.
.EXAMPLE
.\add-regauditpolicybatch.ps1 server1.someserver.com
#>
[CmdletBinding()]
param (
[Array]$Servers = $( Read-Host "Server?" )
)
# If you want to create a batch do it here
# Example $servers = get-content servers.txt
# o... | MattLParker/Powershell | Add-RegAuditPolicybatch.ps1 | PowerShell | mit | 1,595 |
<#
.Notes
NAME: Update-SCSMEnumList.ps1
AUTHOR: Stefan Johner
Website: http://blog.jhnr.ch
Twitter: http://twitter.com/JohnerStefan
Version: 1.1
CREATED: 11/04/2015
LASTEDIT:
11/04/2015 1.0
Initial Release
.Synopsis
This script updates Service Manager enums based on a MySQL query.
.Description
The scrip... | sjohner/SCSM-ScriptRepository | scripts/Update-SCSMEnumList.ps1 | PowerShell | mit | 4,908 |
###############################################
# PROXY CONFIG (if needed)
###############################################
#$browser = New-Object System.Net.WebClient
#$browser.Proxy.Credentials =[System.Net.CredentialCache]::DefaultNetworkCredentials
###############################################
# INITIAL CONFIG
#... | zephyrict/powershell_profile | profile.ps1 | PowerShell | apache-2.0 | 9,462 |
$hostname = $env:COMPUTERNAME
$nics = Gwmi Win32_NetworkAdapterConfiguration -Comp $hostname | Where{($_.IPEnabled -eq "TRUE")}
foreach ($nic in $nics) {
foreach ($addr in $nic.IPAddress) {
if($addr -like "10.183.*")
{
Write-Host "This NIC is on RTP LAN"
$lastOctet = $... | Cinegy/powershell | ScalingWithPowershell/ChangeMV-Ouput-Port-With-IP-Octet/ChangeMV-Ouput-Port-With-IP-Octet.ps1 | PowerShell | apache-2.0 | 874 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.