full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/janikvonrotz_PowerShell-PowerUp/functions/Obsolete/Export-SPLists.ps1 | Export-SPLists.ps1 | <#
$Metadata = @{
Title = "Export SharePoint Lists"
Filename = "Export-SPLists.ps1"
Description = ""
Tags = ""
Project = ""
Author = "Janik von Rotz"
AuthorContact = "http://janikvonrotz.ch"
CreateDate = "2013-06-09"
LastEditDate = "2013-09-02"
Version = "2.0.0"
License = @'
This work is license... |
PowerShellCorpus/Github/janikvonrotz_PowerShell-PowerUp/functions/Mail Reporting/Send-PPErrorReport.ps1 | Send-PPErrorReport.ps1 | <#
$Metadata = @{
Title = "Send PowerShell PowerUp Error Report"
Filename = "Send-PPErrorReport.ps1"
Description = "Sends a default error Report based on the PowerShell PowerUp configurations."
Tags = "powershell, profile, error, report"
Project = ""
Author = "Janik von Rotz"
AuthorContact = "http://jani... |
PowerShellCorpus/Github/janikvonrotz_PowerShell-PowerUp/functions/Windows Scheduled Task/Update-ScheduledTask.ps1 | Update-ScheduledTask.ps1 | <#
$Metadata = @{
Title = "Update Scheduled Task"
Filename = "Update-ScheduledTask.ps1"
Description = ""
Tags = "powershell, function, update, task"
Project = ""
Author = "Janik von Rotz"
AuthorContact = "http://janikvonrotz.ch"
CreateDate = "2013-10-07"
LastEditDate = "2013-12-13"
Version = "2.0.0... |
PowerShellCorpus/Github/sampka_Connect-MSTSC/Connect-Mstsc.ps1 | Connect-Mstsc.ps1 |
function Connect-Mstsc {
param (
[Parameter(Mandatory=$true,Position=0)]
[Alias("CN")]
[string[]]$ComputerName,
[Parameter(Mandatory=$true,Position=1)]
[Alias("U")]
[string]$User,
[Parameter(Mandatory=$true,Position=2)]
[Alias("... |
PowerShellCorpus/Github/stefanhzr_PSWindowsNativeBoot/PSWindowsNativeBoot.ps1 | PSWindowsNativeBoot.ps1 | <#
The MIT License (MIT)
Copyright (c) 2017 Stefan H
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
t... |
PowerShellCorpus/Github/cchanpromys_EfQuery/packages/EntityFramework.6.1.2-beta2-31010/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/cchanpromys_EfQuery/packages/EntityFramework.6.1.2-beta2-31010/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/cchanpromys_EfQuery/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/ghanin-fr_ARMrepo/KeyVault.ps1 | KeyVault.ps1 | #Connec to Azure subscription
Login-AzureRmAccount
#Create new resource group
New-AzureRmResourceGroup -Name 'KeyValutDemo' -Location 'East Asia' -Verbose
#Create a new Key Vault
New-AzureRmKeyVault -VaultName 'kvDemo' -ResourceGroupName 'KeyValutDemo' -Location 'East Asia' -Verbose
#Add a key to the vault
... |
PowerShellCorpus/Github/cmeans_powershell-rrtpmonitor/rrtpmonitor.ps1 | rrtpmonitor.ps1 | # The path/directory we're running in.
$path = Split-Path -Parent $MyInvocation.MyCommand.Path
$name = [System.IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Name)
# The configuration settings.
$config = ([xml](Get-Content ("{0}\{1}.xml" -f $path, $name))).Settings
function Get-RRTPRate()
{
... |
PowerShellCorpus/Github/ABreWPower_LogProxy/Tests/LogProxy.Tests.ps1 | LogProxy.Tests.ps1 | <#
By running this through pester it actually tests out all of the Write- commands very well
Note: this may need to be run as an administrator depending on your UAC settings
Note2: this can not be run in the ISE as transcripts do not work
NAME: LogProxy Pester Tests
AUTHOR: Adam Wicker... |
PowerShellCorpus/Github/bklockwood_PSWH/pswh.ps1 | pswh.ps1 | Function main {
Get-OSInfo
Get-MemoryInfo
}
function Get-OSInfo {
<#
.SYNOPSIS
Returns OS version, edition and other information
#>
Write-Output "--- Version, Edition ---"
Get-WmiObject -Class win32_operatingsystem | select Caption, Version, OSArchitecture, ServicePackMajorVersion, ServicePackMinorVersion... |
PowerShellCorpus/Github/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/packages/EntityFramework.6.0.0/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
# MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQ... |
PowerShellCorpus/Github/guibovo_TesteBludata/TesteBluData/packages/EntityFramework.6.0.0/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/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/guibovo_TesteBludata/TesteBluData/packages/jQuery.1.7.1.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/guibovo_TesteBludata/TesteBluData/packages/jQuery.1.7.1.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
$supportsJsIntelliSenseFile = [System.Version]::Parse($dte.Version).Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
Write-Host "IntelliSense JS files are n... |
PowerShellCorpus/Github/guibovo_TesteBludata/TesteBluData/packages/jQuery.1.7.1.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/guibovo_TesteBludata/TesteBluData/packages/Newtonsoft.Json.6.0.4/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/workstation-setup.ps1 | workstation-setup.ps1 | function Install-NeededFor {
param([string]$packageName = '')
if ($packageName -eq '') {return $false}
$yes = '6'
$no = '7'
$msgBoxTimeout='-1'
$answer = $msgBoxTimeout
try {
$timeout = 10
$question = "Do you need to install $($packageName)? Defaults to 'Yes' after $timeout seconds"
... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/ConfigureRemotingForAnsible.ps1 | ConfigureRemotingForAnsible.ps1 | #Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerS... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/cleaning.ps1 | cleaning.ps1 | $tempfolders = @( "C:\temp\*", "C:\Windows\Temp\*", "C:\Windows\Prefetch\*", "C:\Documents and Settings\*\Local Settings\temp\*", "C:\Users\*\Appdata\Local\Temp\*" )
Remove-Item $tempfolders -force -recurse
|
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/upgrade_to_ps3-2.ps1 | upgrade_to_ps3-2.ps1 | #Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerS... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/upgrade_to_ps3-1.ps1 | upgrade_to_ps3-1.ps1 |
# Powershell script to upgrade a PowerShell 2.0 system to PowerShell 3.0
# based on http://occasionalutility.blogspot.com/2013/11/everyday-powershell-part-7-powershell.html
#
# some Ansible modules that may use Powershell 3 features, so systems may need
# to be upgraded. This may be used by a sample playbook. R... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/upgrade_to_ps4.ps1 | upgrade_to_ps4.ps1 |
#http://download.microsoft.com/download/3/D/6/3D61D262-8549-4769-A660-230B67E15B25/Windows8-RT-KB2799888-x64.msu
if ($PSVersionTable.psversion.Major -ge 4)
{
write-host "Powershell 4 Installed already you don't need this"
Exit-PSSession
}
$powershellpath = "C:\powershell"
function download-file
... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/common-setup.ps1 | common-setup.ps1 | function Install-NeededFor {
param([string]$packageName = '')
if ($packageName -eq '') {return $false}
$yes = '6'
$no = '7'
$msgBoxTimeout='-1'
$answer = $msgBoxTimeout
try {
$timeout = 10
$question = "Do you need to install $($packageName)? Defaults to 'Yes' after $timeout seconds"
... |
PowerShellCorpus/Github/AlbanAndrieu_ansible-windows/files/helloworld.ps1 | helloworld.ps1 | # Filename: helloworld.ps1
Write-Host
Write-Host 'Hello World!'
Write-Host "Good-bye World! `n"
# end of script
|
PowerShellCorpus/Github/mrsunge_working_script/conf/ParseConfFile.ps1 | ParseConfFile.ps1 | function ParseConfFile([string]$ConfFileName) {
$conf = @{};
get-content $ConfFileName | ForEach-Object {
$con = $_.toString().Replace(' ', '').Split('=');
$conf.Set_Item($con[0], $con[1]);
}
return $conf;
}
|
PowerShellCorpus/Github/mrsunge_working_script/copy/MakeFileList.ps1 | MakeFileList.ps1 | function MaekFileListFile([string]$path, [datetime]$date) {
$flist = 'flist_' + $date.ToString('yyyyMMdd') + '.txt'
gci $path/*.bak* | where {$_.name -like '*'+$date.ToString('yyyyMMdd')+'*'} | select Name | ft -HideTableHeaders > $flist;
return $flist;
}
|
PowerShellCorpus/Github/mrsunge_working_script/copy/CopyFile.ps1 | CopyFile.ps1 | # This script is run on destination computer.
param([string]$ConfFileName, [datetime]$date)
##############################################
#import module file.
. C:\dba\script\conf\ParseConfFile.ps1
. C:\dba\script\copy\MakeFileList.ps1
##############################################
# load information
... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_Provision_2017_3_27_20_5_36/.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/BZanten_LastPassPSImport/New-LastPassRecord.ps1 | New-LastPassRecord.ps1 |
. .\Class-LastPassRecord.ps1
$Rec1 = New-Object -TypeName LastPassRecord
$Rec1.Name="My Generic LastPass record"
$Rec1.UserName="BZanten"
$Rec1.Password="MyP@ssWr0d"
$Rec1.Fav=0
$Rec1.Grouping="AAA Test notities"
$Rec1.Url="http://www.mynetwork.local"
$Rec1.Extra="Extra informatie"
$Rec1
$Rec1 | Sel... |
PowerShellCorpus/Github/BZanten_LastPassPSImport/Class-LastPassRecord.ps1 | Class-LastPassRecord.ps1 |
#
# https://xainey.github.io/2016/powershell-classes-and-concepts/
#
#
# A Normal LastPass Record has 7 fields.
# the Url property can have any value, that becomes the URL field
# the Extra property can have any value, that becomes the Note field
#
class LastPassRecord {
[string]$Url;
[string... |
PowerShellCorpus/Github/lucabol_University/Src/DeallocateStoppedVM.ps1 | DeallocateStoppedVM.ps1 | <#
.SYNOPSIS
This script deallocates every stopped Azure virtual machines.
.DESCRIPTION
This script deallocates every Azure virtual machines which are stopped (i.e. the machine you stop from the OS and not
the Azure portal, therefore you still pay for it) in the specified DevTest Lab.
.PARAMETER ... |
PowerShellCorpus/Github/lucabol_University/Src/Test-AzureDtlVMs.ps1 | Test-AzureDtlVMs.ps1 | <#
.SYNOPSIS
Given LabName and LabSize, this script verifies how many Azure virtual machines are inside the DevTest Lab and throws an error inside the logs when the number is greater or lower than size +/- VMDelta.
.DESCRIPTION
Given LabName and LabSize, this script verifies how many Azure virtual machi... |
PowerShellCorpus/Github/lucabol_University/Src/Manage-AzureDtlFixedPool.ps1 | Manage-AzureDtlFixedPool.ps1 | <#
.SYNOPSIS
This script guarantees that the Virtual Machine pool of the Lab equals to the PoolSize specified as Azure Tag of Lab.
.DESCRIPTION
This script guaratees the presence of an appropriate number of Virtual machines inside the Lab depending on the number you can find inside an Azure Tag, PoolSize... |
PowerShellCorpus/Github/lucabol_University/Src/Add-GroupPermissionsDevTestLab.ps1 | Add-GroupPermissionsDevTestLab.ps1 | <#
.SYNOPSIS
This script adds the specified role to the AD Group in the DevTest Lab.
.DESCRIPTION
This script allows IT admins to give programmatically the permissions to access lab resources to a specific group using the lab role.
.PARAMETER labName
Mandatory. The name of the lab.
.PARAMETER ... |
PowerShellCorpus/Github/lucabol_University/Src/Remove-AzureDtlLabVMs.ps1 | Remove-AzureDtlLabVMs.ps1 | <#
.SYNOPSIS
This script deletes the Azure virtual machines with the passed Ids in the DevTest Lab.
.DESCRIPTION
This script deletes the Azure virtual machines with the passed Ids in the DevTest Lab. It will
process all VMs in parallel divided into blocks.
.PARAMETER ids
Mandatory. Resource ... |
PowerShellCorpus/Github/lucabol_University/Src/Add-AzureDtlVM.ps1 | Add-AzureDtlVM.ps1 | <#
.SYNOPSIS
This script adds the specified number of Azure virtual machines to a DevTest Lab.
.DESCRIPTION
It allows the creation of the VMs inside a specific lab. This script can be run either from command line or Azure Automation for the creation of the VMs of each lab.
.PARAMETER LabName
Man... |
PowerShellCorpus/Github/lucabol_University/Src/Add-AzureDtlVMAutoVar.ps1 | Add-AzureDtlVMAutoVar.ps1 | <#
.SYNOPSIS
This script adds the number of Azure virtual machines in the DevTest Lab by reading some parameters from AutomationVariable.
.DESCRIPTION
It allows the creation of the VMs inside a specific lab. This script can be run either from command line or Azure Automation for the creation of the VMs o... |
PowerShellCorpus/Github/lucabol_University/Src/Remove-AzureDtlVM.ps1 | Remove-AzureDtlVM.ps1 | <#
.SYNOPSIS
This script deletes every Azure virtual machines in the DevTest Lab.
.DESCRIPTION
This script deletes every Azure virtual machines in the DevTest Lab. It will
process all VMs in parallel divided into blocks.
.PARAMETER LabName
Mandatory. The name of the Dev Test Lab to clean up.... |
PowerShellCorpus/Github/lucabol_University/Src/Common.ps1 | Common.ps1 | #### PS utility functions
# Stop at first error
$ErrorActionPreference = "Stop"
pushd $PSScriptRoot
# Workaround to set verbose everywhere
$global:VerbosePreference = $VerbosePreference
$ProgressPreference = $VerbosePreference # Disable Progress Bar
# Print nice error
function Report-Error {
<#
.S... |
PowerShellCorpus/Github/lucabol_University/Src/Remove-GroupPermissionsDevTestLab.ps1 | Remove-GroupPermissionsDevTestLab.ps1 | <#
.SYNOPSIS
This script removes the specified role from the AD Group in the DevTest Lab.
.DESCRIPTION
This script allows IT admins to remove programmatically the permissions to access lab resources to a specific group associated to a specific role.
.PARAMETER labName
Mandatory. The name of the l... |
PowerShellCorpus/Github/lucabol_University/Src/Shutdown scripts/LoadIdleScript.ps1 | LoadIdleScript.ps1 | <#
.SYNOPSIS
This script creates a task inside Windows Task Scheduler getting a file script from a blob storage.
.DESCRIPTION
This script creates a task inside Windows Task Scheduler getting the Task scheduler configuration from the xml file.
.PARAMETER StorageAccountName
O... |
PowerShellCorpus/Github/lucabol_University/Src/Shutdown scripts/ShutdownOnIdleV2.ps1 | ShutdownOnIdleV2.ps1 | <#
.SYNOPSIS
This script shutdowns the machine if the user hasn't been active.
.DESCRIPTION
This script verifies if: the user is active, CPU and disk usage and shutsdown the machine if the user is no longer active.
.PARAMETER MaxIdleTime
Max allowed idle (in minutes)
... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/AddWorkflow.ps1 | AddWorkflow.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
$Cred
)
$currentPath = Split-Path -Parent $PSCommandPath
$workflowDefinition = "$currentPath\Copy to LibraryB.xml"
.\AddWorkflowDefinition.ps1 -Url $Url -WorkflowDefinitionFile $workflowDefinition -TaskList "Workflow Tasks" ... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/GetWorkflowDefinition.ps1 | GetWorkflowDefinition.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
[string]$WorkflowDefinitionName,
[Parameter(Mandatory=$true)]
[string]$DefinitionFile,
$Cred
)
#------------------------------------------------------------------------------
#
# functions
#
#--------------------------... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/AddWorkflowDefinition.ps1 | AddWorkflowDefinition.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
[string]$WorkflowDefinitionFile,
[Parameter(Mandatory=$true)]
[string]$TaskList,
[Parameter(Mandatory=$true)]
[string]$HistoryList,
$Credential
)
#-----------------------------------------------------------------------... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/AddWorkflowSubscription.ps1 | AddWorkflowSubscription.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
[string]$WorkflowDefinitionFile,
[Parameter(Mandatory=$true)]
[string]$TargetList,
[Parameter(Mandatory=$true)]
[string]$TaskList,
[Parameter(Mandatory=$true)]
[string]$HistoryList,
$Credential
)
#-----------------... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/UpdateWorkflow.ps1 | UpdateWorkflow.ps1 | param (
[Parameter(Mandatory=$true)]
$Url,
[Parameter(Mandatory=$true)]
$Cred
)
$currentPath = Split-Path -Parent $PSCommandPath
$workflowDefinition = "$currentPath\Copy to LibraryB.xml"
.\SetWorkflowDefinition -Url $Url -WorkflowDefinitionFile $workflowDefinition -Credential $Cred
.\SetWorkflowSubsc... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/CreateStructure.ps1 | CreateStructure.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
$Cred
)
if ($Cred -eq $null)
{
$Cred = Get-Credential
}
Connect-SPOnline -Url $Url -Credentials $Cred
Write-Host "Connected to $Url"
New-SPOList -Title "LibraryA" -Template DocumentLibrary
Add-SPOField -List "... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/SetWorkflowSubscription.ps1 | SetWorkflowSubscription.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
[string]$WorkflowDefinitionFile,
[Parameter(Mandatory=$true)]
[string]$TargetList,
$Credential
)
#------------------------------------------------------------------------------
#
# functions
#
#------------------------... |
PowerShellCorpus/Github/OlafD_DeployWorkflowDemo/DeployWorkflowDemo/SetWorkflowDefinition.ps1 | SetWorkflowDefinition.ps1 | param (
[Parameter(Mandatory=$true)]
[string]$Url,
[Parameter(Mandatory=$true)]
[string]$WorkflowDefinitionFile,
$Credential
)
#------------------------------------------------------------------------------
#
# functions
#
#------------------------------------------------------------------------------... |
PowerShellCorpus/Github/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/glaucia86_CRUD_KnockoutJs_AspNET_WEBAPI/CRUD_KnockoutJS/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/iamrommel_multple-data-source/App/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/iamrommel_multple-data-source/App/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/iamrommel_multple-data-source/App/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/iamrommel_multple-data-source/App/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/iamrommel_multple-data-source/App/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/iamrommel_multple-data-source/App/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/iamrommel_multple-data-source/App/packages/Newtonsoft.Json.8.0.2/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/iamrommel_multple-data-source/App/packages/Newtonsoft.Json.6.0.4/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
# open json.net splash page on package install
# don't open if json.net is installed as a dependency
try
{
$url = "http://james.newtonking.com/json"
$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])
if ($dte2.ActiveWindow.Caption -eq "Package Manager Con... |
PowerShellCorpus/Github/thomasjo_appveyor-texlive/prepare.ps1 | prepare.ps1 | $TargetDir = "$PSScriptRoot\texlive"
Remove-Item -Path $TargetDir -ErrorAction SilentlyContinue -WarningAction SilentlyContinue -Recurse -Force
$Date = ((Get-Date).ToUniversalTime()).ToString("ddd MMM d HH:mm:ss yyyy UTC")
$PosixTargetDir = $TargetDir -replace "\\","/"
$ProfilePath = "$PSScriptRoot\texlive.pro... |
PowerShellCorpus/Github/thomasjo_appveyor-texlive/download.ps1 | download.ps1 | $TickMark = [Char]0x2713
function Expand-ZipFile($FilePath, $DestinationPath) {
New-Item -ItemType Directory -Path $DestinationPath -WarningAction SilentlyContinue -Force | Out-Null
$Shell = New-Object -ComObject Shell.Application
$ZipFile = $Shell.Namespace($FilePath)
# vOption flags: http://msdn.mi... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1484825123903/.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/Snaptags_powershell-config/aliases.ps1 | aliases.ps1 | # command aliases
function CallNodeReplace
{
node $env:USERPROFILE\AppData\Roaming\npm\node_modules\replace\bin\replace.js $args
}
function OpenShellAsAdmin([string]$application = 'powershell -NoExit -File "' + "$PSScriptRoot/profile.ps1" + '"')
{
ConEmuC -c $application $args -new_console:a
}
fu... |
PowerShellCorpus/Github/Snaptags_powershell-config/PSReadLine.ps1 | PSReadLine.ps1 | if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadline
Set-PSReadlineOption -EditMode vi -ViModeIndicator Cursor
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadlineKeyHandler -Key UpArrow `
-BriefDescription HistorySearchBackward `
... |
PowerShellCorpus/Github/Snaptags_powershell-config/Get-ESSearchResult.ps1 | Get-ESSearchResult.ps1 | # source: https://github.com/DBremen/PowerShellScripts
filter Get-FileSize {
"{0:N2} {1}" -f $(
if ($_ -lt 1kb) { $_, 'Bytes' }
elseif ($_ -lt 1mb) { ($_/1kb), 'KB' }
elseif ($_ -lt 1gb) { ($_/1mb), 'MB' }
elseif ($_ -lt 1tb) { ($_/1gb), 'GB' }
elseif ($_ -lt 1pb) { ($_/1tb), 'TB' }
else { ($_/1pb), 'PB'... |
PowerShellCorpus/Github/Snaptags_powershell-config/profile.ps1 | profile.ps1 | # My PowerShell Profile
. "$PSScriptRoot\aliases.ps1"
. "$PSScriptRoot\avoid_accidental_dcommit.ps1"
. "$PSScriptRoot\folderdate.ps1"
. "$PSScriptRoot\Get-ESSearchResult.ps1"
. "$PSScriptRoot\PSReadLine.ps1"
. "$PSScriptRoot\prompt.ps1"
Import-Module PSColor
|
PowerShellCorpus/Github/Snaptags_powershell-config/avoid_accidental_dcommit.ps1 | avoid_accidental_dcommit.ps1 | # inspired by http://stackoverflow.com/questions/9226528/how-can-i-avoid-an-accidental-dcommit-from-a-local-branch
function CallGit
{
if (($args[0] -eq "svn") -And ($args[1] -eq "dcommit")) {
$curr_branch = &{git branch};
$curr_branch = [regex]::Match($curr_branch, '\* (\w*)').captures.groups[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.