full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/chrisdaley223_ASP_NET_MVC/MVCDemo/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/chrisdaley223_ASP_NET_MVC/MVCDemo/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/chrisdaley223_ASP_NET_MVC/MVCDemo/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/chrisdaley223_ASP_NET_MVC/MVCDemo/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/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/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/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/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/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/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/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/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/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/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/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/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/chrisdaley223_ASP_NET_MVC/MVCPartyInvitations2/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/chrisdaley223_ASP_NET_MVC/MVCRecords/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/chrisdaley223_ASP_NET_MVC/MVCRecords/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/chrisdaley223_ASP_NET_MVC/MVCRecords/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/chrisdaley223_ASP_NET_MVC/MVCRecords/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/chrisdaley223_ASP_NET_MVC/MVCRecords/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/chrisdaley223_ASP_NET_MVC/MVCRecords/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/chrisdaley223_ASP_NET_MVC/MVCRecords/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/chrisdaley223_ASP_NET_MVC/MVCRecords/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/kiwibirch_Azure/AzureResourceGroup2/AzureResourceGroup2/Deploy-AzureResourceGroup.ps1 | Deploy-AzureResourceGroup.ps1 | #Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'AzureResourceGroup2',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageCon... |
PowerShellCorpus/Github/kiwibirch_Azure/AzureResourceGroup2/AzureResourceGroup2/bin/Debug/staging/AzureResourceGroup2/Deploy-AzureResourceGroup.ps1 | Deploy-AzureResourceGroup.ps1 | #Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'AzureResourceGroup2',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageCon... |
PowerShellCorpus/Github/Hexatown_user-functions/adoption-update/run.ps1 | run.ps1 | #*********************************************************
# User Adoption Tracking
# ----------------------
#
# version 0.1 baseline
# version 0.2 change modules inclusion strategy thx to
# https://docs.microsoft.com/en-us/powershell/azure/install-adv2?view=azureadps-2.0
#
# https://itfordummie... |
PowerShellCorpus/Github/Hexatown_user-functions/adoption-update/modules/download-modules.ps1 | download-modules.ps1 | #Save-Module SharePointPnPPowerShellOnline -Path "$PSScriptRoot"
Save-Module AzureAD -Path "$PSScriptRoot"
#Save-Module AzureRM -Path "$PSScriptRoot"
|
PowerShellCorpus/Github/acab9759_SysAdminToolbelt/disableuser.ps1 | disableuser.ps1 | $user = Read-Host 'Username to Disable?'
#Disable-ADAccount -Identity $user
$MemberofGroups = Get-ADUser -Identity $user -Properties memberof | select -ExpandProperty memberof
#write-host $MemberofGroups
$MemberofGroups | out-file ".\$user Groups.csv"
Dir C:\Scripts\Powershell\DisableUser\*.csv | Start-... |
PowerShellCorpus/Github/acab9759_SysAdminToolbelt/nimblelunremove.ps1 | nimblelunremove.ps1 | #remove old test snaps
################## Connect to Nimble Storage ##################
Connect-NSArray -SystemName "IPADDRESS OF NIMBLE" -Password password
############### Prod
Set-NSVolumeState "Name of the Lun" -offline
Remove-NSVolume "Name of the Lun" -force
|
PowerShellCorpus/Github/acab9759_SysAdminToolbelt/nimble_DR.ps1 | nimble_DR.ps1 | ################## Import Nimble Storage CMD-LETS ##################
#iex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/jrich523/NimblePowerShell/master/Install.ps1')
################## Connect to Nimble ##################
Connect-NSArray -SystemName "IPADDRESSOFNIMBLE" -Password pass... |
PowerShellCorpus/Github/acab9759_SysAdminToolbelt/expiringaccounts.ps1 | expiringaccounts.ps1 | Import-Module ActiveDirectory
$accountsexp = Search-ADAccount -AccountExpiring -TimeSpan "14"
$Target = @()
foreach ( $account in $accountsexp){
$TargetObject = get-aduser -identity $account -Properties * | select name, samaccountname,department, AccountExpirationDate, manager
$Target += $TargetObjec... |
PowerShellCorpus/Github/HarriMa_DevOps/DevTestLabs/Artifacts/windows-install-ax-novs/InstallAX.ps1 | InstallAX.ps1 | #parameters
param(
[Parameter (Mandatory=$True)]
[string] $setupPath
)
Set-PSDebug -Strict
function InstallWithParmFile
{
try
{
$newProcess = new-object System.Diagnostics.ProcessStartInfo "setup.exe"
$newProcess.WorkingDirectory = "$setupPath"
$newProcess.Verb = "r... |
PowerShellCorpus/Github/HarriMa_DevOps/DevTestLabs/Artifacts/windows-vsts-download/DownloadVSTSDrop.ps1 | DownloadVSTSDrop.ps1 | #parameters
param(
[Parameter]
[AllowEmptyString()]
[string] $username,
[Parameter (Mandatory=$TRUE)]
[string] $accessToken,
[Parameter (Mandatory=$TRUE)]
[string] $buildDefinitionName,
[Parameter (Mandatory=$TRUE)]
[string] $vstsProjectUri
)
Set-PSDebug -Strict... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485482744841/.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/mikef-nl_vagrant-windows/provisioning/01_install_AD.ps1 | 01_install_AD.ps1 | Add-WindowsFeature "RSAT-AD-Tools"
Add-WindowsFeature "RSAT-DNS-Server"
Start-Job -Name addFeature -ScriptBlock {
Import-Module ServerManager
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools}
Wait-Job -Name addFeature
|
PowerShellCorpus/Github/mikef-nl_vagrant-windows/provisioning/06_client_setup.ps1 | 06_client_setup.ps1 |
Set-DnsClientServerAddress -InterfaceIndex ((get-netadapter | ? { $_.MacAddress -eq '08-00-27-00-00-11' }).InterfaceIndex) -ServerAddress '192.168.100.10'
$Domain = "test.local"
$Password = "vagrant" | ConvertTo-SecureString -asPlainText -Force
$Username = "vagrant"
$Credential = New-Object System.Management.A... |
PowerShellCorpus/Github/mikef-nl_vagrant-windows/provisioning/03_install_adfs.ps1 | 03_install_adfs.ps1 | param (
[switch]$OnlineRequest
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$Start = get-date
### Variables
$CertificateADFSsubject = "adfs.broeglin.fr"
$ADFSdisplayName = "Kloud Showcase ADFS 2"
$ADFSuser = "broeglin\ADFSfarm2012R2"
$CertificateLocalPath = "C:\Certificate... |
PowerShellCorpus/Github/mikef-nl_vagrant-windows/provisioning/ConfigDNS.ps1 | ConfigDNS.ps1 | Add-DnsServerPrimaryZone -NetworkID 192.168.100.0/24 -ZoneFile "100.168.192.in-addr.arpa.dns"
$zoneName="100.168.192.in-addr.arpa"
$startingIP=10
$endingIP=30
$incrementingName=0
$preName="public"
$postName=".test.local"
while ($startingIP -le $endingIP) {
$significanDigit="{0:D4}" -f $incrementing... |
PowerShellCorpus/Github/mikef-nl_vagrant-windows/provisioning/00_admin_password.ps1 | 00_admin_password.ps1 | $user = [adsi]"WinNT://localhost/Administrator,user"
$user.SetPassword("Passw0rd")
$user.SetInfo()
|
PowerShellCorpus/Github/mikef-nl_vagrant-windows/provisioning/ChangeDisks.ps1 | ChangeDisks.ps1 | #Afer cloning dirveletter in the templat get reset because of the customization.
$drv = Get-WmiObject win32_volume -filter 'DriveLetter = "D:"'
$drv.DriveLetter = "Z:"
$drv.Put() | out-null
#Get the RAW disks and Initialize, Partition and Format them
Get-Disk |
Where partitionstyle -eq 'raw' |
Initialize-Di... |
PowerShellCorpus/Github/mikef-nl_vagrant-windows/provisioning/02_install_forest.ps1 | 02_install_forest.ps1 | $domainname = "test.local"
$netbiosName = "test"
Import-Module ADDSDeployment
Install-ADDSForest -CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "Win2012" `
-DomainName $domainname `
-DomainNetbiosName $netbiosName `
-ForestMode "Win2012" `
-InstallDns:$true `
-LogPath "C:\Wind... |
PowerShellCorpus/Github/fenxu_fenxu_internal_docs_20160519/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstorageinternal.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 ur... |
PowerShellCorpus/Github/johanwintgens_Week3/SQLlite/packages/System.Data.SQLite.EF6.1.0.94.0/tools/net45/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/johanwintgens_Week3/SQLlite/packages/System.Data.SQLite.EF6.1.0.94.0/tools/net451/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/johanwintgens_Week3/SQLlite/packages/System.Data.SQLite.EF6.1.0.94.0/tools/net40/install.ps1 | install.ps1 | ###############################################################################
#
# provider.ps1 --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################
param($installPath, $toolsPath, $package, ... |
PowerShellCorpus/Github/johanwintgens_Week3/SQLlite/packages/EntityFramework.6.1.1/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/johanwintgens_Week3/SQLlite/packages/EntityFramework.6.1.1/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/travd93_Powershell/GetDefaultAnonymousAccess.ps1 | GetDefaultAnonymousAccess.ps1 | #This Script sets the 'Default' and 'Anonymous' Access to NONE for any mail box where $folder.AccessRights does not currently equal 'None'
#https://technet.microsoft.com/en-us/library/ff522363%28v=exchg.160%29.aspx
#Log File
$logfile = 'C:\Temp\ExchangeFolders\Logs\ExchangeAccess.log'
$Title = "No,Mailbox,FolderP... |
PowerShellCorpus/Github/ilenghel_WinImage-Tools/Interop.ps1 | Interop.ps1 | $code = @"
/*
From: http://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.... |
PowerShellCorpus/Github/ilenghel_WinImage-Tools/UnattendResources/Logon.ps1 | Logon.ps1 | $ErrorActionPreference = "Stop"
$resourcesDir = "$ENV:SystemDrive\UnattendResources"
$configIniPath = "$resourcesDir\config.ini"
function Set-PersistDrivers {
Param(
[parameter(Mandatory=$true)]
[string]$Path,
[switch]$Persist=$true
)
if (!(Test-Path $Path)){
return $false
... |
PowerShellCorpus/Github/ilenghel_WinImage-Tools/UnattendResources/Specialize.ps1 | Specialize.ps1 | $ErrorActionPreference = "Stop"
$resourcesDir = "$ENV:SystemDrive\UnattendResources"
try
{
$wallpaper = "$resourcesDir\Wallpaper.png"
if(Test-Path $wallpaper)
{
$Host.UI.RawUI.WindowTitle = "Configuring wallpaper..."
# Put the wallpaper in place
$wallpaper_dir = "$ENV:Sy... |
PowerShellCorpus/Github/ilenghel_WinImage-Tools/UnattendResources/FirstLogon.ps1 | FirstLogon.ps1 | $ErrorActionPreference = "Stop"
$resourcesDir = "$ENV:SystemDrive\UnattendResources"
function getHypervisor() {
$hypervisor = & "$resourcesDir\checkhypervisor.exe"
if ($LastExitCode -eq 1) {
Write-Host "No hypervisor detected."
} else {
return $hypervisor
}
}
try
{
... |
PowerShellCorpus/Github/ilenghel_WinImage-Tools/Examples/create-windows-online-cloud-image.ps1 | create-windows-online-cloud-image.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/ilenghel_WinImage-Tools/Examples/create-windows-cloud-image.ps1 | create-windows-cloud-image.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/ilenghel_WinImage-Tools/Tests/WinImageBuilder.Tests.ps1 | WinImageBuilder.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$moduleName = "WinImageBuilder"
$moduleHome = Split-Path -Parent $here
$modulePath = Join-Path $moduleHome "${moduleName}.psm1"
if (Get-Module $moduleName -ErrorAction SilentlyContinue) {
Remove-Module $moduleName
}
function Compare-Objects ($firs... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/Obmen1C.Obmen1CInstance.ps1 | Obmen1C.Obmen1CInstance.ps1 | param ($InstanceId)
#### Initialization section BEGIN ####
function Get-ScriptPath
{
try
{
Split-Path $myInvocation.ScriptName
}
catch
{
"."
}
}
## Imports
. (Join-Path (Get-ScriptPath) "CommonInits.ps1")
Update-TypeData (Join-Path (Get-ScriptPath) "GenericTypesExt... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/MSMQFuncs.ps1 | MSMQFuncs.ps1 | [Reflection.Assembly]::LoadWithPartialName("System.Messaging") | Out-Null
function Get-MSMQueue($QueueName, $ServerName = ".")
{
if ([String]::IsNullOrEmpty($ServerName) -or $ServerName -eq ".")
{
$TargetServer = "."
}
else
{
$TargetServer = "FormatName:Direct=OS:$ServerNa... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/Obmen1C.ps1 | Obmen1C.ps1 | #### Initialization section BEGIN ####
function Get-ScriptPath
{
try
{
Split-Path $myInvocation.ScriptName
}
catch
{
"."
}
}
## Imports
. (Join-Path (Get-ScriptPath) "CommonInits.ps1")
Update-TypeData (Join-Path (Get-ScriptPath) "GenericTypesExtension.ps1xml")
. (J... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/Obmen1C.CommCenter.API.ps1 | Obmen1C.CommCenter.API.ps1 | function New-Obmen1CMessage
{
$msg = [xml]'<?xml version="1.0" encoding="UTF-8"?>
<message>
<id></id>
<body></body>
</message>'
$msg.message.id = (Get-Date).Ticks.ToString()
$msg
}
function Add-Obmen1CMessageSender ($xmlmsg, $sender)
{
if ($xmlmsg.SelectNodes('//message/sen... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/Obmen1C.SqlConfReplicator.ps1 | Obmen1C.SqlConfReplicator.ps1 | #### Initialization section BEGIN ####
function Get-ScriptPath
{
try
{
Split-Path $myInvocation.ScriptName
}
catch
{
"."
}
}
## Imports
. (Join-Path (Get-ScriptPath) "CommonInits.ps1")
Update-TypeData (Join-Path (Get-ScriptPath) "GenericTypesExtension.ps1xml")
. (J... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/PSAsyncPipes.ps1 | PSAsyncPipes.ps1 | function Get-NamedPipeServer ($PipeName)
{
New-Object PSObject -Property @{
RunspacePool = Get-RunspacePool 10
ThreadsNum = 10
PipeName = $PipeName
AsyncPipelines = @()
SyncedHashtable = [Hashtable]::Synchronized(@{runNamedPipeServer = $false})
SyncedQueue = [... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/CommonInits.ps1 | CommonInits.ps1 | function Read-Settings
{
([xml](gc ".\settings.xml")).settings # В продакшене файл будет лежать в \ProgramData\Obmen1C
}
function Init-MSMQ ($MSMQueueName)
{
if (Test-MSMQueue $MSMQueueName)
{
$MSMQueue = Get-MSMQueue $MSMQueueName
Purge-MSMQueue $MSMQueue
}
else
{
... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/SQLFuncs.ps1 | SQLFuncs.ps1 | function Invoke-SqlCommand
{
param(
[string] $dataSource = ".\SQLEXPRESS",
[string] $database = "Northwind",
[string] $sqlCommand = $(throw "Please specify a query."),
[System.Management.Automation.PsCredential] $credential
)
## Prepare the authentication information. By default, w... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/Obmen1C.CommCenter.ps1 | Obmen1C.CommCenter.ps1 | #### Initialization section BEGIN ####
function Get-ScriptPath
{
try
{
Split-Path $myInvocation.ScriptName
}
catch
{
"."
}
}
## Imports
. (Join-Path (Get-ScriptPath) "CommonInits.ps1")
Update-TypeData (Join-Path (Get-ScriptPath) "GenericTypesExtension.ps1xml")
. (J... |
PowerShellCorpus/Github/Asker80_Obmen1C.v2/pscrypto.ps1 | pscrypto.ps1 | function Encrypt-String($String, $Passphrase, $salt="My Voice is my P455W0RD!", $init="Yet another key", [switch]$arrayOutput)
{
$r = new-Object System.Security.Cryptography.RijndaelManaged
$pass = [Text.Encoding]::UTF8.GetBytes($Passphrase)
$salt = [Text.Encoding]::UTF8.GetBytes($salt)
$r.Key = (new... |
PowerShellCorpus/Github/poshsecurity_Posh-SubnetTools/Functions/Get-SubnetSize.ps1 | Get-SubnetSize.ps1 | #!/usr/bin/env powershell
#requires -Version 1.0
function Get-SubnetSize
{
<#
.SYNOPSIS
Returns the possible number of hosts that a subnet can contain.
.DESCRIPTION
This function returns the possible number of hosts that the subnet can contain, b... |
PowerShellCorpus/Github/poshsecurity_Posh-SubnetTools/Tests/Get-SubnetSize.tests.ps1 | Get-SubnetSize.tests.ps1 | Import-Module $PSScriptRoot\..\Functions\Get-SubnetSize.ps1 -Force -Verbose
Describe 'Get-SubnetSize' {
Context 'Script Analyzer' {
It 'Does not have any issues with the Script Analyser - Get-SubnetSize' {
Invoke-ScriptAnalyzer $PSScriptRoot\..\Functions\Get-SubnetSize.ps1 | Should be $nul... |
PowerShellCorpus/Github/aplanting_ssmsGit/Baseline/schema.ps1 | schema.ps1 | $ServerName = "SERVER\production" #SERVERNAME AND INSTANCE, otherwise use Servername only
$path="C:\CodeBase\database-development\" #folder that contains the userdatabase git repository.
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO')
$serverInstance = New-Object ('Microsoft.SqlServer... |
PowerShellCorpus/Github/donthor_patrickbot/setup_and_install/new_bot_cleanup.ps1 | new_bot_cleanup.ps1 | # Retrieving User Information
$GITHUBUSER = Read-Host -Prompt "What is your GitHub Username?"
Write-Output ""
Write-Output "** If you have 2 Factor Auth configured, "
Write-Output " provide a Personal Access Token with repo and delete_repo access."
Write-Output " Tokens can be generated at https://github.com/s... |
PowerShellCorpus/Github/donthor_patrickbot/setup_and_install/bot_install_sandbox.ps1 | bot_install_sandbox.ps1 | # Ignore SSL Certificate Errors
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest ... |
PowerShellCorpus/Github/donthor_patrickbot/setup_and_install/new_bot_setup.ps1 | new_bot_setup.ps1 | # Retrieving User Information
$GITHUBUSER = Read-Host -Prompt "What is your GitHub Username?"
Write-Output ""
Write-Output "** If you have 2 Factor Auth configured, "
Write-Output " provide a Personal Access Token with repo and delete_repo access."
Write-Output " Tokens can be generated at https://github.com/s... |
PowerShellCorpus/Github/donthor_patrickbot/setup_and_install/bot_config.ps1 | bot_config.ps1 | # Ignore SSL Certificate Errors
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest ... |
PowerShellCorpus/Github/donthor_patrickbot/setup_and_install/bot_uninstall_sandbox.ps1 | bot_uninstall_sandbox.ps1 | # Ignore SSL Certificate Errors
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest ... |
PowerShellCorpus/Github/blole_nuget-manage-property-sheets/manage-property-sheets.ps1 | manage-property-sheets.ps1 | function Relative-Path ([string]$from, [string]$to)
{
Push-Location
Set-Location "$from"
Write-Output $(Resolve-Path -Relative "$to")
Pop-Location
}
# from http://stackoverflow.com/questions/12292577/how-can-i-reload-a-visual-studio-project-thru-a-nuget-powershell-script
function Select-Project ([string]$... |
PowerShellCorpus/Github/sanderaernouts_tfs-security-tools/TfsSecurityTools/TfsSecurityTools/TfsSecurityTools.dll-Help.ps1 | TfsSecurityTools.dll-Help.ps1 |
# Get-GroupMember command help
@{
command = 'Get-GroupMember'
synopsis = 'Gets the group members for specific TFS application group'
description = 'Retrieves the group members for a specfic TFS application group based on the ID and collection. Users or Groups can be excluded as members and members can be filte... |
PowerShellCorpus/Github/sanderaernouts_tfs-security-tools/TfsSecurityTools/TfsSecurityTools/Install.ps1 | Install.ps1 | $personalModules = "$HOME\Documents\WindowsPowerShell\Modules"
$modulePath = "$personalModules\TfsSecurityTools"
Write-Host "Installing TfsSecurityTools module into $modulePath..."
#Remove the module if it is loaded
Get-Module | Where-Object {$_.name -eq "TfsSecurityTools"} | Remove-Module -Force
if((Test-... |
PowerShellCorpus/Github/sanderaernouts_tfs-security-tools/TfsSecurityTools/TfsSecurityTools/packaging/package.ps1 | package.ps1 | Try{
$packageDir = "$PSScriptRoot\..\published packages"
$packagingDir = "$packageDir\TfsSecurityTools"
#generate XML help file for module
. "$PSScriptRoot\Helps.ps1"
Import-Module $PSScriptRoot\..\TfsSecurityTools.psd1
Convert-Helps $PSScriptRoot\..\TfsSecurityTools.dll-Help.ps1 $PSScriptRoot\..\... |
PowerShellCorpus/Github/sanderaernouts_tfs-security-tools/TfsSecurityTools/TfsSecurityTools/packaging/Helps.ps1 | Helps.ps1 |
<#
* Helps.ps1 - PowerShell Help Builder
* Copyright (c) 2011-2014 Roman Kuzmin
*
* 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
*
* ... |
PowerShellCorpus/Github/v-peliao_E2E_NewRepo_1489641714491/.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/solidstate888_JSON-ToCSV/Convert-JsonToCsv.ps1 | Convert-JsonToCsv.ps1 | <#
.SYNOPSIS
"Flattens" a JSON file into a CSV formatted file.
.DESCRIPTION
Uses the built-in function "ConvertFrom-Json" to convert the source JSON file to a PSCustomObject.
Once the data is a PSCustomObject, calls the function "Flatten-PsCustomObject" to remove nesting.
After nesting is remov... |
PowerShellCorpus/Github/andrstor_PowerShell/dsc/NewPullServer/NewPullServer.ps1 | NewPullServer.ps1 | configuration NewPullServer
{
param
(
[string[]]$ComputerName = ‘localhost’
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node $ComputerName
{
WindowsFeature DSCServiceFeature
{
Ensure = “Present”
Name = “DSC-Service”
}
xD... |
PowerShellCorpus/Github/andrstor_PowerShell/dsc/TestWebSite/TestWebSite.ps1 | TestWebSite.ps1 | Configuration TestWebSite
{
param ($MachineName)
Node $MachineName
{
#Install the IIS Role
WindowsFeature IIS
{
Ensure = “Present”
Name = “Web-Server”
}
#Install ASP.NET 4.5
WindowsFeature ASP
{
Ensure = “Pre... |
PowerShellCorpus/Github/andrstor_PowerShell/dsc/InstallTFSBuildServer/InstallTFSBuildServer.ps1 | InstallTFSBuildServer.ps1 | configuration InstallTFSBuildServer
{
param(
[string]$node = 'localhost'
)
Import-DscResource -ModuleName xPSDesiredStateConfiguration
# One can evaluate expressions to get the node list
# E.g: $AllNodes.Where("Role -eq Web").NodeName
node $node
{
Archive DSCWave {
... |
PowerShellCorpus/Github/andrstor_PowerShell/dsc/InstallTFSBuildServer/CopyFilesFromAzureStorageContainer.ps1 | CopyFilesFromAzureStorageContainer.ps1 | <#
.SYNOPSIS
Copies files from a storage container to a local folder.
.DESCRIPTION
Copies blobs from a single storage container or all storage containers to a local
directory. If the blobs have "/" in the name to represent a directory hierarchy,
then the script will recreate that directory hierar... |
PowerShellCorpus/Github/andrstor_PowerShell/dsc/DscServiceFeature/DSCServiceFeature.ps1 | DSCServiceFeature.ps1 | configuration DSCServiceFeature
{
param
(
[string[]]$ComputerName = ‘localhost’
)
Import-DSCResource -ModuleName xPSDesiredStateConfiguration
Node $ComputerName
{
WindowsFeature DSCServiceFeature
{
Ensure = “Present”
Name = “DSC-Service”
}
}
... |
PowerShellCorpus/Github/andrstor_PowerShell/dsc/SetPullMode/SetPullMode.ps1 | SetPullMode.ps1 | Configuration SetPullMode
{
param([string]$guid, [string]$computername)
Node $computername
{
LocalConfigurationManager
{
ConfigurationMode = ‘ApplyAndAutoCorrect’
ConfigurationID = $guid
RefreshMode = ‘Pull’
RefreshFrequencyMins = 15
... |
PowerShellCorpus/Github/andrstor_PowerShell/Scripts/Azure/InstallAzureCertificate.ps1 | InstallAzureCertificate.ps1 | $WinRMCertificateThumbprint = (Get-AzureVM -ServiceName "andreascloud" -Name "andreasdc01" | Select-Object -ExpandProperty VM).DefaultWinRMCertificateThumbprint
(Get-AzureCertificate -ServiceName "andreascloud" -Thumbprint $WinRMCertificateThumbprint -ThumbprintAlgorithm SHA1).Data | Out-File "${env:TEMP}\CloudService... |
PowerShellCorpus/Github/hirschadam_PS_script_joke/install.ps1 | install.ps1 | <# File: install.ps1
This file installs the text and speec scripts
#>
$scriptPath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptPath
New-Item $HOME\bin -Type Directory
Set-Location $HOME\bin
Copy-Item -Path $dir\voice\* -Destination .
.\times.ps1 |
PowerShellCorpus/Github/hirschadam_PS_script_joke/voice/voice.ps1 | voice.ps1 | <# File: voice.ps1
Purpose: This is the main payload for the Text-To-Speech prank,
it executes the Speech Synthesizer from a document containing phrases.
#>
[Reflection.Assembly]::LoadWithPartialName('System.Speech') | Out-Null
$executingScriptDirectory = Split-Path -Path $MyInvocation.M... |
PowerShellCorpus/Github/hirschadam_PS_script_joke/voice/times.ps1 | times.ps1 | <# File: times.ps1
This file sets up the PowerShell jobs that execute the main payload.
#>
$dir = "$HOME\bin"
$times = '08:44am','09:41am','10:31am','11:17am','12:24pm','01:23pm','02:53pm','03:57pm','04:08pm','05:4pm','06:56pm','07:49pm','07:57pm','08:05pm','08:09pm','08:31pm','10:39pm'
$days = 'Monday'... |
PowerShellCorpus/Github/MasterPie_SilentVoice/SilentVoice/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
try {
# Set up variables
$timestamp = (Get-Date).ToString('yyyyMMddHHmmss')
$projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar))
$catalogName = "aspnet-$project... |
PowerShellCorpus/Github/MasterPie_SilentVoice/SilentVoice/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/MasterPie_SilentVoice/SilentVoice/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/MasterPie_SilentVoice/SilentVoice/packages/jQuery.1.7.1.1/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/MasterPie_SilentVoice/SilentVoice/packages/jQuery.1.7.1.1/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
$supportsJsIntelliSenseFile = [System.Version]::Parse($dte.Version).Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
Write-Host "IntelliSense JS files are n... |
PowerShellCorpus/Github/MasterPie_SilentVoice/SilentVoice/packages/jQuery.1.7.1.1/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/tmessinis_find_pst_script/start_script.ps1 | start_script.ps1 | # Loop to verify that user enters correct hostname or IP address
do {
$computer = Read-Host -Prompt "Enter hostname or IP address of remote computer"
} until ($computer -match "^(\w{2}){2}[\d]{6}$" -or $computer -match "^([0-9]\.|[1-9][0-9]\.|1[0-9][0-9]\.|2[0-4][0-9]\.|25[0-4]\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]... |
PowerShellCorpus/Github/tmessinis_find_pst_script/find_pst.ps1 | find_pst.ps1 | function find-pst {
# Initialize variables. Find all local drives on remote user's machine.
$comp = $args[0]
$local_drives = Get-WmiObject Win32_LogicalDisk | Select-Object -ExpandProperty DeviceID
$pst_paths = @()
# Loop through the local drives and recursively search them for PST files. Add... |
PowerShellCorpus/Github/kewanggh_14_FullStackTodo/VSTDA/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$compilerPackageName = 'Microsoft.Net.Compilers'
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$libDirectory = Join-Path $installPath 'lib\net45'
$packageDirectory = Split-Path $installPath
$compilerPackage = Get-Chil... |
PowerShellCorpus/Github/kewanggh_14_FullStackTodo/VSTDA/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
$roslynSubFolder = 'roslyn'
if ($project -eq $null) {
$project = Get-Project
}
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory = Join-Path $projectRoot 'bin'
$targetDirectory = Join-Path $binDirectory $roslynSubFolder
if (Te... |
PowerShellCorpus/Github/kewanggh_14_FullStackTodo/VSTDA/packages/Newtonsoft.Json.6.0.4/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://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/matmutant_PowerShellAtWork/deleteAllButN.ps1 | deleteAllButN.ps1 | #LICENSE: Creative Commons CC-BY-SA.
#Script Written by matmutant
#The aim of this PowerShell script is to remove file(s) from a directory where only the $nbFileToKeep most recent copies will be kept (sorted by timestamped name using alpha order)
#The source file should be named BACK_YYYYMMDD_HHmm.foo to make sure t... |
PowerShellCorpus/Github/matmutant_PowerShellAtWork/csv2xmlConcept.ps1 | csv2xmlConcept.ps1 | #one line csv to xml converter proof of concept, that features lots of un-assigned issues and would be quite hard to maintain
#this is based on a use case where the csv content has fixed strings and numbers size in each member of the list like the following example:
#4char;6num;0or35char;0or35char;0or14char;1char;13... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.