full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/QuietusPlus_Write-Menu/Examples/AdvancedMenu.ps1
AdvancedMenu.ps1
<# Example: AdvancedMenu #> . ..\Write-Menu.ps1 $menuReturn = Write-Menu -Title 'Advanced Menu' -Sort -Entries @{ 'Command Entry' = '(Get-AppxPackage).Name' 'Invoke Entry' = '@(Get-AppxPackage).Name' 'Hashtable Entry' = @{ 'Array Entry' = "@('Menu Option 1', 'Menu Option 2', 'Menu Op...
PowerShellCorpus/Github/QuietusPlus_Write-Menu/Examples/CustomMenu.ps1
CustomMenu.ps1
<# Example: CustomMenu #> # Include . ..\Write-Menu.ps1 $menuReturn = Write-Menu -Title 'Custom Menu' -Entries @( 'Menu Option 1' 'Menu Option 2' 'Menu Option 3' 'Menu Option 4' ) Write-Host $menuReturn
PowerShellCorpus/Github/jamesbannan_pluralsight/azure-resource-manager-deep-dive/Deploy-SimplePaas.ps1
Deploy-SimplePaas.ps1
### Define Deployment Variables $resourceGroupName = 'pluralsight-arm-simple-paas' $resourceProviderNamespace = 'Microsoft.Web' $resourceTypeName = 'sites' $resourceGroupLocation = 'Australia Southeast' $randomString = ([char[]]([char]'a'..[char]'z') + 0..9 | Sort-Object {Get-Random})[0..8] -join '' $appNam...
PowerShellCorpus/Github/jamesbannan_pluralsight/azure-resource-manager-deep-dive/Deploy-SimpleIaas.ps1
Deploy-SimpleIaas.ps1
### Define Deployment Variables $resourceGroupName = 'pluralsight-arm-simple-iaas' $resourceProviderNamespace = 'Microsoft.Network' $resourceTypeName = 'virtualNetworks' $resourceGroupLocation = 'Australia Southeast' $vNetName = 'vnet-pluralsight' $vNetAddressPrefix = '172.16.0.0/16' $vNetSubnet1Name = 'su...
PowerShellCorpus/Github/jamesbannan_pluralsight/azure-resource-manager-deep-dive/Deploy-NestedSolution.ps1
Deploy-NestedSolution.ps1
### Define variables $location = 'Australia Southeast' $resourceGroupName = 'pluralsight-arm-nested' $resourceDeploymentSolutionName = 'pluralsight-arm-nested-deployment' $templateBaseUri = 'https://steamstorage01.blob.core.windows.net/resources' $templateFile = 'azureDeploy.json' $template = $templateBaseUri + '...
PowerShellCorpus/Github/jamesbannan_pluralsight/azure-resource-manager-deep-dive/Deploy-PaasSolution.ps1
Deploy-PaasSolution.ps1
### Define variables $location = 'Australia Southeast' $resourceGroupName = 'pluralsight-arm-paas' $resourceDeploymentName = 'pluralsight-arm-paas-deployment' $templatePath = $env:USERPROFILE + '\Documents\git\pluralsight-azure-resource-manager-deep-dive' $templateFile = 'paasDeploy_v2.json' $template = $template...
PowerShellCorpus/Github/jamesbannan_pluralsight/azure-resource-manager-deep-dive/Deploy-IaasSolution.ps1
Deploy-IaasSolution.ps1
### Define variables $location = 'Australia Southeast' $resourceGroupName = 'pluralsight-arm-iaas' $resourceDeploymentADSolutionName = 'pluralsight-arm-iaas-deployment' $templatePath = $env:USERPROFILE + '\Documents\git\pluralsight-azure-resource-manager-deep-dive' $templateFileADSolution = 'iaasDeploy.json' $tem...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-ContosoIaas.ps1
Deploy-ContosoIaas.ps1
### Define Deployment Variables { $location = 'Australia Southeast' $resourceGroupName = 'contoso-iaas' $resourceDeploymentName = 'contoso-iaas-deployment' $templatePath = $env:SystemDrive + '\' + 'pluralsight' $templateFile = 'contosoIaas.json' $template = $templatePath + '\' + $templateFile $password = "C0nts...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-SimplePaasTemplate.ps1
Deploy-SimplePaasTemplate.ps1
### Define Deployment Variables { $location = 'Australia Southeast' $resourceGroupName = 'contoso-simple-paas-template' $resourceDeploymentName = 'contoso-paas-template-deployment' $templatePath = $env:SystemDrive + '\' + 'pluralsight' $templateFile = 'simplePaas.json' $template = $templatePath + '\' + $template...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-SimplePaas.ps1
Deploy-SimplePaas.ps1
### Define Deployment Variables { $resourceGroupName = 'contoso-simple-paas' $resourceProviderNamespace = 'Microsoft.Web' $resourceTypeName = 'sites' $resourceGroupLocation = 'Australia Southeast' $randomString = ([char[]]([char]'a'..[char]'z') + 0..9 | Sort-Object {Get-Random})[0..8] -join '' $appNamePref...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-SimpleIaas.ps1
Deploy-SimpleIaas.ps1
### Define Deployment Variables { $resourceGroupName = 'contoso-simple-iaas' $resourceProviderNamespace = 'Microsoft.Network' $resourceTypeName = 'virtualNetworks' $resourceGroupLocation = 'Australia Southeast' $vNetName = 'vnet-contoso' $vNetAddressPrefix = '172.16.0.0/16' $vNetSubnet1Name = 'subnet-1' $v...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-ContosoPaas.ps1
Deploy-ContosoPaas.ps1
### Define Deployment Variables { $resourceGroupLocation = 'Australia Southeast' $resourceGroupName = 'contoso-paas' $resourceDeploymentName = 'contoso-paas-deployment' $templatePath = $env:SystemDrive + '\' + 'pluralsight' $templateFile = 'contosoPaas.json' $template = $templatePath + '\' + $templateFile } ...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/New-vmWebTags.ps1
New-vmWebTags.ps1
### Get vmWeb VMs { $VMs = Get-AzureRmResource | ` Where-Object {$_.Name -like "vmWeb-*" -and $_.ResourceType -eq 'Microsoft.Compute/virtualMachines'} } ### Add Tags to Resources { $tags = New-Object -TypeName Hashtable $tags += @{"department"="IT"} $tags += @{"environment"="Production"} forea...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-NestedSolution.ps1
Deploy-NestedSolution.ps1
### Define variables { $location = 'Australia Southeast' $resourceGroupName = 'contoso-arm-nested' $resourceDeploymentSolutionName = 'contoso-arm-nested-deployment' $templateBasePath = $env:SystemDrive + '\' + 'pluralsight' + '\' + 'nested' $templateFile = 'azureDeploy.json' $template = $templateBasePath + '\'...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-PaasSolution.ps1
Deploy-PaasSolution.ps1
### Define variables $location = 'Australia Southeast' $resourceGroupName = 'pluralsight-arm-paas' $resourceDeploymentName = 'pluralsight-arm-paas-deployment' $templatePath = $env:USERPROFILE + '\Documents\git\pluralsight-azure-resource-manager-deep-dive' $templateFile = 'paasDeploy_v2.json' $template = $template...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-SimpleIaasTemplate.ps1
Deploy-SimpleIaasTemplate.ps1
### Define Deployment Variables { $location = 'Australia Southeast' $resourceGroupName = 'contoso-simple-iaas-template' $resourceDeploymentName = 'contoso-iaas-template-deployment' $templatePath = $env:SystemDrive + '\' + 'pluralsight' $templateFile = 'simpleiaas.json' $template = $templatePath + '\' + $template...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-IaasSolution.ps1
Deploy-IaasSolution.ps1
### Define variables $location = 'Australia Southeast' $resourceGroupName = 'pluralsight-arm-iaas' $resourceDeploymentADSolutionName = 'pluralsight-arm-iaas-deployment' $templatePath = $env:USERPROFILE + '\Documents\git\pluralsight-azure-resource-manager-deep-dive' $templateFileADSolution = 'iaasDeploy.json' $tem...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/Deploy-KeyVault.ps1
Deploy-KeyVault.ps1
### Define variables { $location = 'Australia Southeast' $resourceGroupName = 'contoso-keyvault' $resourceDeploymentName = 'contoso-vault' $keyVaultName = 'contoso-vault' $password = 'C0nt0s0P@55' $secretName = 'vmAdminPassword' } ### Create Resource Group { New-AzureRmResourceGroup ` -Name $r...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/New-CustomRbacRoles.ps1
New-CustomRbacRoles.ps1
### Get Azure Subscription ID { $subscriptionID = (Get-AzureRmSubscription).Id } ### Create New RBAC Role { $role = Get-AzureRmRoleDefinition "Virtual Machine Contributor" $role.Id = $null $role.Name = "Virtual Machine Operator" $role.Description = "Can monitor and restart virtual machines." $role...
PowerShellCorpus/Github/jamesbannan_pluralsight/microsoft-azure-resource-manager-mastering/New-ARMPolicies.ps1
New-ARMPolicies.ps1
### Create and Apply Location Policy { $policyName = 'policyLocationDefinition' $policyAssignment = 'policyLocationAssignment' $policyFile = $env:SystemDrive + '\' + 'pluralsight' + '\' + 'policylocation.json' New-AzureRmPolicyDefinition ` -Name $policyName ` -Policy $policyFile ` -Verbose ...
PowerShellCorpus/Github/jamesbannan_pluralsight/chef-planning-installing/powershell/Create-WindowsClientARM.ps1
Create-WindowsClientARM.ps1
function New-RandomString { $String = $null $r = New-Object System.Random 1..6 | % { $String += [char]$r.next(97,122) } $string } ### Define variables $SubscriptionName = 'Free Trial' $Location = 'West US' ### Use "Get-AzureLocation | Where-Object Name -eq 'ResourceGroup' | Format-Table Name...
PowerShellCorpus/Github/jamesbannan_pluralsight/chef-planning-installing/powershell/Create-CourseEnvironmentARM.ps1
Create-CourseEnvironmentARM.ps1
function New-RandomString { $String = $null $r = New-Object System.Random 1..6 | % { $String += [char]$r.next(97,122) } $string } ### Define variables $SubscriptionName = 'Visual Studio Ultimate with MSDN' $Location = 'West US' ### Use "Get-AzureLocation | Where-Object Name -eq 'ResourceGrou...
PowerShellCorpus/Github/jamesbannan_pluralsight/chef-planning-installing/powershell/Create-CourseEnvironment.ps1
Create-CourseEnvironment.ps1
function New-RandomString { $String = $null $r = New-Object System.Random 1..6 | % { $String += [char]$r.next(97,122) } $string } ### Declare Variables ### $VMName = 'chef-server' $VMSize = 'Large' # Specify one: Small, Medium, Large, ExtraLarge, A5, A6, A7, A8, A9 $Location = 'Australia So...
PowerShellCorpus/Github/jamesbannan_pluralsight/chef-planning-installing/powershell/Create-LinuxClientARM.ps1
Create-LinuxClientARM.ps1
function New-RandomString { $String = $null $r = New-Object System.Random 1..6 | % { $String += [char]$r.next(97,122) } $string } ### Define variables $SubscriptionName = 'Free Trial' $Location = 'West US' ### Use "Get-AzureLocation | Where-Object Name -eq 'ResourceGroup' | Format-Table Name...
PowerShellCorpus/Github/kimizhu_oltest_ems/.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 ur...
PowerShellCorpus/Github/peterbeck_win/powershell/foo_windows_appinstalls.ps1
foo_windows_appinstalls.ps1
Function QueryProgramFiles { Function BuildArray { #if 64bit system if (!([Diagnostics.Process]::GetCurrentProcess().Path -match '\\syswow64\\')) { $unistallPath = "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" $unistallWow6432Path = "\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\...
PowerShellCorpus/Github/peterbeck_win/powershell/foo_check_winupdates.ps1
foo_check_winupdates.ps1
############################################################################## # # NAME: check_windows_updates.ps1 # # AUTHOR: Christian Kaufmann, Umwelt-Campus Birkenfeld # EMAIL: c.kaufmann@umwelt-campus.de # # COMMENT: Script to check for windows updates with Nagios + NRPE/NSClient++ # # Return Values...
PowerShellCorpus/Github/peterbeck_win/powershell/foo_check_fileage.ps1
foo_check_fileage.ps1
# foo.li systeme + software 2014 ############################################################################## # # NAME: check_file_age.ps1 # # AUTHOR: Peter Beck, foo.li systeme + software # EMAIL: peter.beck@foo.li # # COMMENT: Script to check windows file age with Nagios + NRPE/NSClient++ # ...
PowerShellCorpus/Github/peterbeck_win/powershell/foo_dhcp_leases.ps1
foo_dhcp_leases.ps1
# DHCP Leases Exportieren # # foo.li systeme + software 2014 # # neuere win-versionen haben das in der powershell integriert, bei 2003 waere mir das jedoch # nicht bekannt, deshalb das ganze via netsh-Umweg. # # 29.3.2014/pvb # nur mit englischem Server 2003 getestet # # Originalskript: # http://theadminguy...
PowerShellCorpus/Github/kimizhu_CapsToOps0129_AzureRight/.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 ur...
PowerShellCorpus/Github/runceel_winrtapps/Okazuki.Bookmarker/Okazuki.Bookmarker/AppPackages/Okazuki.Bookmarker_1.0.0.0_AnyCPU_Debug_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/runceel_winrtapps/Okazuki.Bookmarker/Okazuki.Bookmarker/AppPackages/Okazuki.Bookmarker_1.0.0.2_AnyCPU_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/runceel_winrtapps/Okazuki.Bookmarker/Okazuki.Bookmarker/AppPackages/Okazuki.Bookmarker_1.0.0.1_AnyCPU_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/runceel_winrtapps/Okazuki.Bookmarker/Okazuki.Bookmarker/AppPackages/Okazuki.Bookmarker_1.0.0.3_AnyCPU_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/modulexcite_PowerShellMOFSchema/Try-NewMOFSchema.ps1
Try-NewMOFSchema.ps1
. .\New-MOFSchema.ps1 New-MOFSchema WebSite { Set-Version 1.0.1 Add-ClassName Demo_IISWebsite Add-Key string Name Add-WriteProperty string PhysicalPath Add-WriteValueMap "Present", "Absent" string Ensure Add-WriteValueMap "Started", "Stopped" string State Add-WriteValueMa...
PowerShellCorpus/Github/modulexcite_PowerShellMOFSchema/New-MOFSchema.ps1
New-MOFSchema.ps1
# http://technet.microsoft.com/en-us/library/dn249927.aspx function New-MOFSchema { param( [string]$FriendlyName, [ScriptBlock]$sb ) $script:MOFOutput = @() function Set-Version { param( [Parameter(Mandatory)] [version]$script:version ...
PowerShellCorpus/Github/modulexcite_PowerShellMOFSchema/spike-try-transforms/spike.ps1
spike.ps1
function New-MOFSchema { param( [string]$FriendlyName, [ScriptBlock]$sb, [Switch]$AsPSObject, [Switch]$AsJSON ) $MOFMap = [Ordered]@{ Keys = [Ordered]@{} Writes = [Ordered]@{} Reads = [Ordered]@{} ValueMaps = [Order...
PowerShellCorpus/Github/speedmax123_Powershell_Configuration/profile.ps1
profile.ps1
# There's usually much more than this in my profile! $SCRIPTPATH = "C:\Users\Speed\Documents\WindowsPowerShell" $PROGRAMPATH = "D:\Program Files (x86)" $VIMPATH = $PROGRAMPATH + "\vim\vim74\vim.exe" $VIMRUNTIME = $PROGRAMPATH + "\vim\vim74" Set-Alias vi $VIMPATH Set-Alias vim $VIMPATH Set-Alias c ...
PowerShellCorpus/Github/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/rbgrandcircus_ExperienceIT--rb/GrandCircus-Test/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/Nodocify_psexec-block/network_logon_monitor.ps1
network_logon_monitor.ps1
$startDate = Get-Date $newEvent = $false while($true) { $log = Get-Eventlog -LogName Security -after $startDate #Get-EventLog -LogName Security -Instance 4624 -Newest 2 | Where-Object {$_.ReplacementStrings[8] -eq 3} # Loop through each security event, print all login/logoffs with type, date/t...
PowerShellCorpus/Github/lasiewicz_stuff/CreateDiffScript/CreateEmptyDB_VS2015_wliu.ps1
CreateEmptyDB_VS2015_wliu.ps1
<# ---------------------------------------------------------------------------------------------------- This script runs generates delta scripts against empty DBs Version 1.1.003: 06/15/2016: Jim Blair -- Add support for compiling and creating the ces_master update script Version 1.1.002: 03/29/2016: Ed Moon -...
PowerShellCorpus/Github/lasiewicz_stuff/CreateDiffScript/AddSQLSnapIns.ps1
AddSQLSnapIns.ps1
# # Add the SQL Server Provider. # $ErrorActionPreference = "Stop" $sqlpsreg="HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps" if (Get-ChildItem $sqlpsreg -ErrorAction "SilentlyContinue") { throw "SQL Server Provider for Windows PowerShell is not installed...
PowerShellCorpus/Github/lasiewicz_stuff/CreateDiffScript/CreateEmptyDB_VS2012.ps1
CreateEmptyDB_VS2012.ps1
<# ---------------------------------------------------------------------------------------------------- This script runs generates delta scripts against empty DBs Version 1.1.003: 06/15/2016: Jim Blair -- Add support for compiling and creating the ces_master update script Version 1.1.002: 03/29/2016: Ed Moon -...
PowerShellCorpus/Github/lasiewicz_stuff/CreateDiffScript/CreateEmptyDB_VS2015.ps1
CreateEmptyDB_VS2015.ps1
<# ---------------------------------------------------------------------------------------------------- This script runs generates delta scripts against empty DBs Version 1.1.003: 06/15/2016: Jim Blair -- Add support for compiling and creating the ces_master update script Version 1.1.002: 03/29/2016: Ed Moon -...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/ChangeUser.ps1
ChangeUser.ps1
#Agustín Mántaras December 2014. #This code was downloaded from MSDN Code Gallery #You can visit my blog post http://blogs.msdn.com/b/amantaras/archive/2014/12/10/powershell-script-to-change-windows-service-credentials.aspx [CmdletBinding()] Param( [Parameter(Mandatory=$True,Position=1)] [string]$UserName, ...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/InstallConsoleServer.ps1
InstallConsoleServer.ps1
<# --------------------------------------------------------------------------- Version 1.0.000: Bill Lasiewicz -- Initial version: Initial version. This script iterates calling the main script though a batch file depending on the number of servers You will notice what changes is the order of the servers, whi...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/Insertnew.ps1
Insertnew.ps1
function Searchtext { param([string]$text) (Get-Content $fileName) | Foreach-Object { $_ # send the current line to output if ($_ -contains $text) { $global:filecontainsvalue="1" ...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/TestSucess.ps1
TestSucess.ps1
$Server1=$args[0] $flpath="\\" + $Server1 + "\c$\temp\consolescripts\test.bat" Write-Host $$flpath cmd.exe /C $flpath
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/kill.ps1
kill.ps1
Stop-process -name consul
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/startservice.ps1
startservice.ps1
sc start consul Start-Service consul
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/installconsole.ps1
installconsole.ps1
<# --------------------------------------------------------------------------- Version 1.0.000: Bill Lasiewicz -- Initial version: Initial version. This is the main script for the consul process which will be invoked by other scripts depending on what type This will do both a server and client type of install...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/Upgrade.ps1
Upgrade.ps1
sc stop consul Start-Sleep -s 30 choco upgrade consul -y $Server1=(Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain $currentlocation=split-path -parent $MyInvocation.MyCommand.Definition $t=0 $fl=$currentlocation+ "\Prompt.exeinfo.txt" foreach($line in Get-Conte...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/startClent.ps1
startClent.ps1
$cmdlnargs= "client" $flpath="\\" + $args[0] + "\c$\temp\consolescripts\installconsole.ps1" Invoke-Command -ComputerName $args[0] -FilePath $flpath -Args $cmdlnargs $flpath="\\" + $args[0] + "\c$\temp\consolescripts\startservice.ps1" Invoke-Command -ComputerName $args[0] -FilePath $flpath
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/StarfirstServer.ps1
StarfirstServer.ps1
$cmd = { $tst="consul.exe agent -data-dir=" + [char]34 + "C:\ProgramData\consul\data" + [char]34 +" -config-file=" + [char]34 + "C:\ProgramData\consul\bootstrap_config.json" + [char]34 Write-Host $tst cmd.exe /C $tst } Start-Job -ScriptBlock $cmd
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/Installnuke.ps1
Installnuke.ps1
$Server1=$args[0] $Server2=$args[1] $currentlocation=split-path -parent $MyInvocation.MyCommand.Definition #$Servers="lax-qanr-exmt01 lax-qanr-exmt02 lax-qanr-exmt03" Write-Host "starting" try { $Server4="" $Server3="" $Server3=$args[2] $Server4=$args[3] } catch ...
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/prompt.ps1
prompt.ps1
$Cred = Get-Credential #Prompt you for user name and password
PowerShellCorpus/Github/lasiewicz_stuff/consulservice/scripts/nuke.ps1
nuke.ps1
(Get-WmiObject Win32_Service -filter "name='consul'").Delete() choco uninstall consul -y function Get-Tree($Path,$Include='*') { @(Get-Item $Path -Include $Include) + (Get-ChildItem $Path -Recurse -Include $Include) | sort pspath -Descending -unique } function Remove-Tree($Path,$Inc...
PowerShellCorpus/Github/lasiewicz_stuff/Migrationtool/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/pbakker1_new/boomgoed.ps1
boomgoed.ps1
function Add-Node { param ( $selectedNode, $name, $tag ) $newNode = new-object System.Windows.Forms.TreeNode $newNode.Name = $name $newNode.Text = $name $newNode.Tag = $tag $selectedNode.Nodes.Add($newNode) ...
PowerShellCorpus/Github/smithnoff_controldeprestamo/SistemaControlDeCobranzas/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/smithnoff_controldeprestamo/SistemaControlDeCobranzas/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/smithnoff_controldeprestamo/SistemaControlDeCobranzas/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/smithnoff_controldeprestamo/SistemaControlDeCobranzas/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/smithnoff_controldeprestamo/SistemaControlDeCobranzas/packages/MahApps.Metro.1.1.2.0/tools/install.ps1
install.ps1
param($rootPath, $toolsPath, $package, $project) $project.DTE.ItemOperations.Navigate('http://mahapps.com/guides/quick-start.html')
PowerShellCorpus/Github/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/CarlosSantos3_PizzariaPolohTeste/PizzariaPoloh/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/bbielesch_azure-playground/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage #Requires -Module AzureRM.Storage Param( [string] [Parameter(Mandatory=$true)] $ArtifactStagingDirectory, [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = $ArtifactS...
PowerShellCorpus/Github/GeriCookie_Database-2015-Team-Flerovium-/ImportingReports/packages/Newtonsoft.Json.7.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/GeriCookie_Database-2015-Team-Flerovium-/ImportingReports/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/GeriCookie_Database-2015-Team-Flerovium-/ImportingReports/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/parliamentarydigitalservice_chefcookbook.gocd-update-in-environment/upload.ps1
upload.ps1
Param( [string]$name , [string]$version, [string]$environment, [string]$file ) function Upload-Environment { # ====== Get-Environment ====== # # Gets the environment either from Chef or from a file. # # If the -environment parameter is specified, we fetch that environment from Che...
PowerShellCorpus/Github/Aethylred_puppet-blank/unblank.ps1
unblank.ps1
Param($author,$module) if ($author -match "^\w+$") { if ($module -match "^\w+$") { echo "Update README.md..." $readme = Get-Content README.blank.md $readme = Foreach-Object {$readme -replace "blank-blank", $module} $readme = Foreach-Object {$modulefile -replace "authorauthor", $author} $rea...
PowerShellCorpus/Github/Aethylred_puppet-blank/cleanup.ps1
cleanup.ps1
echo "Cleaning up template..." if ((Test-Path 'metadata.json') -and (Test-Path 'manifests/init.pp') -and (Test-Path 'manifests/params.pp') -and (Test-Path 'spec/classes/init_spec.rb') -and (Test-Path 'tests/init.pp') -and (Test-Path '.fixtures.yml')){ echo "Deleting .orig templates..." Remove-Item 'metadata.orig...
PowerShellCorpus/Github/ahumeniy_GeneratorComentariosRBB/src/RBBCommentGeneratorWeb/Properties/PublishProfiles/RBBCommentGenerator-publish.ps1
RBBCommentGenerator-publish.ps1
[cmdletbinding(SupportsShouldProcess=$true)] param($publishProperties=@{}, $packOutput, $pubProfilePath) # to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 try{ if ($publishProperties['ProjectGuid'] -eq $null){ $publishProperties['ProjectGuid'] = '578cfed6-eb22-406...
PowerShellCorpus/Github/poshsecurity_Posh-PasswordAuditor/Invoke-ADUserPasswordAudit.ps1
Invoke-ADUserPasswordAudit.ps1
#requires -Version 2 <# .SYNOPSIS Audits Active Directory user accounts against a specified list of plaintext passwords. Results either stored to file or sent via email. .DESCRIPTION This script provides a method for the automation of auditing domain user account credentials against a list of pas...
PowerShellCorpus/Github/poshsecurity_Posh-PasswordAuditor/Invoke-EnhancedADUserPasswordAudit.ps1
Invoke-EnhancedADUserPasswordAudit.ps1
<# .SYNOPSIS Audits Active Directory user accounts against a specified list of plaintext passwords. Results either stored to file or sent via email. This script integrates with Kieran Jacobsen's Enhanced Script Environment and requires its presence on the system. .DESCRIPTION This script prov...
PowerShellCorpus/Github/poshsecurity_Posh-PasswordAuditor/Functions/Test-UserCredential.ps1
Test-UserCredential.ps1
Set-StrictMode -Version 2 function Test-UserCredential { <# .SYNOPSIS Validates credentials for local or domain user. .DESCRIPTION This CMDLet validates a set of credentials against a local user or domain user. The CMDLet was developed by Andy Arismendi. The cr...
PowerShellCorpus/Github/poshsecurity_Posh-PasswordAuditor/Functions/Find-UserPassword.ps1
Find-UserPassword.ps1
Set-StrictMode -Version 2 function Find-UserPassword { <# .SYNOPSIS Test a user account against entries in a specified file. Users could be local or domain user accounts. .DESCRIPTION This CMDLet is basically a simple password file attack tool, allowing for the testing of ...
PowerShellCorpus/Github/matthiaspr_scripts/exchange/export_mailbox.ps1
export_mailbox.ps1
# Author: Matthiaspr # Date last modified: 22.06.2017 # This script has to be run in the Exchange Management Shell in order to function! # Powershell script for exporting Exchange mailboxes for a list of users $content = Get-Content C:\<path>\<to>\<text_file>.txt # One entry per line, either the users DisplayN...
PowerShellCorpus/Github/ConstantineK_tsql-snippets/powershell-sql/smtp/email-contents.ps1
email-contents.ps1
# emailer script param ( $from, $to, $subject, $body, $smtpserver, $port, $password, $username = $from, $ssl = 0 ) if ($from -eq $null -or $to -eq $null -or $smtpserver -eq $null -or $password -eq $null -or $port -eq $null) { Write-Host "Missing one of the parameters" } else { if ($from...
PowerShellCorpus/Github/ConstantineK_tsql-snippets/powershell-sql/run_script_on_all_dbs/connect.ps1
connect.ps1
$serverName = "example-pc" [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") # this is dirty, but it means when I run it the variable is available in the posh session, so I run this file and then do what I want New-Variable -name "sqlServer" -Value $(new-object ("Microsoft.SqlServer.Management.S...
PowerShellCorpus/Github/ConstantineK_tsql-snippets/powershell-sql/run_script_on_all_dbs/propertycheck.ps1
propertycheck.ps1
param( [string]$serverName = "example-pc", [string]$propertyFile = 'propertyfile.csv', [string]$dbFile = 'databases.csv', [string]$spocfile = 'sprocs.csv' ) Set-Location -Path "$home\Dropbox\github\tsql-snippets\powershell-sql\run_script_on_all_dbs" # # Dont touch anything under here # Push-Lo...
PowerShellCorpus/Github/ConstantineK_tsql-snippets/powershell-sql/run_script_on_all_dbs/run_console.ps1
run_console.ps1
# coding a simple menu interface to run the powershell scripts # simple example I am adapting from http://mspowershell.blogspot.co.uk/2009/02/cli-menu-in-powershell.html?m=1 param ( $folder = "$home\Dropbox\github\tsql-snippets\powershell-sql\run_script_on_all_dbs\" ) function Draw { param ( $items, ...
PowerShellCorpus/Github/ConstantineK_tsql-snippets/powershell-sql/run_script_on_all_dbs/run.ps1
run.ps1
foreach ($name in $sqlserver.databases.name) { # maybe change over to sqlcmd.exe, what I am reading is that this may have a few problems that are easier avoided than worked with Invoke-Sqlcmd # need to change this over to -InputFile sqlfile.sql -Database $name -Hostname localhost -QueryTimeou...
PowerShellCorpus/Github/ConstantineK_tsql-snippets/powershell-sql/run_script_on_all_dbs/all-in-one.ps1
all-in-one.ps1
Set-Location -Path "$home\Dropbox\github\tsql-snippets\powershell-sql\run_script_on_all_dbs" # This top zone sets up the variables for the script to run. # # I am working on moving the configuration to another file to make mistakes more apparent when modifying configuration, and making sure to test if they input ...