full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-MailboxRestoreRequest.ps1 | New-MailboxRestoreRequest.ps1 | New-MailboxRestoreRequest -SourceDatabase "MDB01 Recovery" -SourceStoreMailbox Administrator -TargetMailbox administrator
|
PowerShellCorpus/Github/Apress_pro-exchange-server-2013-admin/9781430246954_Chapter_07/New-MailboxRestoreRequest-2.ps1 | New-MailboxRestoreRequest-2.ps1 | New-MailboxRestoreRequest -SourceDatabase "MDB01 Recovery" -SourceStoreMailbox Administrator -TargetMailbox administrator -IncludeFolders "DeletedItems/*"
|
PowerShellCorpus/Github/aestasit_groowin-test-box/scripts/win-updates.ps1 | win-updates.ps1 | param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=5,
$MaxUpdatesPerCycle=500)
$Logfile = "C:\Windows\Temp\win-updates.log"
function LogWrite {
Param ([string]$logstring)
$now = Get-Date -format s
Add-Content $Logfile -value "$now $logstring"
Write... |
PowerShellCorpus/Github/aestasit_groowin-test-box/scripts/chocolatey.ps1 | chocolatey.ps1 | iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) |
PowerShellCorpus/Github/aestasit_groowin-test-box/scripts/openssh.ps1 | openssh.ps1 | param (
[switch]$AutoStart = $false
)
Write-Host "AutoStart: $AutoStart"
$is_64bit = [IntPtr]::size -eq 8
# setup openssh
$ssh_download_url = "http://www.mls-software.com/files/setupssh-6.6p1-1.exe"
if ($is_64bit) {
Write-Host "64 bit OS found"
$ssh_download_url = "http://www.mls-software.com/fil... |
PowerShellCorpus/Github/Universum_universum-approve-wsus/main.ps1 | main.ps1 | function Approve-WindowsUpdates {
$upd = Get-WsusUpdate -Approval Unapproved -Status FailedOrNeeded -UpdateServer $srv
if (!$upd) {
ECHO "No updates awaiting approval for staging."
} else {
ECHO "Updates approved for staging:"
ECHO $upd
$upd | Approve-WsusUpdate -Action Install -TargetGro... |
PowerShellCorpus/Github/marcusbianchi_csharpWS/DashboardEngine2.0/packages/Newtonsoft.Json.9.0.1/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindo... |
PowerShellCorpus/Github/marcusbianchi_csharpWS/DashboardEngine2.0/packages/EntityFramework.5.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' }
if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 )))
{
$thisModuleManifest = 'EntityFramework.PS3.psd1'
}
else
{
$thisModuleManifest = 'EntityFramework.psd1'
}
$thisModule... |
PowerShellCorpus/Github/marcusbianchi_csharpWS/DashboardEngine2.0/packages/EntityFramework.5.0.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project)
{
$appDomain = [AppDomain]::CreateDomain(
'EntityFramework.PowerShell',
$null,
(New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' }))
... |
PowerShellCorpus/Github/vbushmanov_azurebootcamp2017/BuildDevAndProdInf/Demo/New-ProductionResource.ps1 | New-ProductionResource.ps1 | # Resource AGENDA
# - Create network, include \front subnet \back subnet
# - Create network security rules for front subnet
# - Create VM - Role: WEB server
#Global variables
$subscription = Get-AzureRmSubscription | Out-GridView -PassThru -Title "Select subscription"
$resourceGroupName = "gabprod"
$location ... |
PowerShellCorpus/Github/vbushmanov_azurebootcamp2017/BuildDevAndProdInf/Demo/New-ResourceFromTemplate.ps1 | New-ResourceFromTemplate.ps1 | <#
.SYNOPSIS
Deploys a template to Azure
.DESCRIPTION
Deploys an Azure Resource Manager template
.PARAMETER subscriptionId
The subscription id where the template will be deployed.
.PARAMETER resourceGroupName
The resource group where the template will be deployed. Can be the name of an... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/jQuery.1.10.2/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/jQuery.1.10.2/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/jQuery.1.10.2/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/EntityFramework.6.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
if (Get-Module | ?{ $_.Name -eq 'EntityFramework' })
{
Remove-Module EntityFramework
}
Import-Module (Join-Path $toolsPath EntityFramework.psd1)
# SIG # Begin signature block
# MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/EntityFramework.6.0.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Initialize-EFConfiguration $project
Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer'
Write-Host
Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/Modernizr.2.6.2/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/Modernizr.2.6.2/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName... |
PowerShellCorpus/Github/SimonLegg_Organiser/Organiser/Organiser/packages/Modernizr.2.6.2/Tools/common.ps1 | common.ps1 | function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProject... |
PowerShellCorpus/Github/tatsu0001_powershell-practice/SimpleTaskManager/CreateTask.ps1 | CreateTask.ps1 | param(
# タスク名
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String] $TaskName,
# 実行コマンド
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String] $RunCommand,
# 実行ユーザ(デフォルト:自ユーザ)
[String] $RunUser = $Env:USERNAME,
# パスワード
[Parameter... |
PowerShellCorpus/Github/tatsu0001_powershell-practice/SimpleTaskManager/ViewTask.ps1 | ViewTask.ps1 |
param([String] $TaskName = $null,
[Switch] $GridView,
[String] $Csv = $null)
$ErrorActionPreference = "Stop"
function Get-TaskList(
[String] $TaskName = $null) {
$query="schtasks.exe /Query /FO CSV /V "
[Object[]] $taskList = (Invoke-Expression "& $query" | ConvertFrom-Csv | ? { -... |
PowerShellCorpus/Github/tatsu0001_powershell-practice/SimpleProcessViewer/ViewProcess.ps1 | ViewProcess.ps1 |
param([String] $CommandPattern = $null,
[Switch] $GridView,
[String] $Csv = $null)
$ErrorActionPreference = "Stop"
function Get-ProcessList(
[String] $CommandPattern = $null) {
# 出力対象は
# - プロセス名
# - 親プロセスID
# - プロセスID
# - 実行開始日時
# - コマンドライン
# - 概要
# の... |
PowerShellCorpus/Github/Strelik_powershell/DSC_Configuration_Example.ps1 | DSC_Configuration_Example.ps1 | Configuration MyWebConfig
{
# A Configuration block can have zero or more Node blocks
Node "Server001"
{
# Next, specify one or more resource blocks
# WindowsFeature is one of the built-in resources you can use in a Node block
# This example ensures the Web Server (IIS) role is insta... |
PowerShellCorpus/Github/Strelik_powershell/Build-StorageVMs.ps1 | Build-StorageVMs.ps1 |
#Script to create a handful of identical storage-oriented VirtualBox VMS automatically with multiple hard-drives attached for use in a cluster scenario.
#IE Ceph, Replication Nodes, Shared Storage ETC
#Just call the script and pass in the parameters.
function Build-VMs ()
{
[CMDletBinding()]
Param... |
PowerShellCorpus/Github/Strelik_powershell/mailalert_anon.ps1 | mailalert_anon.ps1 |
#author The Strelik
#Summary: Email notification script that you can run via task scheduler to notifiy you about services, login attempts etc.
#######################################################
#Global Variables
######################################################
#Functions
#You... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Private/Get-ADSIObject.ps1 | Get-ADSIObject.ps1 | function Get-ADSIObject {
<#
.SYNOPSIS
Get AD object (user, group, etc.) via ADSI.
.DESCRIPTION
Get AD object (user, group, etc.) via ADSI.
Invoke a specify an LDAP Query, or search based on samaccountname and/or objectcategory
.FUNCTIONALITY
Active Directory
... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Private/Get-ADObjectClass.ps1 | Get-ADObjectClass.ps1 | function Get-ADObjectClass {
[cmdletbinding()]
param(
$sAMAccountName,
$IncludeType = $True
)
if($IncludeType)
{
$Type = ( Get-ADSIObject $sAMAccountName -Property objectClass ).objectClass
if($Type.count -gt 0)
{
switch ($Type[-1])
... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Private/Get-PropertyOrder.ps1 | Get-PropertyOrder.ps1 | #function to extract properties
Function Get-PropertyOrder {
<#
.SYNOPSIS
Gets property order for specified object
.DESCRIPTION
Gets property order for specified object
.PARAMETER InputObject
A single object to convert to an array of property value pairs.
.PARA... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Private/Expand-Account.ps1 | Expand-Account.ps1 | function Expand-Account {
[cmdletbinding()]
param(
$Identity,
$Type,
[switch]$Recurse,
[switch]$Expand
)
if($Type -eq 'Group' -and $Expand)
{
$params = @{
Identity = $Identity
}
if($Recurse)
{
$par... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Private/powershell-yaml/Load-Assemblies.ps1 | Load-Assemblies.ps1 | # Copyright 2016 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Public/Get-ADDynamicGroup.ps1 | Get-ADDynamicGroup.ps1 | Function Get-ADDynamicGroup {
<#
.SYNOPSIS
Parse yaml describing dynamic security groups
.DESCRIPTION
Parse yaml describing dynamic security groups
This parses the yaml without hitting Active Directory
.FUNCTIONALITY
Active Directory
.PARAMETER InputObject
... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Public/Invoke-ADGrouper.ps1 | Invoke-ADGrouper.ps1 | Function Invoke-ADGrouper {
<#
.SYNOPSIS
Adjust AD group membership based on yaml config files
.DESCRIPTION
Adjust AD group membership based on yaml config files
YAML schema:
'Target Group': # Target security group we are populating
Purge: ... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/ADGrouper/Public/Expand-ADDynamicGroup.ps1 | Expand-ADDynamicGroup.ps1 | Function Expand-ADDynamicGroup {
<#
.SYNOPSIS
Expand dynamic security group definition to describe actions to take
.DESCRIPTION
Expand dynamic security group definition to describe actions to take
Takes the output of Get-ADDynamicGroup and expands this into an array of actions wi... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/Build/psake.ps1 | psake.ps1 | # PSake makes variables declared here available in other scriptblocks
# Init some things
Properties {
# Find the build folder based on build system
$ProjectRoot = $ENV:BHProjectPath
if(-not $ProjectRoot)
{
$ProjectRoot = Resolve-Path "$PSScriptRoot\.."
}
$T... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/Build/deploy.psdeploy.ps1 | deploy.psdeploy.ps1 | # Generic module deployment.
#
# ASSUMPTIONS:
#
# * folder structure either like:
#
# - RepoFolder
# - This PSDeploy file
# - ModuleName
# - ModuleName.psd1
#
# OR the less preferable:
# - RepoFolder
# - RepoFolder.psd1
#
# * Nuget key in $ENV:NugetApiKey
#
# * Set-BuildEnvironm... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/Build/Start-Build.ps1 | Start-Build.ps1 | param(
$Task = 'Default'
)
# dependencies
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
if(-not (Get-Module -ListAvailable PSDepend))
{
& (Resolve-Path "$PSScriptRoot\helpers\Install-PSDepend.ps1")
}
Import-Module PSDepend
$null = Invoke-PSDepend -Path "$PSScriptRoot\build.requirements.... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/Build/helpers/Install-PSDepend.ps1 | Install-PSDepend.ps1 | <#
.SYNOPSIS
Bootstrap PSDepend
.DESCRIPTION
Bootstrap PSDepend
Why? No reliance on PowerShellGallery
* Downloads nuget to your ~\ home directory
* Creates $Path (and full path to it)
* Downloads module to $Path\PSDepend
* Moves ... |
PowerShellCorpus/Github/RamblingCookieMonster_ADGrouper/Tests/ADGrouper.Tests.ps1 | ADGrouper.Tests.ps1 | $PSVersion = $PSVersionTable.PSVersion.Major
if(-not $ENV:BHProjectPath)
{
Set-BuildEnvironment -Path $PSScriptRoot\..
}
Remove-Module $ENV:BHProjectName -ErrorAction SilentlyContinue
Import-Module (Join-Path $ENV:BHProjectPath $ENV:BHProjectName) -Force
# Verbose output for non-master builds on appveyor
... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Add-AppxPackageExt.ps1 | Add-AppxPackageExt.ps1 | <#
.SYNOPSIS
Install Appx packages.
.DESCRIPTION
A wrapper for Add-AppxPackage, this script additionally supports a Force
switch that will install the package even when a package with the same
package full name is already installed or if the package to install has an
untrusted signature. Add... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Launch-AppxPackageBackgroundTask.ps1 | Launch-AppxPackageBackgroundTask.ps1 | <#
.SYNOPSIS
Launch an Appx package's registered background task.
.DESCRIPTION
Given a background task id, launch the corresponding registered background
task.
.PARAMETER BackgroundTaskId
The GUID of the registered background task to launch. This may be obtained by
examining the BackgroundTa... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Suspend-AppxPackage.ps1 | Suspend-AppxPackage.ps1 | <#
.SYNOPSIS
Suspend all running processes for a particular Appx package.
.DESCRIPTION
Suspend all running processes for a particular Appx package.
.PARAMETER PackageFullNames
The list of PackageFullNames of the Appx package's the processes of which
should be acted upon. This is either a string o... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Start.ps1 | Start.ps1 | $ErrorActionPreference = "Stop"
$cwd = $args[0]
$guid = $args[1]
$appxmanifest = $args[2]
Write-Host $guid
cd $cwd
$installed = .\AppxUtilities\Get-AppxPackageExt.ps1 $guid
if ($installed) { Remove-AppxPackage $installed.PackageFullName }
$result = .\AppxUtilities\Add-AppxPackageExt.ps1 $appxmanifest
$pfn = ... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Debug-AppxPackage.ps1 | Debug-AppxPackage.ps1 | <#
.SYNOPSIS
Debug appx packages.
.DESCRIPTION
A wrapper for plmdebug.exe, this script makes it easy to use plmdebug.exe
in PowerShell with other AppxPackage commands. Returns the
Get-AppxPackageExt results of the packages to which this command applied.
.PARAMETER PackageFullNames
This para... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/StartLh.ps1 | StartLh.ps1 | $ErrorActionPreference = "Stop"
$cwd = $args[0]
$guid = $args[1]
$appxmanifest = $args[2]
Write-Host $guid
cd $cwd
$installed = .\AppxUtilities\Get-AppxPackageExt.ps1 $guid
if ($installed) { Remove-AppxPackage $installed.PackageFullName }
$result = .\AppxUtilities\Add-AppxPackageExt.ps1 $appxmanifest
$pfn = ... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Get-ProcessAppxPackage.ps1 | Get-ProcessAppxPackage.ps1 | <#
.SYNOPSIS
Get Appx package info for running processes.
.DESCRIPTION
A wrapper for Get-Process, this script provides information about the
running processes package identity and package execution state.
.PARAMETER ProcessFilter
Filter the output using this to match either process ID, proce... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Get-AppxPackageExt.ps1 | Get-AppxPackageExt.ps1 | <#
.SYNOPSIS
Get installed Appx package information.
.DESCRIPTION
A wrapper for Get-AppxPackage, this script provides additional info beyond
Get-AppxPackage's including:
- DisplayName
- Manifest parsed as XML
- InstallLocation as file item
- Application IDs
- Registered ba... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Launch-AppxPackage.ps1 | Launch-AppxPackage.ps1 | <#
.SYNOPSIS
Launch an installed Appx package's application.
.DESCRIPTION
Given an AppxPackage or PackageFamilyName and ApplicationId Launch-AppxPackage
launches the application and provides as output the Get-ProcessAppxPackage
result of the launched process.
.PARAMETER PackageFamilyName
The... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Get-AppxPackageFile.ps1 | Get-AppxPackageFile.ps1 | <#
.SYNOPSIS
Get Appx package info from an Appx package file.
.DESCRIPTION
Given an Appx package file, Get-AppxPackageFile extracts the manifest from
the file (using ExtractFromAppx.exe) and outputs the results of
Get-AppxPackageExt filtered to packages with the same name as that in the
mani... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Resume-AppxPackage.ps1 | Resume-AppxPackage.ps1 | <#
.SYNOPSIS
Resume all suspended processes for a particular Appx package.
.DESCRIPTION
Resume all suspended processes for a particular Appx package.
.PARAMETER PackageFullNames
The list of PackageFullNames of the Appx package's the processes of which
should be acted upon. This is either a string... |
PowerShellCorpus/Github/MicrosoftEdge_hwa/AppxUtilities/Terminate-AppxPackage.ps1 | Terminate-AppxPackage.ps1 | <#
.SYNOPSIS
Terminate all processes for a particular Appx package.
.DESCRIPTION
Terminate all processes for a particular Appx package.
.PARAMETER PackageFullNames
The list of PackageFullNames of the Appx package's the processes of which
should be acted upon. This is either a string or the result... |
PowerShellCorpus/Github/saldana_CrazyTesting1.fr-fr/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
# Main
$errorActionPreference = 'Stop'
# Step-1: Download buildcore script to local
echo "download build core script to local with source u... |
PowerShellCorpus/Github/hezymal_quick-ps/helpers/get-config.ps1 | get-config.ps1 | param($key);
$HELPERS_PATH = split-path -parent $MyInvocation.MyCommand.Definition;
$CONFIG_PATH = "$HELPERS_PATH\..\etc\config.ini";
foreach ($line in Get-Content $CONFIG_PATH) {
if ($line.indexOf($key) -ne -1) {
$index = $line.indexOf("=");
if ($index -ne -1) {
return $line.substring($index + 1, $l... |
PowerShellCorpus/Github/hezymal_quick-ps/bin/qnote.ps1 | qnote.ps1 | # run notepad
param($path);
$BIN_PATH = split-path -parent $MyInvocation.MyCommand.Definition;
$HELPERS_PATH = "$BIN_PATH\..\helpers";
$notepadPath = (& "$HELPERS_PATH\get-config.ps1" "npp");
start-process $notepadPath -argumentList $path;
|
PowerShellCorpus/Github/hezymal_quick-ps/bin/qset.ps1 | qset.ps1 | # set environment
$BIN_PATH = split-path -parent $MyInvocation.MyCommand.Definition;
if ($env:path.indexOf($BIN_PATH) -eq -1) {
$env:path += ";$BIN_PATH";
write-host "quick-ps: set environment!";
}
else {
write-host "quick-ps: environment used!";
}
|
PowerShellCorpus/Github/IvanBoyko_vsts-regex-replace/Tasks/RegexReplace/RegexReplace.ps1 | RegexReplace.ps1 | #
# Script replaces content in files based on regular expression
#
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[string] $FileMask,
[Parameter(Mandatory=$True)]
[string] $Regex,
[Parameter(Mandatory=$False)]
[string] $Replacement
)
#
# Constants
#
$errorActionPreference = "Stop"
... |
PowerShellCorpus/Github/segilbert_nuget.packages/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'ncrunch.vs2012'
#$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{421F9DC0-5A07-4F05-91BD-4801714EE08C}").UninstallString;
$file = '{421F9DC0-5A07-4F05-91BD-4801714EE08C}'
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/visualsvn/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 |
$packageName = 'visualsvn'
$installerType = 'MSI'
$url = 'http://www.visualsvn.com/files/VisualSVN-4.0.9.msi'
$url64 = $url
$silentArgs = '/quiet'
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes |
PowerShellCorpus/Github/segilbert_nuget.packages/visualsvn/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'visualsvn'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CE3EAFB7-3A12-4214-944E-A6256633AB5B}").UninstallString;
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/frozenbytes.repos/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | #Install-VirtualPackage 'frozenbytes.repos.tool' 'frozenbytes.repos.app' |
PowerShellCorpus/Github/segilbert_nuget.packages/ncrunch.vs2010/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | $packageName = 'ncrunch.vs2010'
$installerType = 'MSI'
$url = 'http://downloads.ncrunch.net/NCrunch_VS2010_2.10.0.4.msi'
$url64 = $url
$silentArgs = '/quiet'
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
|
PowerShellCorpus/Github/segilbert_nuget.packages/ncrunch.vs2010/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'ncrunch.vs2010'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{421F9DC0-5A07-4F05-91BD-4801714EE08C}").UninstallString;
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/frozenbytes.dev.essentials/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | #Install-VirtualPackage 'frozenbytes.dev.essentials.tool' 'frozenbytes.dev.essentials.app' |
PowerShellCorpus/Github/segilbert_nuget.packages/boxstarter/_templates/baselineDev.ps1 | baselineDev.ps1 | # Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFo... |
PowerShellCorpus/Github/segilbert_nuget.packages/boxstarter/_packages/frozenbytes.baseline.dev.vs/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | try {
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
... |
PowerShellCorpus/Github/segilbert_nuget.packages/boxstarter/_packages/frozenbytes.baseline.dev.sdks/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | try {
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
... |
PowerShellCorpus/Github/segilbert_nuget.packages/boxstarter/_packages/frozenbytes.baseline.dev.core/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | try {
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
... |
PowerShellCorpus/Github/segilbert_nuget.packages/boxstarter/_packages/frozenbytes.baseline.dev/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | try {
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
... |
PowerShellCorpus/Github/segilbert_nuget.packages/boxstarter/_packages/frozenbytes.baseline.dev.tools/tools/ChocolateyInstall.ps1 | ChocolateyInstall.ps1 | try {
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
... |
PowerShellCorpus/Github/segilbert_nuget.packages/mightymoose/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | $packageName = 'mightmoose'
$installerType = 'EXE'
$url = 'http://continuoustests.com/ContinuousTests-v1.0.47.exe'
$url64 = $url
$silentArgs = '/SILENT'
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
|
PowerShellCorpus/Github/segilbert_nuget.packages/mightymoose/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'mightymoose'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{DE3A8FE7-5918-471A-BF59-84C2C3328CCF}_is1").UninstallString
Uninstall-ChocolateyPackage $package 'EXE' -file $file |
PowerShellCorpus/Github/segilbert_nuget.packages/Silverlight3SDK/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 |
$packageName = 'Silverlight3SDK'
$installerType = 'EXE'
$url = 'http://download.microsoft.com/download/F/5/1/F516C774-3BD1-40E0-BB51-2CDC9FD8D63A/silverlight_sdk.exe'
$silentArgs = '/quiet'
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url"
|
PowerShellCorpus/Github/segilbert_nuget.packages/Silverlight3SDK/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 |
$packageName = 'Silverlight3SDK'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2012098D-EEE9-4769-8DD3-B038050854D4}").UninstallString;
Uninstall-ChocolateyPackage $package 'EXE' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/Silverlight4SDK/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 |
$packageName = 'Silverlight4SDK'
$installerType = 'EXE'
$url = 'http://download.microsoft.com/download/F/2/C/F2CFFB78-03CF-4749-A6AE-EF60FB6FB14E/sdk/silverlight_sdk.exe'
$silentArgs = '/quiet'
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url"
|
PowerShellCorpus/Github/segilbert_nuget.packages/Silverlight4SDK/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 |
$packageName = 'Silverlight4SDK'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{189AEA94-DAFB-487A-8CEE-F9D3DDE0A748}").UninstallString;
Uninstall-ChocolateyPackage $package 'EXE' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/frozenbytes.vs2010.extensions/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | #NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one
$packageName = 'frozenbytes.vs2010.extensions' # arbitrary name for the package, used in messages
$installerType = 'EXE_OR_MSI' #only one of these two: exe or msi
$url = 'URL_HERE' # download url
$url64 = $url #... |
PowerShellCorpus/Github/segilbert_nuget.packages/datastax.community/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 |
$packageName = 'datastax.community'
$installerType = 'MSI'
$url = 'http://downloads.datastax.com/community/datastax-community-32bit_2.1.0.msi'
$url64 = 'http://downloads.datastax.com/community/datastax-community-64bit_2.1.0.msi'
$silentArgs = '/quiet'
$validExitCodes = @(0)
Install-ChocolateyPackage "$p... |
PowerShellCorpus/Github/segilbert_nuget.packages/datastax.community/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'datastax.community'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{147BC00A-5C98-421E-816E-7C51E924B5E0}").UninstallString;
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/frozenbytes.extras/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | #Install-VirtualPackage 'frozenbytes.extras.tool' 'frozenbytes.extras.app' |
PowerShellCorpus/Github/segilbert_nuget.packages/ncrunch.vs2013/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | $packageName = 'ncrunch.vs2013'
$installerType = 'MSI'
$url = 'http://downloads.ncrunch.net/NCrunch_VS2013_2.10.0.4.msi'
$url64 = $url
$silentArgs = '/quiet'
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
|
PowerShellCorpus/Github/segilbert_nuget.packages/ncrunch.vs2013/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'ncrunch.vs2013'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F6C17912-1317-485D-A2B6-00A5BE7F00A8}").UninstallString;
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/visualsvnserver/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 |
$packageName = 'visualsvnserver'
$installerType = 'MSI'
$url = 'http://www.visualsvn.com/files/VisualSVN-Server-3.0.0-win32.msi'
$url64 = 'http://www.visualsvn.com/files/VisualSVN-Server-3.0.0-x64.msi'
$silentArgs = ''
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentAr... |
PowerShellCorpus/Github/segilbert_nuget.packages/visualsvnserver/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $packageName = 'visualsvnserver'
$installerType = 'MSI'
$silentArgs = ''
$file = '{421F9DC0-5A07-4F05-91BD-4801714EE08C}'
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/ncrunch.vs2012/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | $packageName = 'ncrunch.vs2012'
$installerType = 'MSI'
$url = 'http://downloads.ncrunch.net/NCrunch_VS2012_2.10.0.4.msi'
$url64 = $url
$silentArgs = '/quiet'
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
|
PowerShellCorpus/Github/segilbert_nuget.packages/ncrunch.vs2012/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | $package = 'ncrunch.vs2012'
$file = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5A1897E2-83E0-4C6C-80F0-85CE6E6D9305}").UninstallString;
Uninstall-ChocolateyPackage $package 'MSI' -file $file
|
PowerShellCorpus/Github/segilbert_nuget.packages/frozenbytes.vs2012.extensions/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | $packageName = 'forzenbytes.vs2012.extensions'
# Special Thanks to Alan Stevens for this powershell code
#
function Get-Batchfile ($file) {
$cmd = "`"$file`" & set"
cmd /c $cmd | Foreach-Object {
$p, $v = $_.split('=')
Set-Item -path env:$p -value $v
}
}
function VsVars32()
{
... |
PowerShellCorpus/Github/segilbert_nuget.packages/frozenbytes.essentials/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | #Install-VirtualPackage 'frozenbytes.essentials.tool' 'frozenbytes.essentials.app' |
PowerShellCorpus/Github/vijayjt_AzureHDInsight/Set-xAzureRmHDInsightClusterSize.ps1 | Set-xAzureRmHDInsightClusterSize.ps1 | <#
.SYNOPSIS
This script is used to scale HDInsight clusters out and in via Azure Automation or via a Scheduled Task running on a Windows server.
.DESCRIPTION
This script can be used to scale a cluster by adding or removing worker nodes. The script should be executed from Azure Automation on a sch... |
PowerShellCorpus/Github/spaghettidba_DBA-Scripts/Replay/WorkloadReplay/Replay.ps1 | Replay.ps1 | #
# Script.ps1
#
Import-Module $PSScriptRoot\..\WorkloadUtils\WorkloadUtils.psm1
$VerbosePreference = "Continue"
#$ErrorActionPreference = "Inquire"
Invoke-WorkloadCapture -ServerName "SQLCLP01" `
-ServerOutputPath "D:\temp\capture" `
-OutputPath "C:\temp\results" `
-Capture "CAPTURE" `
-... |
PowerShellCorpus/Github/sharon-hadar-leverate_first/painter/packages/EntityFramework.6.1.3/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
if (Get-Module | ?{ $_.Name -eq 'EntityFramework' })
{
Remove-Module EntityFramework
}
Import-Module (Join-Path $toolsPath EntityFramework.psd1)
# SIG # Begin signature block
# MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/sharon-hadar-leverate_first/painter/packages/EntityFramework.6.1.3/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Initialize-EFConfiguration $project
Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer'
Write-Host
Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma... |
PowerShellCorpus/Github/ryanlangley4_PS-malwaredomains/hostfile_generator.ps1 | hostfile_generator.ps1 | $host_file_path = "C:\windows\system32\drivers\etc\hosts_tmp"
$final_loc = "C:\windows\system32\drivers\etc\hosts"
$tmp_file_holder = ".\current_list.bk"
$reroute = "127.0.0.1"
$Host_File_header = "# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#... |
PowerShellCorpus/Github/ryanlangley4_PS-malwaredomains/malware_domain_rollbackns.ps1 | malware_domain_rollbackns.ps1 | $rollback_path = "C:\scripts\current_roll_back.list"
$domain_content = get-content $rollback_path
$zone_list = get-dnsserverzone | where {$_.IsDsIntegrated -eq $false} | select -expandproperty Zonename
foreach($line in $domain_content) {
if($zone_list -contains $line) {
Remove-DnsServerZone "$line" -Force
}
... |
PowerShellCorpus/Github/ryanlangley4_PS-malwaredomains/malware_domain_addns.ps1 | malware_domain_addns.ps1 | $log_path = "C:\scripts\logs.txt"
$rollback_path = "C:\scripts\"
$current_rollback_list_name = "current_roll_back.list"
$current_rollback = $rollback_path + $current_rollback_list_name
$rollback_date = get-date -format "M_dd_yyyy"
$rollback_backup_file = $rollback_path + "rollback_" + $rollback_date + ".list"
$t... |
PowerShellCorpus/Github/rdtechie_Library/01-Files/00-General/01-Snippets/Snippet-Custom-Object-Splatting.ps1 | Snippet-Custom-Object-Splatting.ps1 | <#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.120
Created on: 2016-05-01 3:04 AM
Created by: Richard Diphoorn
Organization:
Filename: Snippet-Custom-Object-Splatting
=========... |
PowerShellCorpus/Github/rdtechie_Library/01-Files/00-General/03-Pester/00-Sandbox/HelloWorldExample/Get-HelloWorld.Tests.ps1 | Get-HelloWorld.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "Get-HelloWorld" {
It "outputs 'Hello world!'" {
Get-HelloWorld | Should Be 'Hello world!'
}
}
|
PowerShellCorpus/Github/rdtechie_Library/01-Files/00-General/03-Pester/00-Sandbox/HelloWorldExample/Get-HelloWorld.ps1 | Get-HelloWorld.ps1 | function Get-HelloWorld {
Write-Output -InputObject 'Hello World!'
}
|
PowerShellCorpus/Github/rdtechie_Library/01-Files/02-VMware/01-Inventory/Function-Get-VMwareVMThinProvisionedVMDK.ps1 | Function-Get-VMwareVMThinProvisionedVMDK.ps1 | function Get-VMwareVMThinProvisionedVMDK {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $true)]
[System.String[]]$VMname = '*'
)
begin {
try {
}
catch {
}
}
process {
try {
$vms = Get-VM $VMname
}
catch {
$_
}
try {
ForEach ($vm in $vms) {
... |
PowerShellCorpus/Github/rdtechie_Library/01-Files/02-VMware/01-Inventory/Function-Get-VMwareVCPUtoThreadRatio.ps1 | Function-Get-VMwareVCPUtoThreadRatio.ps1 | function Get-VMwareVCPUtoThreadRatio {
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $false)]
[System.String]$Hosts = '*'
)
begin {
try {
}
catch {
}
}
process {
try {
$vmHosts = Get-VMHost $vmHosts
$vms = Get-VM
}
catch {
$_
}
try {
ForE... |
PowerShellCorpus/Github/rdtechie_Library/01-Files/01-Microsoft/02-Exchange/04-2016/Configure-NormalizedEmailAddressPolicy.ps1 | Configure-NormalizedEmailAddressPolicy.ps1 | <#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.120
Created on: 2016-05-01 2:20 AM
Created by: Richard Diphoorn
Twitter: https://twitter.com/rdtechie
Organization: Platani Nederland B.... |
PowerShellCorpus/Github/dance2die_MyAnimeListSharp/Project.MyAnimeList/Project.MyAnimeList.Demo/_CreateNewNuGetPackage/Config.ps1 | Config.ps1 | #==========================================================
# Edit the variable values below to configure how your .nupkg file is packed (i.e. created) and pushed (i.e. uploaded) to the NuGet gallery.
#
# If you have modified this script:
# - if you uninstall the "Create New NuGet Package From Project After Each Bu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.