full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SETUP/Sentry/tmp/Get-MemoryDump.ps1 | Get-MemoryDump.ps1 | function Get-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 parame... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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/SOURCE/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... |
PowerShellCorpus/Github/hungchau248_Working/Ghi CD/APTIDS/SOURCE/Sentry/tmp/Get-MemoryDump.ps1 | Get-MemoryDump.ps1 | function Get-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 parame... |
PowerShellCorpus/Github/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/packages/jQuery.2.1.3/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/scty11_MVC5Fund/APImyBuild/packages/jQuery.2.1.3/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/scty11_MVC5Fund/APImyBuild/packages/jQuery.2.1.3/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/APImyBuild/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/scty11_MVC5Fund/MyPerfSurf/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/scty11_MVC5Fund/MyPerfSurf/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/scty11_MVC5Fund/MyPerfSurf/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/scty11_MVC5Fund/MyPerfSurf/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/scty11_MVC5Fund/MyPerfSurf/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/scty11_MVC5Fund/MyPerfSurf/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuild/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.1.8.6/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package)
Import-Module (Join-Path $toolsPath glimpse.psm1) |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.1.8.6/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.1.8.6/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.Mvc5.1.5.3/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.Mvc5.1.5.3/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.EF6.1.6.5/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.EF6.1.6.5/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.Ado.1.7.3/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.Ado.1.7.3/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/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/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.AspNet.1.8.0/tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
Unregister-GlimpseExtension $package |
PowerShellCorpus/Github/scty11_MVC5Fund/MyBuildEF6MVC/packages/Glimpse.AspNet.1.8.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
Register-GlimpseExtension $package $DTE |
PowerShellCorpus/Github/LMJConsulting_Main/Info-Gathering/Find local admins.ps1 | Find local admins.ps1 | $Targets=@();
get-adcomputer -filter * | select -expandproperty name | foreach {if ((test-connection -computername $_ -quiet) -eq $true) {$targets=$targets+$_}};
foreach ($t in $targets) {$admins=gwmi win32_groupuser -computername $t | where {$_.groupcomponent -like "*Administrators*"} | select partcomponent ; $admin... |
PowerShellCorpus/Github/LMJConsulting_Main/Misc/Canary Script 2.0.ps1 | Canary Script 2.0.ps1 |
get-childitem C:\users\*\documents | select fullname | foreach {if (!(test-path ($_.fullname+"\_A.txt"))){new-item -path ($_.fullname) -name _A.txt -value "testing" -force} }
$user="gsmith@lmjconsulting.com"
$password=get-content C:\EncryptedPassword.txt | convertto-securestring
$cred=new-object system.man... |
PowerShellCorpus/Github/LMJConsulting_Main/Misc/Powershell delete files.ps1 | Powershell delete files.ps1 | $items=gci C:\deletetest
foreach ($item in $items) {if ($Item.lastwritetime -lt (get-date).adddays(-7)){remove-item $item.fullname}}
|
PowerShellCorpus/Github/LMJConsulting_Main/Misc/logonactivity.ps1 | logonactivity.ps1 | # Variables
# Path for HTML file output
$htmlfile = ".\LogonActivity.html"
# Table Creation
$LogonActivityTable = New-Object system.Data.DataTable “Logon/Logoff Activity”
# Create Columns
$date = New-Object system.Data.DataColumn "Date",([string])
$type = New-Object system.Data.DataColumn "Type",([string])
... |
PowerShellCorpus/Github/LMJConsulting_Main/Misc/Credential Script.ps1 | Credential Script.ps1 | $credential=get-credential
$credential.password | convertfrom-securestring | set-content C:\test.txt
|
PowerShellCorpus/Github/LMJConsulting_Main/Misc/canary script revised.ps1 | canary script revised.ps1 | ##############################################
# Canary script meant to detect Cryptolocker #
##############################################
#this is the build script. It preps the machine then creates and executes the monitor script.
#This part takes user-provided O365 credentials and converts it to a secure s... |
PowerShellCorpus/Github/LMJConsulting_Main/AD/Function create ad user.ps1 | Function create ad user.ps1 | Function Create-ADUser{
##name should be in the following format: John Doe
##UPN will be first letter of first name + last name, EG. JDoe
[cmdletbinding()]
param(
[parameter(mandatory=$true)]
[string]$name,
[parameter (mandatory=$true)]
[string]$copyfrom
)
$password=read-host "please ... |
PowerShellCorpus/Github/LMJConsulting_Main/Office365/changepw.ps1 | changepw.ps1 | $cred=Get-credential
Connect-MSOLService -Credential $cred
do {
Write-host "Please enter user alias:"
$UserName = read-host
$EmailAddress = "$username"
Write-host "Please enter new password:"
$Password = read-host
Set-MsolUser -UserPrincipalName $EmailAddress -StrongPasswordRequired $False
Set-Mso... |
PowerShellCorpus/Github/LMJConsulting_Main/Pranks/mouseprank.ps1 | mouseprank.ps1 | powershell.exe -noexit -windowstyle hidden {
$CSharpSig = @'
[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
public static extern bool SystemParametersInfo(
uint uiAction,
uint uiParam,
uint pvParam,
uint fWinIni);
'@
$mousesp... |
PowerShellCorpus/Github/LMJConsulting_Main/Pranks/FixMouse.ps1 | FixMouse.ps1 | powershell.exe -noexit -windowstyle hidden {
$CSharpSig = @'
[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
public static extern bool SystemParametersInfo(
uint uiAction,
uint uiParam,
uint pvParam,
uint fWinIni);
'@
$mousesp... |
PowerShellCorpus/Github/LMJConsulting_Main/Pranks/keyboard.ps1 | keyboard.ps1 | Powershell.exe -windowstyle hidden {
notepad.exe
[void] [system.reflection.assembly]::loadwithpartialname("'microsoft.visualbasic")
[microsoft.visualbasic.interaction]::appactivate("notepad")
[void] [system.reflection.assembly]::loadwithpartialname("'system.windows.forms")
[system.windows.forms.sendkeys]::sendwait... |
PowerShellCorpus/Github/LMJConsulting_Main/Pranks/CDROM random.ps1 | CDROM random.ps1 | powershell.exe -noexit -windowstyle hidden {
$sh = New-Object -ComObject "Shell.Application"
$timer=new-object system.timers.timer
$timer.interval = 100
$timer.autoreset=$true
register-objectevent -inputobject $timer -eventname elapsed -action {
$number = (get-random -minimum "1" -maximum "10")
if ($number -gt "... |
PowerShellCorpus/Github/BradyDonovan_Remote-Back-Up-Powershell/Profile backup Git.ps1 | Profile backup Git.ps1 | #Run this to backup your user profile. This script is built with the purpose of running it from our file server under and admin account.
#For this to work properly, the computers you are targeting need to have File and Printer sharing turned on.
#This can be applied en masse with this Group Policy:
#Computer Config... |
PowerShellCorpus/Github/tsmithy_RoundhousE.Psake.Example/psake-config.ps1 | psake-config.ps1 | <#
-------------------------------------------------------------------
Defaults
-------------------------------------------------------------------
#>
$config.buildFileName="default.ps1"
$config.framework = "4.0"
$config.taskNameFormat="Executing {0}"
$config.verboseError=$false
$config.coloredOutput = $true
... |
PowerShellCorpus/Github/tsmithy_RoundhousE.Psake.Example/default.ps1 | default.ps1 | $script:project_config = "Release"
properties {
Framework '4.5.1'
$project_name = "RoundhousE.Psake.Example"
$sub_project_name = "SimpleProject"
if(-not $version)
{
$version = "0.0.0.1"
}
$date = Get-Date
$ReleaseNumber = $version
Write-Host "***********************... |
PowerShellCorpus/Github/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$srcFiles = Join-Path $installPath "lib\net40\*.dll"
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$destDirec... |
PowerShellCorpus/Github/Sevsoul_TestMVC/WebApplication1/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Join-Path $projectRoot "bin"
$srcDirectory = Join-Path $... |
PowerShellCorpus/Github/Sevsoul_TestMVC/WebApplication1/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/Sevsoul_TestMVC/WebApplication1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/Sevsoul_TestMVC/WebApplication1/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1 | install.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'
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory... |
PowerShellCorpus/Github/GCCIS_Ducktape/Run-Ducktape.ps1 | Run-Ducktape.ps1 | # Imports data from the RIT API into an Exchange Calendar
#
# Author: Jimmy McNatt
[CmdletBinding()]
param
(
[Parameter(Position = 0, Mandatory = $false)]
[String] $ConfigFilePath,
[Parameter(Position = 1, Mandatory = $false)]
[Switch] $FixedDays,
[Parameter(Position = 2, Mandatory = $false)]... |
PowerShellCorpus/Github/kim0_vmware-bootstrap-puppet/mini-cloud-esx.ps1 | mini-cloud-esx.ps1 | function GetPercentages(){
# get all the hosts
$objHosts = get-vmhost -Location c9-sw;
# loop through each of the hosts and calculate the percentage of memory used
foreach($objHost in $objHosts){
$objHost | add-member NoteProperty PercentMemory ([int]($objHost.MemoryUsa... |
PowerShellCorpus/Github/mdanshin_Write-Log/Write-Log/Write-Log/Write-Log.ps1 | Write-Log.ps1 | <#
.SYNOPSIS
Запись информации в Log.
.DESCRIPTION
Данный скрипт создан для стандартизации записи информации в Log. Скрипт
предоставляет интерфейс записи как в файл на диске так и в базу данных SQL.
.PARAMETER logType
Указывает какой тип лога использовать. Возможные значения:
SQL
file
.PARAMET... |
PowerShellCorpus/Github/mdanshin_Write-Log/Write-Log/Write-Log/Write-Log.tests.ps1 | Write-Log.tests.ps1 | Describe "WriteLogTest" {
Context "Exists" {
It "Runs" {
Write-Host "Ooops!"
}
}
} |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Write-Log.ps1 | Write-Log.ps1 | function Log-Info($message, $toFile)
{
$now = {Get-Date -f "HH:mm:ss"}
$msg = "[INFO]{0} {1}" -f (&$now), $message
if($toFile -ne $null -and (Test-Path $toFile))
{
$msg | Out-File $toFile -Append
}
Write-Debug $msg
}
function Log-Warn($message, $toFile)
{
$now = {Get-Date -f "HH:mm:ss"}
$m... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Call-CCNET.ps1 | Call-CCNET.ps1 | function Load-Dll($dllName)
{
[Reflection.Assembly]::LoadFrom($dllName) | Out-Null
Write-Debug " Loaded $dllName"
}
function Load-CruiseControlDll ($dllFolders)
{
$ccDll=@("ThoughtWorks.CruiseControl.Core.dll","ThoughtWorks.CruiseControl.Remote.dll")
foreach ($dir in $dllFolders)
{... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Use-Jobs.ps1 | Use-Jobs.ps1 | $work1={
Start-Sleep -Seconds 5
"Do work 1 done."
}
$work2={
Start-Sleep -Seconds 10
"Do work 2 done."
}
cls
"-----------------------"
$jobs = @()
"Start-Job {0}" -f (Get-Date)
$jobs += Start-Job $work1
$jobs += Start-Job $work2
"-----------------------"
"Wait-Job {0}" -f (Get-Date)... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Robo-Copy.ps1 | Robo-Copy.ps1 | function Robo-Copy($from, $to, $log)
{
$tool = "robocopy"
$args = "$from $to /MIR /MT:50 /R:0"
Log-Info "Tool: '$tool'"
Log-Info "Argument: '$args'"
Set-Location $env:TEMP
$tempLog = [System.IO.Path]::GetTempFileName()
Start-Process -FilePath $tool -ArgumentList $args -WindowSty... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Compare-Folder.ps1 | Compare-Folder.ps1 | $md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
function Get-Hash($filePath, $retry=3)
{
$stream = [System.IO.File]::Open("$filePath",[System.IO.Filemode]::Open, [System.IO.FileAccess]::Read)
$hash = [System.BitConverter]::ToString($md5.ComputeHash($stream))
$stream.Close()
... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Get-CallingFunctionName.ps1 | Get-CallingFunctionName.ps1 | $ErrorActionPreference="Stop"
$DebugPreference="Continue"
trap
{
Write-Debug "=== Enter trap ==="
# C:\GitHub\PowerScripts\PowerShell\Get-CallingFunctionName.ps1
#$MyInvocation.InvocationName
# Get-CallingFunctionName.ps1
#$MyInvocation.MyCommand.Name
# Say-Hello
... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Test-LogWriter.ps1 | Test-LogWriter.ps1 | $DebugPreference = "Continue"
$ErrorActionPreference="Stop"
function Write-Log($logFile, $logInfo)
{
$now = {Get-Date -f "yyyy-MM-dd HH:mm:ss"}
$msg = "{0} {1}" -f (&$now), $logInfo
if(Test-Path $logFile)
{
$msg | Out-File $logFile -Append
}
Write-Debug $msg
}
$log="C:\Test\test.txt"
Wri... |
PowerShellCorpus/Github/tobyqin_PowerScripts/PowerShell/Test-Timeout.ps1 | Test-Timeout.ps1 | $task1 = {
Write-Host "Stopping process..."
while($true)
{
Write-Host "." -NoNewline
sleep -Seconds 2
}
}
$task2 = {
Write-Host "Kill Process..."
Exit-PSSession
}
# by seconds
$timeout = 10
Write-Host "=> Start task1 ..."
$job1 = Start-Job $task1
Wait-Job -Job $job1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.