full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Write-WarningLog.ps1
Write-WarningLog.ps1
<# .SYNOPSIS Log a warning message. .DESCRIPTION Log a warning message to the log file, the event log and show it on the current console. If the global log level is set to 'error', no warning message will be logged. .INPUTS None. .OUTPUTS None. .EXAMPLE ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Write-ErrorLog.ps1
Write-ErrorLog.ps1
<# .SYNOPSIS Log an error message. .DESCRIPTION Log an error message to the log file, the event log and show it on the current console. It can also use an error record conataining an exception as input. The exception will be converted into a log message. .INPUTS None. ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Start-ScriptLogger.ps1
Start-ScriptLogger.ps1
<# .SYNOPSIS Start the script logger inside the current PowerShell session. .DESCRIPTION Start the script logger inside the current PowerShell session. By starting the logger, a global log configuration for the current PowerShell session will be set. This configuration is customizable wi...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Write-InformationLog.ps1
Write-InformationLog.ps1
<# .SYNOPSIS Log an information message. .DESCRIPTION Log an information message to the log file, the event log and show it on the current console. If the global log level is set to 'warning', no information message will be logged. .INPUTS None. .OUTPUTS None. ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Set-ScriptLogger.ps1
Set-ScriptLogger.ps1
<# .SYNOPSIS Update the script logger log configuration. .DESCRIPTION The script logger inside the current PowerShell session can be updated with all parameters inside this cmdlet. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Set-ScriptLogger -Level 'Warni...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Functions/Write-VerboseLog.ps1
Write-VerboseLog.ps1
<# .SYNOPSIS Log a verbose message. .DESCRIPTION Log a verbose message to the log file, the event log and show it on the current console. If the global log level is set to 'information', no verbose message will be logged. .INPUTS None. .OUTPUTS None. .EXAMP...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Helpers/Write-Log.ps1
Write-Log.ps1
<# .SYNOPSIS Log a message with the specified log level. .DESCRIPTION If the specified log level is higher as the configured log level, the message will be logged to the enabled destinations. These are the specified log file, the PowerShell event log and the current PowerShell console. ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Helpers/Show-VerboseMessage.ps1
Show-VerboseMessage.ps1
<# .SYNOPSIS Shows a verbose message on the PowerShell host. .DESCRIPTION Uses the internal .NET method WriteVerboseLine() of the host UI class to show the verbose message on the console. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Show-VerboseMessage -Me...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Helpers/Show-InformationMessage.ps1
Show-InformationMessage.ps1
<# .SYNOPSIS Shows an information message on the PowerShell host. .DESCRIPTION Uses the internal .NET method () of the host UI class to show the information message on the console. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Show-InformationMessage -Messa...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Helpers/Show-ErrorMessage.ps1
Show-ErrorMessage.ps1
<# .SYNOPSIS Shows an error message on the PowerShell host. .DESCRIPTION Uses the internal .NET method WriteErrorLine() of the host UI class to show the error message on the console. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Show-ErrorMessage -Message '...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Modules/ScriptLogger/Helpers/Show-WarningMessage.ps1
Show-WarningMessage.ps1
<# .SYNOPSIS Shows a warning message on the PowerShell host. .DESCRIPTION Uses the internal .NET method WriteWarningLine() of the host UI class to show the warning message on the console. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Show-WarningMessage -Me...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Write-WarningLog.Tests.ps1
Write-WarningLog.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force InModul...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Write-ErrorLog.Tests.ps1
Write-ErrorLog.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force InModul...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Write-InformationLog.Tests.ps1
Write-InformationLog.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force InModul...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Get-ScriptLogger.Tests.ps1
Get-ScriptLogger.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force Describ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Start-ScriptLogger.Tests.ps1
Start-ScriptLogger.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force Describ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Stop-ScriptLogger.Tests.ps1
Stop-ScriptLogger.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force Describ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Write-VerboseLog.Tests.ps1
Write-VerboseLog.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force InModul...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Unit/Set-ScriptLogger.Tests.ps1
Set-ScriptLogger.Tests.ps1
$ModulePath = Resolve-Path -Path "$PSScriptRoot\..\..\Modules" | ForEach-Object Path $ModuleName = Get-ChildItem -Path $ModulePath | Select-Object -First 1 -ExpandProperty BaseName Remove-Module -Name $ModuleName -Force -ErrorAction SilentlyContinue Import-Module -Name "$ModulePath\$ModuleName" -Force Describ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Integration/LoggerDemo.ps1
LoggerDemo.ps1
# Initialize the logger with default values Start-ScriptLogger # Second options, specify multiple custom settings for the logger Start-ScriptLogger -Path 'C:\Temp\test.log' -Format '{0:yyyy-MM-dd} {0:HH:mm:ss} {1} {2} {3,-11} {4}' -Level Warning -Encoding 'UTF8' -NoEventLog -NoConsoleOutput # Get th...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Tests/Meta/Autoload.Tests.ps1
Autoload.Tests.ps1
<# Use this tests to verify, if the latest meta tests are available in this repository, compared to the claudiospizzi/PowerShellModuleBase repository. #> Describe 'Meta Autoload' { $baseApi = 'https://api.github.com/repos/claudiospizzi/PowerShellModuleBase/contents/Tests/Meta' $files = Inv...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Scripts/release.ps1
release.ps1
#Requires -Version 5.0 <# .SYNOPSIS Release the PowerShell module and upload the artifact to AppVeyor. .DESCRIPTION Use the GitHub REST api to create a new release for the version tag and upload the ZIP module artifact to the release. In addition, publish the module to the PowerShell ...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Scripts/test.ps1
test.ps1
#Requires -Version 5.0 #Requires -Modules Pester, PSScriptAnalyzer <# .SYNOPSIS Test the PowerShell module with Pester and upload the results to AppVeyor. .DESCRIPTION Using Pester to execute all tests within the Tests folder. The tests result is dropped as NUnit XML file in the staging p...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Scripts/debug.default.ps1
debug.default.ps1
# Get and dot source all helper functions (private) Split-Path -Path $PSScriptRoot | Join-Path -ChildPath 'Modules\ScriptLogger\Helpers' | Get-ChildItem -Include '*.ps1' -Exclude '*.Tests.*' -Recurse | ForEach-Object { . $_.FullName } # Get and dot source all external functions (public)...
PowerShellCorpus/Github/claudiospizzi_ScriptLogger/Scripts/build.ps1
build.ps1
#Requires -Version 5.0 <# .SYNOPSIS Build the PowerShell module and upload the artifact to AppVeyor. .DESCRIPTION Build a PowerShell module means creating a ZIP file with the necessary files. If needed, the created ZIP file can be uploaded to the current running AppVeyor build. #> ...
PowerShellCorpus/Github/AndrewJey_Reproductor-Audio---Video---Jos--Guerrero---Jos--Carrillo---C-/Proyecto-Sistemas-Operativos-master/Reproductor/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/AndrewJey_Reproductor-Audio---Video---Jos--Guerrero---Jos--Carrillo---C-/Proyecto-Sistemas-Operativos-master/Reproductor/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/daxian-dbw_PSSandbox/Level1/Get-PSDrive.ps1
Get-PSDrive.ps1
[CmdletBinding(DefaultParameterSetName='Name', SupportsTransactions=$true, HelpUri='http://go.microsoft.com/fwlink/?LinkID=113327')] param( [Parameter(ParameterSetName='Name', Position=0, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string[]] ${Name}, [Parameter(Value...
PowerShellCorpus/Github/daxian-dbw_PSSandbox/Level1/Set-Location.ps1
Set-Location.ps1
[CmdletBinding(DefaultParameterSetName='Path', SupportsTransactions=$true, HelpUri='http://go.microsoft.com/fwlink/?LinkID=113397')] param( [Parameter(ParameterSetName='Path', Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [string] ${Path}, [switch] ${PassThru}...
PowerShellCorpus/Github/daxian-dbw_PSSandbox/Level1/startup.ps1
startup.ps1
$GameRoot = Join-Path ([System.IO.Path]::GetTempPath()) "PSGame" if (Test-Path $GameRoot -PathType Container) { Remove-Item $GameRoot -Recurse -Force } New-Item -Path $GameRoot -ItemType Directory -Force > $null New-PSDrive -Name Lab-43 -PSProvider FileSystem -Root $GameRoot -Scope Global -Description "Sec...
PowerShellCorpus/Github/daveyb_powershell/CrashPlan.ps1
CrashPlan.ps1
# Script to Start||Stop CrashPlanService param([string]$command) $crashPlanService = Get-Service CrashPlanService $timestamp = Get-Date -format u $errors = @() if($command -eq "start") { try { $crashPlanService.Start(); } catch [InvalidOperationException] { $errors += $_.Exception.ToStr...
PowerShellCorpus/Github/daveyb_powershell/Microsoft.Powershell_profile.ps1
Microsoft.Powershell_profile.ps1
# "Aliases" to other functions function gms { param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] $o ) process { Get-Member -InputObject $o -Static } }
PowerShellCorpus/Github/prbreezy_PowerShell/AWS/CreateELB.ps1
CreateELB.ps1
#Function to create load Balancer Param ( [String]$ELBName, [Tnteger]$ELBIntPort, [Integer]$ELBEc2Port ) function CreateELB ($ELBName,$ELBIntPort,$ELBEc2Port) { New-ELBLoadBalancer -LoadBalancerName $ELBName -Listeners @($HTTPListener, $HTTPSListener) -SecurityGroups @($sgId) -Subnets @($s...
PowerShellCorpus/Github/prbreezy_PowerShell/Functions/CreateIISWebsiteFunction.ps1
CreateIISWebsiteFunction.ps1
function CreateIISWebsite ($iisAppPoolName, $iisAppName, $WebPath, $Password, $UserName, $MyVirtualDirectory, $PublicURL, $WebsitePort) { #Variables Import-Module WebAdministration $iisAppPoolName = "MyAppPool" $iisAppName = "MyWebsite" $WebPath = "c:\inetpub\website" $Password = "MyPass" $UserName = "MyUser"...
PowerShellCorpus/Github/prbreezy_PowerShell/Scripts/DownloadAFile.ps1
DownloadAFile.ps1
#Make sure the target folder exist $client = new-object System.Net.WebClient $client.DownloadFile("https://abcdefghi.jkl./mnopqrstuvw.xyz","C:\temp\abcdefghijklmnopqrstuvw.xyz")
PowerShellCorpus/Github/prbreezy_PowerShell/Scripts/SyncDocsToS3.ps1
SyncDocsToS3.ps1
# ------------------------------------------------------------------------ # AUTHOR: PrBreezy, # DATE: 25/11/2015 # # KEYWORDS: AWS, S3, Sync # # COMMENTS: This script copy all documents from a remote server and sync them on S3 # # http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html # # Few more ste...
PowerShellCorpus/Github/prbreezy_PowerShell/Scripts/RoboCopyThroughShare.ps1
RoboCopyThroughShare.ps1
robocopy /MIR $SharePath $LocalPath /log:"l:\Logs_$(get-date -f yyyy-MM-dd).log"
PowerShellCorpus/Github/prbreezy_PowerShell/Scripts/SyncDocsFromS3.ps1
SyncDocsFromS3.ps1
# ------------------------------------------------------------------------ # AUTHOR: PrBreezy, # DATE: 25/11/2015 # # KEYWORDS: AWS, S3, Sync # # COMMENTS: This script copy all documents from a remote server and sync them on S3 # # http://docs.aws.amazon.com/cli/latest/reference/s3/sync.html # # Few more ste...
PowerShellCorpus/Github/prbreezy_PowerShell/Scripts/CreateIISWebsite.ps1
CreateIISWebsite.ps1
#Parameters param([String]$PublicURL, [int]$WebsitePort ) #Variables Import-Module WebAdministration $iisAppPoolName = "MyAppPool" $iisAppName = "MyWebsite" $WebPath = "c:\inetpub\website" $Password = "MyPass" $UserName = "MyUser" $MyVirtualDirectory = "MyVirtualDirectory" #Create website wit...
PowerShellCorpus/Github/samanasiri_contoas/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/samanasiri_contoas/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/samanasiri_contoas/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/samanasiri_contoas/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/samanasiri_contoas/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/samanasiri_contoas/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/samanasiri_contoas/packages/Microsoft.Web.WebJobs.Publish.1.0.2/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' $msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProjectCollection.GetLoadedProjects($project.FullName) | Select-Object -First 1 ...
PowerShellCorpus/Github/samanasiri_contoas/packages/Microsoft.Web.WebJobs.Publish.1.0.2/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) $targetsFile = [System.IO.Path]::Combine($toolsPath, 'webjobs.targets') Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' $msbuild = [Microsoft.Build.Evaluation.ProjectCollection]::GlobalProje...
PowerShellCorpus/Github/samanasiri_contoas/packages/WebGrease.1.5.2/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Visual Studio execution done via NuGet Package Manager Function VSExecution($toolsPath, $project) { $project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty) # Get the msbuild version of the project and add the import $msbuild = [Microsof...
PowerShellCorpus/Github/samanasiri_contoas/packages/WebGrease.1.5.2/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # Return a relative path with reference to root as Uri object # $rootPath - root path # $relativePath - relative path # $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine() Function GetRelativeUri($root...
PowerShellCorpus/Github/samanasiri_contoas/packages/EntityFramework.6.1.2-beta1/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 # MIIa2AYJKoZIhvcNAQcCoIIayTCCGsUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/samanasiri_contoas/packages/EntityFramework.6.1.2-beta1/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/samanasiri_contoas/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/samanasiri_contoas/packages/Newtonsoft.Json.6.0.3/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/avishekhbharati_LinkHub/linkHubUI/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/avishekhbharati_LinkHub/linkHubUI/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/avishekhbharati_LinkHub/linkHubUI/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/avishekhbharati_LinkHub/linkHubUI/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/avishekhbharati_LinkHub/linkHubUI/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/avishekhbharati_LinkHub/linkHubUI/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/avishekhbharati_LinkHub/linkHubUI/packages/EntityFramework.6.1.1/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIa4AYJKoZIhvcNAQcCoIIa0TCCGs0CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/avishekhbharati_LinkHub/linkHubUI/packages/EntityFramework.6.1.1/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/guruhp_MyRepo/Test.ps1
Test.ps1
get-date
PowerShellCorpus/Github/poshsql_poshsql/poshpath.ps1
poshpath.ps1
function PoshPath([string] $tag) { switch ($tag) { "sql" { return $psscriptroot+"\scripts\sql" } "private" { return $psscriptroot+"\scripts\private" } "public" { return $psscriptroot+"\scripts\public" } "config" { return $psscriptroot+"\config" } "temp" { return $psscriptroot+"\temp" } d...
PowerShellCorpus/Github/poshsql_poshsql/scripts/private/executesql.ps1
executesql.ps1
function ExecuteSQL ([string]$Query,[string]$DatabaseName,[string]$ServerName) { $Connection = New-Object System.Data.SQLClient.SQLConnection if ($DatabaseName.Trim() -eq '' -or $ServerName.Trim() -eq ''){ write-host 'Database Name and Server Name is a Mandatory Parameter' -ForegroundColor Red; return; ...
PowerShellCorpus/Github/poshsql_poshsql/scripts/private/DecorateServiceStatus.ps1
DecorateServiceStatus.ps1
function DecorateServiceStatus() { param( [parameter(Mandatory=$true)][AllowEmptyString()][string] $status, [parameter(Mandatory=$true)][AllowEmptyString()][string] $startmode ) if($status -eq 'Running'){ $ret = 'UP'+"("+$startmode.substring(0,1)+")" }elseif ($status -eq ''){ $ret = '-'...
PowerShellCorpus/Github/poshsql_poshsql/scripts/private/ReplaceParameters.ps1
ReplaceParameters.ps1
function ReplaceParameters() { $query = $args[0]| out-string; for($i=1;$i -lt $args.Length;$i++){ $Query = $query.Replace("@parameter$i", $args[$i]); } $query; }
PowerShellCorpus/Github/poshsql_poshsql/scripts/private/AlignData.ps1
AlignData.ps1
Function AlignData { param( [string]$data, [int]$width, [switch]$Right, [switch]$Lastcolumn ) $padspace = 0 $ww = $data.Length if ($Lastcolumn -eq $false){ #if this is not for a last column we need to reduce a width for column spacing $width--; } if ($ww -le $width){ $padspace = $width - $...
PowerShellCorpus/Github/poshsql_poshsql/scripts/private/LoadQuery.ps1
LoadQuery.ps1
function LoadQuery($tag="fixeddrives") { [xml]$queryxml = Get-Content "$(poshpath -tag config)\query.xml" $querypath = ($queryxml.queries.query | where {$_.tag -match $tag} | select path -first 1).path if ($querypath) { $querypath = $querypath.replace('$psscriptroot',"$(poshpath -tag sql)")} if ($querypath) {ge...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/serverinfo.ps1
serverinfo.ps1
function Get-PQServerinfo() { param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [string[]]$ServerName, [switch]$AsObject ) process { $computersystem = Get-WMIObject -Query "SELECT * from Win32_ComputerSystem" -ComputerName ...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/sqlloginaccount.ps1
sqlloginaccount.ps1
function Get-PQSQLLoginAccount { $Input | %{gwmi win32_service -computer $_.SErverName -property __server,name, startname, caption | select __server, name,startname| ? {$_.name -eq 'MSSQLSERVER'} }| ft }
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/clipboard.ps1
clipboard.ps1
function Get-ClipBoard { Add-Type -AssemblyName System.Windows.Forms $tb = New-Object System.Windows.Forms.TextBox $tb.Multiline = $true $tb.Paste() $tb.Text }
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/sqlservers.ps1
sqlservers.ps1
Function Get-PQSqlServers($tag="all") { [xml]$serverxml = Get-Content "$(poshpath -tag config)\servers.xml" if($tag -eq "all"){ $servers = $serverxml.servers.server }else{ $servers = $serverxml.servers.server | where {$_.tag -eq $tag} } foreach ($server in $servers){ $info = @{ 'InstanceName...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/Highlight-Object.ps1
Highlight-Object.ps1
Function Out-Highlight { # Parameter Definition {{{ Param( [Parameter(ValueFromPipeline = $true)] $InputObject, [Parameter(Position = 0)] [scriptblock]$Condition= {$false}, [ValidateNotNullOrEmpty()] [System.String]$Fcolor = 'Red', [ValidateNotNullOrEmpty()] [System.String]$Bcolor = 'Black', [String[...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/sqlservicestatus.ps1
sqlservicestatus.ps1
function Get-PQSqlServiceStatus(){ param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [string[]]$instanceName ) process { foreach ($instance in $instancename){ if ($instance -like "*\*") { $ServerName = $instance.split('\')[0] $inst=...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/backupfiles.ps1
backupfiles.ps1
function Get-PQBackupFiles([string]$ServerName,[string]$DatabaseName,[string]$stopat,[string]$tag){ $Query = LoadQuery -tag BackupFiles $Query = ReplaceParameters $Query $DatabaseName $stopat $files = ExecuteSQL -Query $Query -ServerName $ServerName -DatabaseName $DatabaseName foreach ($file in $files){ $in...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/wmispace.ps1
wmispace.ps1
function Get-PQSpace() { param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [string[]]$ServerName, [switch]$mb, [switch]$AsObject ) process { $disks = Get-WMIObject -Query "SELECT name,capacity,freespace,systemname ...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/Out-TextReport.ps1
Out-TextReport.ps1
function Out-Text { param( $path = "$(poshpath -tag temp)\outtext.txt" ) $Input | Format-Table -AutoSize | Out-File $Path -Width 99999 & $Path }
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/Out-ExcelReport.ps1
Out-ExcelReport.ps1
function Out-Excel { param( $path = "$(poshpath -tag temp)\outexcel.csv" ) $Input | Export-Csv $path -NoTypeInformation -UseCulture -Encoding UTF8 & $path }
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/Set-ClipBoard.ps1
Set-ClipBoard.ps1
function Set-ClipBoard { param( $text ) Add-Type -AssemblyName System.Windows.Forms $tb = New-Object System.Windows.Forms.TextBox $tb.Multiline = $true if ($Input -ne $null) { $Input.Reset() $tb.Text = $Input | Out-String } else { $tb.Text = $text } $tb.SelectAll() $tb.Copy() }...
PowerShellCorpus/Github/poshsql_poshsql/scripts/public/authmode.ps1
authmode.ps1
function Get-PQAuthMode(){ param( [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] [string[]]$instancename ) process { $Query = LoadQuery -tag authmode $authstatus = ExecuteSQL -Query $Query -ServerName $instancename -DatabaseName master $info...
PowerShellCorpus/Github/hasithakj_vsphere-setalarm/setAlarmEmail.ps1
setAlarmEmail.ps1
<# This script can be used to configure Email action triggers for defined vCenter alarms. Usage: setAlarmEmail.ps1 -vcenter <vcenter_fqdn> -email <email_address>,<email_address>,... -alarms <alarms_text_file> #> param( [Parameter(Mandatory=$true)] [string]$vcenter, [Parameter(...
PowerShellCorpus/Github/hasithakj_vsphere-setalarm/setAlarmSnmp.ps1
setAlarmSnmp.ps1
<# This script can be used to configure SNMP action triggers for defined vCenter alarms. Usage: setAlarmSnmp.ps1 -vcenter <vcenter_fqdn> -alarms <alarms_text_file> #> param( [Parameter(Mandatory=$true)] [string]$vcenter, [Parameter(Mandatory=$true)] [string]$alarms ) if (!(get-...
PowerShellCorpus/Github/matthewhatch_NCache/NCache.Tests.ps1
NCache.Tests.ps1
<# Added prefix so I know I'm using the version in this repo and not the one in Modules Dir Write tests to run disconnected #> Import-Module ./NCache.psm1 -Prefix 'Test' -Force $secpasswd = ConvertTo-SecureString 'PlainTextPassword' -AsPlainText -Force $Cred = New-Object -TypeName PSCredential('usernam...
PowerShellCorpus/Github/jstuparitz_FamilyBook/Code/FamilyBook/PublishScripts/Publish-WebApplicationWebsite.ps1
Publish-WebApplicationWebsite.ps1
#Requires -Version 3.0 <# .SYNOPSIS Creates and deploys a Windows Azure Web Site 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-d...
PowerShellCorpus/Github/leshkinski_randoms/DSCbits/provision.ps1
provision.ps1
function Expand-ZIPFile($file, $destination) { $shell = new-object -com shell.application $zip = $shell.NameSpace($file) foreach($item in $zip.items()) { $shell.Namespace($destination).copyhere($item) } } function installWMF5 { # Install WMF5.0 Preview and reboot # $...
PowerShellCorpus/Github/richardychua_powershell/RedisCacheIngestionRunbook.ps1
RedisCacheIngestionRunbook.ps1
<#****************************************************************************** RedisCacheIngestionRunbook.ps1 - Runbook to enumerate Azure Redis Cache metric data to OMS workspace Created by: Richard Chua Date: Marc 1, 2017 Source: https://azure.microsoft.com/en-us/documentation/articles/sql-databas...
PowerShellCorpus/Github/richardychua_powershell/NewRelic.NETAgentWrapper.ps1
NewRelic.NETAgentWrapper.ps1
<#*********************************************************************** NewRelic.NETAgentWrapper.ps1 - Checks for the installation of New Relic .NET Agent and installs if necessary USAGE: NewRelic.NETAgentWrapper.ps1 -key <40-digit-license-key> Default Installation: msiexec.exe /i C:\NewRelicAgent_xxxx...
PowerShellCorpus/Github/richardychua_powershell/NewRelicMSSQLSvrPluginInstaller.ps1
NewRelicMSSQLSvrPluginInstaller.ps1
<#*********************************************************************** NewRelicMSSQLSvrPluginInstaller.ps1 - Checks for the installation of New Relic SQL Server Plugin and installs if necessary USAGE: NewRelicMSSQLSvrPluginInstaller.ps1 -key <40-digit-license-key> Installation: msiexec /i NewRelicServ...
PowerShellCorpus/Github/richardychua_powershell/dotNetFramework4Wrapper.ps1
dotNetFramework4Wrapper.ps1
<#*********************************************************************** dotNetFramework4Wrapper.ps1 - Checks for the installation of .NET Framework 4.x then downloads & installs if needed Installation: dotNetFx40_Client_x86_x64.exe /q /norestart See: https://msdn.microsoft.com/library/ee942965(v=VS.100)....
PowerShellCorpus/Github/richardychua_powershell/NewRelicServerAgentWrapper.ps1
NewRelicServerAgentWrapper.ps1
<#*********************************************************************** NewRelicServerAgentWrapper.ps1 - Checks for the installation of New Relic Server Agent and installs if necessary USAGE: NewRelicServerAgentWrapper.ps1 -key <40-digit-license-key> Installation: msiexec /i NewRelicServerMonitor_"vers...
PowerShellCorpus/Github/richardychua_powershell/NAbleServerAgentWrapper.ps1
NAbleServerAgentWrapper.ps1
<#*********************************************************************** NAbleServerAgentWrapper.ps1 - Checks for the installation of N-able Server Agent and installs if necessary USAGE: NAbleServerAgentWrapper.ps1 -customerID <customerID> Installation: \\%installerLocation%\WindowsAgentSetup.exe /s /v"...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_1.ps1
ADI-AzureSqlIngestionRunbook_1.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_1.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 1 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/scheduleIngestion.ps1
scheduleIngestion.ps1
# Suspend the runbook if any errors, not just exceptions, are encountered $ErrorActionPreference = "Stop" #region Login to Azure account and select the subscription. #Authenticate to Azure with SPN section "Logging in to Azure..." $cred = get-automationpscredential -Name 'MS Service Desk' add-azurermaccount -cr...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_3.ps1
ADI-AzureSqlIngestionRunbook_3.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_3.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 3 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/ADI-OMSAutomationAcct.ps1
ADI-OMSAutomationAcct.ps1
set-strictmode -version Latest $Tenant = "rightpoint.com" $Authority = "https://login.windows.net/$Tenant" $ClientID = "1950a258-227b-4e31-a9cf-717495945fc2" $RedirectURI = "urn:ietf:wg:oauth:2.0:oob" $AzureMgmtURI = "https://management.azure.com" Login-AzureRMAccount $AuthContext = New-Object "Microsoft.Ide...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_2.ps1
ADI-AzureSqlIngestionRunbook_2.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_2.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 2 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/OMSAlertingBuildout2.ps1
OMSAlertingBuildout2.ps1
<#****************************************************************************** OMSAlertingBuildout2.ps1 - Build out alerts for client's OMS Workspace for AppInsights & OMS Webtest alerts Created by: Richard Chua Date: March 7, 2017 **********************************************************************...
PowerShellCorpus/Github/richardychua_powershell/ADI-AzureSqlIngestionRunbook_4.ps1
ADI-AzureSqlIngestionRunbook_4.ps1
<#****************************************************************************** ADI-AzureSQLIngestionRunbook_4.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace - subset of Adient's AzureSQL PaaS databases, pt. 4 of 7 Created by: Richard Chua Date: May 4, 2017 Source: https://azu...
PowerShellCorpus/Github/richardychua_powershell/AzureSqlIngestionRunbook.ps1
AzureSqlIngestionRunbook.ps1
<#****************************************************************************** AzureSQLIngestionRunbook.ps1 - Runbook to enumerate Azure SQL PaaS metric data to OMS workspace Created by: Richard Chua Date: February 21, 2017 Source: https://azure.microsoft.com/en-us/documentation/articles/sql-databas...
PowerShellCorpus/Github/richardychua_powershell/NewRelicNPIInstaller.ps1
NewRelicNPIInstaller.ps1
<#*********************************************************************** NewRelicNPIInstaller.ps1 - Checks for the installation of New Relic Platform Installer utility and installs if necessary USAGE: NewRelicNPIInstaller.ps1 -key <40-digit-license-key> Installation: npi config set license_key <YOUR_LIC...