full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/richardychua_powershell/sqlazureIngestion.ps1
sqlazureIngestion.ps1
#Reference URL for SQL PaaS Script content borrowed below #https://azure.microsoft.com/en-us/documentation/articles/sql-database-elastic-pool-manage-powershell/ # Suspend the runbook if any errors, not just exceptions, are encountered $ErrorActionPreference = "Stop" #region Variables definition # Variables def...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_7.ps1
ADI-AzureSqlIngestionRunbook_7.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_7.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 7 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/SMI-DB_XlogsBackup.ps1
SMI-DB_XlogsBackup.ps1
<#*********************************************************************** SMI-DB&XLogsBackup.ps1 - Creates remote copies of SQL database and transaction logs backups and cleans off backups older than 5 days Created by: Richard Chua Date: October 27, 2016 ************************************************...
PowerShellCorpus/Github/richardychua_powershell/VCA-AppPoolRecycling.ps1
VCA-AppPoolRecycling.ps1
<#****************************************************************************** VCA-AppPoolRecycling.ps1 - Special App Pool Recycling Process for VCA Hospitals Created by: Richard Chua Date: April 26, 2017 ******************************************************************************#> set-strictmode -...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_5.ps1
ADI-AzureSqlIngestionRunbook_5.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_5.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 5 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/OMSAlertingBuildout3.ps1
OMSAlertingBuildout3.ps1
<#****************************************************************************** OMSAlertingBuildout3.ps1 - Build out alerts for client's OMS Workspace for Redis & AzureSQL Created by: Richard Chua Date: April 7, 2017 ******************************************************************************#> set-s...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_6.ps1
ADI-AzureSqlIngestionRunbook_6.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_6.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 6 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/OMSAlertingBuildout.ps1
OMSAlertingBuildout.ps1
<#****************************************************************************** OMSAlertingBuildout.ps1 - Build out alerts for client's OMS Workspace Created by: Richard Chua Date: November 23, 2016 ******************************************************************************#> set-strictmode -version...
PowerShellCorpus/Github/richardychua_powershell/Random Snippets.ps1
Random Snippets.ps1
# Pending Patches $UpdateSession = New-Object -ComObject Microsoft.Update.Session $SearchResult = $null $UpdateSearcher = $UpdateSession.CreateUpdateSearcher() $UpdateSearcher.Online = $true $SearchResult = $UpdateSearcher.Search("IsInstalled=0 and IsHidden=0") $SearchResult.Updates | Where { $_.BrowseOnly -eq 0 ...
PowerShellCorpus/Github/richardychua_powershell/SMI-NRSynthetics-ScriptDownloads.ps1
SMI-NRSynthetics-ScriptDownloads.ps1
<#****************************************************************************** SMI-NRSynthetics-ScriptDownloads.ps1 - Pulls New Relic Synthetic Monitor scripts for John Crane / Smiths Medical via REST API Created by: Richard Chua Date: November 15, 2016 ***********************************************...
PowerShellCorpus/Github/richardychua_powershell/NAbleWindowsProbeWrapper.ps1
NAbleWindowsProbeWrapper.ps1
<#*********************************************************************** NAbleWindowsProbeWrapper.ps1 - Checks for the installation of N-able Windows Probe and installs if necessary Installation: \\%installerLocation%\WindowsProbeSetup.exe /s /v" /qn CUSTOMERID=<customer ID> SERVERPROTOCOL=<protocol> SERVER...
PowerShellCorpus/Github/openpublishtest_Perf-Test2/.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/TsekNet_PowerShell/Set-PowerCfg/set-powercfg.ps1
set-powercfg.ps1
<# .SYNOPSIS Enable Custom Portware Laptop Power Config Settings such as don't sleep when lid closed .NOTES NAME: Set-LaptopPowerCfg.ps1 VERSION: 1.0 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 10/7/2016 #> #Import Laptop Power Profile. Includes do not sleep when lid closed on lap...
PowerShellCorpus/Github/TsekNet_PowerShell/Get-OldPasswords/Get-OldPasswords.ps1
Get-OldPasswords.ps1
<# .SYNOPSIS Finding service accounts with old passwords .NOTES NAME: Get-EmployeeIDFromUser.ps1 VERSION: 1.0 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 7/6/2015 #> Import-Module ActiveDirectory Function Main { Write-Host "### Finding service accounts with old passwords ...
PowerShellCorpus/Github/TsekNet_PowerShell/Create-CobblerKickstart/Create-CobblerKickstart.ps1
Create-CobblerKickstart.ps1
<# .SYNOPSIS Create Cobbler Kickstart command from XLSX import - used to kick off linux builds using cobbler kickstart config file. .NOTES NAME: Get-EmployeeIDFromUser.ps1 VERSION: 1.0 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 12/6/2015 #> #Declare the file path and sheet name $fil...
PowerShellCorpus/Github/TsekNet_PowerShell/Notify-PasswordExpiration/Notify-PasswordExpiration.ps1
Notify-PasswordExpiration.ps1
<# .SYNOPSIS Send emails to users whose passwords are expiring soon. See $OU and $DC variables to customize effected users. Requires RSAT to be installed on system executing this script .NOTES NAME: Notify-PasswordExpiration VERSION: 1.3 AUTHOR: Daniel Tsekhanskiy LASTED...
PowerShellCorpus/Github/TsekNet_PowerShell/Set-BitlockerPIN/Set-BitlockerPIN.ps1
Set-BitlockerPIN.ps1
<# .SYNOPSIS Prompt user for Bitlocker password after bitlocker/TPM has already been enabled. .NOTES NAME: Set-BitlockerPIN.ps1 VERSION: 1.2 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 11/9/16 #> #Loop until the user hits cancel, there is an error, or the PIN is set Do { #Con...
PowerShellCorpus/Github/TsekNet_PowerShell/Create-NewUser/Create-NewUser.ps1
Create-NewUser.ps1
<# .SYNOPSIS Automate new hire process using PowerShell GUI! Includes: Creating user account based on copied user. Sending new hire welcome email (cc hr) Creating file server share Requires RSAT to be installed on system executing this script .NOTES NAME: Cr...
PowerShellCorpus/Github/TsekNet_PowerShell/Get-SecurityGroupMembers/Get-SecurityGroupMembers.ps1
Get-SecurityGroupMembers.ps1
<# .SYNOPSIS Export Security Group Membership to CSV .NOTES NAME: Get-SecurityGroupMembers.ps1 VERSION: 1.0 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 2/7/2017 #> $users = import-csv “c:\temp\grouplist.csv" $output = ForEach ($item in $users) { # I like to assign eac...
PowerShellCorpus/Github/TsekNet_PowerShell/Get-EmployeeIDFromUser/Get-EmployeeIDFromUser.ps1
Get-EmployeeIDFromUser.ps1
<# .SYNOPSIS Get employeeid's based on samaccountname Used during migration, in conjunction with export of usernames's taken from other current domain Requires RSAT to be installed on system executing this script .NOTES NAME: Get-EmployeeIDFromUser.ps1 VERSION: 1.1 AUTH...
PowerShellCorpus/Github/TsekNet_PowerShell/Get-PCInfo/Get-PCInfo.ps1
Get-PCInfo.ps1
<# .SYNOPSIS Autoinventory script. Gets Computer name, Logged in user, Serial Number, Model, Version of Windows, Version of Office, Visual Studio, Visio, Project .NOTES NAME: Get-PCInfo.ps1 VERSION: 1.0 AUTHOR: Dumplati LASTEDIT: 7/8/2015 #> $hostname = hostname $user ...
PowerShellCorpus/Github/TsekNet_PowerShell/Get-PCInfo/Get-PCInfoHTML.ps1
Get-PCInfoHTML.ps1
<# .SYNOPSIS Autoinventory script. Gets Computer name, Logged in user, Serial Number, Model, Version of Windows, Version of Office, Visual Studio, Visio, Project .NOTES NAME: Get-PCInfoHTML.ps1 VERSION: 1.0 AUTHOR: Dumplati LASTEDIT: 7/8/2015 #> #Set-ExecutionPolicy Remo...
PowerShellCorpus/Github/TsekNet_PowerShell/Set-UID/Set-UATUID.ps1
Set-UATUID.ps1
<# .SYNOPSIS Set Posix attributes (uid, gid, etc) for other domains based on Main Domain .NOTES NAME: Set-UID.ps1 VERSION: 1.4 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 4/20/17 #> param([string]$WorkingDir= (Get-Location).ProviderPath) #region Global Variables $Script:Prog...
PowerShellCorpus/Github/TsekNet_PowerShell/Set-UID/Set-PRODUID.ps1
Set-PRODUID.ps1
<# .SYNOPSIS Set Posix attributes (uid, gid, etc) for other domains based on Main domain .NOTES NAME: Set-UID.ps1 VERSION: 1.4 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 4/20/17 #> param([string]$WorkingDir= (Get-Location).ProviderPath) #region Global Variables $Script:Prog...
PowerShellCorpus/Github/TsekNet_PowerShell/Find-OldUser/Find-OldUser.ps1
Find-OldUser.ps1
<# .SYNOPSIS Searches Active Directory for inactive user accounts .NOTES NAME: Find-OldUser.ps1 VERSION: 1.0 AUTHOR: Richard Horsley LASTEDIT: 6/9/2013 #> # Set this variable to find users that have not logged on to the domain for over this number of days. # Set this value...
PowerShellCorpus/Github/TsekNet_PowerShell/Spectrum-Installer/Savepath.ps1
Savepath.ps1
<# .SYNOPSIS Save Path environmental variable pre-java install for later restoration .NOTES NAME: Savepath.ps1 VERSION: 1.0 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 3/1/16 #> #If Temp dir does not exist on main drive, create it. md -force $env:TEMP # Save the path environmental v...
PowerShellCorpus/Github/TsekNet_PowerShell/Spectrum-Installer/Restorepath.ps1
Restorepath.ps1
<# .SYNOPSIS Restore Path environmental variable post-java install .NOTES NAME: Restorepath.ps1 VERSION: 1.0 AUTHOR: Daniel Tsekhanskiy LASTEDIT: 3/1/16 #> # Save the registry entry for the path environment variable to variable $Reg $Reg = "Registry::HKLM\System\CurrentControlSe...
PowerShellCorpus/Github/LevonBecker_zip-sqlbackups/Zip-SQLBackups.ps1
Zip-SQLBackups.ps1
#requires –version 2.0 #region Info <# .SYNOPSIS Compress SQL flat file backups in a given path. .DESCRIPTION This Powershell script will zip up all the files in a directory based on a given file extension. .NOTES AUTHOR: Levon Becker TITLE: Zip-SQLBackups VERSIO...
PowerShellCorpus/Github/vvmspace_choco-install/install-chocolatey.ps1
install-chocolatey.ps1
echo "!!! READ readme.md !!!" pause Set-ExecutionPolicy -ExecutionPolicy ALLSIGNED iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
PowerShellCorpus/Github/rjkey_JustForFun/MVVMExample/packages/Caliburn.Micro.Start.3.0.3/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) $project.DTE.ItemOperations.Navigate('http://caliburnmicro.com/documentation/nuget')
PowerShellCorpus/Github/rjkey_JustForFun/MVVMExample/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/rjkey_JustForFun/MVVMExample/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/OPSTest_E2E_Provision_1486544743018/.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/OPSTestPPE_E2E_Provision_2017_3_24_30_5_35/.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/mathesamuelhenry_MyConsoleApps/EntityFrameworkSample/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/mathesamuelhenry_MyConsoleApps/EntityFrameworkSample/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/mathesamuelhenry_MyConsoleApps/WCF/Products/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/mathesamuelhenry_MyConsoleApps/WCF/Products/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/swestner_posh/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
# Load posh-git example profile . "$home\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1" install-module z set-alias npp notepad++.exe set-alias ex explorer.exe $ccgit = "https://github.com/CareerCruising" function dd{ Param([String] $folder) $tempdir = [system.guid]::newguid().tostr...
PowerShellCorpus/Github/swestner_posh/Modules/csake/default.ps1
default.ps1
Framework "4.5.1x64" Task prep { cd (get-working) } Task clean -depends prep { api-clean } Task restore { nuget-restore } Task default -depends clean,build Task build -depends clean, restore { api-build } Task unit -depends build { api-unit } Task integration -depends build { api-integration } Task coverage...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/TortoiseGit.ps1
TortoiseGit.ps1
# TortoiseGit function private:Get-TortoiseGitPath { if ((Test-Path "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe") -eq $true) { # TortoiseGit 1.8.0 renamed TortoiseProc to TortoiseGitProc. return "C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe" } return "C:\Program Files\Tortoise...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/CheckVersion.ps1
CheckVersion.ps1
$Global:GitMissing = $false if (!(Get-Command git -TotalCount 1 -ErrorAction SilentlyContinue)) { Write-Warning "git command could not be found. Please create an alias or add it to your PATH." $Global:GitMissing = $true return } $requiredVersion = [Version]'1.7.2' if ((git --version 2> $null) -ma...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/Utils.ps1
Utils.ps1
# General Utility Functions function Invoke-NullCoalescing { $result = $null foreach($arg in $args) { if ($arg -is [ScriptBlock]) { $result = & $arg } else { $result = $arg } if ($result) { break } } $result } Set-Alias ?? Invoke-N...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/GitPrompt.ps1
GitPrompt.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration $global:GitPromptSettings = New-Object PSObject -Property @{ DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor BeforeText = ' [' ...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/GitUtils.ps1
GitUtils.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration function Get-GitDirectory { if ($Env:GIT_DIR) { $Env:GIT_DIR } else { Get-LocalOrParentPath .git } } function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.S...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/profile.example.ps1
profile.example.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) # Load posh-git module from current directory Import-Module .\posh-git # If module is installed in a default location ($env:PSModulePath), # use this instead (see about_Modules for more information): # Import-Module posh-git # Set...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/install.ps1
install.ps1
param([switch]$WhatIf = $false) if($PSVersionTable.PSVersion.Major -lt 2) { Write-Warning "posh-git requires PowerShell 2.0 or better; you have version $($Host.Version)." return } if(!(Test-Path $PROFILE)) { Write-Host "Creating PowerShell profile...`n$PROFILE" New-Item $PROFILE -Force -Type ...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/GitTabExpansion.ps1
GitTabExpansion.ps1
# Initial implementation by Jeremy Skinner # http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/ $Global:GitTabSettings = New-Object PSObject -Property @{ AllCommands = $false } $subcommands = @{ bisect = 'start bad good skip reset visualize replay log run' notes = 'edit ...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/chocolatey/tests/InstallChocolatey.Tests.ps1
InstallChocolatey.Tests.ps1
$packageName = "poshgit" cpack function Setup-Environment { Cleanup $env:poshGit = join-path (Resolve-Path .\Tests ) dahlbyk-posh-git-60be436.zip $profileScript = "function Prompt(){ `$host.ui.RawUI.WindowTitle = `"My Prompt`" }" (Set-Content $Profile -value $profileScript -Force) } function...
PowerShellCorpus/Github/swestner_posh/Modules/posh-git/chocolatey/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
function Insert-Script([ref]$originalScript, $script) { if(!($originalScript.Value -Contains $script)) { $originalScript.Value += $script } } try { $binRoot = join-path $env:systemdrive 'tools' $oldPromptOverride = "if(Test-Path Function:\Prompt) {Rename-Item Function:\Prompt PrePoshGitPrompt -Force}...
PowerShellCorpus/Github/swestner_posh/Modules/psake/psake.ps1
psake.ps1
# Helper script for those who want to run psake without importing the module. # Example run from PowerShell: # .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0" # Must match parameter definitions for psake.psm1/invoke-psake # otherwise named parameter binding fails param( [Parameter(Position = 0,Mandatory = ...
PowerShellCorpus/Github/eliagbayani_cassandra_conf/cassandra-env.ps1
cassandra-env.ps1
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may n...
PowerShellCorpus/Github/phamngocduy_TEAM1/WindowsFormsApplication/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/phamngocduy_TEAM1/WindowsFormsApplication/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/showkathm_ImportUtility/ATTS.ImportUtilityUI/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/showkathm_ImportUtility/ATTS.ImportUtilityUI/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/m-fahim_portHmServ/portHmServ.ps1
portHmServ.ps1
Import-Module ActiveDirectory # This script helps in bulk import of hMailServer user accounts from Active Directory using Async GUI # Provides complete control to sync accounts from specific Organization Unit or Group # CSV/TXT File can be use to import existing AD accounts to hMailServer # (C) 2015 m...
PowerShellCorpus/Github/vonlar_Create-folders-based-on-dates/folders-based-on-modified-date.ps1
folders-based-on-modified-date.ps1
$SourceDir = "C:\Users\RandyWalker\Desktop\Pictures\" $DestinationDir = "C:\Users\RandyWalker\Desktop\FolderPictures\" foreach ($file in get-childitem $SourceDir *.*) { $Directory = $DestinationDir + $file.LastWriteTime.ToString("yyyy-MM-dd") $FullDestinationDir if (!(Test-Path $Directory)) ...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1486497941724/.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/OPS-E2E-PPE_E2E_D_Provision_2017_5_9_22_12_44/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.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 url: ...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_23_24_58_27/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.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 url: ...
PowerShellCorpus/Github/John1s_StaticWebServer/src/Properties/PublishProfiles/UI-publish.ps1
UI-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'] = '97caac71-5e9f-4df...
PowerShellCorpus/Github/tescales_AzureDesktop/deployment/CustomScripts/New-AzureKV.ps1.ps1
New-AzureKV.ps1.ps1
<# Custom Script for Windows #>
PowerShellCorpus/Github/tescales_AzureDesktop/deployment/bin/Debug/staging/DeploymentResources/CustomScripts/New-AzureKV.ps1.ps1
New-AzureKV.ps1.ps1
<# Custom Script for Windows #>
PowerShellCorpus/Github/tescales_AzureDesktop/deployment/bin/Debug/staging/DeploymentResources/Scripts/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 = 'AzureDesktop', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerN...
PowerShellCorpus/Github/tescales_AzureDesktop/deployment/Scripts/installChoco.ps1
installChoco.ps1
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) choco install WindowsAzurePowershell
PowerShellCorpus/Github/tescales_AzureDesktop/deployment/Scripts/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 = 'AzureDesktop', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerN...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_Provision_2017_4_13_16_5_18/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.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 url: ...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 3/Warmup/willi.ps1
willi.ps1
$code = { $a = 1 $b = 100 $c = $a * $b $c } $code.Ast.FindAll( { $true }, $true) | Foreach-Object { $_.GetType().FullName } $code.Ast.FindAll( { param($willi) $willi.GetType().Name -eq 'AssignmentStatementAst' }, $true) | Out-GridView $code.Ast.FindAll( { param($willi) $willi.GetType()....
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 1/Administration of Nano Server/A_HyperVHost/02_CreateNANO.ps1
02_CreateNANO.ps1
#region PREREQUISITES # Variables $password = ConvertTo-SecureString -AsPlainText -Force -String 'Pa$$w0rd' $iso_X = 'C:\depot\iso_x\en_windows_server_2016_technical_preview_4_x64_dvd_7258292\' $VirtualHardDiskPath = (Get-VMHost).VirtualHardDiskPath # Nano creation module (from WS 2016 ISO...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 1/Administration of Nano Server/A_HyperVHost/03_CreateNANOVMs.ps1
03_CreateNANOVMs.ps1
<# sea-nano1: Workgroup, Gen1 sea-nano2: Domain, Gen2, DNS, Webserver sea-nano3: Domain, Gen2, VirtHost #> #region NANO1 $vmName = 'sea-nano11' $paramsNewVM = @{ Computername = $env:computername Name = $vmName Generation = 1 MemoryStartupBytes = 1GB...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 1/Administration of Nano Server/A_HyperVHost/01_PSDirect.ps1
01_PSDirect.ps1
# PREQUISITES $password = ConvertTo-SecureString 'Pa$$w0rd' -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential('contoso\administrator',$password) $vmDC1 = 'sea-dc1' # Check VM status Get-VM -Name $vmDC1 # PowerShell direct Invoke-Command -VMName $vmDC1 -Credential $cred -ScriptB...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 1/Administration of Nano Server/B_DomainClient/4_ConfigureNetworkServices.ps1
4_ConfigureNetworkServices.ps1
<# SESSIONS $computername = '192.168.0.' # sea-nano1 $computername = '192.168.0.' # sea-nano2 $computername = '192.168.0.' # sea-nano3 $pssession | Remove-PSSession $cimsession | Remove-CimSession $pssession = New-PSSession -ComputerName $computername -Credential ...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 1/Administration of Nano Server/B_DomainClient/3_Connecting_to_NANO.ps1
3_Connecting_to_NANO.ps1
#region GROUNDWORK # Find the nano server Get-DhcpServerv4Lease -ScopeId 192.168.0.0 -ComputerName sea-dc1 | Where-Object { $_.HostName -like 'sea-nano*' } # Variables $computername = '192.168.0.142' #nano2 $password = ConvertTo-SecureString 'Pa$$w0rd' -AsPlainText -Force $cred...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 1/Administration of Nano Server/B_DomainClient/5_DSC.ps1
5_DSC.ps1
# Check the current config. the current of NANO server Invoke-Command -Session $pssession -ScriptBlock { Get-Module -ListAvailable -Name *desired* Import-Module PSDesiredStateConfiguration Get-Command -Module PSDesiredStateConfiguration - Get-DscResource Get-DscLocalConfigurationManager } ...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/Test Driven Development with Pester/Module.Help.Tests.ps1
Module.Help.Tests.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.119 Created on: 4/12/2016 1:11 PM Created by: June Blender Organization: SAPIEN Technologies, Inc Filename: *.Help.Tests.ps1 =======...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/Test Driven Development with Pester/InModule.Help.Tests.ps1
InModule.Help.Tests.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.119 Created on: 4/12/2016 1:11 PM Created by: June Blender Organization: SAPIEN Technologies, Inc Filename: *.Help.Tests.ps1 =======...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/Test Driven Development with Pester/ManageProfiles/1.0.0.0/ManageProfiles.Integration.Tests.ps1
ManageProfiles.Integration.Tests.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.116 Created on: 3/7/2016 12:57 PM Author: June Blender Organization: SAPIEN Technologies, Inc Filename: ManageProfiles.Integration.Tests.p...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/Test Driven Development with Pester/ManageProfiles/1.0.0.0/ManageProfiles.Unit.Tests.ps1
ManageProfiles.Unit.Tests.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.116 Created on: 3/7/2016 12:57 PM Author: June Blender Organization: SAPIEN Technologies, Inc Filename: ManageProfiles.Unit.Tests.ps1 ===...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/07_KeepItSimple.ps1
07_KeepItSimple.ps1
$number07 = { 'KEEP IT SIMPLE' } # Array syntax Get-Process | Where-Object { $_.WS -gt 40MB} | Sort-Object -Property WS -Descending ps | ? { $_.WS -gt 40MB } | sort WS -des # PSv3: PSITEM Get-Process | where { $PSITEM.WS -gt 40MB } | sort WS -Descending # PSv3: Simplified syntax Get-Process | wh...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/10_WalkingOnThinIce.ps1
10_WalkingOnThinIce.ps1
$number10 = { 'WALKING ON THIN ICE' | Write-Warning Get-Help about_scrubby_cmdlets } #region RUNNER-UP 'localhost' | Test-Connection Get-Help Test-Connection -ShowWindow [pscustomobject]@{'Computername'='localhost'} | Test-Connection New-SmbShare -Name 'sales' -path 'c:\sales' -WhatIf ...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/09_LostInTranslation.ps1
09_LostInTranslation.ps1
$number09 = { 'LOST IN TRANSLATION' # -replace vs .replace } #region TEST 1 'Thomas Müller' -replace 'ü','ue' 'Thomas Müller'.replace('ü','ue') #endregion #region TEST 2 'Mesut Özil' -replace 'ö','oe' 'Mesut Özil'.replace('ö','oe') #endregion #region TEST 3 'Mesut Özi...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/03_CDXML.ps1
03_CDXML.ps1
$number04 = { 'CDXML' } #region WHAT IS CDXML ? # Cmdlet definition XML (CDXML) is a way to create a Windows PowerShell module from a WMI class # by using the cmdlets-over-objects technology that was introduced in Windows PowerShell 3.0. # The WMI source class Get-CimInstance -ClassNam...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/04_TheImpactOfSpeed.ps1
04_TheImpactOfSpeed.ps1
$number04 = { 'THE IMPACT OF SPEED HAS BEEN GREATLY EXAGGERATED' } # How many items do you want to add to your collections (array, arrayList)? $count = 20000 # Try 10.000 items (or less) first! #region Arraylist [System.Collections.ArrayList]$al = @() $durationAl = (Measure-Command { ...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/06_MrBool.ps1
06_MrBool.ps1
$number06 = { 'MR. BOOL AND THE EVIL SWITCH' } #region PROBLEM STATEMENT Get-NetFirewallRule -Enabled true New-ADUser -Name 'John' -Enabled $true Remove-ADUser -Identity 'John' -Confirm:$false #endregion #region INVESTIGATION # A: Custom type/System Enum: true, false, 1, 2 Get-NetFir...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/05_NiceTry.ps1
05_NiceTry.ps1
$number05 = { 'Nice try ...' # Trouble with ADWS } <# DELETE Groups Get-ADGroup -filter { name -like "Research DL Group*"} | Remove-ADGroup -Confirm:0 #> ## Tokenbloat demo # $ErrorActionPreference = 'SilentlyContinue' # Example OU New-ADOrganizationalUnit -Name 'Research' -ProtectedFro...
PowerShellCorpus/Github/KurtDeGreeff_PSConfEU2016/Day 2/I Hate Powershell/Demo/08_Consistency.ps1
08_Consistency.ps1
$number08 = { 'CONSINSTENCY' } # TRY CRTL J => SNIPPETS 1..10 | ForEach-Object ` { $_ } #region LOOPING Remove-Variable -Name a,b,c,d -ErrorAction SilentlyContinue 1..5 | ForEach-Object ` { $_ } foreach ($a in (1..5)) { $a | Write-Host -Foreg...
PowerShellCorpus/Github/cesaroll_OracleAndEntityFramework/SledDogEvent/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/cesaroll_OracleAndEntityFramework/SledDogEvent/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/cesaroll_OracleAndEntityFramework/QueriesAndLinQ/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/cesaroll_OracleAndEntityFramework/QueriesAndLinQ/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/cesaroll_OracleAndEntityFramework/QueriesAndLinQ/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/cesaroll_OracleAndEntityFramework/QueriesAndLinQ/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/cesaroll_OracleAndEntityFramework/OracleHR/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/cesaroll_OracleAndEntityFramework/OracleHR/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/staino83_powershell/Get-WannaCryReport.ps1
Get-WannaCryReport.ps1
#This will run a report for windows10 computers to see if they are patched against wannacry. #will export a CSV report to the same directory you run the script from #Example .\Get-WannaCryReport.ps1 -computers computer1 #Example .\Get-WannaCryReport.ps1 -computers computer1,computer2 #Example - search all computers...
PowerShellCorpus/Github/onurgoker_TFS-Test/MVCTFSSample/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/onurgoker_TFS-Test/MVCTFSSample/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/onurgoker_TFS-Test/MVCTFSSample/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/onurgoker_TFS-Test/MVCTFSSample/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...