full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/bostonmtc_azlab/T3/T3-Office-Demo-RB1.ps1
T3-Office-Demo-RB1.ps1
$domainName = "ned.mtc-bos.com" $azureCredentialName = "Get-AutomationPSCredential -Name 'AzureOrgIdCredential' $Location = "United States" $cred = Get-AutomationPSCredential -Name $azureCredentialName Connect-MsolService -Credential $cred $users = get-msoluser -all -DomainName $domainName $groups = get-msolg...
PowerShellCorpus/Github/bostonmtc_azlab/T3/Connect-ARMVM.ps1
Connect-ARMVM.ps1
<#PSScriptInfo .VERSION 2.01 .GUID b66368a8-dc27-481a-b4f3-dff65a6d42ee .AUTHOR Rohit Minni, AzureAutomationTeam .COMPANYNAME Microsoft .COPYRIGHT .TAGS AzureAutomation OMS VirtualMachines Utility .LICENSEURI .PROJECTURI https://github.com/azureautomation/runbooks/blob/master/Utility/ARM/Conn...
PowerShellCorpus/Github/bostonmtc_azlab/T3/Connect-AzureARMVMPS.ps1
Connect-AzureARMVMPS.ps1
<# .SYNOPSIS Sets up the connection to an Azure ARM VM .DESCRIPTION This runbook sets up a connection to an Azure ARM virtual machine. It requires the Azure virtual machine to have the Windows Remote Management service enabled. It enables WinRM and configures it on your VM after which it sets up a c...
PowerShellCorpus/Github/bostonmtc_azlab/T3/Write-HelloWorld.ps1
Write-HelloWorld.ps1
<# .SYNOPSIS Provides a simple example of a Azure Automation runbook. .DESCRIPTION This runbook provides the "Hello World" example for Azure Automation. If you are brand new to Automation in Azure, you can use this runbook to explore testing and publishing capabilities. The runbook...
PowerShellCorpus/Github/bostonmtc_azlab/T3/Invoke-PSCommandSample.ps1
Invoke-PSCommandSample.ps1
<# This PowerShell script was automatically converted to PowerShell Workflow so it can be run as a runbook. Specific changes that have been made are marked with a comment starting with “Converter:” #> <# .SYNOPSIS This runbook calls a command inside of an Azure VM .DESCRIPTION This runbook connect...
PowerShellCorpus/Github/dancaps_powercli_playground/Create-TestEnv.ps1
Create-TestEnv.ps1
############################################################################################################################################ #.SYNOPSIS # Used to create several testing VM's at one time. # #.DESCRIPTION # The Create-TestEnv function creates X number of VM's from a template. It # disconnects all ...
PowerShellCorpus/Github/dancaps_powercli_playground/Migrate_Test-VMs.ps1
Migrate_Test-VMs.ps1
#This script tests the connection of a vm before and after a migration to verify connectivity. # User variables to modify $dest_cluster = "gold-02" $src_cluster = "gold-01" # Variables $vms = Get-Cluster $src_cluster | Get-VM | Get-View # Gets the vms to be migrated. $test_failed_vms = @() # Documents the fai...
PowerShellCorpus/Github/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/conanNomad_forumla/forumla/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/ferventcoder_puppet-chocolatey-presentation/demo/resources/templates/MSI/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$ErrorActionPreference = 'Stop'; # stop on all errors [[AutomaticPackageNotesInstaller]] $packageName = '[[PackageName]]' $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $fileLocation = Join-Path $toolsDir 'NAME_OF_EMBEDDED_INSTALLER_FILE' $packageArgs = @{ packageName = $packa...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/resources/licensed/createpackages/createpackages.ps1
createpackages.ps1
$path = 'installers' # Generate packages over supported types of files $supportedTypes = @('.exe', '.msi', '.7z', '.zip', '.msu', '.msp') Get-ChildItem -Path $path | ?{ $extension = [System.IO.Path]::GetExtension($_.Name) $supportedTypes.Contains($extension) } | %{ Write-Host "$($_.FullName)" & choco ...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/shell/InstallChocolatey.ps1
InstallChocolatey.ps1
$ChocoInstallPathOld = "$env:SystemDrive\Chocolatey\bin" $ChocoInstallPath = "$env:SystemDrive\ProgramData\chocolatey\bin" $env:Path += ";$ChocoInstallPath" if (!(Test-Path $ChocoInstallPath)) { # Install chocolatey iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) } ...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/shell/NotifyGuiAppsOfEnvironmentChanges.ps1
NotifyGuiAppsOfEnvironmentChanges.ps1
Write-Host "Sometimes explorer.exe just doesn't get the message that it should update environment variables" #if (-not ("win32.nativemethods" -as [type])) { # # import sendmessagetimeout from win32 # add-type -Namespace Win32 -Name NativeMethods -MemberDefinition @" #[DllImport("user32.dll", SetLastError = tr...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/shell/InstallPuppetFromMSI.ps1
InstallPuppetFromMSI.ps1
$puppetVersion = '1.7.0' $MsiUrl = "https://downloads.puppetlabs.com/windows/puppet-agent-$puppetVersion-x86.msi" $MsiUrlx64 = "https://downloads.puppetlabs.com/windows/puppet-agent-$puppetVersion-x64.msi" $puppetVersion = '3.8.7' $MsiUrl = "https://downloads.puppetlabs.com/windows/puppet-$puppetVersion.msi" $MsiU...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/shell/PrepareWindows.ps1
PrepareWindows.ps1
function Add-PuppetMasterToHostsFile { # Centos 6.5 Write-Host 'Adding puppet (192.168.0.6) to hosts file. This is the same private IP that the centos-6.4-x64 box uses.' Add-Content $env:SystemDrive\Windows\System32\Drivers\etc\hosts "`r`n192.168.0.6 puppet" # Ubuntu 12.04 #Write-Host 'Adding puppe...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/shell/InstallNet4.ps1
InstallNet4.ps1
$NetFx4ClientUrl = 'http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe' $NetFx4FullUrl = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe' $NetFx4Url = $NetFx4FullUrl $NetFx4Path = 'c:\vagrant\r...
PowerShellCorpus/Github/ferventcoder_puppet-chocolatey-presentation/demo/shell/PreparePuppetProvisioner.ps1
PreparePuppetProvisioner.ps1
$PuppetFile = 'c:\vagrant\puppet\Puppetfile' if (Test-Path $PuppetFile) { $PuppetInstallPath = "$env:SystemDrive\Program Files\Puppet Labs\Puppet" if (!(Test-Path $PuppetInstallPath)) {$PuppetInstallPath = "$env:SystemDrive\Program Files (x86)\Puppet Labs\Puppet";} Write-Host "Ensuring environment f...
PowerShellCorpus/Github/randycoffland_PowerShell/EWS-SummaryEmailFromInbox.ps1
EWS-SummaryEmailFromInbox.ps1
#Randy Coffland #Not the best way to do this, but I was in a hurry. Better way is to search inbox for subjects instead of opening each email # import-module -name "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll" $Username = "ChangeUserName" $Password = "ChangePassword" ...
PowerShellCorpus/Github/randycoffland_PowerShell/Remove-Item-ForAllUserProfiles.ps1
Remove-Item-ForAllUserProfiles.ps1
$users = Get-ChildItem C:\Users foreach ($user in $users) { $folder = "C:\users\" + $user + "\AppData\Roaming\DocsCorp\pdfDocs compareDocs\config" Remove-Item -path $folder -Recurse -Force -ErrorAction silentlycontinue }
PowerShellCorpus/Github/randycoffland_PowerShell/EWS-SendTestEmail.ps1
EWS-SendTestEmail.ps1
#Test that Exchange can receive email via EWS import-module -name "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll" $Username = "" $Password = "" $Domain = "" $Email = "" $smtp = "" $to = "" $bcc = "" $to = "" $from = "" $subject = "" $mailCount=0 $m...
PowerShellCorpus/Github/gitspdev_powershell/SP-LegacytoClaims.ps1
SP-LegacytoClaims.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell $WebAppName = "ENTER THE WEBAPPLICATION URL" $wa = get-SPWebApplication $WebAppName $wa.UseClaimsAuthentication = $true $wa.Update() $account = "ENTER FARM ACCOUNT domain\user" $account = (New-SPClaimsPrincipal -identity $account -identitytype 1).ToEncodedString() $...
PowerShellCorpus/Github/gitspdev_powershell/Delete_Databases.ps1
Delete_Databases.ps1
# Load SSAS DLL [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.AnalysisServices") # Create SSAS Server Object $serverAS = New-Object Microsoft.AnalysisServices.Server # Connect to the SSAS Server instance (using either name\Instance or IP:Port) $serverAS.connect("SQL\MSSQL") # Displays all database ...
PowerShellCorpus/Github/gitspdev_powershell/GetList_ByID.ps1
GetList_ByID.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell Get-SPSite -Limit All | Get-SPWeb -Limit ALL | %{$_.Lists} | ?{$_.ID –eq "Enter List GUID"} | ft Title, ParentWebURL, RootFolder
PowerShellCorpus/Github/gitspdev_powershell/Cancell_All_WF_SiteCollection.ps1
Cancell_All_WF_SiteCollection.ps1
param( [string]$siteCollectionUrl = $null, #"http://hostname", [array]$workflowAssociationNames = @(), # pass $null to cancel all [bool]$verbose = $true, [array]$workflowStatesToCancel = @(2,6,7) ) #Status Value #Not Started 0 #Failed on Start 1 #In Progress 2 #Error Occurred 3 #Canceled 4 ...
PowerShellCorpus/Github/gitspdev_powershell/Cancel_Workflow.ps1
Cancel_Workflow.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell $date = Get-Date "01.05.2016 00:00:00 AM" $sourceWebURL = "" $sourceListName = "" $spSourceWeb = Get-SPWeb $sourceWebURL $spSourceList = $spSourceWeb.Lists[$sourceListName] $spSourceItems = $spSourceList.Items | where {$_['Created'] -LT $date } #Get Workflow Man...
PowerShellCorpus/Github/gitspdev_powershell/Configure_AccessRequestSettings.ps1
Configure_AccessRequestSettings.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell # Get All Web Application $webApp= Get-SPWebApplication # Get All site collections foreach ($SPsite in $webApp.Sites) { # get the collection of webs foreach($SPweb in $SPsite.AllWebs) { # if a site inherits permissions, then the Access request mail setting also wi...
PowerShellCorpus/Github/gitspdev_powershell/GetSiteCollectionAdministrator/GetSiteCollectionAdministrator.ps1
GetSiteCollectionAdministrator.ps1
#Set file location for saving information. We'll create a tab separated file. $FileLocation = "SiteCollectionOwnersReport.csv" #Load SharePoint snap-in Add-PSSnapin Microsoft.SharePoint.PowerShell #Fetches webapplications in the farm $WebApplications = Get-SPWebApplication -IncludeCentralAdministration Write-Output "...
PowerShellCorpus/Github/Hidenori0919Tanaka_ASP.NET_WebApi/ASP.NET_WebApi/packages/Microsoft.ApplicationInsights.WindowsServer.2.1.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/Hidenori0919Tanaka_ASP.NET_WebApi/ASP.NET_WebApi/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/Hidenori0919Tanaka_ASP.NET_WebApi/ASP.NET_WebApi/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/Hidenori0919Tanaka_ASP.NET_WebApi/ASP.NET_WebApi/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/trsqd_SQL/Grant-SQLAccess.ps1
Grant-SQLAccess.ps1
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs exit } $InstanceName = ...
PowerShellCorpus/Github/trsqd_SQL/Test-SQLConnection.ps1
Test-SQLConnection.ps1
Function Test-SQLCredentials { [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipeline=$False)] [string[]]$InstanceName, [Parameter(Mandatory=$true,ValueFromPipeline=$False)] [string]$SQLUserName, [Parameter(Mandatory=$true,ValueFromPipeline=$False)]...
PowerShellCorpus/Github/darkdragon61_TracNghiemLichSu/KidLearning/packages/EntityFramework.6.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/darkdragon61_TracNghiemLichSu/KidLearning/packages/EntityFramework.6.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/darkdragon61_TracNghiemLichSu/KidLearning/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/darkdragon61_TracNghiemLichSu/KidLearning/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/darkdragon61_TracNghiemLichSu/KidLearning/packages/System.Data.SQLite.EF6.1.0.103/tools/net45/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/darkdragon61_TracNghiemLichSu/KidLearning/packages/System.Data.SQLite.EF6.1.0.103/tools/net451/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/darkdragon61_TracNghiemLichSu/KidLearning/packages/System.Data.SQLite.EF6.1.0.103/tools/net46/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/darkdragon61_TracNghiemLichSu/KidLearning/packages/System.Data.SQLite.EF6.1.0.103/tools/net40/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/osterik_Zabbix-Template-MSSQL/SQLBaseName_To_Zabbix.ps1
SQLBaseName_To_Zabbix.ps1
# Скрипт для авто-обнаружения баз данных MSSQL для мониторинга в Zabbix # основан на скрипте Антона Голубкина из "Template MS SQL 2012" # https://share.zabbix.com/databases/microsoft-sql-server/template-ms-sql-2012 # Script to auto-discover MSSQL databases for Zabbix monitoring # based on Anton Golubkin script fro...
PowerShellCorpus/Github/banisadr_banisadrRepo1111172131/.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/OPS-E2E-PPE_E2E_D_Provision_2017_5_18_28_58_35/.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/CristianCanedo_Federal-Bank-Database/BankAccountPrototype/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/CristianCanedo_Federal-Bank-Database/BankAccountPrototype/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/CarlWebster_GetServiceWithAccountName/Get-ServiceWithAccountName.ps1
Get-ServiceWithAccountName.ps1
<# .SYNOPSIS Find Services using a specific account name on Servers in Microsoft Active Directory. .DESCRIPTION By default, builds a list of all computers where "Server" is in the OperatingSystem property unless the ComputerName or InputFile parameter is used. Process each server looking for Service...
PowerShellCorpus/Github/ChaseManhatton_BL_Template/bin/Release/staging/BL_Template/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 = 'AxcessFE_Deployment', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageAcc...
PowerShellCorpus/Github/ChaseManhatton_BL_Template/Scripts/InitSQLDataDrives.ps1
InitSQLDataDrives.ps1
# # InitSQLDataDrives.ps1 # Initialize-Disk 2;Start-Sleep -s 2;New-Partition -DiskNumber 2 -UseMaximumSize -DriveLetter Z;Start-Sleep -s 2;Format-Volume -DriveLetter Z -FileSystem NTFS -NewFileSystemLabel DATA -Confirm:$false Initialize-Disk 3;Start-Sleep -s 2;New-Partition -DiskNumber 3 -UseMaximumSize -DriveLet...
PowerShellCorpus/Github/ChaseManhatton_BL_Template/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 = 'AxcessFE_Deployment', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageAcc...
PowerShellCorpus/Github/ChaseManhatton_BL_Template/Scripts/InitDataDrive.ps1
InitDataDrive.ps1
# # InitDataDrive.ps1 # Initialize-Disk 2;Start-Sleep -s 2;New-Partition -DiskNumber 2 -UseMaximumSize -DriveLetter Z;Start-Sleep -s 2;Format-Volume -DriveLetter Z -FileSystem NTFS -NewFileSystemLabel DATA -Confirm:$false
PowerShellCorpus/Github/ChaseManhatton_BL_Template/Tools/TempFile.ps1
TempFile.ps1
Configuration CreateServerIDFile { param ($MachineName) Node $MachineName { File CreateFile { DestinationPath = 'C:\inetpub\wwwroot\serverid.txt' Ensure = "Present" Contents = $MachineName } Log AfterDirectoryCopy { ...
PowerShellCorpus/Github/ChaseManhatton_BL_Template/Tools/AppServerConfig.ps1
AppServerConfig.ps1
Configuration IISConfig { param ($MachineName) Node $MachineName { #Install the IIS Role WindowsFeature IIS { Ensure = “Present” Name = “Web-Server” } #Install ASP.NET 4.5 WindowsFeature ASP { Ensure = “Present” Name = “Web-Asp-Net45” } ...
PowerShellCorpus/Github/ChaseManhatton_BL_Template/Tools/BLServerRegConfig.ps1
BLServerRegConfig.ps1
Configuration BLAppRegChange { param ($MachineName) Node $MachineName { Registry RegistryDeleteTempDirs { Ensure = "Present" # You can also set Ensure to "Absent" Key = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" ValueName = "DeleteTempDirsOnExit" ValueData = "0...
PowerShellCorpus/Github/irwins_dsaMAN/Public/New-ADMUser.ps1
New-ADMUser.ps1
Function New-ADMUser{ [CmdletBinding()] param( [String]$Identity, [PSCustomObject]$Properties ) Process{ if($PSBoundParameters.ContainsKey('Identity')){ if($PSBoundParameters.ContainsKey('Properties')){ Write-Verbose "PSBoundParameter Identity & Properties...
PowerShellCorpus/Github/irwins_dsaMAN/Classes/ADMUser.ps1
ADMUser.ps1
Class ADMHelper{ [String]$Identity ADMHelper(){} [HashTable] Splat([PSObject]$objProperties){ $splat = @{} $objProperties | Get-Member -MemberType *Property | ForEach-Object{ $splat.$($_.Name) = $objProperties.$($_.Name) } return $splat } ...
PowerShellCorpus/Github/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/mwerner340_MoviesFolder/MoviesProject1/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/OPSTestPPE_E2E_NewRepo_2017_3_25_28_5_34/.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/jeffknutson_GoodGuyConsultingPublic/RealPage/working.ps1
working.ps1
try { $x = 1/2 $x } catch { "An error occured" } finally { "this is from finally" "finally is a good place to cleanup; e.g. open connections, i/o ports, etc" }
PowerShellCorpus/Github/jeffknutson_GoodGuyConsultingPublic/RealPage/Get-HotfixByYear.ps1
Get-HotfixByYear.ps1
<# .SYNOPSIS Retrieves a list of installed hotfixes from the local computer. .DESCRIPTION TODO put description text here. #> param( [int]$Year = (get-date).year, [bool]$LongView = $true, [Parameter(Mandatory=$true)] [string]$Stuff #for our example script, $Stuff does not really do any...
PowerShellCorpus/Github/jeffknutson_GoodGuyConsultingPublic/RealPage/get-weather.ps1
get-weather.ps1
$uri = "http://api.apixu.com/v1/current.json?key=8ddc97dc38ad434480d221412170703&q=dallas" $response = invoke-webrequest -Uri $uri $json = ConvertFrom-Json $response.Content $js...
PowerShellCorpus/Github/jeffknutson_GoodGuyConsultingPublic/RealPage/Get-CombinedProcessesAndServices.ps1
Get-CombinedProcessesAndServices.ps1
# script to combine disparate data types in the same result set by wrapping them in a custom object $result = @{} $result.Processes = Get-Process $result.Services = Get-Service $result
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_NewRepo_2017_4_29_23_59_11/.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/ReportsForNAV_Beta/PowerShell/CreateTestEnvironment.ps1
CreateTestEnvironment.ps1
Set-ExecutionPolicy unrestricted import-module "C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\NavModelTools.ps1" import-module "C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1" import-module sqlps $MyNAVServerName = "ForNAV"  $MySQLServerName = ".\NAVDEMO"  $MyNewC...
PowerShellCorpus/Github/ReportsForNAV_Beta/PowerShell/Split File.ps1
Split File.ps1
Set-ExecutionPolicy unrestricted import-module "C:\Program Files (x86)\Microsoft Dynamics NAV\100\RoleTailored Client\NavModelTools.ps1" import-module "C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1" Split-NAVApplicationObjectFile -Source "Q:\ForNAV\Add-On\Objects.txt" -Destination "Q:\ForN...
PowerShellCorpus/Github/miensol_powerkick/run-specs.ps1
run-specs.ps1
Import-Module Pester Invoke-Pester
PowerShellCorpus/Github/miensol_powerkick/build-nuget-package.ps1
build-nuget-package.ps1
rm -Recurse -Force .\src\logs -ErrorAction SilentlyContinue rm -Recurse -Force .\temp -ErrorAction SilentlyContinue mkdir .\temp $temp = "$(pwd)\temp" cp .\src\ $temp\tools -Recurse cp powerkick.nuspec $temp pushd $temp nuget pack cp *.nupkg ..\ popd rm -Recurse -Force .\temp
PowerShellCorpus/Github/miensol_powerkick/src/powerkick.ps1
powerkick.ps1
#requires -version 2 [CmdLetBinding()] param( [Parameter(Position=0, Mandatory=0)] [string]$Environment = 'Local', [Parameter(Position=1, Mandatory=0)] [string[]]$Roles = @('All'), [Parameter(Position=2, Mandatory=0)] [switch]$WhatIf = $false, [Parameter(Position=3, Mandatory=0)] [switch]$EnableTran...
PowerShellCorpus/Github/miensol_powerkick/src/plan.ps1
plan.ps1
Role Replicator { param($Settings) $source = 'build\Replicator' $binPath = ("{0}\Replicator.exe" -f $Settings.ReplicatorPath) Remove-ServiceOnTarget -BinPath $binPath Copy-DirectoryContent $source -Destination $Settings.ReplicatorPath -ClearDestination New-ServiceOnTarget $binPath -StartA...
PowerShellCorpus/Github/miensol_powerkick/src/settings/Local-ServerMap.ps1
Local-ServerMap.ps1
$serverMap = @{ 'Replicator' = @('piotr-win7-wm'); 'Publisher' = @('piotr-win7-wm'); 'WebApp' = @('piotr-win7-wm'); }
PowerShellCorpus/Github/miensol_powerkick/src/settings/Local.ps1
Local.ps1
$settings = @{ ReplicatorPath = "c:\temp\replicator\"; PublisherPath = "c:\temp\publisher"; WebAppPath = "c:\apps\webapp"; };
PowerShellCorpus/Github/miensol_powerkick/specs/powerkick-installers.Tests.ps1
powerkick-installers.Tests.ps1
Get-ChildItem **\spec-helpers.ps1 | ForEach { . $_.FullName } Reload-PowerkickModule 'powerkick-installers' Describe 'Require specify .net version' { It 'should throw framework is not avialable' { try { Assert-NetFramework -Version 5 "should throw exception already".should.be("") }catch { ...
PowerShellCorpus/Github/miensol_powerkick/specs/powerkick-files.Tests.ps1
powerkick-files.Tests.ps1
Get-ChildItem **\spec-helpers.ps1 | ForEach { . $_.FullName } Reload-PowerkickModule powerkick-files Describe "mapping local path to remote server" { It "should properly map absolute path" { $mappedPath = Convert-PathToPhysical "c:\Windows" "remote-machine" $mappedPath.should.be("\\remote-machine\c$\Wi...
PowerShellCorpus/Github/miensol_powerkick/specs/spec-helpers.ps1
spec-helpers.ps1
$src = (split-path -parent (Split-Path -Parent $MyInvocation.MyCommand.Path)) + "\src\powerkick" function Reload-PowerkickModule([string]$moduleName) { Import-Module "$src\$($moduleName).psm1" -Force }
PowerShellCorpus/Github/miensol_powerkick/specs/powerkick-helpers.Tests.ps1
powerkick-helpers.Tests.ps1
Get-ChildItem **\spec-helpers.ps1 | ForEach { . $_.FullName } Reload-PowerkickModule powerkick-helpers Describe 'tests for local server' { It 'be true for localhost' { (Test-IsLocal localhost).should.be($true) } It 'be true for local machine name' { (Test-IsLocal $Env:COMPUTERNAME).should.be($...
PowerShellCorpus/Github/miensol_powerkick/specs/powerkick-log.Tests.ps1
powerkick-log.Tests.ps1
Get-ChildItem **\spec-helpers.ps1 | ForEach { . $_.FullName } function ReloadModule { Reload-PowerkickModule "powerkick-log" } Describe "getting log file" { It "by default it should return file in current directory" { ReloadModule (Get-LogFile).should.be("$(pwd)\log.txt") } It "shoul...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/profile.ps1
profile.ps1
# this is an example profile file that can be put into some of below #Current User, Current Host - console # $Home\[My ]Documents\WindowsPowerShell\Profile.ps1 #Current User, All Hosts # $Home\[My ]Documents\Profile.ps1 #All Users, Current Host - console # $PsHome\Microsoft.PowerShell_profile.ps1 #Al...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/install-episerver/server-install.ps1
server-install.ps1
[CmdletBinding()] param() ### This script uses modules from powershell-webdevelopertools repository ### # On default errors wont stop execution, we want to break execution on error $ErrorActionPreference = "Stop" ### Load tools and config ### Import-Module ..\solita-servertools.psm1 $configPath = gci *instal...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/install/workstation-install.ps1
workstation-install.ps1
# powershell.exe -executionpolicy unrestricted -command .\workstation-install.ps1 # Set-ExecutionPolicy unrestricted -force iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) #windows features # List all windowsfeatures with Get-WindowsOptionalFeature -Online $features = @( "...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/install/workstation-install-windows7-registry.ps1
workstation-install-windows7-registry.ps1
# windows7 registry options # Explorer options reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v Hidden /t REG_DWORD /d 0 /f # Start menu options reg add HKCU\Software\Microsof...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/scripts/solita_example_server_install.ps1
solita_example_server_install.ps1
[CmdletBinding()] param() ### This is an example how to setup new server with default software and configuration ### # On default errors wont stop execution, we want to break execution on error $ErrorActionPreference = "Stop" ### Load tools and config ### Import-Module .\..\solita-servertools.psm1 $configPat...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/scripts/solita_list_sites.ps1
solita_list_sites.ps1
[CmdletBinding(SupportsShouldProcess=$True)] param ( [Parameter(Mandatory=$false)] [string]$BindingRegExp ) # Import iis modules Import-Module Webadministration # define regexp for iis looping $protocolRegExp = 'http|https' $destinationFile = "$PSScriptRoot\sites.html" # get the sites that match o...
PowerShellCorpus/Github/solita_powershell-webdevelopertools/scripts/solita_example_site_creation.ps1
solita_example_site_creation.ps1
$ErrorActionPreference = "Stop" import-module .\..\solita-webdevelopertools.psm1 ################# # SANITY CHECKS # ################# Test-IsElevated Test-EverythingIsInstalled $siteName = "ExampleSite" $pool = "TheTestPool" $path = "C:\Temp\TestWebSite" $bindSiteName = $false $Bindings = "test1.solita....
PowerShellCorpus/Github/billhay_yacli/CommandLine/_CreateNewNuGetPackage/Config.ps1
Config.ps1
#========================================================== # Edit the variable values below to configure how your .nupkg file is packed (i.e. created) and pushed (i.e. uploaded) to the NuGet gallery. # # If you have modified this script: # - if you uninstall the "Create New NuGet Package From Project After Each Bu...