full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/DrDrrae_Powershell/Test/GuiTest.ps1
GuiTest.ps1
$inputXML = @" <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.o...
PowerShellCorpus/Github/DrDrrae_Powershell/Test/TestingPowerRails/Template.ps1
Template.ps1
<# .SYNOPSIS Write a synopsis here .DESCRIPTION Write a description here .EXAMPLE C:\PS> ./TestingPowerRails.ps1 .NOTES Author: amastellone CreateDate: 02/08/2017 19:05:36 #> # Generated command for testing. Can be removed Write-Output "Reporting from TestingPowerRails!"
PowerShellCorpus/Github/DrDrrae_Powershell/Test/TestingPowerRails/TestingPowerRails.tests.ps1
TestingPowerRails.tests.ps1
# Pester testing. https://github.com/pester/Pester/wiki $myScript = "$PSScriptRoot\TestingPowerRails.ps1" Describe 'Unit Tests' { Context 'Basic Validation' { it 'Should run successfully' { if ($myScript -like '*ps1') { $run = invoke-expression $myScript } else { import-modul...
PowerShellCorpus/Github/DrDrrae_Powershell/Test/TestingPowerRails/psakeBuild.ps1
psakeBuild.ps1
properties { $script = "$PSScriptRoot\TestingPowerRails.ps1" } # Default task includes Analyzing and Testing of script task default -depends Analyze, Test # Analyze by running Invoke-ScriptAnalyzer. Check script against best known practices task Analyze { $saResults = Invoke-ScriptAnalyzer -Path $script ...
PowerShellCorpus/Github/DrDrrae_Powershell/Test/TestingPowerRails/TestingPowerRails.ps1
TestingPowerRails.ps1
function New-SWRandomPassword { [CmdletBinding(ConfirmImpact='None')] [OutputType([String])] Param ( [Parameter(Mandatory=$false)] [ValidateRange(1,2147483647)] [int]$PasswordLength = 8, [String[]]$InputStrings = @('abcdefghijklmnopqrstuvwxyz', 'ABCEFGHIJKLMNOPQRS...
PowerShellCorpus/Github/DrDrrae_Powershell/Test/TestingPowerRails/TestingPowerRails.psdeploy.ps1
TestingPowerRails.psdeploy.ps1
# Deploy the script to the c:\scripts directory Deploy 'Copy to scripts folder' { By Filesystem { FromSource '.\' To "c:\scripts\TestingPowerRails" Tagged Prod } }
PowerShellCorpus/Github/DrDrrae_Powershell/Test/TestingPowerRails/build.ps1
build.ps1
[cmdletbinding()] param( [string[]]$Task = 'default' # This task is defined in psakeBuild. We are just setting a default here. ) # Verify that we have PackageManagement module installed if(!(Get-Command Install-Module)) { throw 'PackageManagement is not installed. You need V5 or https://www.microsoft.com/en...
PowerShellCorpus/Github/DrDrrae_Powershell/ExcelerateHCS/CreateUser.ps1
CreateUser.ps1
<# # # Name: Create Excelerate Healthcare User # Author: Andrea Mastellone # Date: 2016-04-22 # Version: 0.1.201600422.1 # Copyright 2016 # #> #Requires -Modules ActiveDirectory #Requires -PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn #Requires -Version 4.0 #Requires -RunAsAdministrator #...
PowerShellCorpus/Github/DrDrrae_Powershell/LetsEncrypt/Update-RDSCertificate.ps1
Update-RDSCertificate.ps1
#Requires -Modules RemoteDesktop #Requires -Version 3.0 #Requires -RunAsAdministrator # Check if script is run as Administrator. If it is, then continue, if not, write an error and exit. $isAdministrator = [bool](([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544") if ($isAd...
PowerShellCorpus/Github/DrDrrae_Powershell/DeployCryptoBlocker/DeployCryptoBlocker2012.ps1
DeployCryptoBlocker2012.ps1
# DeployCryptoBlocker2012.ps1 # # This script performs the following actions: # 1) Checks for network shares # 2) Install File Server Resource Manager (FSRM) if missing # 3) Creates Batch and PowerShell scripts used by FSRM # 4) Creates a File Group within FSRM containing malicious extensions to screen on # 5) C...
PowerShellCorpus/Github/DrDrrae_Powershell/DeployCryptoBlocker/DeployCryptoBlocker2008.ps1
DeployCryptoBlocker2008.ps1
# DeployCryptoBlocker2008.ps1 # # This script performs the following actions: # 1) Checks for network shares # 2) Install File Server Resource Manager (FSRM) if missing # 3) Creates Batch and PowerShell scripts used by FSRM # 4) Creates a File Group within FSRM containing malicious extensions to screen on # 5) C...
PowerShellCorpus/Github/MattBrowne_Hello-World/Hello-World.ps1
Hello-World.ps1
<# .SYNOPSIS Just a Hello-World Script .DESCRIPTION This is a test script that is just used for playing with stuff, and Git Hub etc. .PARAMETER computername Here, the dotted keyword is followed by a single parameter name. Don't precede that with a hyphen. The following lines describe the purpose of the ...
PowerShellCorpus/Github/judares_server/Web Service/packages/Newtonsoft.Json.5.0.8/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/judares_server/Web Service/packages/Microsoft.Bcl.Build.1.0.13/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) # This is the MSBuild targets file to add $targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets') # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=ne...
PowerShellCorpus/Github/judares_server/Web Service/packages/Microsoft.Bcl.Build.1.0.13/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Need to load MSBuild assembly if it's not loaded yet. Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' # Grab the loaded MSBuild project for the project $msbuild = [Microsoft.Build.Evaluatio...
PowerShellCorpus/Github/judares_server/Web Service/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/judares_server/Web Service/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/wesleykirkland_MiscPowershell/Plex_CouchPotato_Comparision.ps1
Plex_CouchPotato_Comparision.ps1
#Check local powershell version if (!($PSVersionTable.PSVersion.Major -ge '4')) { Write-Warning "You need to update powershell, please visit https://www.microsoft.com/en-us/download/details.aspx?id=40855 to download the latest version. Until then I will now exit" ;exit } #Change these variables, note this scr...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Obfuscating_With_Booleans.ps1
Obfuscating_With_Booleans.ps1
<#Silly way of obfuscating code. The function converts a given command to a series of null-arrays, which can then be decoded back into the original command. To run the obfuscated command, you can invoke it like so: From file: iex ([system.text.encoding]::utf8.getstring((get-content $OutputPath | foreach {(iex $_)})...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Computer-Rename.ps1
Computer-Rename.ps1
<# .SYNOPSYS When you run the script it will check if you have ran the script all the way previously based upon the site prefix. If you have not it will help you build a computer name. Once the computer name is built it will check if it exists inside of AD and if it does not it will rename the computer to the...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Base64_Encode_For_Formatting.ps1
Base64_Encode_For_Formatting.ps1
Write-Output 'This script will read files as bytes/hex and keep all the random encoding and stuff' $SourceFile = Read-Host 'What is the file that you would like to encode?' $Content = Get-Content -Path $SourceFile -Encoding Byte $Base64 = [System.Convert]::ToBase64String($Content) Write-Output 'Outputting the...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Event-Log-QA.ps1
Event-Log-QA.ps1
<# .SYNOPSYS . .DESCRIPTION . .PARAMETER ComputerName Name of the Server to query .PARAMETER Log Name of the Server to query .EXAMPLE Event-Log-QA.PS1 <server> .NOTES Script to create local admins group for server builds and / or add accounts to the group Wesley Kirkland 12/05/2014 #> [CmdletBin...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/New-EC2InstanceProgramattic.ps1
New-EC2InstanceProgramattic.ps1
#Working Sample function New-EC2InstanceProgramattic { [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [string]$Name, [Parameter(Mandatory=$true)] [int]$Number ) DynamicParam { $paramDictionary = New-Object -Type System.Mana...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Write-WindowsLogo.ps1
Write-WindowsLogo.ps1
function Write-WindowsLogo { Write-Host -Object ("") Write-Host -Object ("") Write-Host -Object (" ,.=:^!^!t3Z3z., ") -ForegroundColor Red Write-Host -Object (" :tt:::tt333EE3 ") -ForegroundColor Red Write-Host -Object (" Et:::ztt33EEE "...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Generate-Secure Credentials.ps1
Generate-Secure Credentials.ps1
# ask for credentials $cred = Get-Credential $pass = $cred.Password $user = $cred.UserName # create random encryption key $key = 1..32 | ForEach-Object { Get-Random -Maximum 256 } # encrypt password with key $passencrypted = $pass | ConvertFrom-SecureString -Key $key # turn key and password into text repr...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Security_Folder_and_Group_Creation.ps1
Security_Folder_and_Group_Creation.ps1
<# .SYNOPSIS This script is designed to help aid in creating Shares for protected access .DESCRIPTION This script will take the correct input and create a new folder on a share with broken inheritiance to apply specific permissions Author: Wesley Kirkland .PARAMETER Folder_Name...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Dynamically_Remove_Invalid_Name_Servers_From_Hosted_AD_DNS_Zones.ps1
Dynamically_Remove_Invalid_Name_Servers_From_Hosted_AD_DNS_Zones.ps1
#This script will dynamically remove invalid name servers from AD Integrated DNS zones that are non-default zones #The script will scan all AD Integrated DNS Zones and exclude default zones such as Trust Anchors and your msdsc zone(s), it will then attempt to resolve DNS for each entry. #If DNS can not be resolved it...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Netezza/Connect_To_Netezza.ps1
Connect_To_Netezza.ps1
#Function to establish a connection to Netezza function New-NetezzaSQLConnection { #Params [CmdletBinding()] Param( [parameter(Position=0,Mandatory=$true)] $ServerInstance, [parameter(Position=1,Mandatory=$true)] $Database, [parameter()] [System.Management.Autom...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/MYSQL/Powershell_MySQL_Connector.ps1
Powershell_MySQL_Connector.ps1
Function Connect-MYSQL { Param( [Parameter(Mandatory = $true,ParameterSetName = '',ValueFromPipeline = $true)] [string]$Query, [Parameter(Mandatory=$true)] [switch]$MySQLAdminUserName, [Parameter(Mandatory=$true)] [switch]$MySQLAdminPassword, [Parameter(Mandatory=$t...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/VMWare/Add_Vlans_To_Production.ps1
Add_Vlans_To_Production.ps1
#Connect to vCenter Connect-VIServer vcenter $servers = Get-Cluster -Name "Cluster Name" | Get-VMHost #I would suggest doing a GC on this [array]$Vlans = @('760') foreach ($VMHost in $servers) { Write-Output "Working on $VMHost" #Get Virtual Switch on host $vSwitch0 = Get-VirtualSwitch -VMHost ...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/VMWare/Add_BootISOs_NFS_Share_Read_Only.ps1
Add_BootISOs_NFS_Share_Read_Only.ps1
Get-PSSnapin -Registered | Add-PSSnapin Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Scope Session -Confirm:$false #Set default certification acction Connect-VIServer vcenter #Connect to vCenter #WildCard Clusters, Clusters to add to $Clusters = @('*Cluster1*','*Cluster2*','*Ora*') #Foreach ar...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/VMWare/Disconnect-Known-Isos.ps1
Disconnect-Known-Isos.ps1
#Script to auto disconnect know Isos's #Written by Wesley Kirkland 11-19-14 #Add Powercli Get-PSSnapin -Registered | Add-PSSnapin #Connect to the vCenter Server Connect-VIServer -Server $vcenter -WarningAction SilentlyContinue | Out-Null #Generate Report of vms with attached SCCM iso's to say hey this will ...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/MSSQL/Connect_and_Verify_MSSQL.ps1
Connect_and_Verify_MSSQL.ps1
#Test SQL Server Connection Function Test-SQLConnection { #Params [CmdletBinding()] Param( [parameter(Position=0,Mandatory=$true)] $ServerInstance, [parameter()] [System.Management.Automation.PSCredential]$Cred, [parameter()] [switch]$NoSSPI = $false ) ...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/MSSQL/Connect_to_MSSQL_Advanced.ps1
Connect_to_MSSQL_Advanced.ps1
#Function to open up MSSQL Connection function New-MSSQLConnection { #Params [CmdletBinding()] Param( [parameter(Position=0,Mandatory=$true)] $ServerInstance, [parameter(Position=1,Mandatory=$true)] $Database, [parameter()] [System.Management.Automation.PSCreden...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/iLO/Configure_iLO_For_AD_Auth.ps1
Configure_iLO_For_AD_Auth.ps1
#Requires -Modules HPiLOCmdlets #Requires -Version 4 <# .SYNOPSIS This script will preconfigure HP iLOs to our Standards .DESCRIPTION This script will take the input of a DNS name or IP address and configure the iLO, it will first check if the iLO is version 3 and above and if it can autheni...
PowerShellCorpus/Github/wesleykirkland_MiscPowershell/Printers/Printer-Migration.ps1
Printer-Migration.ps1
<# .SYNOPSYS . .DESCRIPTION Script designed to help automate printer migrations Requires Powershell Version 4 on the client side .EXAMPLE Printer-Migration.PS1 .NOTES Script to help automate printer migrations, was designed for 2003 x86 to 2008 R2 specifically buts work in other variations. Wesley Ki...
PowerShellCorpus/Github/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment1/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment1/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment1/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment3/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment3/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment3/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment2/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment2/packages/jQuery.2.1.4/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/DiegoCaridei_Microsoft-DEV203x-Introduction-to-Bootstrap/BootStrapAssignment2/packages/jQuery.2.1.4/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/ae-krasnov_epam-dev/Task4/Accessor/packages/NLog.Config.2.1.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) $configItem = $project.ProjectItems.Item("NLog.config") # set 'Copy To Output Directory' to 'Copy if newer' $copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory") $copyToOutput.Value = 1 # set 'Build Action' to 'Content' $buildAction = $confi...
PowerShellCorpus/Github/ae-krasnov_epam-dev/Task4/Accessor/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/ae-krasnov_epam-dev/Task4/Accessor/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/ae-krasnov_epam-dev/Task6/Accessor/packages/NLog.Config.2.1.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) $configItem = $project.ProjectItems.Item("NLog.config") # set 'Copy To Output Directory' to 'Copy if newer' $copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory") $copyToOutput.Value = 1 # set 'Build Action' to 'Content' $buildAction = $confi...
PowerShellCorpus/Github/ae-krasnov_epam-dev/Task6/Accessor/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/ae-krasnov_epam-dev/Task6/Accessor/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/ae-krasnov_epam-dev/Task5/Accessor/packages/NLog.Config.2.1.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) $configItem = $project.ProjectItems.Item("NLog.config") # set 'Copy To Output Directory' to 'Copy if newer' $copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory") $copyToOutput.Value = 1 # set 'Build Action' to 'Content' $buildAction = $confi...
PowerShellCorpus/Github/ae-krasnov_epam-dev/Task5/Accessor/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/ae-krasnov_epam-dev/Task5/Accessor/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/ae-krasnov_epam-dev/Task7/Accessor/packages/NLog.Config.2.1.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) $configItem = $project.ProjectItems.Item("NLog.config") # set 'Copy To Output Directory' to 'Copy if newer' $copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory") $copyToOutput.Value = 1 # set 'Build Action' to 'Content' $buildAction = $confi...
PowerShellCorpus/Github/ae-krasnov_epam-dev/Task7/Accessor/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/ae-krasnov_epam-dev/Task7/Accessor/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/ae-krasnov_epam-dev/Task3/Accessor/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/ae-krasnov_epam-dev/Task3/Accessor/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/ae-krasnov_epam-dev/Task8/Accessor/packages/NLog.Config.2.1.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) $configItem = $project.ProjectItems.Item("NLog.config") # set 'Copy To Output Directory' to 'Copy if newer' $copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory") $copyToOutput.Value = 1 # set 'Build Action' to 'Content' $buildAction = $confi...
PowerShellCorpus/Github/ae-krasnov_epam-dev/Task8/Accessor/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/ae-krasnov_epam-dev/Task8/Accessor/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/ae-krasnov_epam-dev/Task2/Accessor/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/ae-krasnov_epam-dev/Task2/Accessor/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/adilamean_Patchy/Find-WindowsUpdate.ps1
Find-WindowsUpdate.ps1
function Find-WindowsUpdate { <# .Synopsis Finds updates for windows and other products .Description Finds updates for windows and other products that use the Microsoft Update system. .Example Find-WindowsUpdate .Link Get-InstalledUpdate #> param( ...
PowerShellCorpus/Github/adilamean_Patchy/Get-InstalledUpdate.ps1
Get-InstalledUpdate.ps1
function Get-InstalledUpdate { <# .Synopsis Gets updates installed on the system .Description Gets windows and microsoft updates installed on the system .Example Get-InstalledUpdate .Link Get-InstalledKBNumber #> param() process { ...
PowerShellCorpus/Github/adilamean_Patchy/Disable-WindowsUpdate.ps1
Disable-WindowsUpdate.ps1
function Disable-WindowsUpdate { <# .Synopsis Disables automatic updates .Description Disables automatic updates on the current machine .Link Enable-WindowsUpdate #> $AUSettigns = (New-Object -com "Microsoft.Update.AutoUpdate").Settings $AUSettigns.No...
PowerShellCorpus/Github/adilamean_Patchy/Get-InstalledKBNumber.ps1
Get-InstalledKBNumber.ps1
function Get-InstalledKBNumber { <# .Synopsis Gets the installed KB numbers .Description Gets the installed KB numbers on the current machine .Link Get-InstalledUpdate .Example Get-InstalledKBNumber #> param() Get-InstalledUpdate | ...
PowerShellCorpus/Github/adilamean_Patchy/Test-UpdateRebootRequired.ps1
Test-UpdateRebootRequired.ps1
function Test-UpdateRebootRequired { <# .Synopsis Determines a reboot is required .Description Determines if a reboot is required after applying an update. .Link Install-WindowsUpdate #> param() end { (New-Object -ComObject "Microsoft.Upd...
PowerShellCorpus/Github/adilamean_Patchy/Install-WindowsUpdate.ps1
Install-WindowsUpdate.ps1
function Install-WindowsUpdate { <# .Synopsis Installs windows updates .Description Installs windows updates discovered with Find-WindowsUpdate .Example Find-WindowsUpdate -Recommended | Install-WindowsUpdate .Link Find-WindowsUpdate #> ...
PowerShellCorpus/Github/adilamean_Patchy/Patchy.ezformat.ps1
Patchy.ezformat.ps1
$moduleName = 'Patchy' $ModuleRoot = "$home\Documents\WindowsPowerShell\Modules\$moduleName" $formatting = @() $formatting += Write-FormatView -TypeName "System.__ComObject#{c1c2f21a-d2f4-4902-b5c6-8a081c19a890}", "System.__ComObject#{70cf5c82-8642-42bb-9dbc-0cfd2...
PowerShellCorpus/Github/adilamean_Patchy/Enable-WindowsUpdate.ps1
Enable-WindowsUpdate.ps1
function Enable-WindowsUpdate { <# .Synopsis Enables automatic updates .Description Enables automatic updates on the current machine .Link Disable-WindowsUpdate #> $AUSettigns = (New-Object -com "Microsoft.Update.AutoUpdate").Settings $AUSettigns....
PowerShellCorpus/Github/kyanro_mytool/1週間以内に更新されたファイルを表示/Get-RecentlyFile.ps1
Get-RecentlyFile.ps1
param( [string] $pattern=$null, [datetime] $date=(Get-Date).AddDays(-7) ) $inputPattern = Read-Host "検索したいパターン(正規表現)を入力するといいよ" if(($inputPattern -eq $null) -or ($inputPattern -eq "")){ $pattern = $inputPattern } $inputFromDate = Read-Host "検索の起点にしたい日付を入力するといいよ(yyyy/m/d)" if(($inputF...
PowerShellCorpus/Github/kyanro_mytool/1週間以内に更新されたファイルを表示/Get-RecentlyFile_for20.ps1
Get-RecentlyFile_for20.ps1
param( [string] $pattern=$null, [datetime] $date=(Get-Date).AddDays(-7) ) $inputPattern = Read-Host "検索したいパターン(正規表現)を入力するといいよ" if(($inputPattern -eq $null) -or ($inputPattern -eq "")){ $pattern = $inputPattern } $inputFromDate = Read-Host "検索の起点にしたい日付を入力するといいよ(yyyy/m/d)" if(($inputF...
PowerShellCorpus/Github/Tervis-Tumbler_OperationsMetrics/load.ps1
load.ps1
param( [String] $l, [String] $url, [String] $u, [String] $user, [String] $i, [String] $index, [switch] $h = $false, [switch] $help = $false ) # The default value of the variable. Initialize your own variables here $ELASTICSEARCH="http://localhost:9200" $CURL="Invoke-RestMethod" $KIBANA_INDEX=".kiba...
PowerShellCorpus/Github/Tervis-Tumbler_OperationsMetrics/SendCSVToLogstash.ps1
SendCSVToLogstash.ps1
#POC #Invoke-WebRequest -Uri http://localhost:8080 -ContentType "application/json" -Body '{"thing":"value", "thing2":"Value2"}' -Method Post function Send-CSVToLogstash { param( $CSVFilePath ) $CSVFileRecords = Import-Csv -Delimiter ',' -Path $CSVFilePath $CSVFileRecords | % { $p...
PowerShellCorpus/Github/Tervis-Tumbler_OperationsMetrics/ParseCSVHeaderIntoFormNeededForLogstashConfig.ps1
ParseCSVHeaderIntoFormNeededForLogstashConfig.ps1
$CSVHeader = "Run ID,Sales Channel,Shpmt Priority,Order Type,Item Type,Customer PO,Order Source,SO #,SO Line #,Item #,Item Description,Item Size,Cup Sizes In Order,Line Item Qty,Dec ID,Item $ Amt,Inner Color,Lid Color,Ship Set,Bill To #,Bill To Name,Ship To Loc #,Ship To Country,Ship Complete?,Ultimate Ship-to Store #,...
PowerShellCorpus/Github/SaibersysTesting_Akhila_Devops_Azure/VMonAzure.ps1
VMonAzure.ps1
$family="Windows Server 2012 R2 Datacenter" $image=Get-AzureVMImage | where { $_.ImageFamily -eq $family } | sort PublishedDate -Descending | select -ExpandProperty ImageName -First 1 $vmname="Sample" $vmsize="Medium" $vm1=New-AzureVMConfig -Name $vmname -InstanceSize $vmsize -ImageName $image $cred=Get-Credenti...
PowerShellCorpus/Github/hmontoliu_robocopy_backups/lib_copias.ps1
lib_copias.ps1
# Use a good editor like vim in GNU/Linux or notepad++ # variables generales (RUNDIR debe definirse en los scripts que llaman a este $RUNDIR = "C:\_backups\" $TOOLSDIR = "${RUNDIR}\tools\" # Opciones recomenadadas para robocopy $opts="/NP /MIR /R:1 /W:1 /XJ /FFT /TEE" # /NP - No mostrar el progr...
PowerShellCorpus/Github/hmontoliu_robocopy_backups/vss_copia_disco_c.ps1
vss_copia_disco_c.ps1
# VSS requiere privilegios elevados (admin, backup operator y/o Performance Log # Users) o bien que los binarios tengan privilegios (peligroso) # basado en http://vscsc.sourceforge.net/ $COMMONSETTINGS = "C:\_backups\lib_copias.ps1" . $COMMONSETTINGS cd $RUNDIR # Modificar si procede $USUARIO = "user" # nombr...
PowerShellCorpus/Github/hmontoliu_robocopy_backups/documentsandoutlook.ps1
documentsandoutlook.ps1
# Use a good editor like vim in GNU/Linux or notepad++ $COMMONSETTINGS = "C:\_backups\lib_copias.ps1" . $COMMONSETTINGS cd $RUNDIR # Modificar si procede: $LOGBASENAME = "documentos_y_correo" $ROTATEIDX = 1 # 1 a 7 $DESTBASE="D:\copias_seguridad\${env:USERNAME}\" # No Modificar $logfile="${log_dir}\${LOGB...
PowerShellCorpus/Github/billcurtis_Public/SCVMM/Get-VMIOPS.ps1
Get-VMIOPS.ps1
#This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. #THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT #LIMITED TO THE IMPLIED WARRANTIES OF MERCHANT...
PowerShellCorpus/Github/billcurtis_Public/SCVMM/Get-VMMClusterUtil.ps1
Get-VMMClusterUtil.ps1
#This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment. #THIS SAMPLE CODE AND ANY RELATED INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT #LIMITED TO THE IMPLIED WARRANTIES OF MERCHANT...
PowerShellCorpus/Github/billcurtis_Public/Hyper-V/Set-VMProcessorCompatibility.ps1
Set-VMProcessorCompatibility.ps1
Function Set-VMProcessorCompatibility { param ( [Parameter(Mandatory = $true)] [string] $VMClusterFQDN ) cls #Get the hosts that belong to the cluster $Hosts = Get-SCVMHost | ? {$_.HostCluster -match $VMClusterFQDN} Foreach ($vHost in $Hosts) ...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/LabInstaller.ps1
LabInstaller.ps1
Param( [Parameter(Mandatory=$true)] [int]$DeploytoLab ) Import-Module virtualmachinemanager $vmmserver = Get-SCVMMServer -ComputerName VMMServer If (!$vmmserver) {Throw "Something went wrong connecting to the VMM Server.";break} $ErrorActionPreference = "Stop" ############LAB 1 Write-Host "`nBegin ...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/Create-SDNLab.ps1
Create-SDNLab.ps1
<#Nested SDN Lab Generator Version 1.0 11-13-2016 wcurtis@microsoft.com Description: ########### Deploys the SDN Lab in a Nested environment. Parameters ########## NestedVMMemoryinGB ------------------ (INT) - Amount of RAM for the SDN Host will have. Enter the gigabyte value. Ensure that your ...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionFabrikam.ps1
ProvisionFabrikam.ps1
Param ($ParentDiskPath, $vmpath, $OSVHDX, $Unattendpath, $Assetspath) $VMName = "Fabrikam" #Create Private vSwitch $switch = Get-VMSwitch | ?{$_.name -eq "vSwitch-Fabrikam"} if (!$switch){New-VMSwitch vSwitch-Fabrikam -SwitchType Private | Out-Null} $localCred = new-object -typename System.Management....
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionBGPTOR.ps1
ProvisionBGPTOR.ps1
Param ($ParentDiskPath,$vmpath, $OSVHDX, $Unattendpath, $Assetspath) $localCred = new-object -typename System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString "Password01" -AsPlainText -Force) $VMName = "BGP-TOR-Router" #Create Virtual Machine $date = Get-dat...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionWoodGrove.ps1
ProvisionWoodGrove.ps1
Param ($ParentDiskPath, $vmpath, $OSVHDX, $Unattendpath, $Assetspath) $VMName = "WoodGrove" #Create Private vSwitch $switch = Get-VMSwitch | ?{$_.name -eq "vSwitch-WoodGrove"} if (!$switch){New-VMSwitch vSwitch-WoodGrove -SwitchType Private | Out-Null} $localCred = new-object -typename System.Manage...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionVMMServer.ps1
ProvisionVMMServer.ps1
Param ($ParentDiskPath, $OSVHDX, $DeploymentSourceFiles, $vmpath) $VMName = "VMMserver" $VHDPath = $vmpath + "VMMServer\" $BaseVHDPath = $ParentDiskPath + $OSVHDX $localCred = new-object -typename System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString "Password01" -...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionProseware.ps1
ProvisionProseware.ps1
Param ($ParentDiskPath, $vmpath, $OSVHDX, $Unattendpath, $Assetspath) $VMName = "Proseware" #Create Private vSwitch $switch = Get-VMSwitch | ?{$_.name -eq "vSwitch-Proseware"} if (!$switch){New-VMSwitch vSwitch-Proseware -SwitchType Private | Out-Null} $localCred = new-object -typename System.Manageme...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionSDNHost1VMs.ps1
ProvisionSDNHost1VMs.ps1
$ParentDiskPath = "C:\VMs\Base\" $vmpath = "C:\VMs\" $OSVHDX = "WS2016.vhdx" $VMStoragePathforOtherHosts = "E:\" $SourcePath = 'C:\VMConfigs' $LogFilePath = "C:\" #Set variables $Assetspath = "$SourcePath\Assets" $DeploymentSourceFiles = "$SourcePath\VMMImagePayload.wim" $BGPXML = "$SourcePath\BGPTOR.x...
PowerShellCorpus/Github/billcurtis_Public/SDNNESTED/VMConfigs/ProvisionContosoDC.ps1
ProvisionContosoDC.ps1
Param ($ParentDiskPath,$vmPath,$OSVHDX,$Unattendpath,$Assetspath) $VMName = "CONTOSODC" $ProgressPreference = "SilentlyContinue" #Local Credential $localCred = new-object -typename System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString "Password01" -AsP...
PowerShellCorpus/Github/billcurtis_Public/WAP/WAPInstaller.ps1
WAPInstaller.ps1
$VerbosePreference = "Continue" #Disable Firewall Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False #Enable Powershell set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 #Disable IE-ESC $AdminKey = "HKLM:\SOFTWARE\Microsoft...
PowerShellCorpus/Github/billcurtis_Public/WAP/DeployWAP.ps1
DeployWAP.ps1
Import-Module virtualmachinemanager $vmmserver = Get-SCVMMServer -ComputerName VMMServer If (!$vmmserver) {Throw "Something went wrong connecting to the VMM Server.";break} $ErrorActionPreference = "Stop" #Import WAP Service Template $package = Get-SCTemplatePackage -Path "C:\Templates\Windows Azure Pack ...
PowerShellCorpus/Github/billcurtis_Public/WAP/AutoImportVMtoWAP.ps1
AutoImportVMtoWAP.ps1
function Get-AdfsToken([string]$adfsAddress, [PSCredential]$credential) { $clientRealm = 'http://azureservices/AdminSite' $allowSelfSignCertificates = $true Add-Type -AssemblyName 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Add-Type -AssemblyName 'Syste...
PowerShellCorpus/Github/billcurtis_Public/SDN/Unblock-Ports.ps1
Unblock-Ports.ps1
#Gets VM NICs and sets the Port Profile to unblock the ports on NC Managed Host. #Run this script on the Hyper-V Host with VFP filtering enabled. param([string]$VMName) #Import Hyper-V Module Import-Module Hyper-V #Set Verbose $VerbosePreference = "Continue" #Port Profile Settings $PortProfileFeatureI...
PowerShellCorpus/Github/billcurtis_Public/SDN/EnableGateways.ps1
EnableGateways.ps1
#Workaround for bug #9528925. This script is not necessary if running VMM 2016 UR2 or higher #Description - Iterates through all deployed virtual gateways and enables them in Network Controller #wcurtis@microsoft.com 11/18/2016 $uri = "https://nc-cluster.contoso.com" $domainCred = new-object -typename Syst...
PowerShellCorpus/Github/billcurtis_Public/SDN/Config-L3.ps1
Config-L3.ps1
#Purpose of script is to create a SDN L3 Gateway. Script source is from Technet, with some #modifications to make creating L3 connections easier (at least for me) to understand. #Example #.\Config-L3.ps1 -L3VPNConnectionName L3 -VmNetworkName "L3Tenants" -NextHopVmNetworkName CURTIS.DOM -LocalIPAddresses @("192....
PowerShellCorpus/Github/billcurtis_Public/SDN/AdvertiseVIPS.ps1
AdvertiseVIPS.ps1
# Private VIP Logical Network $ipPool1 = Get-SCStaticIPAddressPool -Name "Private VIPs IP Pool" $ipPool2 = Get-SCStaticIPAddressPool -Name "Public VIPs IP Pool"   # Get Fabric role 'config', the GUID used is associated with SLB Manager role $networkService = Get-SCNetworkService -Name "NC" $fabricRole = Get-SCFab...