full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/magdalena70_Back-End_Database-Applications/4.Homework-Entity-Framework-Transactions/1.News Database (Code-First)/NewsDB/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/magdalena70_Back-End_Database-Applications/4.Homework-Entity-Framework-Transactions/1.News Database (Code-First)/NewsDB/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/habsgoalie_DscComplianceChecks/Check-DscCompliance.ps1
Check-DscCompliance.ps1
param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$ResourceGroupName, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$AutomationAccountName, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Recipient, ...
PowerShellCorpus/Github/vchrisb_Isilon-POSH-Generator/IsilonPlatformGenerate.ps1
IsilonPlatformGenerate.ps1
$path = Split-Path $script:MyInvocation.MyCommand.Path $dictionary = "$path\IsilonPlatformAddOn.csv" #import prior IsilonPlatform Version first Import-Module "$path\IsilonPlatformGenerator" -Force #generate new IsilonPlatform New-isiAPI -file "$path\Output\IsilonPlatformGet.ps1" -dictionary $dictionary -method...
PowerShellCorpus/Github/BloodHoundAD_BloodHound/PowerShell/BloodHound.ps1
BloodHound.ps1
#requires -version 2 <# File: BloodHound.ps1 Author: Will Schroeder (@harmj0y) License: BSD 3-Clause Required Dependencies: None Optional Dependencies: None #> ######################################################## # # PSReflect code for Windows API access # Author: @mattifestat...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/check_ms_win_updates.ps1
check_ms_win_updates.ps1
# Script name: check_ms_win_updates.ps1 # Version: v2.05.160229 # Created on: 12/05/2015 # Author: D'Haese Willem # Purpose: Checks a Microsoft Windows Server for pending updates and alert in Nagios style output if a number of days is exceeded. # On Github: https://git...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WUUninstall.ps1
Get-WUUninstall.ps1
Function Get-WUUninstall { <# .SYNOPSIS Uninstall update. .DESCRIPTION Use Get-WUUninstall to uninstall update. .PARAM KBArticleID Update ID that will be uninstalled. .EXAMPLE Try to uninstall update with specific KBArticleID = KB958830 ...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WUList.ps1
Get-WUList.ps1
Function Get-WUList { <# .SYNOPSIS Get list of available updates meeting the criteria. .DESCRIPTION Use Get-WUList to get list of available or installed updates meeting specific criteria. There are two types of filtering update: Pre search criteria, Post search criteria. - Pre search works on...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WUServiceManager.ps1
Get-WUServiceManager.ps1
Function Get-WUServiceManager { <# .SYNOPSIS Show Service Manager configuration. .DESCRIPTION Use Get-WUServiceManager to get available configuration of update services. .EXAMPLE Show currently available Windows Update Services on machine. PS C:\> Get-WU...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Invoke-WUInstall.ps1
Invoke-WUInstall.ps1
Function Invoke-WUInstall { <# .SYNOPSIS Invoke Get-WUInstall remotely. .DESCRIPTION Use Invoke-WUInstall to invoke Windows Update install remotly. It Based on TaskScheduler because CreateUpdateDownloader() and CreateUpdateInstaller() methods can't be called from a remote computer - E_ACCESSDENIED. ...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WURebootStatus.ps1
Get-WURebootStatus.ps1
Function Get-WURebootStatus { <# .SYNOPSIS Show Windows Update Reboot status. .DESCRIPTION Use Get-WURebootStatus to check if reboot is needed. .PARAMETER Silent Get only status True/False without any more comments on screen. .EXAMPLE Check whether restart is necessary...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Update-WUModule.ps1
Update-WUModule.ps1
Function Update-WUModule { <# .SYNOPSIS Invoke Get-WUInstall remotely. .DESCRIPTION Use Invoke-WUInstall to invoke Windows Update install remotly. It Based on TaskScheduler because CreateUpdateDownloader() and CreateUpdateInstaller() methods can't be called from a remote computer - E_ACCESSDENIED. ...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Remove-WUOfflineSync.ps1
Remove-WUOfflineSync.ps1
Function Remove-WUOfflineSync { <# .SYNOPSIS Unregister offline scaner service. .DESCRIPTION Use Remove-WUOfflineSync to unregister Windows Update offline scan file (wsusscan.cab or wsusscn2.cab) from current machine. .EXAMPLE Check if Offline Sync Service ...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WUInstallerStatus.ps1
Get-WUInstallerStatus.ps1
Function Get-WUInstallerStatus { <# .SYNOPSIS Show Windows Update Installer status. .DESCRIPTION Use Get-WUInstallerStatus to show Windows Update Installer status. .PARAMETER Silent Get only status True/False without any more comments on screen. .EXAMPLE Check if Windows Updat...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Remove-WUServiceManager.ps1
Remove-WUServiceManager.ps1
Function Remove-WUServiceManager { <# .SYNOPSIS Remove windows update service manager. .DESCRIPTION Use Remove-WUServiceManager to unregister Windows Update Service Manager. .PARAMETER ServiceID An identifier for the service to be unregistered. .EXAMPLE Try unregister Microsoft...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Add-WUOfflineSync.ps1
Add-WUOfflineSync.ps1
Function Add-WUOfflineSync { <# .SYNOPSIS Register offline scaner service. .DESCRIPTION Use Add-WUOfflineSync to register Windows Update offline scan file. You may use old wsusscan.cab or wsusscn2.cab from Microsoft Baseline Security Analyzer (MSBA) or System Management Server Inventory Tool for Mi...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WUHistory.ps1
Get-WUHistory.ps1
Function Get-WUHistory { <# .SYNOPSIS Get list of updates history. .DESCRIPTION Use function Get-WUHistory to get list of installed updates on current machine. It works similar like Get-Hotfix. .PARAMETER ComputerName Specify the name of the computer to the remote connection. ...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Hide-WUUpdate.ps1
Hide-WUUpdate.ps1
Function Hide-WUUpdate { <# .SYNOPSIS Get list of available updates meeting the criteria and try to hide/unhide it. .DESCRIPTION Use Hide-WUUpdate to get list of available updates meeting specific criteria. In next step script try to hide (or unhide) updates. There are two types of filtering upd...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Get-WUInstall.ps1
Get-WUInstall.ps1
Function Get-WUInstall { <# .SYNOPSIS Download and install updates. .DESCRIPTION Use Get-WUInstall to get list of available updates, next download and install it. There are two types of filtering update: Pre search criteria, Post search criteria. - Pre search works on server side, like example: ( ...
PowerShellCorpus/Github/Fox-Alpha_check_ms_win_updates/PSWindowsUpdate/1.5.1.11/Add-WUServiceManager.ps1
Add-WUServiceManager.ps1
Function Add-WUServiceManager { <# .SYNOPSIS Register windows update service manager. .DESCRIPTION Use Add-WUServiceManager to register new Windows Update Service Manager. .PARAMETER ServiceID An identifier for the service to be registered. Examples Of ServiceID: Windows Upd...
PowerShellCorpus/Github/Midacts_DisableInactiveUsers/DisableInactiveUsers.ps1
DisableInactiveUsers.ps1
############### ###VARIABLES### ############### # Clears LogArray $logArray = @() # Clears DisabledUsers Variable $disabledUser = @() # Variable for filename $logDate = Get-Date -f MMddyyyy # Variable for 90days $90days = (Get-Date).adddays(-90) # OU Variable for Disabled OU $OUDisabled = '# [NAME OF OU FO...
PowerShellCorpus/Github/triad-cdp_Triad.Intranet.Provisioning/Triad.Intranet.Provisioning/Triad.Intranet.Provisioning/Install.ps1
Install.ps1
# # Script1.ps1 # Write-Host "Started installation" Write-Host "Completed installation"
PowerShellCorpus/Github/triad-cdp_Triad.Intranet.Provisioning/Triad.Intranet.Provisioning/Triad.Intranet.Provisioning/Build.ps1
Build.ps1
# # Script.ps1 # Write-Host "Hello World!"
PowerShellCorpus/Github/triad-cdp_Triad.Intranet.Provisioning/Triad.Intranet.Provisioning/Triad.Provisioning.Console/Install.ps1
Install.ps1
# # Install.ps1 # Param( [string]$Tenant, [string]$Site, [string]$Username, [string]$Password ) begin { Clear-Host Write-Host "Tenant: $Tenant" Write-Host "Site: $Site" Write-Host "User: $Username" Write-Host "Password: $Password" Write-Host "Started installation" } process { ...
PowerShellCorpus/Github/lwblackledge_DbObjectReferenceChecker/FindReferencesInFiles.ps1
FindReferencesInFiles.ps1
param ( [string]$searchLocation = $(throw "searchLocation is empty. Please specify where you want to search."), [string]$searchString = $(throw "searchString is empty. Please specify what you want to search for."), [string[]]$excludedFileTypes = @("") ) return (Get-ChildItem -Path $searchLocation -Recurse | ...
PowerShellCorpus/Github/lwblackledge_DbObjectReferenceChecker/CheckForDbReferences.ps1
CheckForDbReferences.ps1
param ( [string] $connectionString = $(throw "Enter a connection string."), [string] $objectName = $(throw "Enter an object to check for dependencies.") ) $invalidObjectsFile = "$(Get-Location)\invalidObjects.txt"; if ((Test-Path $invalidObjectsFile) -eq $false) { New-Item $invalidObjectsFile -ItemType file...
PowerShellCorpus/Github/lwblackledge_DbObjectReferenceChecker/GetDbObjectNames.ps1
GetDbObjectNames.ps1
param ( [string] $connectionString = $(throw "Enter a connection string.") ) $getObjectsQuery = "SELECT name FROM sys.sql_modules AS sm INNER JOIN sys.objects AS o ON sm.object_id = o.object_id"; $results = @(); $conn = New-Object System.Data.SqlClient.SqlConnection($connectionString); $conn.Open(); $cmd...
PowerShellCorpus/Github/lwblackledge_DbObjectReferenceChecker/RunDbObjectReferenceCheck.ps1
RunDbObjectReferenceCheck.ps1
param ( [string] $connectionString = "replace this", [string] $searchLocation = "replace this" ) $ErrorActionPreference = "stop"; $nl = [Environment]::NewLine; $outputFile = "$(Get-Location)\results.txt"; New-Item $outputFile -ItemType file -Force; $conn = New-Object System.Data.SqlClient.SqlConnecti...
PowerShellCorpus/Github/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/ShepVlad_TaskManager/AspExam/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/jdpleiness_List-WIndows-Printers/List-Windows-Printers.ps1
List-Windows-Printers.ps1
<# .SUMMARY Lists printers from a computer specified with $computer_name Outputs results in a .csv format to the path specified with $path_name .AUTHOR Jacob Pleiness #> function New-Printer() { param ([string]$queue_name, [string]$portname, [string]$location, [string]$comment) $Printer = New-...
PowerShellCorpus/Github/mikiorla_Exchange/Get-OutlookInbox.ps1
Get-OutlookInbox.ps1
#Get-OutlookInBox function Function Get-OutlookInBox { <# .Synopsis This function returns InBox items from default Outlook profile .Description This function returns InBox items from default Outlook profile. It uses the Outlook interop assembly to use the olFolderInBox enumeration. It...
PowerShellCorpus/Github/mikiorla_Exchange/Office 365.ps1
Office 365.ps1
$UserCredential = Get-Credential -Message 'Office 365 Admin' -UserName milan@kt.rs #$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection #Import-PSSession $Session Import-...
PowerShellCorpus/Github/mikiorla_Exchange/Create New Mailboxes.ps1
Create New Mailboxes.ps1
#create AD users/mailboxes from CSV $users = Import-Csv 'C:\Users\Milan.KTEHNIKA\Documents\trcpro-users list 3.txt' -Encoding Unicode #$password = 'Trcprons1' $password = ConvertTo-SecureString "Trcprons1" -AsPlainText -Force foreach ($user in $users) { $param = @{ OrganizationalUnit = 'ktehnika.local/T...
PowerShellCorpus/Github/mikiorla_Exchange/Get-SimpleAuditLogReport.ps1
Get-SimpleAuditLogReport.ps1
################################################################################# # # The sample scripts are not supported under any Microsoft standard support # program or service. The sample scripts are provided AS IS without warranty # of any kind. Microsoft further disclaims all implied warranties including, ...
PowerShellCorpus/Github/mikiorla_Exchange/Get Outlook Signature Location.ps1
Get Outlook Signature Location.ps1
$comps = Get-ADComputer -Properties OperatingSystem -Filter "OperatingSystem -LIKE '*7*'" $comps = $comps.Name #$comps = 'jadranka-pc' #,'xn26' foreach ($compname in $comps) { $Error.Clear() if (Test-Connection $compname -count 1 -ErrorAction SilentlyContinue ) { #check WMI $os = (gwmi -Class Win32_operat...
PowerShellCorpus/Github/mikiorla_Exchange/Get-Active-Cas-Connections-v3.ps1
Get-Active-Cas-Connections-v3.ps1
<# .SYNOPSIS Purpose of this script is to report on particular performance monitor counters for Outlook RPC Client Access, OWA and Exchange ActiveSync on multiple servers .DESCRIPTION Script was initially created to easily show the number of connected users to each Exchange 2010 CAS. This was du...
PowerShellCorpus/Github/mikiorla_Exchange/getVirtualDirectories.ps1
getVirtualDirectories.ps1
$servers = Get-ExchangeServer #$vds = "OWA","ECP","WebServices","ActiveSync","OAB","Powershell" $vds = "OWA","ECP","WebServices","ActiveSync","OAB","Autodiscover","Powershell" $Object = New-Object PSObject #$Object | add-member Noteproperty -Name Server -Value $null $Object | add-member Noteproperty -Name Nam...
PowerShellCorpus/Github/mikiorla_Exchange/Get-serverHealth.ps1
Get-serverHealth.ps1
$eserver = 'e1.ktehnika.local' Get-ServerHealth $eserver | ?{$_.HealthSetName -eq "ActiveSync"} Invoke-MonitoringProbe ActiveSync\ActiveSyncCTPProbe -Server $eserver | Format-List Invoke-MonitoringProbe -Identity ActiveSync.Protocol\ActiveSyncSelfTestProbe -Server $eserver
PowerShellCorpus/Github/mikiorla_Exchange/Get-MessageSizeLimits.ps1
Get-MessageSizeLimits.ps1
$user = Read-host "Enter username to check" Write-host 'Organizational limits - Transport Config' -ForegroundColor Yellow -NoNewline Get-TransportConfig | ft MaxReceiveSize, MaxSendSize, MaxRecipientEnvelopeLimit #Get-TransportRule Write-host 'Receive Connector limits' -ForegroundColor Yellow -NoNewline G...
PowerShellCorpus/Github/mikiorla_Exchange/ExchangeTransportLogs.ps1
ExchangeTransportLogs.ps1
#Get-MessageTrackingLog -Server e1 -Recipients petar.dzigurski@ktehnika.co.rs -Start (get-date).AddMinutes(-30) $SMTPReceiveLogPath = get-childitem -path "\\e1\c$\Program Files\Microsoft\Exchange Server\V15\TransportRoles\Logs\FrontEnd\ProtocolLog\SmtpReceive" $SMTPReceiveLog = $SMTPReceiveLogPath | sort -Pr...
PowerShellCorpus/Github/mikiorla_Exchange/Email Campaign.ps1
Email Campaign.ps1
#email compaing #created Transport rule, not neccesery #Wait for QMAIL Reply #create AutoReply message on Qmail #_________________________________ #get-MailboxAutoReplyConfiguration -Identity qmail #Set-MailboxAutoReplyConfiguration -Identity qmail -ExternalMessage "Thank you for reply!" -AutoReplyState:enabl...
PowerShellCorpus/Github/mikiorla_Exchange/Managed Availability.ps1
Managed Availability.ps1
#http://blogs.technet.com/b/exchange/archive/2013/06/13/what-did-managed-availability-just-do-to-this-service.aspx $server = 'E1' Get-HealthReport -Identity $server | ? AlertValue -EQ Unhealthy Get-ServerHealth -Identity $server #Recovery Action Log -> Microsoft.Exchange.ManagedAvailability/RecoveryAction...
PowerShellCorpus/Github/mikiorla_Exchange/Migrate Public Folders.ps1
Migrate Public Folders.ps1
#export public folder data Get-PublicFolder -Recurse | Export-CliXML C:\Legacy_PFStructure.xml Get-PublicFolderStatistics | Export-CliXML C:\Legacy_PFStatistics.xml Get-PublicFolder -Recurse | Get-PublicFolderClientPermission | Select-Object Identity,User -ExpandProperty AccessRights | Export-CliXML C:\Legacy_PFPe...
PowerShellCorpus/Github/mikiorla_Exchange/EWS/EWS connect to mailbox.ps1
EWS connect to mailbox.ps1
#http://stackoverflow.com/questions/4454165/how-to-check-an-exchange-mailbox-via-powershell # work with exchange server to retrieve messages # see this SO answer: http://stackoverflow.com/a/4866894 # call this script using dot-source (see http://technet.microsoft.com/en-us/library/ee176949.aspx) # to allow co...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_Provision_2017_5_5_17_12_21/.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/OPSTest_E2E_NewRepo_1488819943315/.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/bslattz_powershell-scripts/test1.ps1
test1.ps1
. .\test.ps1 f test
PowerShellCorpus/Github/bslattz_powershell-scripts/Utils.ps1
Utils.ps1
# General Utility Functions function Invoke-NullCoalescing { $result = $null foreach($arg in $args) { if ($arg -is [ScriptBlock]) { $result = & $arg } else { $result = $arg } if ($result) { break } } $result } Set-Alias ?? Invoke-N...
PowerShellCorpus/Github/bslattz_powershell-scripts/GitPrompt.ps1
GitPrompt.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration $global:GitPromptSettings = New-Object PSObject -Property @{ DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor BeforeText = ' [' BeforeForegroundColor = [Console...
PowerShellCorpus/Github/bslattz_powershell-scripts/test.ps1
test.ps1
param ( [string]$target = "../bash" ) . .\Utils.ps1 . .\GitUtils.ps1 . .\GitPrompt.ps1 $CDR = $PWD cd $target Write-Output $target $s = Get-GitStatus $target Write-Output ConvertTo-Json $s $s = Write-GitStatus $s Write-Output $s cd $CDR
PowerShellCorpus/Github/bslattz_powershell-scripts/GitUtils.ps1
GitUtils.ps1
# Inspired by Mark Embling # http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration function Get-GitDirectory { if ($Env:GIT_DIR) { $Env:GIT_DIR } else { Get-LocalOrParentPath .git } } function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.S...
PowerShellCorpus/Github/bslattz_powershell-scripts/GitTabExpansion.ps1
GitTabExpansion.ps1
# Initial implementation by Jeremy Skinner # http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/ $Global:GitTabSettings = New-Object PSObject -Property @{ AllCommands = $false } $subcommands = @{ bisect = 'start bad good skip reset visualize replay log run' notes = 'edit ...
PowerShellCorpus/Github/bslattz_powershell-scripts/postAction.ps1
postAction.ps1
# Helper for VSTO deploy, post action # CWD is project folder of the addin # # Refrence # Put the document of a solution onto the end user's computer (document-level customizations only) # https://msdn.microsoft.com/en-us/library/vs/alm/bb772100(v=vs.120).aspx# # # Accepts fully qualified postAction class a...
PowerShellCorpus/Github/zhangluther_aspnet1/aspnet1/packages/Newtonsoft.Json.6.0.8/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/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWin...
PowerShellCorpus/Github/v-peliao_E2E_NewRepo_1489657245861/.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/tunisiano187_WindowsFirstBoot/Install.ps1
Install.ps1
Write-Host -ForegroundColor 'GREEN' Windows Preparation # Functions function Download-File { param ( [string]$url, [string]$file ) Write-Host "Downloading $url to $file" #$webclient = New-Object System.Net.WebClient #$webclient.DownloadFile($url,$file) Import-Module BitsTransfer Start-BitsTransfer...
PowerShellCorpus/Github/tunisiano187_WindowsFirstBoot/start.ps1
start.ps1
Write-Host -ForegroundColor 'GREEN' Windows Preparation # Functions function Download-File { param ( [string]$url, [string]$file ) Write-Host -ForeGround Blue "Downloading $url to $file" Import-Module BitsTransfer Start-BitsTransfer $url $file } # Configuration $installDir = Join-Path $env:temp 'wi...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1488776741347/.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/gngrninja_PPUG/2016-09-14/presentation.ps1
presentation.ps1
############################## # # #Starting Jobs With Start-Job# # # ############################## #This will start a job with the name of SleepProcess (Sleeps 1 minute, then runs Get-Process) Start-Job -Name SleepProcess -ScriptB...
PowerShellCorpus/Github/gngrninja_PPUG/2016-09-14/workshopProblem.ps1
workshopProblem.ps1
<# 1. Start the three jobs listed below 2. Collect information from them as they execute -Command run -Job name -Errors (if applicable) -Time the job completed -Anything else you can think of #> Start-Job -Name SleepProcess -ScriptBlock {Start-Sleep -Seconds 60; Get-Process} Start-Job...
PowerShellCorpus/Github/gngrninja_PPUG/2016-09-14/Solution/workshopSolution.ps1
workshopSolution.ps1
#Set the jobs variable to $true so the while loop processes at least once $jobs = $true #Get path $scriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition #Set the output folder path $outputFolder = "$scriptPath\Output" #Create some jobs to monitor. One for each error handling examp...
PowerShellCorpus/Github/paramjit-kaur_ApartmentSearch/ApartmentSearch/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) try { # Set up variables $timestamp = (Get-Date).ToString('yyyyMMddHHmmss') $projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar)) $catalogName = "aspnet-$project...
PowerShellCorpus/Github/paramjit-kaur_ApartmentSearch/ApartmentSearch/packages/Unity.2.1.505.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Import-Module (Join-Path $toolsPath Utils.psm1) $relativeInstallPath = Get-RelativePath ([System.Io.Path]::GetDirectoryName($dte.Solution.FullName)) $installPath $folder = (Join-Path (Join-Path $relativeInstallPath "lib") "NET35") Add-ToolFolder $folder ...
PowerShellCorpus/Github/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/paramjit-kaur_ApartmentSearch/ApartmentSearch/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/OPS-E2E-Prod_E2E_P_Provision_2017_4_27_11_17_19/.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/jleaders_choco-packages/pandora/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
$packageName = 'pandora' $registryUninstallerKeyName = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CAC6BC93-D73B-327E-AB0C-791E74A24111}' #ensure this is the value in the registry $installerType = 'EXE' $silentArgs = '/S' $validExitCodes = @(0) $osBitness = Get-ProcessorB...
PowerShellCorpus/Github/jleaders_choco-packages/pandora/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one $packageName = 'pandora' # arbitrary name for the package, used in messages $url = 'http://www.pandora.com/static/desktop_app/pandora_2_0_9.air' # download url $fileName = split-path "$url" -leaf # Method 1:...
PowerShellCorpus/Github/jleaders_choco-packages/glovepie/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one # Auto Uninstaller should be able to detect and handle registry uninstalls (if it is turned on, it is in preview for 0.9.9). $packageName = 'glovepie' $registryUninstallerKeyName = 'glovepie' #ensure this is th...
PowerShellCorpus/Github/jleaders_choco-packages/glovepie/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one $packageName = 'glovepie' # arbitrary name for the package, used in messages $registryUninstallerKeyName = 'glovepie' #ensure this is the value in the registry $installerType = 'zip' #only one of these: exe, ms...
PowerShellCorpus/Github/jleaders_choco-packages/skype.desktop/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
$packageName = 'skype.desktop' $registryUninstallerKeyName = '{24991BA0-F0EE-44AD-9CC8-5EC50AECF6B7}' #ensure this is the value in the registry $installerType = 'EXE' $silentArgs = '/S' $validExitCodes = @(0) $osBitness = Get-ProcessorBits if ($osBitness -eq 64) { $file = (Get-ItemProperty -Path "hklm:\SO...
PowerShellCorpus/Github/jleaders_choco-packages/skype.desktop/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
$packageName = 'skype.desktop' # arbitrary name for the package, used in messages $registryUninstallerKeyName = '{24991BA0-F0EE-44AD-9CC8-5EC50AECF6B7}' #ensure this is the value in the registry $installerType = 'exe' #only one of these: exe, msi, msu $url = 'http://download.skype.com/0dce4e856bdf8239787df5c367298d5...
PowerShellCorpus/Github/jleaders_choco-packages/winlocate/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one # Auto Uninstaller should be able to detect and handle registry uninstalls (if it is turned on, it is in preview for 0.9.9). $packageName = 'winlocate' $registryUninstallerKeyName = 'winlocate' #ensure this is ...
PowerShellCorpus/Github/jleaders_choco-packages/winlocate/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
$packageName = 'winlocate' # arbitrary name for the package, used in messages $registryUninstallerKeyName = 'winlocate' #ensure this is the value in the registry $installerType = 'zip' #only one of these: exe, msi, msu $url = 'http://colocrossing.dl.sourceforge.net/project/winlocate/Winlocate/0.1.6/winlocate-0.1.6.z...
PowerShellCorpus/Github/jleaders_choco-packages/wingide.pro/tools/chocolateyuninstall.ps1
chocolateyuninstall.ps1
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one # Auto Uninstaller should be able to detect and handle registry uninstalls (if it is turned on, it is in preview for 0.9.9). $packageName = 'wingide.pro' $registryUninstallerKeyName = 'Wing IDE 5.1_is1' #ensure...
PowerShellCorpus/Github/jleaders_choco-packages/wingide.pro/tools/chocolateyinstall.ps1
chocolateyinstall.ps1
$packageName = 'wingide.pro' # arbitrary name for the package, used in messages $registryUninstallerKeyName = 'Wing IDE 5.1_is1' #ensure this is the value in the registry $installerType = 'exe' #only one of these: exe, msi, msu $url = 'http://wingware.com/pub/wingide/5.1.1/wingide-5.1.1-1.exe' # download url $silen...
PowerShellCorpus/Github/kevinGH_WebSocket/WebClient/WebClient/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/kevinGH_WebSocket/WebClient/WebClient/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/kevinGH_WebSocket/WebClient/WebClient/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/OPS-E2E-PPE_E2E_D_NewRepo_2017_4_22_29_58_30/.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/edhilgendorf_powershell/update active directory new computer.ps1
update active directory new computer.ps1
#import active directory module, clear screen, set continue var Import-Module ActiveDirectory cls $cntu = "y" echo "SEE: updateNewComputer_README.txt for more. This script will take a computer name and complete the following: I. Add a new description from user input II. Add the computer to the Adobe Reader,...
PowerShellCorpus/Github/edhilgendorf_powershell/update active directory from csv.ps1
update active directory from csv.ps1
# Import the csv as a variable # IMPORTANT: change -header parameters to match the first line of the CSV, and the path should be where your # comma delimited CSV exists. $data = Import-Csv C:\Users\USER$\Documents\ps\adFinal.txt -header("Full Name","Last Name","pTitle","nTitle","Account Management","SamAccountName",...
PowerShellCorpus/Github/NelaKirylchyk_SpeechToText/SpeechToTextApp/SpeechToTextApp.Windows/AppPackages/SpeechToTextApp.Windows_1.0.0.3_x86_Debug_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...