full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/mkeeton_BasicIdentity/BasicIdentity/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/mkeeton_BasicIdentity/BasicIdentity/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/mkeeton_BasicIdentity/BasicIdentity/packages/EntityFramework.6.1.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/mkeeton_BasicIdentity/BasicIdentity/packages/EntityFramework.6.1.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/Saqo_OSStudio/OSStudio/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/Saqo_OSStudio/OSStudio/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/Saqo_OSStudio/OSStudio/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/Saqo_OSStudio/OSStudio/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/Saqo_OSStudio/OSStudio/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/Saqo_OSStudio/OSStudio/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/Saqo_OSStudio/OSStudio/packages/EntityFramework.6.1.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/Saqo_OSStudio/OSStudio/packages/EntityFramework.6.1.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/Saqo_OSStudio/OSStudio/packages/Newtonsoft.Json.6.0.3/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/horacio3_Bastion/Pull_RDPGW_SSL.ps1
Pull_RDPGW_SSL.ps1
param( [Parameter(Mandatory=$true)][string] $BastionDNS ) $VerbosePreference = 'Continue' $uri = "https://$BastionDNS" do { $rerun = $true try { Invoke-WebRequest -Uri $uri -ErrorAction SilentlyContinue -UseBasicParsing } catch { Write-Verbose "Error retrieving configuration: $(...
PowerShellCorpus/Github/kylog_win2012r2-x64/win2012r2_bootstrap.ps1
win2012r2_bootstrap.ps1
# Install packages iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) choco install git cmake mingw 7zip.commandline ag diffmerge notepad2 ruby wincommandpaste git-credential-winstore # Setup PATH $env:PATH = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" +...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/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/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/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/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/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/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/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/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/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/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/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/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/packages/EntityFramework.6.1.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/packages/EntityFramework.6.1.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Context/MvcWebApplicationContext/packages/Newtonsoft.Json.6.0.4/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Telerik/KendoApplication1/packages/Newtonsoft.Json.6.0.4/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/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/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/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/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/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/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/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/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/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/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/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/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/packages/EntityFramework.6.1.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/packages/EntityFramework.6.1.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/foyzulkarim_RnDs/Web/Handler/MvcWebApplication/packages/Newtonsoft.Json.6.0.4/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # open json.net splash page on package install # don't open if json.net is installed as a dependency try { $url = "http://james.newtonking.com/json" $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindow.Caption -eq "Package Manager Con...
PowerShellCorpus/Github/FrankTuckerCA_powershell/Get-DellFile.ps1
Get-DellFile.ps1
Function Get-DellFile{ # FrankTuckerCA <# .SYNOPSIS Function downloads files from the Dell download site by model-number and download type (alldrivers, video, audio, network, bios, guide). Function only downloads .exe and .pdf files. .PARAMETER Model Specfiy the dell model-number. The dell s...
PowerShellCorpus/Github/FrankTuckerCA_powershell/Reference.ps1
Reference.ps1
#PowerShell Reference #FrankTucker@lan-sol.com #Invoke-Webrequest Downloading all Drivers Requires you to create folders ..not prefected $dell = ( (iwr -Uri http://downloads.dell.com/published/pages/optiplex-740.html#drivers).links.href) Foreach ($href in $dell){ iwr ("http://downloads.dell.com$href") -outf...
PowerShellCorpus/Github/FrankTuckerCA_powershell/New-VMSetup.ps1
New-VMSetup.ps1
<# FrankTucker@lan-sol.com New-VMSetup.ps1 Modify or use as reference Most Values or Parms are provide via $splatting = @{ value1 = 1 ; Value2 = 2; Value3 =3 } #> #Set-VMHost VMHostParms = @{ VirtualHardDiskPath = "d:\Hyper-V\VHD" ; VirtualMachinePath =...
PowerShellCorpus/Github/FrankTuckerCA_powershell/AmazingChartsBackupCleanup.ps1
AmazingChartsBackupCleanup.ps1
#Amazing Charts, Remove Old backup files. #FrankTucker@lan-sol.com #AC runs a daily backup to program folder (Cannot Change). The backup file can be large, 25GB Plus. #Only remove files if more than 7 total backup files AND the backup from yesturday is compelete. #Removes backups 8 days and older #Dates $Date ...
PowerShellCorpus/Github/MicrosoftDocs_ATADocs.cs-cz/.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/bayeslife_ps-validate-nodes/tests/Validate-Nodes.tests.ps1
Validate-Nodes.tests.ps1
$path = (Get-Item -Path ".\" -Verbose).FullName Remove-Module Validate-Nodes -Force Import-Module $path/Validate-Nodes.psm1 InModuleScope Validate-Nodes { $mockTest = { Write-host "Mock Test Ran"} $shouldThrow = { Try { Validate-Nodes -module "http://localhos...
PowerShellCorpus/Github/mikespiering_PSsetup/setupenv.ps1
setupenv.ps1
param ( [string]$resourceGroup, [string]$location, [string]$storageSKU, [string]$boshStorageAccountName, [string]$deploymentStorageAccountNameRoot, [string]$deploymentStorageAccountCount, [string]$ops_mgr_vhd_pivnet_url, [string]$ssh_key_path, [string]$vmName, [string]...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Get-LocalGroupMembership.ps1
Get-LocalGroupMembership.ps1
param($Computername,$Group) $group = [ADSI]"WinNT://$Computername/$Group" @($group.Invoke("Members")) | foreach { $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null) }
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/OnClickBackup/FullBackup.ps1
FullBackup.ps1
$Volume = Get-Volume -UniqueId '\\?\Volume{945e4499-0000-0000-0000-100000000000}\' if($Volume) { if($Volume.HealthStatus -ne 'Healthy') { Write-Warning "HDD should not be used anymore!" } $backupCommand = "start backup -backupTarget:{0}: -include:C:,D: -allCritical -vssfull -quiet" -f...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Get-ErrorType/Get-ErrorType.ps1
Get-ErrorType.ps1
Function Get-ErrorType { <# .Synopsis Returns error information .DESCRIPTION Returns information that can be used in try-catch blocks to handle specific errors .EXAMPLE Get-ErrorType .EXAMPLE Get-ErrorType $myerrorvariable .EXAMPLE Get-ErrorType | select errormessage,errortype | fl .EXA...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Emergency/Mass-Unblock-Users.ps1
Mass-Unblock-Users.ps1
## Find every account locked out in the domain that was locked out today $users = Search-ADAccount -LockedOut -UsersOnly | Where-Object { [datetime]::FromFileTime((get-aduser $_ -Properties lockouttime).lockouttime).Date -eq (Get-Date).Date } ## Write the username to the console while unlocking each account in case y...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Emergency/Set-ServiceAccountCredential.ps1
Set-ServiceAccountCredential.ps1
<# .SYNOPSIS Changes the account a service runs under .NOTES Created on: 11/28/2014 Created by: Adam Bertram Filename: Set-ServiceAccount.ps1 .EXAMPLE PS> .\Set-ServiceAccount.ps1 -ServiceName 'snmp' -Computername 'COMPUTER1','COMPUTER2' -Username someuser -Password password12 This...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Regex/CaptureGroups.ps1
CaptureGroups.ps1
#To fill an array $words with just the matches, use the command $string1 = "woo hoo, let's go to the zoo." $words1 = ([regex]::matches($string1, "\woo") | %{$_.value}) $words1 $string2 = "Cookbook" $words2 = ([regex]::matches($string2, "\woo\w") | %{$_.value}) $words2 # For example, the code will match “Cook...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Pluralsight - Building Tools with PowerShell/DemoMeta.ps1
DemoMeta.ps1
# script verification $props = 'Initials','Department','Title','DistinguishedName','Enabled','Name','GivenName','SurName' Get-ADUser -Filter { GivenName -eq 'Adam' -and SurName -eq 'Bertram'} -Properties $props | Select $props Get-ADUser -Filter { GivenName -eq 'Joe' -and SurName -eq 'Murphy'} -Properties $props | S...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Pluralsight - Building Tools with PowerShell/Script.ps1
Script.ps1
## Example Active Directory Account Automator #1: A Script ## $Employees = Import-Csv -Path C:\Users.csv ## BAD: File path in the script itself foreach ($Employee in $Employees) { #region Create the AD user account ## BAD: What if the desired username is taken? No validation here to check and ## try to us...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Pluralsight - Building Tools with PowerShell/Tool.ps1
Tool.ps1
## Example Active Directory Account Automator #1: A Tool ## [CmdletBinding()] ## We're talkin' advanced here param ( [Parameter(Mandatory)] ## Parameters are a great way to prevent from modifying the script [ValidateNotNullOrEmpty()] [ValidateScript({ Test-Path -Path $_ -PathType Leaf })] ## Validation [str...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Pluralsight - Building Tools with PowerShell/AdAccountManagementAutomator.ps1
AdAccountManagementAutomator.ps1
function New-EmployeeOnboardUser { <# .SYNOPSIS This function is part of the Active Directory Account Management Automator tool. It is used to perform all routine tasks that must be done when onboarding a new employee user account. .EXAMPLE PS> New-EmployeeOnboardUser -FirstName 'adam' -MiddleInitial D ...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/LocalUserManagement/Set-MsRandomPasswordToLocalUserAccount.ps1
Set-MsRandomPasswordToLocalUserAccount.ps1
function Invoke-PasswordRoll { <# .SYNOPSIS This script can be used to set the local account passwords on remote machines to random passwords. The username/password/server combination will be saved in a CSV file. The account passwords stored in the CSV file can be encrypted using a password of the administrat...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/LocalUserManagement/Get-LocalGroupMembership.ps1
Get-LocalGroupMembership.ps1
param($Computername,$Group) $group = [ADSI]"WinNT://$Computername/$Group" @($group.Invoke("Members")) | foreach { $_.GetType().InvokeMember("Name", 'GetProperty', $null, $_, $null) }
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/LocalUserManagement/Set-RandomPasswordToLocalUserAccount.ps1
Set-RandomPasswordToLocalUserAccount.ps1
#Requires -Version 3 <# .SYNOPSIS This finds a local or remote computer(s)' local administrator account and changes it to a random password. .DESCRIPTION This finds a local or remote computer(s)' local administrator account, generates a random password, changes the local administrator password to that rand...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/LocalUserManagement/Set-LocalUser.ps1
Set-LocalUser.ps1
#requires -Version 2 function Set-LocalUser { <# .Synopsis Modifies a local user. .DESCRIPTION The Set-LocalUser cmdlet modifies the properties of a local user. You can modify commonly used property values by using the cmdlet parameters. .PARAMETER ChangePasswordAtLog...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Web/REST/Basic-Auth.ps1
Basic-Auth.ps1
$username = "alternateusername" $password = "alternatepassword" $basicAuth = ("{0}:{1}" -f $username,$password) $basicAuth = [System.Text.Encoding]::UTF8.GetBytes($basicAuth) $basicAuth = [System.Convert]::ToBase64String($basicAuth) $headers = @{Authorization=("Basic {0}" -f $basicAuth)} $result = Invoke-Re...
PowerShellCorpus/Github/megamorf_PowerShell-Stuff/Web/REST/Misc.ps1
Misc.ps1
# accessing properties with dots in their names $result = Invoke-RestMethod -Uri https://gianmariaricci.visualstudio.com/defaultcollection/_apis/wit/workitems/100?api-version=1.0 -headers $headers -Method Get $closedBy = $result.fields.'Microsoft.VSTS.Common.ClosedBy' Write-Output "Work Item was closed by: $closedB...
PowerShellCorpus/Github/vatsalyagoel_DynamoLocal/SetupDynamoDB.ps1
SetupDynamoDB.ps1
$url = "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.zip" $output = "$PSScriptRoot\Dynamodb.zip" Invoke-WebRequest -Uri $url -OutFile $output New-Item "$PSScriptRoot\DynamoDB" -type directory New-Item "$PSScriptRoot\DynamoDB\DevDB" -type directory New-Item "$PSScriptRoot\DynamoDB\...
PowerShellCorpus/Github/vatsalyagoel_DynamoLocal/BootDynamoDB.ps1
BootDynamoDB.ps1
param ( [Parameter(Mandatory = $true)] [ValidateSet('Dev', 'Test', 'Prod')] $Environment ) Switch($Environment) { 'Dev' { Write-Output "Booting Dev DB" java -D'java.library.path'="$PSScriptRoot\DynamoDB\DynamoDBLocal_lib" -jar "$PSScriptRoot\DynamoDB\DynamoDBLocal.jar" -dbPath...
PowerShellCorpus/Github/LadyElle_WestCoastRecMart/WestCoastRecMart/packages/jQuery.2.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/LadyElle_WestCoastRecMart/WestCoastRecMart/packages/jQuery.2.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 $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/LadyElle_WestCoastRecMart/WestCoastRecMart/packages/jQuery.2.1.1/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/LadyElle_WestCoastRecMart/WestCoastRecMart/packages/Newtonsoft.Json.6.0.6/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/LadyElle_WestCoastRecMart/WestCoastRecMart/packages/EntityFramework.6.1.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/LadyElle_WestCoastRecMart/WestCoastRecMart/packages/EntityFramework.6.1.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/berczeck_hackatrix2016/webapi/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/berczeck_hackatrix2016/webapi/PublishScripts/Publish-WebApplicationWebsite.ps1
Publish-WebApplicationWebsite.ps1
#Requires -Version 3.0 <# .SYNOPSIS Creates and deploys a Microsoft Azure Website for a Visual Studio web project. For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394471 .EXAMPLE PS C:\> .\Publish-WebApplicationWebSite.ps1 ` -Configuration .\Configurations\WebApplication1-WAWS-...
PowerShellCorpus/Github/rakheshster_VirtLab/Config-Server.ps1
Config-Server.ps1
[string]$uinput = "" [bool]$exit_script = 0 while (($uinput -ne "99") -and (!$exit_script)) { Write-Host Write-Host "" Write-Host $uinput = Read-Host "What would you like to do?" if ($uinput -eq "1") { } if ($uinput -eq "x") { Write-Host $exit_script =...
PowerShellCorpus/Github/rakheshster_VirtLab/New-VMandVHD.ps1
New-VMandVHD.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$true)] [ValidateScript({Test-Path $_ -PathType Leaf})] [string]$BaseVHD, [Parameter(Mandatory=$true)] [string]$Name, [Parameter(Mandatory=$true)] [ValidateScript({Test-Path $_ -PathType Leaf})] [string]$UnattendFile, [Parameter(Mandatory...
PowerShellCorpus/Github/rakheshster_VirtLab/Quick-Config.ps1
Quick-Config.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$true)] # idea from http://stackoverflow.com/a/5901728/2610230 [ipaddress]$IPaddress, [Parameter(Mandatory=$true)] [int32]$PrefixLength, [Parameter(Mandatory=$false)] [ipaddress]$DefaultGw, [Parameter(Mandatory=$true)] [ipaddress[]]$DNS...
PowerShellCorpus/Github/slyckstyx_DSC_AD/DSC_AD.Tests.ps1
DSC_AD.Tests.ps1
Import-Module "$(Get-Location)\DSC_AD.psm1" Describe "Unit testing the DSC_AD module's internal New-DSCConfigData function:" { It "Returns Computer objects from AD in DSC Configuration Data compatible format." { (New-DSCConfigData).GetType().Name -as [string] | Should Be 'hashtable' } It "C...
PowerShellCorpus/Github/Hurtrus_My-Learning-of-Powershell/movefiles.ps1
movefiles.ps1
Get-ChildItem 'C:\Temp\' -Recurse | Where-Object { $_.psiscontainer -and $_.Name -eq 'four' } | Get-ChildItem -include "*.jpg" | Where-Object { $_.LastWriteTime -ge "01/01/2013" -and $_.LastWriteTime -le "12/31/2013" } | Move-Item -Destination 'C:\RaidTool\2013' -force Get-ChildItem 'C:\Temp\' -Recurse | Where-O...
PowerShellCorpus/Github/Hurtrus_My-Learning-of-Powershell/PendingReboot.ps1
PendingReboot.ps1
<# .SYNOPSIS This script executes a file but first checks to see if any reboot operations are pending. If so, it will reboot the computer to clear up any pending operations and then execute the file. .EXAMPLE PS> .\Start-ScriptWithPendingOperationCheck.ps1 -FilePath 'C:\Windows\System32\WindowsPowerShell\v1.0\p...
PowerShellCorpus/Github/Hurtrus_My-Learning-of-Powershell/removeInI.ps1
removeInI.ps1
$removeINI = Get-ADuser $env:username -Properties homeDirectory | select homeDirectory Remove-Item "$($removeINI.homeDirectory)\desktop.ini" -force
PowerShellCorpus/Github/Hurtrus_My-Learning-of-Powershell/Group Audit Tool/GetGroupMembers1.ps1
GetGroupMembers1.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.82 Created on: 4/24/2015 1:03 PM Created by: Scott Hurst Organization: Filename: ===============================================...
PowerShellCorpus/Github/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/MitkoZ_MVCReferences/MVCReferences/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/odyyudah_ASPNETsaveToExcel/WebApplication1/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/odyyudah_ASPNETsaveToExcel/WebApplication1/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/poshsecurity_AzurePublicIPAddresses/AzurePublicIPAddresses.Tests.ps1
AzurePublicIPAddresses.Tests.ps1
Import-Module $PSScriptRoot\AzurePublicIPAddresses.psm1 -Force Describe 'AzurePublicIPAddresses' { Context 'Script Analyzer' { It 'Does not have any issues with the Script Analyser - Get-MicrosoftAzureDatacenterIPRange' { Invoke-ScriptAnalyzer $PSScriptRoot\Functions\Get-MicrosoftAzureDa...
PowerShellCorpus/Github/poshsecurity_AzurePublicIPAddresses/functions/Get-MicrosoftAzureDatacenterIPRangeFile.ps1
Get-MicrosoftAzureDatacenterIPRangeFile.ps1
#requires -Version 3.0 function Get-MicrosoftAzureDatacenterIPRangeFile { <# .SYNOPSIS Downloads either the Microsoft Azure Datacenter IP Ranges file, or the Windows Azure Datacenter IP Ranges in China file. The file can be stored in memory or to the file system. ...
PowerShellCorpus/Github/poshsecurity_AzurePublicIPAddresses/functions/Get-MicrosoftAzureDatacenterIPRange.ps1
Get-MicrosoftAzureDatacenterIPRange.ps1
#requires -Version 4.0 function Get-MicrosoftAzureDatacenterIPRange { <# .SYNOPSIS Gets the IP ranges associated with Azure regions in CIDR format. .DESCRIPTION The Get-MicrosoftAzureDatacenterIPRange cmdlet gets a list of subnets in CIDR format (eg 192.168...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/wds/install.ps1
install.ps1
Install-WindowsFeature WDS -IncludeAllSubFeature
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/sqlserver/prereq.ps1
prereq.ps1
Import-Module ServerManager Install-WindowsFeature NET-Framework-Features NET-Framework-Core
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/sqlserver/download.ps1
download.ps1
$mssqlPath = "C:\mssql\" If (-not (Test-Path $mssqlPath)) { md $mssqlPath } $webClient = New-Object System.Net.WebClient $isoFile = "SQLServer2016-x64-ENU.iso" $remotePath = "http://care.dlservice.microsoft.com/dl/download/F/E/9/FE9397FA-BFAB-4ADD-8B97-91234BC774B2/" $remoteFile = "$remotePath$isoFile" $localFile...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/wsus/install.ps1
install.ps1
Install-WindowsFeature -Name Net-Framework-Core Install-WindowsFeature UpdateServices -IncludeManagementTools
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/exchange/prereq.ps1
prereq.ps1
Import-Module ServerManager Install-WindowsFeature RSAT-ADDS Install-WindowsFeature AS-HTTP-Activation,Desktop-Experience,NET-Framework-45-Features,RPC-over-HTTP-proxy,RSAT-Clustering,RSAT-Clustering-CmdInterface,Web-Mgmt-Console,WAS-Process-Model,Web-Asp-Net45,Web-Basic-Auth,Web-Client-Auth,Web-Digest-Auth,Web-Dir-B...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/exchange/install.ps1
install.ps1
$exchangePath = "C:\exchange\" If (-not (Test-Path $exchangePath)) { md $exchangePath } $webClient = New-Object System.Net.WebClient $exeFile = "Exchange2016-x64.exe" $remotePath = "https://download.microsoft.com/download/3/9/B/39B8DDA8-509C-4B9E-BCE9-4CD8CDC9A7DA/" $remoteFile = "$remotePath$exeFile" $localFile ...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/dhcp/dhcp_reservation.ps1
dhcp_reservation.ps1
$DHCPStaticEntries = Import-Csv -Path "c:\DRIPCustomizer-ipv4-dhcp.csv" -delimiter ',' For($i = 0; $i -lt $DHCPStaticEntries.count; $i++){ $EndMAC = "{0:x2}" -f $i $FQDN = $DHCPStaticEntries[$i].VMName+'.ASRBD21.local' Add-DhcpServerv4Reservation -ComputerName SRV-01.ASRBD21.local -ScopeID 10.59...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/activedirectory/ad_useradd_csv.ps1
ad_useradd_csv.ps1
" dependances : Module NTFSSecurity 3.2.2 AD_Variables.ps1 AD_variables.csv AD_rep.ps1 AD_RAZ_01.ps1 " " I phase préliminaire modalité d'éxécution a : verrifier ExecutionPolicy b : verrifier ExecutionPolicy c : se placer dans le repertoire du script II création des fonctions ...
PowerShellCorpus/Github/asrbd21_Microsoft/Windows/activedirectory/create_user-it.ps1
create_user-it.ps1
Import-module ActiveDirectory # Création des Utilisateurs dans active directory, basé sur le fichier "Fichier RH Type - Aston.csv" # Ce script s'appuie sur la variable $comptes, qui doit contenir le résultat de l'import du fichier csv. # Exemple de commande d'import : $comptes = Import-Csv '.\Fichier RH Type - Ast...