full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/sponte_Powershell.Deployment/templates/metadata.ps1
metadata.ps1
[CmdletBinding()] param( [string] $environmentConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "deployment_configuration.json" ), [string] $productConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "configuration.xml" ) ) $script...
PowerShellCorpus/Github/sponte_Powershell.Deployment/templates/uninstall.ps1
uninstall.ps1
[CmdletBinding()] param( [string] $environmentConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "deployment_configuration.json" ), [string] $productConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "configuration.xml" ) ) $script...
PowerShellCorpus/Github/sponte_Powershell.Deployment/templates/install.ps1
install.ps1
[CmdletBinding()] param( [string] $environmentConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "deployment_configuration.json" ), [string] $productConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "configuration.xml" ) ) $script...
PowerShellCorpus/Github/sponte_Powershell.Deployment/templates/stop.ps1
stop.ps1
[CmdletBinding()] param( [string] $environmentConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "deployment_configuration.json" ), [string] $productConfigurationFilePath = (Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) "configuration.xml" ) ) $script...
PowerShellCorpus/Github/sponte_Powershell.Deployment/solutiontemplates/InitialSetup.ps1
InitialSetup.ps1
$root = Split-Path -parent $MyInvocation.MyCommand.Path function Contains-NuGetPackage { param( [string] $packageConfigPath, [string] $packageId ) [xml] $xml = gc $packageConfigPath return $xml.SelectSingleNode("//package[@id='$packageId']") -ne $null } function Is-WebProject { param( [str...
PowerShellCorpus/Github/DNajjarzade_archive/IrancellCharge.ps1
IrancellCharge.ps1
$serialPort = new-Object System.IO.Ports.SerialPort $serialPort.PortName = "COM35" $serialPort.BaudRate = 19200 $serialPort.WriteTimeout = 500 $serialPort.ReadTimeout = 3000 $serialPort.DtrEnable = "true" $ErrorActionPreference="SilentlyContinue" Stop-Transcript | out-null $ErrorActionPreference = "Continue" $...
PowerShellCorpus/Github/coolOrange-Public_SelectItemInCAD/CAD/addins/ItemTab.ps1
ItemTab.ps1
Add-Type @" public class itemData { public string Item {get;set;} public string Revision {get;set;} public string Title {get;set;} } "@ function SearchItem() { if($mvparam -eq "") { return } #no searchparameters $srchconds = New-Object autodesk.Connectivity.WebServices.SrchCond[] 1 $srchconds...
PowerShellCorpus/Github/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/AvgustPol_lab7/Web API 2 project/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/mrkaminski77_Invoke-Sql/Invoke-Sql.ps1
Invoke-Sql.ps1
function Invoke-SQL { param( [string] $dataSource = "", [string] $database = "", [string] $sqlCommand = "SELECT * FROM sys.tables" ) $connectionString = "server=$dataSource;database=$database;trusted_connection=true;" $connection = new-object system.data.SqlClient.SQLConnection($connectionString) $...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1488816344109/.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/pitmacaloway_Scripts/Powershell/Security/CypherDechypherTool/CypherDechypherTool 1.1.ps1
CypherDechypherTool 1.1.ps1
# Outils Pour le chiffrement de fichier ou de texte # # Date : 19/05/2016 # # Last Update 27/05/2016 # # Author : Peter Hembert # # Version 1.1 # ######################################## clear-host ################################### # Chargement des Bibliothéques # ################...
PowerShellCorpus/Github/fredbainbridge_WindowsUpgradeReadiness/Get-OMSApplicationByStatus.ps1
Get-OMSApplicationByStatus.ps1
#get all applications by status. Function Get-WUApplicationStatus { [CmdletBinding()] param( [string]$ResourceGroupName = 'mms-eus', [string]$WorkSpaceName = 'cmlab' ) $query = "Type=UAApp | measure count() by Issue" Write-Verbose "Starting Query $query" $endDa...
PowerShellCorpus/Github/fredbainbridge_WindowsUpgradeReadiness/Get-WindowsUpgradeAppDetails.ps1
Get-WindowsUpgradeAppDetails.ps1
# This script get app detail from WU and from CM # Two txt files are created, one for WU apps and one for CM apps. Function Get-WUAppDetails { [CmdletBinding()] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, ...
PowerShellCorpus/Github/fredbainbridge_WindowsUpgradeReadiness/OMSQueries.ps1
OMSQueries.ps1
#identify all blockers for a device' Find-Module AzureRM.OperationalInsights | Install-Module Import-Module AzureRm.OperationalInsights Get-Module AzureRm.OperationalInsights Login-AzureRmAccount $ResourceGroupName = "mms-eus" $WorkSpaceName = "cmlab" $query = Get-AzureRmOperationalInsightsSavedSearch -Res...
PowerShellCorpus/Github/edWAR6_AngularJS/11-backend-crud-dotnet/Backend/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/edWAR6_AngularJS/11-backend-crud-dotnet/Backend/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/edWAR6_AngularJS/11-backend-crud-dotnet/Backend/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/edWAR6_AngularJS/11-backend-crud-dotnet/Backend/PublishScripts/Publish-WebApplicationWebsite.ps1
Publish-WebApplicationWebsite.ps1
#Requires -Version 3.0 <# .SYNOPSIS Creates and deploys a Microsoft Azure Website for a Visual Studio web project. For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394471 .EXAMPLE PS C:\> .\Publish-WebApplicationWebSite.ps1 ` -Configuration .\Configurations\WebApplication1-WAWS-...
PowerShellCorpus/Github/jessewth_PowerShell/CheckServerCLREnvironment.ps1
CheckServerCLREnvironment.ps1
################################################## # Use PowerShell checking your servers .NET Framwork CLR version ################################################## cd c:\batch\ps1 $serverList = Get-Content .\shopping_server_list.txt $objServerListInfo = @() foreach ($server in $serverList) { # G...
PowerShellCorpus/Github/po-max_HomeWork_5-Code-Testing-/CashboxBad/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/po-max_HomeWork_5-Code-Testing-/CashboxBad/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/po-max_HomeWork_5-Code-Testing-/CashboxGood/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/po-max_HomeWork_5-Code-Testing-/CashboxGood/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/po-max_HomeWork_5-Code-Testing-/BookHelper/packages/SpecFlow.NUnit.Runners.1.0.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) $version = "" # Get-Package -Filter NUnit.Runners also returns packages with NUnit.Runners in the description (e.g. NUnit or SpecFlow.NUnit.Runners) # we need to find the one, that we are looking for $nunitPackages = Get-Package -Filter NUnit.Runners foreac...
PowerShellCorpus/Github/po-max_HomeWork_5-Code-Testing-/BookHelper/packages/SpecFlow.NUnit.Runners.1.0.0/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) $nunitCoreRef = $project.Object.References.Item("nunit.core.interfaces") if ($nunitCoreRef) { $nunitCoreRef.Remove() }
PowerShellCorpus/Github/Alexa1234_DevilDancePortal/Portal.DevilDance/packages/Microsoft.AspNet.Providers.1.2/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-$projectNa...
PowerShellCorpus/Github/Alexa1234_DevilDancePortal/Portal.DevilDance/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/Alexa1234_DevilDancePortal/Portal.DevilDance/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/Alexa1234_DevilDancePortal/Portal.DevilDance/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/Alexa1234_DevilDancePortal/Portal.DevilDance/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/Alexa1234_DevilDancePortal/Portal.DevilDance/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/ravneet05_powershellscripts/rav/approvedimages.ps1
approvedimages.ps1
function get-imageinfo { param ( [Parameter(Mandatory = $true)] [string] $ImageIDq #[Parameter(Mandatory = $true)] [string] $availabilityZone2 ) $Src = Get-FoldersCreatedToShareResults $DateNTime = Get-Date -Format "dd_MM_yyyy_HH_mm_ss"; $R...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-armclient/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-armclient/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-curl/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-curl/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-eclipse/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-eclipse/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-skype/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-skype/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-amsexplorer/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-amsexplorer/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-maven/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-maven/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-azurestorageexplorer/startChocolatey.ps1
startChocolatey.ps1
Param( # comma- or semicolon-separated list of Chocolatey packages. [ValidateNotNullOrEmpty()] [Parameter(Mandatory=$True)] [string] $packageList ) Function Get-TempPassword() { Param( [int]$length=10, [string[]]$sourcedata ) For ($loop=1; $loop –le $length; $l...
PowerShellCorpus/Github/0GiS0_azure/azure-devtest-labs/artifacts/windows-azurestorageexplorer/ChocolateyPackageInstaller.ps1
ChocolateyPackageInstaller.ps1
<################################################################################################## Description =========== - This script does the following - - installs chocolatey - installs specified chocolatey packages - This script generates logs in the following folder - - %ALLUSERSP...
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/child-powershell.ps1
child-powershell.ps1
param( [string] $Dad ) Write-Output "Hello from child-powershell (called from $Dad)";
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/child-ps-workflow.ps1
child-ps-workflow.ps1
workflow child-ps-workflow { param( [parameter(Mandatory)] [string] $Dad ) Write-Output "Hello from child-ps-workflow (called from $Dad)"; }
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/Shutdown-Start-ASM-VMs-Parallel.ps1
Shutdown-Start-ASM-VMs-Parallel.ps1
workflow Shutdown-Start-ASM-VMs-Parallel { Param( [Parameter(Mandatory=$true)] [String] $ServiceName, [Parameter(Mandatory=$true)] [Boolean] $Shutdown ) #The name of the Automation Credential Asset this runbook will use to authenticate to Azure. $CredentialAssetName = "Defau...
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/Refresh-WebApps.ps1
Refresh-WebApps.ps1
workflow Refresh-WebApps { $ResourceGroupName = "PowerShell-Runbooks"; $connectionName = "AzureRunAsConnection" try { # Get the connection "AzureRunAsConnection " $servicePrincipalConnection=Get-AutomationConnection -Name $connectionName "Logging in to Azure..." Add-Azu...
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/Hybrid-Demo.ps1
Hybrid-Demo.ps1
Write-Output "PSModulePath environment variable on worker $env:ComputerName`:" Foreach ($item in $env:PSModulePath.split(";")) { Write-Output $item }
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/Shutdown-Start-VMs-By-Resource-Group.ps1
Shutdown-Start-VMs-By-Resource-Group.ps1
workflow Shutdown-Start-VMs-By-Resource-Group { Param ( [Parameter(Mandatory=$true)] [String] $AzureResourceGroup, [Parameter(Mandatory=$true)] [Boolean] $Shutdown ) #The name of the Automation Credential Asset this runbook will use to authenticate to Azur...
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/Shutdown-Start-ARM-VMs-Parallel.ps1
Shutdown-Start-ARM-VMs-Parallel.ps1
workflow Shutdown-Start-ARM-VMs-Parallel { Param( [Parameter(Mandatory=$true)] [String] $ResourceGroupName, [Parameter(Mandatory=$true)] [Boolean] $Shutdown ) #The name of the Automation Credential Asset this runbook will use to authenticate to Azure. $CredentialAssetName =...
PowerShellCorpus/Github/0GiS0_azure/automation/runbooks/Delete-Empty-Resource-Groups.ps1
Delete-Empty-Resource-Groups.ps1
workflow Delete-Empty-Resource-Groups { #git-retungis #The name of the Automation Credential Asset this runbook will use to authenticate to Azure. $CredentialAssetName = "DefaultAzureCredential"; #Get the credential with the above name from the Automation Asset store $Cred = Get-AutomationPSCredenti...
PowerShellCorpus/Github/theworkingcentre_helpful_scripts/reminder/reminder.ps1
reminder.ps1
# Lab reminder. # The Working Centre # Based on # https://bytecookie.wordpress.com/2011/12/28/gui-creation-with-powershell-part-2-the-notify-icon-or-how-to-make-your-own-hdd-health-monitor/ # Notes # Balloon timing is set in accessibility settings. # Parameters? Param() # Assemblies. Add-Type -Asse...
PowerShellCorpus/Github/jeff-seto_FileserverBackup/FileserverBackup.ps1
FileserverBackup.ps1
<# RoboCopy Backup Script with E-mail Notification This script runs a robocopy backup and creates a log file. An e-mail notification along with the attached log file will be sent out. Variables to change: - Source - Destination - LogFileLocation - EmailTo - SMTPServer Original Script Created by Mic...
PowerShellCorpus/Github/mxmxx_deprovision-users/Deprovision-Users.ps1
Deprovision-Users.ps1
<# Deprovision Expired User Accounts ----------------------- This script runs within the 'Disabled Users' OU and will remove mailboxes,home folders and user accounts that have been expired for >30 days. An email report is then sent including a csv. #> Import-Module activedirectory #Enter PSSession...
PowerShellCorpus/Github/linux-china_jenv-ps/GetJenv.ps1
GetJenv.ps1
$jenvZipUrl = 'http://get.jenv.io/jenv-ps.zip' $modulePaths = @($Env:PSModulePath -split ';') # set module path to jenv default $targetModulePath = Join-Path -Path ([Environment]::GetFolderPath('MyDocuments')) -ChildPath WindowsPowerShell\Modules $powerShellProfilePath = Join-Path -Path ([Environment]::GetFolderP...
PowerShellCorpus/Github/linux-china_jenv-ps/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
jenv init
PowerShellCorpus/Github/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $srcFiles = Join-Path $installPath "lib\net40\*.dll" $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $destDirec...
PowerShellCorpus/Github/mustafarumeli_HalisahavarUleen/FieldRental/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1
Uninstall.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $binDirectory = Join-Path $projectRoot "bin" $srcDirectory = Join-Path $...
PowerShellCorpus/Github/mustafarumeli_HalisahavarUleen/FieldRental/packages/EntityFramework.6.1.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/mustafarumeli_HalisahavarUleen/FieldRental/packages/EntityFramework.6.1.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/mustafarumeli_HalisahavarUleen/FieldRental/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/mustafarumeli_HalisahavarUleen/FieldRental/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/mustafarumeli_HalisahavarUleen/FieldRental/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1
install.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' $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory...
PowerShellCorpus/Github/0sm0s1z_wopr/buildkit.ps1
buildkit.ps1
Set-ExecutionPolicy -F RemoteSigned mkdir C:\$HOME\Documents\WindowsPowerShell\ echo "" > C:\$HOME\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 #Environment [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Tools\cmder\vendor\git-for-windows\mingw32\bin\", [EnvironmentVariableTarget]:...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/decompress.ps1
decompress.ps1
function 7zip_installed { cmd_available '7z' } function requires_7zip($manifest, $architecture) { foreach($dlurl in @(url $manifest $architecture)) { if(file_requires_7zip $dlurl) { return $true } } } function file_requires_7zip($fname) { $fname -match '\.((gz)|(tar)|(tgz)|(lzma)|(bz)|(7z)|(rar)|(i...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/config.ps1
config.ps1
. "${env:SCOOPDIR}\..\lib\json.ps1" $cfgpath = "~/.scoop" if(!(test-path $cfgpath)) { "{}" | out-file $cfgpath -encoding utf8 } $cfg = parse_json $cfgpath function get_config($name) { $cfg.$name } function set_config($name, $val) { if ($val -eq $null) { $null = $cfg.remove($name) } else { ...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/getopt.ps1
getopt.ps1
# adapted from http://hg.python.org/cpython/file/2.7/Lib/getopt.py # argv: # array of arguments # shortopts: # string of single-letter options. options that take a parameter # should be follow by ':' # longopts: # array of strings that are long-form options. options that take # a parameter should...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/buckets.ps1
buckets.ps1
. "${env:SCOOPDIR}\..\lib\manifest.ps1" . "${env:SCOOPDIR}\..\lib\json.ps1" $bucketsdir = "$scoopdir\buckets" function bucketdir($name) { if(!$name) { return relpath "..\bucket" } # main bucket "$bucketsdir\$name" } function known_bucket_repo($name) { $dir = versiondir 'scoop' 'current' $buckets = ...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/versions.ps1
versions.ps1
# versions function latest_version($app, $bucket, $url) { (manifest $app $bucket $url).version } function current_version($app, $global) { @(versions $app $global)[-1] } function versions($app, $global) { $appdir = appdir $app $global if(!(test-path $appdir)) { return @() } sort_versions (gci $appdir |...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/json.ps1
json.ps1
function json_get($name, $json) { write-debug "getting $name" $val = $json | jq ".\`"$name\`"" if ($val -eq "null") { return $null } $val } function json_set($name, $val, $json) { if (!$json) { $json = "{}" } if($val -eq $null) { $json = $json | jq "del(.$name)" } else { $json ...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/help.ps1
help.ps1
function usage($text) { $text | sls '(?m)^# Usage: ([^\n]*)$' | % { "usage: " + $_.matches[0].groups[1].value } } function summary($text) { $text | sls '(?m)^# Summary: ([^\n]*)$' | % { $_.matches[0].groups[1].value } } function help($text) { $help_lines = $text | sls '(?ms)^# Help:(.(?!^[^#]))*' | % { $_...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/install.ps1
install.ps1
function nightly_version($date, $quiet = $false) { $date_str = $date.tostring("yyyyMMdd") if (!$quiet) { warn "this is a nightly version: downloaded files won't be verified" } "nightly-$date_str" } function install_app($app, $architecture, $global) { write-debug "entering install app..." $app, $ma...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/commands.ps1
commands.ps1
function command_files { (gci (relpath '..\libexec')) ` + (gci "$scoopdir\shims") ` | where { $_.name -match 'scoop-.*?\.ps1$' } } function commands { command_files | % { command_name $_ } } function command_name($filename) { $filename.name | sls 'scoop-(.*?)\.ps1$' | % { $_.matches[0].g...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/depends.ps1
depends.ps1
# resolve dependencies for the supplied apps, and sort into the correct order function install_order($apps, $arch) { write-debug "entering install order for $apps..." $res = @() foreach($app in $apps) { foreach($dep in deps $app $arch) { if($res -notcontains $dep) { $res += $dep} } if($res -notconta...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/core.ps1
core.ps1
$scoopdir = $env:SCOOP, "~\appdata\local\scoop" | select -first 1 $globaldir = $env:SCOOP_GLOBAL, "$($env:programdata.tolower())\scoop" | select -first 1 $cachedir = "$scoopdir\cache" # always local # helper functions function coalesce($a, $b) { if($a) { return $a } $b } function format($str, $hash) { $hash.ke...
PowerShellCorpus/Github/deevus_scoop-powershell2/lib/manifest.ps1
manifest.ps1
. "${env:SCOOPDIR}\..\lib\json.ps1" function manifest_path($app, $bucket) { "$(bucketdir $bucket)\$app.json" } function url_manifest($url) { $str = $null try { $str = (new-object net.webclient).downloadstring($url) } catch [system.management.automation.methodinvocationexception] { warn "error: $($_...
PowerShellCorpus/Github/deevus_scoop-powershell2/supporting/shimexe/build.ps1
build.ps1
$fwdir = gci C:\Windows\Microsoft.NET\Framework\ -dir | sort -desc | select -first 1 pushd $($env:SCOOPDIR) & "$($fwdir.fullname)\csc.exe" /nologo shim.cs popd
PowerShellCorpus/Github/deevus_scoop-powershell2/test/Scoop-Alias.Tests.ps1
Scoop-Alias.Tests.ps1
. "$psscriptroot\..\libexec\scoop-alias.ps1" reset_aliases describe "add_alias" { mock shimdir { "test\fixtures\shim" } mock set_config { } mock get_config { @{} } $shimdir = shimdir context "alias doesn't exist" { it "creates a new alias" { $alias_file = "$shimdir\scoop-rm.ps1" ...