full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/Rorymon_WindowsMISC/elaboratetextfilecompare.ps1
elaboratetextfilecompare.ps1
<# .SYNOPSIS . .DESCRIPTION Compared the contents of two text files line by line and highlights the lines that are different. Created by Rory Monaghan. .PARAMETER $objFilePath1 Path to a text file .PARAMETER $objFilePath2 Path to a text file #> Param( [Parameter(Mandatory=$True,Pos...
PowerShellCorpus/Github/Rorymon_WindowsMISC/detectos.ps1
detectos.ps1
<# .SYNOPSIS . .DESCRIPTION This script takes a computer name and Outputs the Operating System being run #### Created by Rory Monaghan. .PARAMETER computer An computer hostname #> Param( [Parameter(Mandatory=$True,Position=1)] [string]$computer ) Get-WMIObject Win32_OperatingS...
PowerShellCorpus/Github/rosstified_sample-arm/Sample.Arm/Sample.Arm/Scripts/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'Sample.Arm', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerNam...
PowerShellCorpus/Github/tescales_azure-scaffold/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'devVM', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = $...
PowerShellCorpus/Github/tescales_azure-scaffold/references/Deploy-AzureResourceGroup - Copy.ps1
Deploy-AzureResourceGroup - Copy.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'devVM', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = $...
PowerShellCorpus/Github/tescales_azure-scaffold/references/101-automation-runbook-getvms/DeployThroughARM.ps1
DeployThroughARM.ps1
#Connect to your Azure account Add-AzureRmAccount #Select your subscription if you have more than one #Select-AzureSubscription -SubscriptionName "My Subscription Name" #Create a GUID for the job $JobGUID = [System.Guid]::NewGuid().toString() #Set the parameter values for the template $Params = @{ a...
PowerShellCorpus/Github/tescales_azure-scaffold/references/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1
Get-AzureVMTutorial.ps1
<# .DESCRIPTION An example runbook which prints out the first 10 Azure VMs in your subscription (ordered alphabetically). For more information about how this runbook authenticates to your Azure subscription, see our documentation here: http://aka.ms/fxu3mn .NOTES AUTHOR: Azure Aut...
PowerShellCorpus/Github/tescales_azure-scaffold/scripts/DeployO365SilentWithVersion.ps1
DeployO365SilentWithVersion.ps1
# Office ProPlus Click-To-Run Deployment Script example # # This script demonstrates how utilize the scripts in OfficeDev/Office-IT-Pro-Deployment-Scripts repository together to create # Office ProPlus Click-To-Run deployment script that will be adaptive to the configuration of the computer it is run from para...
PowerShellCorpus/Github/Slartibartfast1_Notification-Logged-On/CurrentlyLoggedOn.ps1
CurrentlyLoggedOn.ps1
$xmlSource = "C:\Users\" + $env:USERNAME + "\Documents\Scripts\Script Output\UserComputers.xml" $xml = [xml](Get-Content $xmlSource) $output = "C:\Users\" + $env:USERNAME + "\Documents\Scripts\Script Output\Logged in Users.txt" $users = Get-ADUser -filter * -properties cn -searchbase #"OU=,DC=domain,DC=com" $us...
PowerShellCorpus/Github/OPS-E2E-Prod_E2E_P_D_Provision_2017_6_1_18_14_55/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source url: ...
PowerShellCorpus/Github/DeSciL_Qualtrics/Hits/HitDefinition.ps1
HitDefinition.ps1
################################################################################################### # Generate a Descil HIT Definition File # stwehrli@gmail.com # 29sept2015 # Source directly from GitHub into PowerShell: # $url = "https://raw.githubusercontent.com/DeSciL/Qualtrics/master/Hits/HitDefinition.ps1" ...
PowerShellCorpus/Github/DeSciL_Qualtrics/Panel/QualtricsPanel.ps1
QualtricsPanel.ps1
################################################################################################### # Generate a Code List from a Qualtrics Panel # stwehrli@gmail.com # 6jul2015 # Source from PowerShell # Navigate into the directory with the .ps1 file and dotsource it # . ./QualtricsPanel.ps1 # Source direct...
PowerShellCorpus/Github/specator_PowerShell/Remove-OldDrivers.ps1
Remove-OldDrivers.ps1
<# 2016.09.01 перечисляет драйвера в системе находит дубликаты в хранилище и удаляет их если вам нужно только посмотреть драйвера закомментируйте 135 строку если драйвер нужно удалить принудительно используйте pnputil.exe -f -d #> #[Console]::OutputEncoding = [System.Text.Encoding]::GetEnco...
PowerShellCorpus/Github/specator_PowerShell/HV-NewVM.ps1
HV-NewVM.ps1
$vmname = 'server-sp-1' $vmdomain = 'portalvp.ru' $vmbasepath = 'G:\Hyper-V\' #-ProcessorCount #-DynamicMemory #-StaticMemory #-MemoryMinimumBytes 512MB #-MemoryMaximumBytes 4GB #-MemoryStartupBytes 1GB $vmfullname = $vmname + '.' + $vmdomain $vmvhdpath = $vmbasepath + $vmfullname + '\Virtual Hard Disks\'...
PowerShellCorpus/Github/OPS-E2E-Prod_E2E_P_D_Provision_2017_5_25_27_33_15/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source url: ...
PowerShellCorpus/Github/averkinderen_Azure/201-EnableNSG-diagnostics/DisableNSGDiagnostics.ps1
DisableNSGDiagnostics.ps1
#variables $ResourgeGroupName = Read-Host "Please provide name of ResourgeGroup that will be used for saving the NSG logs" $StorageAccountLogs = Read-Host "Please provide name of Storage Account that will be used for saving the NSG logs" #Login to the Azure Resource Management Account Login-AzureRmAccount Regi...
PowerShellCorpus/Github/averkinderen_Azure/201-EnableNSG-diagnostics/EnableNSGDiagnostics.ps1
EnableNSGDiagnostics.ps1
#variables $ResourgeGroupName = Read-Host "Please provide name of ResourgeGroup that will be used for saving the NSG logs" $StorageAccountLogs = Read-Host "Please provide name of Storage Account that will be used for saving the NSG logs" $retentionperiod = Read-Host "Please provide retention period" #Login to t...
PowerShellCorpus/Github/averkinderen_Azure/Policy-Deployment/Policydeployments.ps1
Policydeployments.ps1
$policyName = Read-Host "Specify the name of the policy"; $policyDescription = Read-Host "Specify the description of the policy" $policyFile = Read-Host "Path to json policy file"; #Login to the Azure Resource Management Account Login-AzureRmAccount #region Get Azure Subscriptions $subscriptions = Get-AzureRm...
PowerShellCorpus/Github/averkinderen_Azure/201-ExpressRoute-Sharing/expressroute.ps1
expressroute.ps1
#Assumptions #The script assumes that you have performed the following work: #Configured ExpressRoute with a connection to your primary Virtual Network #Added a /28 subnet into your target Virtual Network with the name “GatewaySubnet” #Created a Virtual Network Gateway in your target Virtual Network of type “Ex...
PowerShellCorpus/Github/averkinderen_Azure/oms-all-deploy/scripts/Automated-IaaS-Backup.ps1
Automated-IaaS-Backup.ps1
<# .Synopsis Runbook for automated IaaS VM Backup in Azure using Backup and Site Recovery (OMS) .DESCRIPTION This Runbook will enable Backup on existing Azure IaaS VMs. You need to provide input to the Resource Group name that contains the Backup and Site Recovery (OMS) Resourcem the name of the recovery ...
PowerShellCorpus/Github/edy00_MyApps/ISS/Proiect/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/edy00_MyApps/ISS/Proiect/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/edy00_MyApps/ISS/Proiect/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/edy00_MyApps/ISS/Proiect/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/lfraile_DotNetCoreTasks/restore-dotnet/restore-dotnet.ps1
restore-dotnet.ps1
[CmdletBinding()] param() Set-StrictMode -Version 2 Trace-VstsEnteringInvocation $MyInvocation try { $pathToProjectJson = Get-VstsInput -Name projectPath -Require Assert-VstsPath $pathToProjectJson Invoke-VstsTool -FileName "dotnet.exe" -Arguments " restore $pathToProjectJson" -Requ...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/LongPathFunctions.ps1
LongPathFunctions.ps1
######################################## # Private functions. ######################################## function ConvertFrom-LongFormPath { [CmdletBinding()] param([string]$Path) if ($Path) { if ($Path.StartsWith('\\?\UNC')) { # E.g. \\?\UNC\server\share -> \\server\share ...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/OutFunctions.ps1
OutFunctions.ps1
# TODO: It would be better if the Out-Default function resolved the underlying Out-Default # command in the begin block. This would allow for supporting other modules that override # Out-Default. $script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default") ########...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1
ServerOMFunctions.ps1
<# .SYNOPSIS Gets assembly reference information. .DESCRIPTION Not supported for use during task exection. This function is only intended to help developers resolve the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client SDK. The interface and output may change betw...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/FindFunctions.ps1
FindFunctions.ps1
<# .SYNOPSIS Finds files or directories. .DESCRIPTION Finds files or directories using advanced pattern matching. .PARAMETER LiteralDirectory Directory to search. .PARAMETER LegacyPattern Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns. Separate multiple...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1
LocalizationFunctions.ps1
$script:resourceStrings = @{ } <# .SYNOPSIS Gets a localized resource string. .DESCRIPTION Gets a localized resource string and optionally formats the string with arguments. If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/InputFunctions.ps1
InputFunctions.ps1
# Hash table of known variable info. The formatted env var name is the lookup key. # # The purpose of this hash table is to keep track of known variables. The hash table # needs to be maintained for multiple reasons: # 1) to distinguish between env vars and job vars # 2) to distinguish between secret vars and pu...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/TraceFunctions.ps1
TraceFunctions.ps1
<# .SYNOPSIS Writes verbose information about the invocation being entered. .DESCRIPTION Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced. .PARAM...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1
LoggingCommandFunctions.ps1
$script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet/ps_modules/VstsTaskSdk/ToolFunctions.ps1
ToolFunctions.ps1
<# .SYNOPSIS Asserts that a path exists. Throws if the path does not exist. .PARAMETER PassThru True to return the path. #> function Assert-Path { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$LiteralPath, [Microsoft.PowerShell.Commands.TestPathType]$PathT...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/restore-dotnet.ps1
restore-dotnet.ps1
[CmdletBinding()] param() Set-StrictMode -Version 2 Trace-VstsEnteringInvocation $MyInvocation try { $pathToProjectJson = Get-VstsInput -Name projectPath -Require Assert-VstsPath $pathToProjectJson Invoke-VstsTool -FileName "dotnet.exe" -Arguments " restore $pathToProjectJson" -Requ...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/LongPathFunctions.ps1
LongPathFunctions.ps1
######################################## # Private functions. ######################################## function ConvertFrom-LongFormPath { [CmdletBinding()] param([string]$Path) if ($Path) { if ($Path.StartsWith('\\?\UNC')) { # E.g. \\?\UNC\server\share -> \\server\share ...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/OutFunctions.ps1
OutFunctions.ps1
# TODO: It would be better if the Out-Default function resolved the underlying Out-Default # command in the begin block. This would allow for supporting other modules that override # Out-Default. $script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default") ########...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1
ServerOMFunctions.ps1
<# .SYNOPSIS Gets assembly reference information. .DESCRIPTION Not supported for use during task exection. This function is only intended to help developers resolve the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client SDK. The interface and output may change betw...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/FindFunctions.ps1
FindFunctions.ps1
<# .SYNOPSIS Finds files or directories. .DESCRIPTION Finds files or directories using advanced pattern matching. .PARAMETER LiteralDirectory Directory to search. .PARAMETER LegacyPattern Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns. Separate multiple...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1
LocalizationFunctions.ps1
$script:resourceStrings = @{ } <# .SYNOPSIS Gets a localized resource string. .DESCRIPTION Gets a localized resource string and optionally formats the string with arguments. If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/InputFunctions.ps1
InputFunctions.ps1
# Hash table of known variable info. The formatted env var name is the lookup key. # # The purpose of this hash table is to keep track of known variables. The hash table # needs to be maintained for multiple reasons: # 1) to distinguish between env vars and job vars # 2) to distinguish between secret vars and pu...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/TraceFunctions.ps1
TraceFunctions.ps1
<# .SYNOPSIS Writes verbose information about the invocation being entered. .DESCRIPTION Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced. .PARAM...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1
LoggingCommandFunctions.ps1
$script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/restore-dotnet-ts/ps_modules/VstsTaskSdk/ToolFunctions.ps1
ToolFunctions.ps1
<# .SYNOPSIS Asserts that a path exists. Throws if the path does not exist. .PARAMETER PassThru True to return the path. #> function Assert-Path { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$LiteralPath, [Microsoft.PowerShell.Commands.TestPathType]$PathT...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/publish-dotnet.ps1
publish-dotnet.ps1
[CmdletBinding()] param() Set-StrictMode -Version 2 Trace-VstsEnteringInvocation $MyInvocation try { $pathToProjectJson = Get-VstsInput -Name projectPath -Require $destinationPath = Get-VstsInput -Name folderForPublish -Require Assert-VstsPath $pathToProjectJson Invoke-VstsTo...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/LongPathFunctions.ps1
LongPathFunctions.ps1
######################################## # Private functions. ######################################## function ConvertFrom-LongFormPath { [CmdletBinding()] param([string]$Path) if ($Path) { if ($Path.StartsWith('\\?\UNC')) { # E.g. \\?\UNC\server\share -> \\server\share ...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/OutFunctions.ps1
OutFunctions.ps1
# TODO: It would be better if the Out-Default function resolved the underlying Out-Default # command in the begin block. This would allow for supporting other modules that override # Out-Default. $script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default") ########...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1
ServerOMFunctions.ps1
<# .SYNOPSIS Gets assembly reference information. .DESCRIPTION Not supported for use during task exection. This function is only intended to help developers resolve the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client SDK. The interface and output may change betw...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/FindFunctions.ps1
FindFunctions.ps1
<# .SYNOPSIS Finds files or directories. .DESCRIPTION Finds files or directories using advanced pattern matching. .PARAMETER LiteralDirectory Directory to search. .PARAMETER LegacyPattern Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns. Separate multiple...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1
LocalizationFunctions.ps1
$script:resourceStrings = @{ } <# .SYNOPSIS Gets a localized resource string. .DESCRIPTION Gets a localized resource string and optionally formats the string with arguments. If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/InputFunctions.ps1
InputFunctions.ps1
# Hash table of known variable info. The formatted env var name is the lookup key. # # The purpose of this hash table is to keep track of known variables. The hash table # needs to be maintained for multiple reasons: # 1) to distinguish between env vars and job vars # 2) to distinguish between secret vars and pu...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/TraceFunctions.ps1
TraceFunctions.ps1
<# .SYNOPSIS Writes verbose information about the invocation being entered. .DESCRIPTION Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced. .PARAM...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1
LoggingCommandFunctions.ps1
$script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/publish-dotnet/ps_modules/VstsTaskSdk/ToolFunctions.ps1
ToolFunctions.ps1
<# .SYNOPSIS Asserts that a path exists. Throws if the path does not exist. .PARAMETER PassThru True to return the path. #> function Assert-Path { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$LiteralPath, [Microsoft.PowerShell.Commands.TestPathType]$PathT...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/build-dotnet.ps1
build-dotnet.ps1
[CmdletBinding()] param() Set-StrictMode -Version 2 Trace-VstsEnteringInvocation $MyInvocation try { $pathToProjectJson = Get-VstsInput -Name projectPath -Require Assert-VstsPath $pathToProjectJson Invoke-VstsTool -FileName "dotnet.exe" -Arguments " build $pathToProjectJson" -Requir...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/LongPathFunctions.ps1
LongPathFunctions.ps1
######################################## # Private functions. ######################################## function ConvertFrom-LongFormPath { [CmdletBinding()] param([string]$Path) if ($Path) { if ($Path.StartsWith('\\?\UNC')) { # E.g. \\?\UNC\server\share -> \\server\share ...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/OutFunctions.ps1
OutFunctions.ps1
# TODO: It would be better if the Out-Default function resolved the underlying Out-Default # command in the begin block. This would allow for supporting other modules that override # Out-Default. $script:outDefaultCmdlet = $ExecutionContext.InvokeCommand.GetCmdlet("Microsoft.PowerShell.Core\Out-Default") ########...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/ServerOMFunctions.ps1
ServerOMFunctions.ps1
<# .SYNOPSIS Gets assembly reference information. .DESCRIPTION Not supported for use during task exection. This function is only intended to help developers resolve the minimal set of DLLs that need to be bundled when consuming the VSTS REST SDK or TFS Extended Client SDK. The interface and output may change betw...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/FindFunctions.ps1
FindFunctions.ps1
<# .SYNOPSIS Finds files or directories. .DESCRIPTION Finds files or directories using advanced pattern matching. .PARAMETER LiteralDirectory Directory to search. .PARAMETER LegacyPattern Proprietary pattern format. The LiteralDirectory parameter is used to root any unrooted patterns. Separate multiple...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/LocalizationFunctions.ps1
LocalizationFunctions.ps1
$script:resourceStrings = @{ } <# .SYNOPSIS Gets a localized resource string. .DESCRIPTION Gets a localized resource string and optionally formats the string with arguments. If the format fails (due to a bad format string or incorrect expected arguments in the format string), then the format string is retur...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/InputFunctions.ps1
InputFunctions.ps1
# Hash table of known variable info. The formatted env var name is the lookup key. # # The purpose of this hash table is to keep track of known variables. The hash table # needs to be maintained for multiple reasons: # 1) to distinguish between env vars and job vars # 2) to distinguish between secret vars and pu...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/TraceFunctions.ps1
TraceFunctions.ps1
<# .SYNOPSIS Writes verbose information about the invocation being entered. .DESCRIPTION Used to trace verbose information when entering a function/script. Writes an entering message followed by a short description of the invocation. Additionally each bound parameter and unbound argument is also traced. .PARAM...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/LoggingCommandFunctions.ps1
LoggingCommandFunctions.ps1
$script:loggingCommandPrefix = '##vso[' $script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } New-Object psobject -Property @{ Token = "`...
PowerShellCorpus/Github/lfraile_DotNetCoreTasks/build-dotnet/ps_modules/VstsTaskSdk/ToolFunctions.ps1
ToolFunctions.ps1
<# .SYNOPSIS Asserts that a path exists. Throws if the path does not exist. .PARAMETER PassThru True to return the path. #> function Assert-Path { [CmdletBinding()] param( [Parameter(Mandatory = $true)] [string]$LiteralPath, [Microsoft.PowerShell.Commands.TestPathType]$PathT...
PowerShellCorpus/Github/omrsafetyo_Remoting/Bypass-CredSSP.ps1
Bypass-CredSSP.ps1
# Credential Functions # http://powershell.com/cs/blogs/tips/archive/2014/03/28/exporting-and-importing-credentials-in-powershell.aspx # The scheduled task must be running under the user account that was used to generate the XML credential file . \\networkresource\security\CredentialFunctions.ps1 $cred = Import-Cre...
PowerShellCorpus/Github/omrsafetyo_Remoting/Get-ScheduledTasks.ps1
Get-ScheduledTasks.ps1
Function Get-SchTasks { [OutputType([PSObject])] [CmdletBinding()] param( [Parameter(Mandatory=$false)] $ScheduleCom, [Parameter(Mandatory=$false)] $User, [Parameter(Mandatory=$false)] $TaskNameFilter, [Parameter(Mandatory=$false)] ...
PowerShellCorpus/Github/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/waning1995_ASP.NET-MVC-StudentMangement/StudentManagement/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/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/configure-wsus.ps1
configure-wsus.ps1
# Installs and configures Windows Server Update Services Install-WindowsFeature -Name "UpdateServices" -IncludeManagementTools # Create a folder where WSUS will download its content New-Item C:\WSUS -Type Directory & 'C:\Program Files\Update Services\Tools\WsusUtil.exe' --% postinstall CONTENT_DIR=C:\W...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/Promote-DC.ps1
Promote-DC.ps1
# Windows PowerShell script for AD DS Deployment param($u,$p,$d) # Domain Variables $DomainName = $d $DomainMode = "Win2012" $ForestMode = "Win2012" $u = "$domainname\$u" $securePassword = ConvertTo-SecureString -String $p -AsPlainText -Force $psCreds = new-object -typename System.Management.Automation.PS...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/Set-IntnetSettings.ps1
Set-IntnetSettings.ps1
param($gw,$dns,$masklength) $ipv4adr = (get-netipaddress -InterfaceAlias 'Ethernet 2' -AddressFamily IPv4).IPAddress $ipv4gw = $gw $prefix = $masklength $alias = "Ethernet 2" $ipv4dns1 = $dns #remove-netipaddress -InterfaceAlias 'Ethernet 2' -AddressFamily IPv4 -Confirm:$false # $netadapter = Get-NetAdapter ...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/WinRM-HTTPS-Fix.ps1
WinRM-HTTPS-Fix.ps1
# Configure a Windows host for remote management with Ansible # ----------------------------------------------------------- # # This script checks the current WinRM/PSRemoting configuration and makes the # necessary changes to allow Ansible to connect, authenticate and execute # PowerShell commands. # # Set $Ve...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/Configure-DNSServer.ps1
Configure-DNSServer.ps1
param($gw,$dns,$netmask,$masklength,$domain) $DNSDomain=$domain $DNSServerIP=$dns $DHCPServerIP=$dns $StartRange=$svrstart $EndRange=$svrend $Subnet=$netmask $Router=$gw $dnsext=".dns" $zonefile=$domain -join $dnsext $octet1,$octet2,$octet3,$octet4 = $gw.split('.',3) $nwid=$octet1 + "." + $octet2 + "." +...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/Create-NewDomain.ps1
Create-NewDomain.ps1
# Windows PowerShell script for AD DS Deployment param($u,$p,$d) # Domain Variables: $DomainName = $d $DomainMode = "Win2012" $ForestMode = "Win2012" $u = "$DomainName\$u" #AD Admin Password $admpw = "V@grant1" | ConvertTo-SecureString -AsPlainText -Force # Path Variables $DatabasePath = "C:\Windows\N...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/restart.ps1
restart.ps1
Restart-Computer -Force
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/client-djoin.ps1
client-djoin.ps1
# # Script: client-djoin.ps1 # Joins clients/servers to a domain # param($u,$p,$d) $domainname = $d $u = "$domainname\$u" $computername = $env:computername $securePassword = ConvertTo-SecureString -String $p -AsPlainText -Force $psCreds = new-object -typename System.Management.Automation.PSCredential -ar...
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/Add-DomainAdmin.ps1
Add-DomainAdmin.ps1
# Windows PowerShell script for AD DS Deployment param($u,$p,$a,$w,$d) New-ADUser ` -Name $a ` -SamAccountName "$a" ` -DisplayName "$a" ` -AccountPassword (ConvertTo-SecureString "$w" -AsPlainText -Force) ` -ChangePasswordAtLogon $false ` -Enabled $true Add-ADGroupMember "Domain Admins" "$a"
PowerShellCorpus/Github/Wyvernsquare_ansible-vagrant-windows-stack/ps-scripts/Configure-DHCPServer.ps1
Configure-DHCPServer.ps1
param($gw,$dns,$netmask,$masklength,$svrstart,$svrend,$domain) $DNSDomain=$domain $DNSServerIP=$dns $DHCPServerIP=$dns $StartRange=$svrstart $EndRange=$svrend $Subnet=$netmask $Router=$gw cmd.exe /c "netsh dhcp add securitygroups" Restart-service dhcpserver Add-DhcpServerInDC -DnsName $Env:COMPUTERNAME ...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/Private/ReadSecureString.ps1
ReadSecureString.ps1
Set-StrictMode -Version Latest function ReadSecureString([Parameter(Position=0,mandatory=$false)][String]$Prompt = 'Password:') { [Boolean]$Done = $false do { $SecureString = Read-Host -Prompt $Prompt -AsSecureString $ReSecureString = Read-Host -Prompt ('Re-type '+$Prompt) -AsSecureStri...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/Private/DecryptSecureString.ps1
DecryptSecureString.ps1
Set-StrictMode -Version Latest function DecryptSecureString { param( [parameter(position=0,mandatory=$true)] [System.Security.SecureString] $SecureString ) $BStr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) [System.Runtime.InteropServi...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/Public/New-AzureRmStartStopVmAutomation.ps1
New-AzureRmStartStopVmAutomation.ps1
using namespace Microsoft.Azure.Commands.Profile.Models Set-StrictMode -Version Latest $script:ErrorActionPreference = "Stop" <# .SYNOPSIS Create a new Automation Account which includes two RunBooks. Them makes start/stop a virtual machine. .DESCRIPTION This function creates seven objects in a resource g...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/Public/Register-AzureRmStopVmScheduleRunbook.ps1
Register-AzureRmStopVmScheduleRunbook.ps1
Set-StrictMode -Version Latest <# .SYNOPSIS Associate a schedule to the Stop virtual machine runbook. .EXAMPLE Register-AzureRmStopVmScheduleRunbook -ResourceGroupName rg01 -AutomationAccountName aa01 -VmName myvm -ScheduleName NineOclock #> function Register-AzureRmStopVmScheduleRunbook { param( ...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/Public/Register-AzureRmStartVmScheduleRunbook.ps1
Register-AzureRmStartVmScheduleRunbook.ps1
Set-StrictMode -Version Latest <# .SYNOPSIS Associate a schedule to the Start virtual machine runbook. .EXAMPLE Register-AzureRmStartVmScheduleRunbook -ResourceGroupName rg01 -AutomationAccountName aa01 -VmName myvm -ScheduleName NineOclock #> function Register-AzureRmStartVmScheduleRunbook { param( ...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/RunBook/Stop-SingleAzureRmVm.ps1
Stop-SingleAzureRmVm.ps1
Workflow Stop-SingleAzureRmVm { Param( [parameter(mandatory=$false)] [String] $CredentialAssetName = "AzureCredential", [parameter(mandatory=$false)] [String] $TenantIdAssetName = "TenantId", [parameter(mandatory=$true)] [String] ...
PowerShellCorpus/Github/sengokyu_powershell-cabinet/Modules/AzureRmMinus/RunBook/Start-SingleAzureRmVm.ps1
Start-SingleAzureRmVm.ps1
Workflow Start-SingleAzureRmVm { Param( [parameter(mandatory=$false)] [String] $CredentialAssetName = "AzureCredential", [parameter(mandatory=$false)] [String] $TenantIdAssetName = "TenantId", [parameter(mandatory=$true)] [String] ...
PowerShellCorpus/Github/bendinsn_bendinsnMusicApp/src/bendinsnMusicApp/Properties/PublishProfiles/bendinsnMusicApp20161021122315 - Web Deploy-publish.ps1
bendinsnMusicApp20161021122315 - Web Deploy-publish.ps1
[cmdletbinding(SupportsShouldProcess=$true)] param($publishProperties=@{}, $packOutput, $pubProfilePath) # to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 try{ if ($publishProperties['ProjectGuid'] -eq $null){ $publishProperties['ProjectGuid'] = '120030a1-b46d-4ac...
PowerShellCorpus/Github/bendinsn_bendinsnMusicApp/src/bendinsnMusicApp/Properties/PublishProfiles/bendinsnMusicApp20161021010826 - Web Deploy-publish.ps1
bendinsnMusicApp20161021010826 - Web Deploy-publish.ps1
[cmdletbinding(SupportsShouldProcess=$true)] param($publishProperties=@{}, $packOutput, $pubProfilePath) # to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 try{ if ($publishProperties['ProjectGuid'] -eq $null){ $publishProperties['ProjectGuid'] = '120030a1-b46d-4ac...
PowerShellCorpus/Github/kenshaw_shell-config/win10/fixWin10.ps1
fixWin10.ps1
########## # Win10 Initial Setup Script # Author: Disassembler <disassembler@dasm.cz> # Version: 1.7, 2016-08-15 # dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/ # THIS IS A PERSONALIZED VERSION # This script leaves more MS defaults on, including MS security features. # Tweaked b...
PowerShellCorpus/Github/tinuwalther_active-directory/BulkImport.ps1
BulkImport.ps1
<# .SYNOPSIS Active Directory Bulk Import .DESCRIPTION Massenimport von Active Directory Gruppen .PARAMETER Inputfile Pfad zum Inputfile .NOTES Author: Martin Walther Date created: 13.01.2015 .EXAMPLE .\BulkImport.ps1 -Inputfile .\import.csv #> #===========================...
PowerShellCorpus/Github/sckaushal_utilities/dbs-ynab-exporter.ps1
dbs-ynab-exporter.ps1
param([string] $inputFile, [string] $outfile = "ynabreadyfile.csv") $output = @(); Import-Csv $inputFile | % { $date = Get-Date $_."Transaction Date" -format dd/MM/yyyy; $output += [pscustomobject] @{ Date = $date; Payee = ""; Category = ""; Memo = $_."Transaction Ref...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Stop-ScriptLogger.ps1
Stop-ScriptLogger.ps1
<# .SYNOPSIS Stop the script logger inside the current PowerShell session. .DESCRIPTION Stop the script logger inside the current PowerShell session and clear all log configurations. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Stop-ScriptLogger Stop ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Get-ScriptLogger.ps1
Get-ScriptLogger.ps1
<# .SYNOPSIS Get the current script logger. .DESCRIPTION Returns an object with the current configuration of the script logger inside this PowerShell session. .INPUTS None. .OUTPUTS ScriptLogger.Configuration. Configuration of the script logger instance. .EXAMPL...