full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/CyberSecDef_CSTS/wsus/wua/installer.ps1 | installer.ps1 | $optionsQ = @("ndp1.1sp1-kb867460","capicom","kb913433","rootsupd","rvkroots","kb923789","vcredist")
$optionsQN = @("\msxml","\ndp","FileFormatConverters","compatibilitypacksp","\OFV","940157","2553065")
$optionsQQN = @("KB2758694","KB954430")
$optionsQuietNoRestart = @("KB976932")
$skipFiles = @("clearcompressio... |
PowerShellCorpus/Github/CyberSecDef_CSTS/wwwroot/index.ps1 | index.ps1 | $PageClass = New-PSClass Page{
note -private request
constructor{
param($request)
$private.request = $request
}
method WebResponse{
switch($private.request.Get.action){
"test" { return "this is an inline test"}
"index" { return $this.index() }
"top" { return $this.top() }
default { ... |
PowerShellCorpus/Github/CyberSecDef_CSTS/wwwroot/config.ps1 | config.ps1 |
$config.ContentBlackList = @("image/jpegs") |
PowerShellCorpus/Github/CyberSecDef_CSTS/conf/webConfig.ps1 | webConfig.ps1 | $config = @{}
$config.Add("WebRoot","C:\sandbox\scripts\wwwroot")
$config.Add("LogRoot","C:\sandbox\scripts\logs\web.log")
$config.Add("Port","2223")
$config.Add("HostName","127.0.0.1")
$config.Add("DirectoryBrowsing",$true)
$config.Add("ContentBlackList",@())
$config.Add("IPWhiteList",@())
$config.Add(... |
PowerShellCorpus/Github/sentania_vSphereSandbox/deploy-virtualLab.ps1 | deploy-virtualLab.ps1 | None |
PowerShellCorpus/Github/sentania_vSphereSandbox/vsphere-6.0-vghetto-self-manage-lab-deployment.ps1 | vsphere-6.0-vghetto-self-manage-lab-deployment.ps1 | # Author: William Lam
# Website: www.virtuallyghetto.com
# Description: PowerCLI script to deploy a fully functional vSphere 6.0 lab consisting of 3
# Nested ESXi hosts enable w/vSAN + VCSA 6.0. Expects a single physical ESXi host
# as the endpoint and all three Nested ESXi VMs will be d... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Install.ps1 | Install.ps1 | [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic')
$EonServ = [Microsoft.VisualBasic.Interaction]::InputBox("IP du serveur EON", "Configuration NRDP", "")
$EonToken = [Microsoft.VisualBasic.Interaction]::InputBox("Token NRDP", "Configuration NRDP", "")
$Path = Get-Location
$ApxPath ... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Dependances/init.ps1 | init.ps1 | #*********************************************************************************************************************************************#
#* *#
#* Powershell ... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Dependances/purge.ps1 | purge.ps1 | #*********************************************************************************************************************************************#
#* *#
#* Powershell ... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Dependances/ps_nrdp.ps1 | ps_nrdp.ps1 | param (
[string]$url = "",
[string]$token = "",
[string]$hostname = "",
[string]$service = "",
[string]$state = "",
[string]$output = "",
[char]$delim = "`t",
[int]$checktype = "",
[string]$file = "",
[switch]$readterm = $false,
[switch]$help = $false
)
Set-Str... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Dependances/eon4apps.ps1 | eon4apps.ps1 | #*********************************************************************************************************************************************#
#* *#
#* Powershell ... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Dependances/Apps/www.eyesofnetwork.fr.ps1 | www.eyesofnetwork.fr.ps1 | #*********************************************************************************************************************************************#
#* *#
#* Powershell ... |
PowerShellCorpus/Github/EyesOfNetworkCommunity_eyesofapplication/Dependances/Docs/sample.ps1 | sample.ps1 | #*********************************************************************************************************************************************#
#* *#
#* Powershell ... |
PowerShellCorpus/Github/majkinetor_TFS/publish.ps1 | publish.ps1 | function test-var() {
$input | % { if (!(Test-Path Env:$_)) {throw "Environment Variable $_ must be set"} }
}
function Publish-PSGallery() {
Write-Host 'Publishing to Powershell Gallery'
'NuGet_ApiKey' | test-var
$params = @{
Path = "$PSScriptRoot\TFS"
NuGetApiKey = $... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Update-TFSBuildDefinition.ps1 | Update-TFSBuildDefinition.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Update build definition
.EXAMPLE
Update-TFSBuildDefinition -JsonFile BuildXYZ.json
Update the build definition (create a new revision) using the data in the JSON file 'BuildXYZ'.
.NOTES
Build definiti... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSProcesses.ps1 | Get-TFSProcesses.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS processes
#>
function Get-TFSProcesses {
[CmdletBinding()]
param(
)
check_credential
$uri = "$collection_uri/_apis/process/processes?api-version=" + $global:tfs.api_version
... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSBuildDefinitions.ps1 | Get-TFSBuildDefinitions.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS build definitions
#>
function Get-TFSBuildDefinitions {
[CmdletBinding()]
param (
#Filters to definitions whose names start with this value. Globs supported.
[string]$Name
... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Remove-TFSBuildDefinition.ps1 | Remove-TFSBuildDefinition.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Remove the TFS build definition
.EXAMPLE
defs | % { rmdef $_.Name }
Remove all build definitions from the project. The example is using aliases
#>
function Remove-TFSBuildDefinition {
[CmdletBindin... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSBuildDefinition.ps1 | Get-TFSBuildDefinition.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 27-Apr-2016.
<#
.SYNOPSIS
Get the TFS build definition
.EXAMPLE
Get-TFSBuildDefinition Build1
Get the TFS build definition by name.
.EXAMPLE
Get-TFSBuildDefinition Build1 -OutFile build1.json
Exports the TFS build d... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Invoke-TFSBuild.ps1 | Invoke-TFSBuild.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 20-Oct-2016.
<#
.SYNOPSIS
Invoke the TFS build
#>
function Invoke-TFSBuild {
[CmdletBinding()]
param(
#Build defintion id [int] or name [string]
$Id,
#Optional source branch
[string] $sourceBranch ... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Add-TFSBuildTag.ps1 | Add-TFSBuildTag.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Add tag to TFS build
#>
function Add-TFSBuildTag{
[CmdletBinding()]
param(
#Build ID
[int]$Id,
#Tag to add to the build
[string]$Tag
)
check_credential
... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSQueues.ps1 | Get-TFSQueues.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS build queues
#>
function Get-TFSQueues {
[CmdletBinding()]
param ()
check_credential
$uri = "$collection_uri/_apis/build/queues?api-version=" + $global:tfs.api_version
Write-Verb... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Remove-TFSProject.ps1 | Remove-TFSProject.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 25-Apr-2016.
<#
.SYNOPSIS
Get the TFS project
#>
function Remove-TFSProject {
[CmdletBinding()]
param (
#Id or name of the project
[string]$Id
)
check_credential
if ($Id.Length -ne 36) { $Id = Get-T... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Remove-TFSBuildTag.ps1 | Remove-TFSBuildTag.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Remove tag from TFS build
.EXAMPLE
Remove-TFSBuildTag 220 production
Remove tag 'production' from the build with ID 220.
#>
function Remove-TFSBuildTag{
[CmdletBinding()]
param(
#Build ... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/New-TFSProject.ps1 | New-TFSProject.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Create new TFS project
.EXAMPLE
New-TFSProject -Name Test -Description 'Test project' -ProcessTemplate Scrum
Create a new TFS team project with given name and description and use Scrum process template.
#>... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/_globals.ps1 | _globals.ps1 | $collection_uri = "{0}/{1}" -f $global:tfs.root_url, $global:tfs.collection
$proj_uri = "{0}/{1}" -f $collection_uri, $global:tfs.project
function check_credential() {
[CmdletBinding()]
param()
if ($global:tfs.Credential) {
Write-Verbose "TFS Credential: $($global:tfs.Credential.User... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSBuilds.ps1 | Get-TFSBuilds.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS build list
.EXAMPLE
Get-TFSBuilds
Return last 10 builds
.EXAMPLE
builds -BuildNumber 80[0-4]
Return builds 800 - 804
.EXAMPLE
builds -Definitions Def1, Def2 -MaxBuildsPerDef... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSProject.ps1 | Get-TFSProject.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS project details
.EXAMPLE
Get-TFSProject ProjectXYZ
Get the project 'ProjectXYZ' by its name
.EXAMPLE
Get-TFSProject 1
Get the project by its TFS numeric id
#>
function Get-TFSProj... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSBuildLogs.ps1 | Get-TFSBuildLogs.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 05-Aug-2016.
<#
.SYNOPSIS
Get the unified build logs for the TFS build
.EXAMPLE
PS> Get-TFSBuildLogs
Returns logs of the latest build
.EXAMPLE
PS> Get-TFSBuildLogs 250
Returns logs of the build by id
.EXAMPLE
... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSProjects.ps1 | Get-TFSProjects.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the list of team projects from the TFS server
#>
function Get-TFSProjects{
[CmdletBinding()]
param(
#Maxium number of team projects to return, by default 100
[int] $Top=100,
#N... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSBuildDefinitionHistory.ps1 | Get-TFSBuildDefinitionHistory.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the build definition history
#>
function Get-TFSBuildDefinitionHistory{
[CmdletBinding()]
param(
# Build definition history id [int] or name [string]
$Id
)
check_credential
... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/New-TFSGitRepository.ps1 | New-TFSGitRepository.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 14-Apr-2016.
<#
.SYNOPSIS
Get the TFS Git repositories
#>
function New-TFSGitRepository {
[CmdletBinding()]
param (
#Name of the repository
[string] $Name
)
check_credential
$uri = "$proj_uri/_apis/... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/New-TFSBuildDefinition.ps1 | New-TFSBuildDefinition.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Create/import build definition
.EXAMPLE
New-BuildDefinition -JsonFile BuildXYZ.json
Create a new build definition using the data in the JSON file 'BuildXYZ.json'
#>
function New-TFSBuildDefinition {
... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSStoredCredential.ps1 | Get-TFSStoredCredential.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 18-May-2016.
<#
.SYNOPSIS
Get saved TFS credential from the Windows Credential Manager. If none is available, create and store one.
#>
function Get-TFSStoredCredential {
[CmdletBinding()]
param()
if ($global:tfs.root_url -eq $... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSGitRepositories.ps1 | Get-TFSGitRepositories.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS Git repositories
#>
function Get-TFSGitRepositories {
[CmdletBinding()]
param ()
check_credential
$uri = "$proj_uri/_apis/git/repositories?api-version=" + $tfs.api_version
Write-... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Remove-TFSGitRepository.ps1 | Remove-TFSGitRepository.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Get the TFS Git repositories
#>
function Remove-TFSGitRepository {
[CmdletBinding()]
param (
#Name of the repository
[string] $Name
)
check_credential
$id = Get-TFSGitRepos... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/New-TFSCredential.ps1 | New-TFSCredential.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 18-May-2016.
<#
.SYNOPSIS
Create and optionaly store the TFS credentials
#>
function New-TFSCredential {
[CmdletBinding()]
param(
# TFS credential
[PSCredential] $Credential
)
Write-Verbose "New TFS cred... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Remove-TFSBuild.ps1 | Remove-TFSBuild.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 26-Apr-2016.
<#
.SYNOPSIS
Remove the TFS build
#>
function Remove-TFSBuild {
[CmdletBinding()]
param (
#Build ID
[int] $Id
)
check_credential
$uri = "$proj_uri/_apis/build/builds/$($Id)?api-version=... |
PowerShellCorpus/Github/majkinetor_TFS/TFS/Get-TFSBuildArtifacts.ps1 | Get-TFSBuildArtifacts.ps1 | # Author: Miodrag Milic <miodrag.milic@gmail.com>
# Last Change: 14-Apr-2016.
<#
.SYNOPSIS
Get the build artifacts
#>
function Get-TFSBuildArtifacts{
[CmdletBinding()]
param(
#Build id
[int]$Id
)
check_credential
$uri = "$proj_uri/_apis/build/builds/$Id/artifacts... |
PowerShellCorpus/Github/rickning_HelloServer/HelloServer/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/rickning_HelloServer/HelloServer/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/rickning_HelloServer/HelloServer/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/bundyfx_NanoBuilder/New-NanoServer.ps1 | New-NanoServer.ps1 | <#
.Synopsis
To simply create a Nano Server VHD(x) file.
.DESCRIPTION
Creates a Nano Server VHD(x) file to be mounted to a VM shell in Hyper-V.
This interfaces uses the NanoGenerator module that is included as part of the Windows Server 2016 install media.
It is a prerequisite that the media be mount... |
PowerShellCorpus/Github/gdbarron_Azure-DevTestLabs/Artifacts/Chef-OpenFirewallForWinRM/Chef-OpenFirewallForWinRM.ps1 | Chef-OpenFirewallForWinRM.ps1 | Get-NetFirewallPortFilter | ?{$_.LocalPort -eq 5985 } | Get-NetFirewallRule | ?{ $_.Direction –eq "Inbound" -and $_.Profile -eq "Public" -and $_.Action –eq "Allow"} | Set-NetFirewallRule -RemoteAddress "Any" |
PowerShellCorpus/Github/mcmahonj12_Install-Win-LIAgent/Install-Win-LIAgent.ps1 | Install-Win-LIAgent.ps1 | <# Name: Install-Win-LIAgent.ps1
Author: Jim McMahon II
Date: 5/22/2017
Synopsis: Quickly deploy Windows Log Insight agents
Description: This script can be used to automate the installation of the Log Insight Windows agent without the
use of Active Directory.
Below example calls hostnames from a CSV and... |
PowerShellCorpus/Github/vavkin_Nvx.PowerSharepoint/Deploy/install_wsp.ps1 | install_wsp.ps1 | ###############################################################################################################
# Скрипт развертывание WSP пакета
# (С) NetVoxLab 2011
###############################################################################################################
## ПАРАМЕТРЫ ЗАПУСКА
$solutionName="... |
PowerShellCorpus/Github/vavkin_Nvx.PowerSharepoint/Backups/BackupSite.ps1 | BackupSite.ps1 | ###############################################################################################################
# Скрипт снятия бекапа и автоматического архивирования
# Скрипт рассылает оповещения через e-mail о начале и завершении процесса
# Внимание скрипту требуется установленные 7zip и SMTP сервер
# Для запука ... |
PowerShellCorpus/Github/vavkin_Nvx.PowerSharepoint/Backups/RestoreSite.ps1 | RestoreSite.ps1 | ###############################################################################################################
# Скрипт развертывания бекапа
# Скрипт рассылает оповещения через e-mail о начале и завершении процесса
# (С) NetVoxLab 2011
###############################################################################... |
PowerShellCorpus/Github/terrytrent_PowerShell-Classes/PowerShellClasses-Cars.ps1 | PowerShellClasses-Cars.ps1 | Enum MakeOfCar
{
Unknown;
Dodge;
Lincoln;
Cadilac;
}
Enum DodgeModels
{
Unknown;
Challenger;
Charger;
Dart;
}
Enum LincolnModels
{
Unknown;
Navigator;
MKX;
MKZ;
}
Enum CadilacModels
{
Unknown;
Escalade;
ATS;
CTS;
}
E... |
PowerShellCorpus/Github/mlking89cot_PoSHTest/Update-MuleLicenses.ps1 | Update-MuleLicenses.ps1 | # Powershell script to update Mule license on server
# https://docs.mulesoft.com/mule-user-guide/v/3.8/installing-an-enterprise-license
# Set MULE_HOME - Mule BIN directory
function Create-MuleHome
{
param(
[string] $MuleHomePath = "F:\Program Files\Mule\mule-enterprise-standalone-3.8.3\bin"
)
$MULE_HOME... |
PowerShellCorpus/Github/ssOleg_Useful_code/cred_powershell.ps1 | cred_powershell.ps1 | #Check for local groups on server
net localgroup administrators
function get_result(){
$strUser = $($user)
$strPass = $($passwd)
$PWord = ConvertTo-SecureString –String $strPass –AsPlainText -Force
$objCred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ($strUser,... |
PowerShellCorpus/Github/ssOleg_Useful_code/ConvertFrom-SDDL.ps1 | ConvertFrom-SDDL.ps1 | filter ConvertFrom-SDDL
{
<#
.SYNOPSIS
Convert a raw security descriptor from SDDL form to a parsed security descriptor.
Author: Matthew Graeber (@mattifestation)
.DESCRIPTION
ConvertFrom-SDDL generates a parsed security descriptor based upo... |
PowerShellCorpus/Github/ssOleg_Useful_code/Network.ps1 | Network.ps1 | $ob = [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()
#$ob | % {$_.Description, $_.OperationalStatus, $_.Name, $_.Id, '~~~~~~~~~~~~~';}
$os1 = $ob | % {$net=(Get-WmiObject -Query "Select Description, Index, InterfaceIndex, GUID from win32_NetworkAdapter where GUID = '$($_.Id)'"); $net.De... |
PowerShellCorpus/Github/ssOleg_Useful_code/Set-RemoteShellAccess.ps1 | Set-RemoteShellAccess.ps1 | function Set-RemoteShellAccess {
<#
.SYNOPSIS
Sets the DACL for Powershell and WinRM remote shell access
.DESCRIPTION
By default, BUILTIN\Administrators have remote shell access.
This function appends or over-writes the DACL on the local computer to modif... |
PowerShellCorpus/Github/hobelinm_PsConfigHive/main/Get-CurrentHiveName.ps1 | Get-CurrentHiveName.ps1 | <#
.SYNOPSIS
Gets the Hive Name for the current scope
.DESCRIPTION
Gets the Hive Name for the current scope, this means that caller stack gets inspected in order to get the
appropriate scope. This cmdlet uses Get-PSCallStack to understand the call hierarchy and determine the caller
scope to use.... |
PowerShellCorpus/Github/fabriceleal_fs-lang-template/LangTemplate/GenLexer.ps1 | GenLexer.ps1 | # Lexer.fsl --> Lexer.fs
# if final file doesn't exists
# or the original file modify date > final file modify date
param( [Parameter(Mandatory=$True, Position=1)]
[string] $project_dir)
# For some reason, a " is append to the end of $project_dir
# *sigh*
if($project_dir[$project_dir.Length - 1] ... |
PowerShellCorpus/Github/fabriceleal_fs-lang-template/LangTemplate/GenParser.ps1 | GenParser.ps1 | # Parser.fsi, Parser.fsy --> Parser.fs
# if final file doesn't exists
# or the original file modify date > final file modify date
param( [Parameter(Mandatory=$True, Position=1)]
[string] $project_dir)
# For some reason, a " is append to the end of $project_dir
# *sigh*
if($project_dir[$project_di... |
PowerShellCorpus/Github/jshearer435_ps-ray-tracer/ps_ray_tracer.ps1 | ps_ray_tracer.ps1 |
class Vect {
[double] $x
[double] $y
[double] $z
Vect () {
$this.x = 0
$this.y = 0
$this.z = 0
}
Vect ([double] $x, [double] $y, [double] $z) {
$this.x = $x
$this.y = $y
$this.z = $z
}
[double] getVectX() {
ret... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/tests/Integration/default/RabbitInterface.pyCelery.test.ps1 | RabbitInterface.pyCelery.test.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
$Celery = Join-path (split-path (get-package Python3).Source -Parent) 'tools\scripts'
$Env:Path += ";$Celery"
Describe 'Module basic functions' {
It 'imports without error' {
{ Import-module psCelery -ErrorAction SilentlyContinue } ... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/tests/Integration/default/RabbitInterface.psCelery.test.ps1 | RabbitInterface.psCelery.test.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
. $here\..\..\..\Public\New-RabbitInterface.ps1
. $here\..\..\..\Public\New-Minion.ps1
#this Test creates an Exchange, and a RabbitInterface
# the Interface is set to reply to PING messages with PONG,
# targeted (routed via key) to every queue binded to e... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/tests/Integration/default/RabbitInterface.pingpong.test.ps1 | RabbitInterface.pingpong.test.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
#this Test creates an Exchange, and a RabbitInterface
# the Interface is set to reply to PING messages with PONG,
# targeted (routed via key) to every queue binded to exchange PINGPONG
# then waits for a single message on a
if (!$RabbitMQServer)
{
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/tests/Integration/default/resources/docker.ps1 | docker.ps1 | docker run --rm -d --name rabbitmq -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 rabbitmq:3-management
|
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/Public/Add-CeleryAppToRegistry.ps1 | Add-CeleryAppToRegistry.ps1 | function Add-CeleryAppToRegistry {
<#
.SYNOPSIS
Describe the function here
.DESCRIPTION
Describe the function in more detail
.EXAMPLE
Give an example of how to use it
.EXAMPLE
Give another example of how to use it
.PARAMETER Param1
The param1
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/Public/Convert-PSObjectToHashtable.ps1 | Convert-PSObjectToHashtable.ps1 | function Convert-PSObjectToHashtable
{
[cmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
[PSCustomObject]
$InputObject = @{}
)
process
{
if ($null -eq $InputObject -or
$null -eq $InputObject.PSObject.Properties.name -or
!(... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/Public/Get-CeleryAppFromRegistry.ps1 | Get-CeleryAppFromRegistry.ps1 | function Get-CeleryAppFromRegistry {
<#
.SYNOPSIS
Describe the function here
.DESCRIPTION
Describe the function in more detail
.EXAMPLE
Give an example of how to use it
.EXAMPLE
Give another example of how to use it
.PARAMETER Param1
The param1
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/Public/New-CelerySignature.ps1 | New-CelerySignature.ps1 | function New-CelerySignature {
<#
.SYNOPSIS
Describe the function here
.DESCRIPTION
Describe the function in more detail
.EXAMPLE
Give an example of how to use it
.EXAMPLE
Give another example of how to use it
.PARAMETER Param1
The param... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryBroker.ps1 | CeleryBroker.ps1 | Class CeleryBroker {
[ref]$App
[hashtable] $Conf = @{}
CeleryBroker($App)
{
Write-Verbose "CeleryBroker Constructor"
if ($this.GetType() -eq [CeleryBroker])
{
throw("The CeleryBroker Class must be inherited")
}
#Add reference to Parent ... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/AMQPBroker.ps1 | AMQPBroker.ps1 | Class AMQPBroker : CeleryBroker {
$App
AMQPBroker() : Base ()
{
}
create_task_message()
{
}
send_task_message()
{
#$this.Producer.publish()
}
TaskConsumer()
{
}
}
|
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryTask.ps1 | CeleryTask.ps1 | Class CeleryTask {
[string]$Name
[ref]$App
[TaskBinding]$TaskAttribute = $Null
[System.Management.Automation.FunctionInfo]$Command
[char]$NameElementSeparator = '.'
CeleryTask(
[System.Management.Automation.CommandInfo]$Command,
$App
)
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/Worker.ps1 | Worker.ps1 |
Class Interface {
[String]$Name
[Guid]$id
[String]$Queue
[String]$Exchange
[ScriptBlock]$Action
[Microsoft.PowerShell.Commands.ModuleSpecification]$MessageBroker
[hashtable]$BrokerConfiguration
[Microsoft.PowerShell.Commands.ModuleSpecification]$ResultBackend
[hashtabl... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/RabbitRPCBackend.ps1 | RabbitRPCBackend.ps1 | #require -Modules PSRabbitMQ
Class RabbitRPCBackend : CeleryBackend {
RabbitRPCBackend($App) : Base ($App)
{
$userInfo = [string]::Empty
if (!$this.App.Value.Conf.Backend.options['Credential'] -and ($userInfo = $this.App.Value.Conf.Backend.url.userInfo)) {
$username, $clear... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryApp.ps1 | CeleryApp.ps1 | Class CeleryApp {
[String]$Name = 'CeleryApp'
[guid]$oid
[Bool]$IsStarted = $false
[CeleryBroker]$broker
[CeleryBackend]$backend
[Microsoft.PowerShell.Commands.ModuleSpecification[]]$include
[hashtable]$conf = @{}
[hashtable]$TaskRegistry = @{}
CeleryApp()
{
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryBackend.ps1 | CeleryBackend.ps1 | Class CeleryBackend {
[ref]$App
[hashtable]$Conf = @{
Backend = @{}
}
[bool]$Persistent = $true
[hashtable]$ReadyStates = @{}
[hashtable]$UnreadyStates = @{}
[hashtable]$ExceptionStates = @{}
[hashtable]$Retry_Policy = @{
'max_retries' = 20
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/TaskBinding.ps1 | TaskBinding.ps1 | Class TaskBinding : attribute {
[string]$Name = $null
[string[]]$prefixes = @()
[bool]$AddModuleNameToTaskName = $true
[bool]$AddModuleVersionToTaskName = $false
[int]$Max_Retries = 0
[array]$throws
[float]$Default_Retry_Delay = 180
[string]$Rate_Limit = 0 # 1/s, 1/m, 1/h: enforc... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryModule.specs.ps1 | CeleryModule.specs.ps1 | #import classes from Module PSRabbitMQ
Using module PSRabbitMQ
#Create the celery (aka App) instance
$app = [CeleryApp]::New(
@{
'AppName'='MyApp'
#chose the broker to use, can include username/password, host, port
'broker'='amqp://'
#chose the Backend t... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CelerySignature.ps1 | CelerySignature.ps1 | class CelerySignature : hashtable {
CelerySignature() {
}
} |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryAsyncResult.ps1 | CeleryAsyncResult.ps1 | Class CeleryAsyncResult {
[Ref]$App
[guid]$task_id
[PSCustomObject]$Request
CeleryAsyncResult(
[guid]$Task_id
,[ref]$App
,$request
)
{
$this.task_id = $Task_id
$this.App = $Ap... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/CeleryWorker.ps1 | CeleryWorker.ps1 |
Class CeleryWorker : Worker {
[CeleryApp]$App
[bool]$send_task_events = $false
Hidden [System.Management.Automation.PSEventJob] InitHandler_on_message_received()
{
return $this.App.broker.start_message_Listener($this.ID, $this)
}
CeleryWorker ([hahtable]$Config) : base ()
... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/classes/RabbitAMQPBroker.ps1 | RabbitAMQPBroker.ps1 | #require -Modules PSRabbitMQ
Class RabbitAMQPBroker : CeleryBroker {
[bool]
$ShouldDequeue = $false
[timespan]
$LoopInterval = [timespan]'0:0:0.500'
[System.Management.Automation.PSEventJob]
$AMQP_Handler
[System.Management.Automation.PSEventJob]
$ListenerJobStateChangedEv... |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/examples/Demo1/App.ps1 | App.ps1 | Using Module ..\..\..\PSCelery
$AppConfig = Import-PowerShellDataFile $PSScriptroot\CeleryConfig.psd1
$App = [CeleryApp]::new($AppConfig)
$App.Start()
$App
|
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/examples/Docker/docker.ps1 | docker.ps1 | docker run --rm -d --name rabbitmq -p 5671:5671 -p 5672:5672 -p 15671:15671 -p 15672:15672 6d3ccb39b123 |
PowerShellCorpus/Github/gaelcolas_PSCelery/PSCelery/examples/Demo2/projet.tasks.ps1 | projet.tasks.ps1 | function Test-stuff {
[CeleryTask(
Name = 'test_stuff'
)]
Param (
$param1
)
}
function Restart-SqlService {
[CeleryTask(
Name='Restart_SqlService'
)]
param (
$vmip
)
invoke-command -ComputerName $vmip -ScriptBlock {Restart-service -N... |
PowerShellCorpus/Github/tomaszrak_NoticeBoard-tr/NoticeBoard/packages/jQuery.1.9.1/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/tomaszrak_NoticeBoard-tr/NoticeBoard/packages/jQuery.1.9.1/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/tomaszrak_NoticeBoard-tr/NoticeBoard/packages/jQuery.1.9.1/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/tomaszrak_NoticeBoard-tr/NoticeBoard/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/mkeeton_BasicIdentity/BasicIdentity/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/mkeeton_BasicIdentity/BasicIdentity/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/mkeeton_BasicIdentity/BasicIdentity/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/mkeeton_BasicIdentity/BasicIdentity/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.