full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_10.ps1 | Easy_Challenge_10.ps1 | function PhoneNumber(){
$PhoneNumber = Read-Host -Prompt "Please enter a valid phone number"
while ($PhoneNumber -notmatch '([(]?[1-9]{3}?[)])?[\s.-]?[1-9]{3}[\s.-]?[1-9]{4}'){
$PhoneNumber = Read-Host -Prompt "That was not a valid phone number, please enter a valid phone number"
}
}
|
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_97.ps1 | Easy_Challenge_97.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_85.ps1 | Easy_Challenge_85.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_99.ps1 | Easy_Challenge_99.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_135.ps1 | Easy_Challenge_135.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_38.ps1 | Easy_Challenge_38.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_159.ps1 | Easy_Challenge_159.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_157.ps1 | Easy_Challenge_157.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_32.ps1 | Easy_Challenge_32.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_246.ps1 | Easy_Challenge_246.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_154.ps1 | Easy_Challenge_154.ps1 | |
PowerShellCorpus/Github/WilliamBrown42_DailyProgrammerChallenges/Powershell/Easy_Challenge_206.ps1 | Easy_Challenge_206.ps1 | |
PowerShellCorpus/Github/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/maneevakatya_lab7/WebApplication3/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/fenxu_dependent_repo_20160527_token/.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/brcolow_config/InstallFonts.ps1 | InstallFonts.ps1 | $FONTS = 0x14;
$FromPath = "c:\fonts";
$ObjShell = New-Object -ComObject Shell.Application;
$ObjFolder = $ObjShell.Namespace($FONTS);
$CopyOptions = 4 + 16;
$CopyFlag = [String]::Format("{0:x}", $CopyOptions);
foreach($File in $(Get-ChildItem -Path $FromPath)){
If ((Test-Path "c:\windows\fonts\$($Fil... |
PowerShellCorpus/Github/brcolow_config/profile.ps1 | profile.ps1 | $config = resolve-path ~/config
$env:Path += ";$config\ps"
. 'C:\Users\brcolow\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
if ($host.Name -eq 'ConsoleHost') {
Import-Module PSReadline
}
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler ... |
PowerShellCorpus/Github/brcolow_config/ps/New-CommandWrapper.ps1 | New-CommandWrapper.ps1 | ##############################################################################
##
## New-CommandWrapper
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##############################################################################
<#
.SYNOPSIS
Adds ... |
PowerShellCorpus/Github/ZhaobangChina_ElectsysForEdge/build/package.ps1 | package.ps1 | if ([String]::IsNullOrEmpty($env:APPVEYOR_BUILD_FOLDER))
{
$rootPath = "./";
}
else
{
$rootPath = $env:APPVEYOR_BUILD_FOLDER
}
Set-Location $rootPath
git submodule update --init --recursive
$manifest = [System.IO.Path]::Combine($rootPath, "edgeextension\manifest")
$key = [System.IO.Path]::Combine... |
PowerShellCorpus/Github/ZhaobangChina_ElectsysForEdge/build/InstallManifoldjs.ps1 | InstallManifoldjs.ps1 | npm install -g manifoldjs |
PowerShellCorpus/Github/sunnyvsm_GeneralCookbookB/verify which net is registered.ps1 | verify which net is registered.ps1 | # load the IIS-Commandlets
Import-Module WebAdministration
# get the isapi filters currently loaded
Get-WebConfigurationProperty -Filter "/system.webServer/isapiFilters/filter" -name *
clear-content c:\status.html
$output = ''
$table_format = "<!DOCTYPE html>
<html>
<head>
<style>
table {
color: #333... |
PowerShellCorpus/Github/sunnyvsm_GeneralCookbookB/frameworkversions.ps1 | frameworkversions.ps1 | Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version, Release, @{
name="Product"
expression={
switch($_.Release) {
378389 { [Version]"4.5" }
... |
PowerShellCorpus/Github/sunnyvsm_GeneralCookbookB/list of roles and features instlled.ps1 | list of roles and features instlled.ps1 | Import-Module ServerManager
Get-WindowsFeature |
Where-Object {$_.Installed -match “True”} |
ForEach-Object {
$_.Name | Write-Host
} |
PowerShellCorpus/Github/sunnyvsm_GeneralCookbookB/cluster_01.ps1 | cluster_01.ps1 | $input_array = @{'rms01' = 'server01|srv1:1:8080,srv2:5:808,srv3:6:808 server02|srv4:1:8080,srv2:5:808,srv3:6:808 server03|srv1:1:8080,srv2:5:808,srv3:6:808,srv56:45:9090'; 'rms02' = 'server04|srv4:1:8080,srv2:5:808,srv3:6:808'}
foreach ($key in $input_array.Keys) {
$cluster = $key
sqlcmd -E -Q "DECLARE @curr... |
PowerShellCorpus/Github/sunnyvsm_GeneralCookbookB/cluster.ps1 | cluster.ps1 | $input_array = @{'Cluster1' = 'server01|srv1:1:8080,srv2:5:808,srv3:6:808 server02|srv4:1:8080,srv2:5:808,srv3:6:808 server03|srv1:1:8080,srv2:5:808,srv3:6:808,srv56:45:9090'; 'Cluster2' = 'server04|srv4:1:8080,srv2:5:808,srv3:6:808'}
foreach ($key in $input_array.Keys) {
$cluster = $key
echo "Command to crea... |
PowerShellCorpus/Github/sunnyvsm_GeneralCookbookB/core.ps1 | core.ps1 | # Description: Identify the number of physical processors, logical processors and hyperthreading on the server.
# name: hyperactive.ps1
$vComputerName = "."
$vLogicalCPUs = 0
$vPhysicalCPUs = 0
$vCPUCores = 0
$vSocketDesignation = 0
$vIsHyperThreaded = -1
# Get the Processor information from the WMI object
... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/Trudy_rename.Run.ps1 | Trudy_rename.Run.ps1 | #------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 7774b116-6835-4b6e-a609-f1f1fabd58fc
# Source File: C:\Users\Techplex.Engineer\Desktop\Trudy_rename\Trudy_rename.psproj
#------------------------------------------------------------------... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/Trudy_rename.Export.ps1 | Trudy_rename.Export.ps1 | #------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 7774b116-6835-4b6e-a609-f1f1fabd58fc
# Source File: C:\Users\Techplex.Engineer\Desktop\Trudy_rename\Trudy_rename.psproj
#------------------------------------------------------------------... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/Globals.ps1 | Globals.ps1 | #--------------------------------------------
# Declare Global Variables and Functions here
#--------------------------------------------
#Sample function that provides the location of the script
function Get-ScriptDirectory
{
if($hostinvocation -ne $null)
{
Split-Path $hostinvocation.MyCommand.path
... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/ps2exe/Trudy_rename.Run.ps1 | Trudy_rename.Run.ps1 | #------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 7774b116-6835-4b6e-a609-f1f1fabd58fc
# Source File: C:\Users\Techplex.Engineer\Desktop\Trudy_rename\Trudy_rename.psproj
#------------------------------------------------------------------... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/ps2exe/test.ps1 | test.ps1 | #Demo file for use with PS2EXE (http://ps2exe.codeplex.com), part of PS2EXE v0.3.0.0
write-host "PS2EXE v0.3.0.0 by Ingo Karstein" -f Cyan
write-host ""
write-host "See " -f Yellow
write-host " http://ps2exe.codeplex.com" -f Green
write-host " http://blog.karstein-consulting.com" -f Green
Write-Host ""
$... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/ps2exe/Trudy_rename.Run.old.ps1 | Trudy_rename.Run.old.ps1 | #------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 7774b116-6835-4b6e-a609-f1f1fabd58fc
# Source File: C:\Users\Techplex.Engineer\Desktop\Trudy_rename\Trudy_rename.psproj
#------------------------------------------------------------------... |
PowerShellCorpus/Github/TechplexEngineer_mass-filename-text-appender/ps2exe/ps2exe.ps1 | ps2exe.ps1 | param([string]$inputFile=$null, [string]$outputFile=$null, [switch]$verbose, [switch] $debug, [switch]$runtime20, [switch]$x86, [switch]$x64, [switch]$runtime30, [int]$lcid, [switch]$sta, [switch]$mta, [switch]$noConsole, [switch]$nested)
<###########################################################################... |
PowerShellCorpus/Github/SpectoLogic_Powershell-Snippets/Azure/Logic Apps/Triggers/Get-TriggerCallbackUrls.ps1 | Get-TriggerCallbackUrls.ps1 | #########################################################################################################
# GetTriggerCallbackUrls
# This snippet retrieves the Callback Urls of a given Logic App
# Set these variables
# $ScriptUser... User to run the script with (needs to be an AAD User with approriate rights in A... |
PowerShellCorpus/Github/SpectoLogic_Powershell-Snippets/Azure/Azure AD/ADD Apps and Principals.ps1 | ADD Apps and Principals.ps1 | #########################################################################################################
# These collection provides various method to ease the creation of Azure AAD Applications and Service
# Principals. It also allows to define Application Roles and grant OAuth2Permissions.
#
# Methods:
# Assert... |
PowerShellCorpus/Github/DarkGenius_sp-powershell/workflows/deploy_workflow.ps1 | deploy_workflow.ps1 | <#*****Readme****#
Скрипт предназначен для переноса и развертывания рабочих процессов списков SharePoint2013.
Для использования скрипта необходимо получить файл workflow.xaml, содержащий описание рабочего процесса.
Это можно сделать с помощью функции ExtractWorkflowXaml. Параметры функции:
$url - URL узла, ассо... |
PowerShellCorpus/Github/kemiller2002_SCM/TestFile.ps1 | TestFile.ps1 | $scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
. "$dir\GetItemOrderDependency.ps1"
$objectTypes = "U,FN,V,P,SQ,TF,TR".Split(",")
GetItemListing "Server=localhost\sqlexpress;Database=AdventureWorks2012;Trusted_Connection=True;" "AdventureWorks2012" $objectTypes |
select Values -Un... |
PowerShellCorpus/Github/kemiller2002_SCM/GetItemOrderDependency.ps1 | GetItemOrderDependency.ps1 | function GetItemListing {
param($connectionString, $database, $databaseObjectTypes)
$ExecuteReader = {
param ($statement, $fnReader)
$connection = New-Object System.Data.SqlClient.SqlConnection
$connection.ConnectionString = $connectionString
$connection.Open()
$connection.Cha... |
PowerShellCorpus/Github/kemiller2002_SCM/CreateMasterFileList.ps1 | CreateMasterFileList.ps1 | param (
[string] $pathToDataFiles
,[string] $connectionString
,[string] $database
,[string] $exportFile
)
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
. "$dir\BuildSqlFile.ps1"
$PreMigration = {
"PreMigration".Split(',')
}
$MakePaths = {
para... |
PowerShellCorpus/Github/kemiller2002_SCM/BuildSqlFile.ps1 | BuildSqlFile.ps1 |
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
. "$dir\GetItemOrderDependency.ps1"
$GetPath = {
param($item, $pathToDataFiles)
$path = switch ($_.Type) {
"U" {"Tables"}
"FN" {"Funtions"}
"V" {"Views"}
"P" {"Stored Procedure... |
PowerShellCorpus/Github/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/somshekarm_Blinds/ResistanceCalculator/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/Exploit-install_CrackMapExec/served_over_http/Invoke-NinjaCopy.ps1 | Invoke-NinjaCopy.ps1 | function Invoke-NinjaCopy
{
<#
.SYNOPSIS
This script can copy files off an NTFS volume by opening a read handle to the entire volume (such as c:) and parsing the NTFS structures. This requires you
are an administrator of the server. This allows you to bypass the following protections:
1. Files which are ope... |
PowerShellCorpus/Github/Exploit-install_CrackMapExec/served_over_http/Invoke-Shellcode.ps1 | Invoke-Shellcode.ps1 | function Invoke-Shellcode
{
<#
.SYNOPSIS
Inject shellcode into the process ID of your choosing or within the context of the running PowerShell process.
PowerSploit Function: Invoke-Shellcode
Author: Matthew Graeber (@mattifestation)
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: N... |
PowerShellCorpus/Github/Exploit-install_CrackMapExec/served_over_http/Invoke-Mimikatz.ps1 | Invoke-Mimikatz.ps1 | function Invoke-Mimikatz
{
<#
.SYNOPSIS
This script leverages Mimikatz 2.0 and Invoke-ReflectivePEInjection to reflectively load Mimikatz completely in memory. This allows you to do things such as
dump credentials without ever writing the mimikatz binary to disk.
The script has a ComputerName parameter which a... |
PowerShellCorpus/Github/Exploit-install_CrackMapExec/served_over_http/Invoke-ReflectivePEInjection.ps1 | Invoke-ReflectivePEInjection.ps1 | function Invoke-ReflectivePEInjection
{
<#
.SYNOPSIS
This script has two modes. It can reflectively load a DLL/EXE in to the PowerShell process,
or it can reflectively load a DLL in to a remote process. These modes have different parameters and constraints,
please lead the Notes section (GENERAL NOTES) for in... |
PowerShellCorpus/Github/sayedihashimi_pshelpers/deploy.ps1 | deploy.ps1 | param(
$deployRoot = (join-path -path $global:dropBoxHome -ChildPath 'Personal\PcSettings\Powershell\CustomModules')
)
function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$scriptDir = ((Get-ScriptDirectory) + "\")
fun... |
PowerShellCorpus/Github/sayedihashimi_pshelpers/test.ps1 | test.ps1 | function Get-ScriptDirectory
{
$Invocation = (Get-Variable MyInvocation -Scope 1).Value
Split-Path $Invocation.MyCommand.Path
}
$scriptDir = ((Get-ScriptDirectory) + "\")
$moduleName = 'sayedha-pshelpers'
$modulePath = (Join-Path -Path $scriptDir -ChildPath ("{0}.psm1" -f $moduleName))
if(Test-Path ... |
PowerShellCorpus/Github/sayedihashimi_pshelpers/find-duplicates.ps1 | find-duplicates.ps1 | <#
.SYNOPSIS
This will find duplicate files from one folder to another.
#>
[cmdletbinding()]
param(
[Parameter(Mandatory=$true)]
$leftFolder,
[Parameter(Mandatory=$true)]
$rightFolder)
function Find-Duplicates{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true)]
... |
PowerShellCorpus/Github/tyomi111_testcsv/testcsv.ps1 | testcsv.ps1 | get-childItem "*.csv" | foreach {
Import-Csv -Path $_ | Select ITEM | Export-Csv -Append -NoTypeInformation -Path AB.csv
}
Import-csv AB.csv | foreach { $_.ITEM } | Sort-Object -Unique |
PowerShellCorpus/Github/freud_ListRandomizer/random.ps1 | random.ps1 | $PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
$inputFile = "$PSScriptRoot\list_to_random.csv"
$outputFile = "$PSScriptRoot\random_results.csv"
Get-Content $inputFile -Encoding "UTF8" | Sort-Object {Get-Random} | Out-File -Encoding "UTF8" $outputFile
Get-Content $outputFile # displa... |
PowerShellCorpus/Github/Jordy098_Ejemplo/Tarea4/packages/jQuery.1.9.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/Jordy098_Ejemplo/Tarea4/packages/jQuery.1.9.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/Jordy098_Ejemplo/Tarea4/packages/jQuery.1.9.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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/packages/jQuery.UI.Combined.1.11.4/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $juiFileNameRegEx |
PowerShellCorpus/Github/Jordy098_Ejemplo/Tarea4/packages/jQuery.UI.Combined.1.11.4/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 $juiFileNameRegEx ... |
PowerShellCorpus/Github/Jordy098_Ejemplo/Tarea4/packages/jQuery.UI.Combined.1.11.4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/Jordy098_Ejemplo/Tarea4/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/secminh_DV-Web/WcfService/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/secminh_DV-Web/WcfService/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/kwmaddox_PoshTFSTools/Functions/TFSTeamProjectCollection.tests.ps1 | TFSTeamProjectCollection.tests.ps1 | $srcFile = '.\TFSTeamProjectCollection.ps1'
. $srcFile
Describe isUri{
It 'validates a web URI' {
isUri -Uri 'http://www.google.com' | Should Be $True
}
} |
PowerShellCorpus/Github/kwmaddox_PoshTFSTools/Functions/TFSTeamProjectCollection.ps1 | TFSTeamProjectCollection.ps1 | function Get-TFSTeamProjectCollection
{
Param(
[Parameter(Mandatory=$True)]
[String]$TFSServer
)
#[string]::
}
function isUri
{
Param
(
[Parameter(Mandatory=$True)]
[String]$Uri
)
$validate = [Uri]$Uri
$validate.IsAbsoluteUri -ne ... |
PowerShellCorpus/Github/Gr33nDrag0n69_SslCertMonitor/SslCertMonitor.ps1 | SslCertMonitor.ps1 | <#
.SYNOPSIS
Test SSL Certificate(s) Expiry.
.DESCRIPTION
Verify expiration of SSL certificate and send mail alert if under threshold.
.PARAMETER ShowMessage
Output message to screen. (Doesn't affect e-mail functionnality)
.PARAMETER SendTestEmail
Send a test e-mail to the configured e-mails ERROR.
... |
PowerShellCorpus/Github/tomdw94_azure_wisa/MasterScript.ps1 | MasterScript.ps1 | Function installIis {
echo IIS aan het installeren...
CMD /C START /w PKGMGR.EXE /l:log.etw /iu:IIS-WebServerRole
echo klaar!
}
Function downloaddotnet {
echo ".Net installer aan het downloaden"
$storageDir = "C:\"
$webclient = New-Object System.Net.WebClient
$url = "http://download.microsoft.com/download/... |
PowerShellCorpus/Github/hauvt1_LAR_CapstoneProject/project/source/testConsole/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/hauvt1_LAR_CapstoneProject/project/source/testConsole/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/hauvt1_LAR_CapstoneProject/project/source/Desktop Application/Library/packages/EntityFramework.6.1.2/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
# MIIa2AYJKoZIhvcNAQcCoIIayTCCGsUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/hauvt1_LAR_CapstoneProject/project/source/Desktop Application/Library/packages/EntityFramework.6.1.2/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/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/resource/tmp1.ps1 | tmp1.ps1 | function Invoke-TraceCollect
{
<#
.SYNOPSIS
This module performs a network trace using PowerShell network tracing functionality. After the trace is complete, the module will perform analysis based on user provided arguments to determin whether potentially vulnerable traffic exists in the targeted trace.
Func... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/resource/Invoke-MemoryDump.ps1 | Invoke-MemoryDump.ps1 | function Invoke-MemoryDump {
<#
.SYNOPSIS
Get Windows memory crash dump configuration or analyze the memory crash dump configuration
.DESCRIPTION
Allows the administrator to get windows memory crash dump configuration from the system locally or remotely.
By default without any paramet... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/resource/Invoke-NetworkAnalysis.ps1 | Invoke-NetworkAnalysis.ps1 | $ErrorActionPreference = "SilentlyContinue"
$ProgressPreference = "SilentlyContinue"
########################################################
# MAIN FUNCTION
########################################################
function Invoke-NetworkAnalysis{
[CmdletBinding()] Param(
[paramet... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/resource/tmp.ps1 | tmp.ps1 | function Get-NetworkStatistics
{
$properties = 'Protocol','LocalAddress','LocalPort'
$properties += 'RemoteAddress','RemotePort','State','ProcessName','PID'
netstat -ano | Select-String -Pattern "\s+(TCP|UDP)" | ForEach-Object {
$item = $_.line.split(" ",[System.StringSplitOptions]::RemoveE... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/resource/Sentry.ps1 | Sentry.ps1 | # $ErrorActionPreference = "SilentlyContinue"
# $ProgressPreference = "SilentlyContinue"
# Add-Type -assembly System.Security
function Sentry{
Param (
[switch]$Analysis
)
Begin {
Write-Host "[+]Start Sentry." -foregroundcolor "green"
Write-Host "[+]Import Modules." -foregroundcolor "green"
Wr... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/resource/tmp2.ps1 | tmp2.ps1 | $ErrorActionPreference = "SilentlyContinue"
$ProgressPreference = "SilentlyContinue"
########################################################
# MAIN FUNCTION
########################################################
function Invoke-LiveAnalysis {
[CmdletBinding()] Param(
[parameter... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/tmp/CheckHash.ps1 | CheckHash.ps1 | param(
[String]$Task_XML = "HashFile.xml",
[String]$File_Hash_New = "HashFile_New.log",
[String]$File_Hash_Check = "HashFile_Check.log",
[String]$mode = "none",
[String]$StartBoundary = "2005-10-11T08:00:00",
[String]$Interval = "PT1M",
[String]$Duration = "PT4M",
[String]$DaysInterval = "2",
[String]... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/tmp/BuildLog.ps1 | BuildLog.ps1 | $ErrorActionPreference= 'silentlycontinue'
function Invoke-ScheduledTask{
Param(
[String]$TaskName,
[String]$TaskPath,
[String]$State,
[String]$Author,
[String]$Description,
[String]$Triggers,
[String]$ExecuteFile,
[String]$Arguments,
[String]$DigitalSignature
)
Write-Host "" | Out-Fil... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/tmp/Get-VirusTotalReport.ps1 | Get-VirusTotalReport.ps1 | <#----------------------------------------------------------------------------
LEGAL DISCLAIMER
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 ... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/tmp/Invoke-ScheduledTask.ps1 | Invoke-ScheduledTask.ps1 | function Invoke-ScheduledTask{
Param(
[String]$TaskName,
[String]$TaskPath,
[String]$State,
[String]$Author,
[String]$Description,
[String]$Triggers,
[String]$ExecuteFile,
[String]$Arguments,
[String]$DigitalSignature,
[switch]$Analysis
)
Begin {
$MyScriptBlock = {
if($A... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.