full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-RCPS.ps1 | awsTransform-RCPS.ps1 | #ReataurantContentProviderService
Param([string]$environmentName, [string]$awsRegion)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
#$SQLServerURL = (ELBDNSName $environmentName SQL).DN... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-CampaignService.ps1 | awsTransform-CampaignService.ps1 | #The CampaignService transform file
Param([string]$environmentName, [string]$awsRegion)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
#$SQLServerURL = (ELBDNSName $environmentName SQL).... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-LBSchedulingService.ps1 | awsTransform-LBSchedulingService.ps1 | # LBScheduling
Param([string]$environmentName, [string]$awsRegion)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\services\LBScheduling"
#$SQLServerURL = (ELBDNSName $environmentName SQL).DNSName
$SQL... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-ThePlatform.ps1 | awsTransform-ThePlatform.ps1 | #The Platform transform file
Param([string]$environmentName, [string]$awsRegion, [string]$useCustomDNS)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
$cfURL = GetConnectionEndPoint -use... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-BDA.ps1 | awsTransform-BDA.ps1 | #The BDA transform file
Param([string]$environmentName, [string]$awsRegion, [string]$useCustomDNS, [string]$bucketName)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
$bdaURL = GetConnec... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-MessagingService.ps1 | awsTransform-MessagingService.ps1 | # MessagingService
Param([string]$environmentName, [string]$awsRegion, [string]$versionNumber)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\services\Staging"
$messagingServiceURL = (ELBDNSName $envir... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-Dynamaster.ps1 | awsTransform-Dynamaster.ps1 | #The Dynamaster transform file
Param([string]$environmentName, [string]$awsRegion)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "D:\sites\Dynamaster"
$DynamasterURL = (ELBDNSName $environmentName Dynamas... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-Aggregator.ps1 | awsTransform-Aggregator.ps1 | # Aggregator transform file
Param([string]$environmentName, [string]$awsRegion, [string]$useCustomDNS)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
$RestaurantContentProviderServiceURL... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-LBCalendar.ps1 | awsTransform-LBCalendar.ps1 | #The LBCalendar transform file
Param([string]$environmentName, [string]$awsRegion)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
#$SQLServerURL = (ELBDNSName $environmentName SQL).DNSNa... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/Transforms/MTP/awsTransform-ConsoleAP2013.ps1 | awsTransform-ConsoleAP2013.ps1 | #The ConsoleAP transform file
Param([string]$environmentName, [string]$awsRegion)
$error.clear()
#Set-DefaultAWSRegion $awsRegion
$global:StoredAWSRegion = $awsRegion
import-module "C:\tools\bookatable.psm1"
$applicationPath = "d:\sites\Staging"
#$SQLServerURL = (ELBDNSName $environmentName SQL).DNSNam... |
PowerShellCorpus/Github/ggoinden_gibster/infrastructure-as-code/Powershell/BatAccount/AWS-ScheduledShutdown.ps1 | AWS-ScheduledShutdown.ps1 | Param([string]$Action)
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\Net35\AWSSDK.dll"
$Region = 'eu-west-1'
$AccessKey = 'AKIAIACYI5ZFEKRE4EUQ'
$SecretKey = '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'
$Filter = New-Object Amazon.EC2.Model.Filter
$Filter.Name = 'tag:ScheduledShutdown'
$Filter.... |
PowerShellCorpus/Github/kedonov_VPRepoTesting_eu-ES/.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 ur... |
PowerShellCorpus/Github/gibletto_Powershell/rewritemaps.ps1 | rewritemaps.ps1 | Param([string]$FileName)
[System.Xml.XmlDocument]$file = new-object System.Xml.XmlDocument
$path = Join-Path $pwd $FileName
$file.load($path)
$keys = $file.SelectNodes("//rewriteMaps//rewriteMap") | Group-Object key
foreach ($key in $keys){
foreach ($group in $key.Group) {
Write-Host "$($group.Name... |
PowerShellCorpus/Github/2Dman_Spark/SparkInstall.ps1 | SparkInstall.ps1 | # Script name: SparkInstall.ps1
# Version: v1.03.121515
# Created on: 15/12/2015
# Author: Riebbels Willem
# Purpose: Install Spark
#
# On Github: https://github.com/2Dman/spark/
# On Oper-Init.eu http://blog.oper-init.eu
# Recent History:
# 19/11/15 => First edit
# 0... |
PowerShellCorpus/Github/joxz_PSEXOS/PSEXOS/functions/Send-EXOSrpc.ps1 | Send-EXOSrpc.ps1 | function Send-EXOSrpc {
<#
.SYNOPSIS
Sends commands to an ExtremeXOS switch with JSONRPC enabled.
.DESCRIPTION
Sends commands to an ExtremeXOS switch with JSONRPC enabled.
When used with credentials this function returns 2 objects, WebResponseObject and Sessionvariable.
The Sessionvaria... |
PowerShellCorpus/Github/joxz_PSEXOS/PSEXOS/functions/Get-VlanPortInfo.ps1 | Get-VlanPortInfo.ps1 | function Get-VlanPortInfo {
<#
.SYNOPSIS
Displays VLANs assigned to a list of ports.
.DESCRIPTION
Displays VLANs assigned to a list of ports.
You can see VLAN IDs, VLAN Names, tagged or untagged and VR.
Output is a PSCustomObject and may be formatted or processed like any other PowerShe... |
PowerShellCorpus/Github/joxz_PSEXOS/PSEXOS/functions/Invoke-EXOScommand.ps1 | Invoke-EXOScommand.ps1 | function Invoke-EXOScommand {
<#
.SYNOPSIS
Invokes command on an EXOS switch.
.DESCRIPTION
Invokes command on an EXOS switch.
When used this function returns the CLIoutput as formatted text and when used with '-json' the JSON response as PowerShell Object.
.PARAMETER ipaddress
Spec... |
PowerShellCorpus/Github/joxz_PSEXOS/PSEXOS/functions/Get-Vlans.ps1 | Get-Vlans.ps1 | function Get-Vlans {
<#
.SYNOPSIS
Displays VLANs and VLAN properties.
.DESCRIPTION
Displays VLANs and VLAN properties.
You can see VLAN IDs, VLAN Names, tagged or untagged, IP addresses and VR.
Output is a PSCustomObject and may be formatted or processed like any other PowerShell object... |
PowerShellCorpus/Github/OPS-E2E-Prod_E2E_P_NewRepo_2017_3_31_17_4_48/.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/OPSTest_E2E_Provision_1488056744822/.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/artigat1_Demo-AngularModules/PublishScripts/Publish-WebApplicationWebsite.ps1 | Publish-WebApplicationWebsite.ps1 | #Requires -Version 3.0
<#
.SYNOPSIS
Creates and deploys a Microsoft 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... |
PowerShellCorpus/Github/ComFreek_chocolatey-licecap/licecap/tools/chocolateyInstall.ps1 | chocolateyInstall.ps1 | $packageName = 'LICEcap'
$installerType = 'EXE'
$url = 'http://www.cockos.com/licecap/licecap125-install.exe'
$silentArgs = '/S'
$validExitCodes = @(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes |
PowerShellCorpus/Github/ComFreek_chocolatey-licecap/licecap/tools/chocolateyUninstall.ps1 | chocolateyUninstall.ps1 | function Get-LicecapPath () {
$path = ""
# Check for 64-bit Windows (this env variable only exists in 64-bit)
if (Test-Path "Env:\ProgramFiles(x86)") {
$path = "${env:ProgramFiles(x86)}\LICEcap\Uninstall.exe"
}
else {
$path = "$env:programfiles\LICEcap\Uninstall.exe"
}
if (Test-Path $path -PathTy... |
PowerShellCorpus/Github/absmart_azure-templates/Deploy-ArmTemplate.ps1 | Deploy-ArmTemplate.ps1 | param(
[Parameter(ParameterSetName='TemplateFile')]
$TemplateFile,
[Parameter(ParameterSetName='TemplateFile')]
$ParameterFile,
[Parameter(ParameterSetName='TemplateUri')]
$TemplateUri,
$ResourceGroup = (Read-Host "Enter the ResourceGroup: "),
$Location = (Read-Host "Enter th... |
PowerShellCorpus/Github/absmart_azure-templates/site-recovery/Scripts/Deploy-Network.ps1 | Deploy-Network.ps1 | #
# DeployNetwork.ps1
#
|
PowerShellCorpus/Github/absmart_azure-templates/site-recovery/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 = 'azuredeploy',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerNa... |
PowerShellCorpus/Github/absmart_azure-templates/site-recovery/Scripts/Deploy-SiteRecovery-Template.ps1 | Deploy-SiteRecovery-Template.ps1 | param(
$AzureRmProfilePath
)
$NetworkRgName = "Network-01-EastUS2"
$VmRgName = "SiteRecovery-01-EastUS2"
$Location = "eastus2"
Get-AzureRmContext -ErrorAction Stop
try{ Get-AzureRMResourceGroup -Name $ResourceGroup -Location $Location }
catch{ New-AzureRMResourceGroup -Name $ResourceGroup -Location $L... |
PowerShellCorpus/Github/daveRendon_Azure/migrate-vhd-to-azure-template.ps1 | migrate-vhd-to-azure-template.ps1 | #************************
# MIGRATE VHD TO AZURE
# Author:@DaveRndn
#***********************
#**********************
# Variables
#*********************
$Subscription = "[Your Subscription]"
$SubscriptionId = "[Your SubscriptionId xxxx-xxxx-xxx]"
$StorageAccountName = '[yourstorageaccountname]'
$Location = '... |
PowerShellCorpus/Github/cAS666666_Roulettified/PublishScripts/Publish-WebApplicationVM.ps1 | Publish-WebApplicationVM.ps1 | #Requires -Version 3.0
<#
.SYNOPSIS
Creates and deploys a Microsoft Azure Virtual Machine for a Visual Studio web project.
For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394472
.EXAMPLE
PS C:\> .\Publish-WebApplicationVM.ps1 `
-Configuration .\Configurations\WebApplication1-VM... |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1488017143690/.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/MercatoInfrastructure_IIS-SSL-Setup/IIS-SSL-Setup/IIS-SSL-Setup/IIS-SSL-Setup.ps1 | IIS-SSL-Setup.ps1 | #Check IIS is installed
$iisInstall = get-wmiobject -query "select * from Win32_Service where name='W3svc'"
If ($iisInstall -eq 0){
Write-Host "Installing IIS"
import-module servermanager
Add-WindowsFeature Web-Server, Web-WebServer, Web-Asp-Net45, Web-Mgmt-Tools, Web-Mgmt-Console
}
Else{
Write-Host "IIS a... |
PowerShellCorpus/Github/MorNando_PowershellScripts/StartJump.ps1 | StartJump.ps1 | import-module *azure*
Login-AzureRmAccount
Select-AzureRmSubscription -SubscriptionName "Microsoft Partner Network"
Start-AzureRmVM -Name jump -ResourceGroupName LABDEVELOPER
start-sleep -Seconds 20
mstsc /v:"jump.ukwest.cloudapp.azure.com" |
PowerShellCorpus/Github/tomascribb10_PowerShell_ES/Get-Cotizacion.ps1 | Get-Cotizacion.ps1 | #Definición de variables
[DateTime]$fecha = get-date
$EUR = "1"
$USD = "1"
$filtro =([Uri]::EscapeDataString(($fecha | Get-Date -Format d)))
#Definición de URI Uniform Resource Identifier
$URI = [Uri]"http://www.bna.com.ar/Cotizador/HistoricoPrincipales?id=billetes&fecha={0}&filtroEuro={1}&filtroDolar={2}" -f ... |
PowerShellCorpus/Github/acazorso7_twitendencias-windows-service/HBase-Query/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$srcFiles = Join-Path $installPath "lib\net40\*.dll"
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$destDirec... |
PowerShellCorpus/Github/acazorso7_twitendencias-windows-service/HBase-Query/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
if ($project.Type -eq 'Web Site') {
Import-Module (Join-Path $toolsPath VS.psd1)
$projectRoot = Get-ProjectRoot $project
if (!$projectRoot) {
return;
}
$binDirectory = Join-Path $projectRoot "bin"
$srcDirectory = Join-Path $... |
PowerShellCorpus/Github/acazorso7_twitendencias-windows-service/HBase-Query/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/Apress_pro-sql-server-admin/Chapter 1/978-1-4842-0711-6_Listing1-2.ps1 | 978-1-4842-0711-6_Listing1-2.ps1 | # Populate the drive letter you want to check
$drive = "f:"
# Initialize outputarray
$outputarray = new-object PSObject
$outputarray | add-member NoteProperty Drive $drive
# Initialize output
$output = (fsutil fsinfo ntfsinfo $drive)
# Split each line of fsutil into a seperate array val... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 1/978-1-4842-0711-6_Listing1-4.ps1 | 978-1-4842-0711-6_Listing1-4.ps1 | Set-ItemProperty -path HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl -name Win32PrioritySeparation -Type DWORD -Value 24 |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 1/978-1-4842-0711-6_Listing1-3.ps1 | 978-1-4842-0711-6_Listing1-3.ps1 | powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/978-1-4842-0711-6_CH22/978-1-4842-0711-6_Listing_22-11.ps1 | 978-1-4842-0711-6_Listing_22-11.ps1 | sl "C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Policies\DatabaseEngine"
Invoke-PolicyEvaluation -Policy " C:\Program Files (x86)\Microsoft SQL Server
\120\Tools\Policies\DatabaseEngine\DatabaseNameConvention.xml DatabaseNameConvention.xml" -TargetServer" .\MASTERSERVER"
|
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 4/978-1-4842-0711-6_Listing_4-10.ps1 | 978-1-4842-0711-6_Listing_4-10.ps1 | New-NetFirewallRule -DisplayName "SQL_Server_TCP_IN " -Direction Inbound -Profile Domain -Action Allow -Protocol TCP -RemotePort 1433,5022,49152-65535 |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 4/978-1-4842-0711-6_Listing_4-8.ps1 | 978-1-4842-0711-6_Listing_4-8.ps1 | # Define initial variables
$InstanceName = "PROSQLADMINCORE"
$TraceFlag = "1117"
# Configure full service name, to be inserted into registry path
$Instance = "MSSQL12.$InstanceName"
#Create full registry path
$RegistryPath = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.$InstanceName\MSSQLServe... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 4/978-1-4842-0711-6_Listing_4-9.ps1 | 978-1-4842-0711-6_Listing_4-9.ps1 | # Initialize variables
$Instance = "PROSQLADMIN"
$Port = "1433"
# Load SMO Wmi.ManagedComputer assembly
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | out-null
# Create a new smo object
$m = New-Object ('Microsoft.SqlServer.Management.Smo.Wmi.ManagedCompu... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 4/978-1-4842-0711-6_Listing_4-13.ps1 | 978-1-4842-0711-6_Listing_4-13.ps1 | ./SETUP.EXE /ACTION="Uninstall" /FEATURES=SQLEngine,Replication,Conn /INSTANCENAME="PROSQLADMINREM" /qs |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 8/978-1-4842-0711-6_Listing_8-5.ps1 | 978-1-4842-0711-6_Listing_8-5.ps1 | .\setup.exe /ACTION=rebuilddatabase /INSTANCENAME=PROSQLADMIN /SQLSYSADMINACCOUNTS=SQLAdministrator |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 8/978-1-4842-0711-6_Listing_8-7.ps1 | 978-1-4842-0711-6_Listing_8-7.ps1 | .\setup.exe /ACTION=repair /INSTANCENAME=PROSQLADMIN /q |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 13/978-1-4842-0711-6_Listing_13-2.ps1 | 978-1-4842-0711-6_Listing_13-2.ps1 | Enable-SqlAlwaysOn -Path SQLSERVER:\SQL\CLUSTERNODE1\PRIMARYREPLICA |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 13/978-1-4842-0711-6_Listing_13-10.ps1 | 978-1-4842-0711-6_Listing_13-10.ps1 | Get-ClusterResource "App1_App1Listen" | Set-ClusterParameter RegisterAllProvidersIP 0
Get-ClusterResource "App1_App1Listen" | Set-ClusterParameter HostRecordTTL 300
|
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-7.ps1 | 978-1-4842-0711-6_Listing_12-7.ps1 | Move-ClusterGroup -Name "SQL Server (PROSQLADMINCLUST)" -Node ClusterNode1 |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-5.ps1 | 978-1-4842-0711-6_Listing_12-5.ps1 | .\SETUP.EXE /IACCEPTSQLSERVERLICENSETERMS /ACTION="InstallFailoverCluster" /FEATURES=SQL,Conn,ADV_SSMS,DREPLAY_CTLR,DREPLAY_CLT /INSTANCENAME="PROSQLADMINCLUST" /SQLSVCACCOUNT="PROSQLADMIN\ClusterAdmin" /SQLSVCPASSWORD="Pa$$w0rd" /AGTSVCACCOUNT="PROSQLADMIN\ClusterAdmin" /AGTSVCPASSWORD="Pa$$w0rd" /SQLSYSADMINACCOUNTS=... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-2.ps1 | 978-1-4842-0711-6_Listing_12-2.ps1 | #Run the validation tests
Test-Cluster -Node Clusternode1.prosqladmin.com,Clusternode2.prosqladmin.com
#Create the cluster
New-Cluster -Node ClusterNode1.prosqladmin.com,ClusterNode2.prosqladmin.com -StaticAddress 192.168.0.20 -Name PROSQLADMIN-C
|
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-6.ps1 | 978-1-4842-0711-6_Listing_12-6.ps1 | .\setup.exe /IACCEPTSQLSERVERLICENSETERMS /ACTION="AddNode" /INSTANCENAME="PROSQLADMINCLUST" /SQLSVCACCOUNT="PROSQLADMIN\ClusterAdmin" /SQLSVCPASSWORD="Pa$$w0rd" /AGTSVCACCOUNT="PROSQLADMIN\ClusterAdmin" /AGTSVCPASSWORD="Pa$$w0rd" /FAILOVERCLUSTERIPADDRESSES="IPv4;192.168.0.23;Cluster Network 2;255.255.255.0" /CONFIRMI... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-3.ps1 | 978-1-4842-0711-6_Listing_12-3.ps1 | Set-ClusterQuorum -Cluster PROSQLADMIN-C -NodeAndDiskMajority "Cluster Disk 5" |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-9.ps1 | 978-1-4842-0711-6_Listing_12-9.ps1 | .\setup.exe /ACTION="RemoveNode" /INSTANCENAME="PROSQLADMINCLUST" /CONFIRMIPDEPENDENCYCHANGE=0 /qs |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-1.ps1 | 978-1-4842-0711-6_Listing_12-1.ps1 | Install-WindowsFeature –name NET-Framework-Core
Install-WindowsFeature -Name Failover-Clustering –IncludeManagementTools
|
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-4.ps1 | 978-1-4842-0711-6_Listing_12-4.ps1 | #Create the Role
Add-ClusterServerRole -Name PROSQLMSDTC-C -Storage "Cluster Disk 4" -StaticAddress 192.168.0.21
#Create the DTC Resource
Add-ClusterResource -Name MSDTC-PROSQLMSDTC-C -ResourceType "Distributed Transaction Coordinator" -Group PROSQLMSDTC-C
#Create the dependencies
Add-ClusterResourceDepe... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 12/978-1-4842-0711-6_Listing_12-8.ps1 | 978-1-4842-0711-6_Listing_12-8.ps1 | Get-ClusterResource "SQL Network Name (PROSQLSRV-C)" | Set-ClusterOwnerNode -Owners clusternode1 |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/978-1-4842-0711-6_CH21/978-1-4842-0711-6_Listing_21-1.ps1 | 978-1-4842-0711-6_Listing_21-1.ps1 | Set-ExecutionPolicy Unrestricted
import-module SQLPS
import-module servermanager
Add-WindowsFeature -Name "RSAT-AD-PowerShell" -IncludeAllSubFeature
New-ADUser SQLUser -AccountPassword (ConvertTo-SecureString -AsPlainText "Pa$$w0rd" -Force) -Server "PROSQLADMIN.COM"
Enable-ADAccount -Identity SQLUser
Ne... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-4.ps1 | 978-1-4842-0711-6_Listing_3-4.ps1 | Get-service -displayname *PROSQLADMINCORE* |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-6.ps1 | 978-1-4842-0711-6_Listing_3-6.ps1 | .\SETUP.EXE / IACCEPTSQLSERVERLICENSETERMS /ACTION="Install" /FEATURES=SQLEngine,Replication,Conn /INSTANCENAME="PROSQLADMINCU2" /SQLSVCACCOUNT="MyDomain\SQLServiceAccount1" /SQLSVCPASSWORD="Pa$$w0rd" /AGTSVCACCOUNT="MyDomain\SQLServiceAccount1" /AGTSVCPASSWORD="Pa$$w0rd" /SQLSYSADMINACCOUNTS="MyDomain\SQLDBA" /UPDATEE... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-12.ps1 | 978-1-4842-0711-6_Listing_3-12.ps1 | param(
[string] $InstanceName,
[string] $SQLServiceAccount,
[string] $SQLServiceAccountPassword,
[string] $AgentServiceAccount,
[string] $AgentServiceAccountPassword
)
D:\SETUP.EXE /INSTANCENAME=$InstanceName /SQLSVCACCOUNT=$SQLServiceAccount /SQLSVCPASSWORD=$SQLServiceAccountPassword /AGTSVCACCOUNT=$AgentServ... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-2.ps1 | 978-1-4842-0711-6_Listing_3-2.ps1 | Install-WindowsFeature Net-Framework-Core -source \\192.168.183.1\netsp35sp1\ |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-7.ps1 | 978-1-4842-0711-6_Listing_3-7.ps1 | .\sqlcmd.exe -S ".\PROSQLADMINCORE" -Q "SELECT @@SERVERNAME, @@VERSION"
.\sqlcmd.exe -S ".\PROSQLADMINCU2" -Q "SELECT @@SERVERNAME, @@VERSION"
|
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-9.ps1 | 978-1-4842-0711-6_Listing_3-9.ps1 | .\setup.exe /CONFIGURATIONFILE="c:\SQL2014\Configuration1.ini" |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-11.ps1 | 978-1-4842-0711-6_Listing_3-11.ps1 | .\SETUP.EXE /INSTANCENAME="PROSQLADMINCONF2" /SQLSVCACCOUNT="MyDomain\SQLServiceAccount1" /SQLSVCPASSWORD="Pa$$w0rd" /AGTSVCACCOUNT="MyDomain\SQLServiceAccount1" /AGTSVCPASSWORD="Pa$$w0rd" /CONFIGURATIONFILE="C:\SQL2014\Configuration2.ini" |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-13.ps1 | 978-1-4842-0711-6_Listing_3-13.ps1 | ./SQLAutoInstall.ps1 -InstanceName 'PROSQLADMIN1' -SQLServiceAccount 'MyDomain\SQLServiceAccount1' -SQLServiceAccountPassword 'Pa$$w0rd' -AgentServiceAccount 'MyDomain\SQLServiceAccount1' -AgentServiceAccountPassword 'Pa$$w0rd' |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-14.ps1 | 978-1-4842-0711-6_Listing_3-14.ps1 | param(
[string] $InstanceName,
[string] $SQLServiceAccount,
[string] $SQLServiceAccountPassword,
[string] $AgentServiceAccount,
[string] $AgentServiceAccountPassword
)
# Initialize ConnectionString variable
$ServerName = $env:computername
$ConnectionString = $ServerName + '\' + $InstanceName
#Install th... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-10.ps1 | 978-1-4842-0711-6_Listing_3-10.ps1 | ;SQL Server 2014 Configuration File
[OPTIONS]
; Accept the SQL Server License Agreement
IACCEPTSQLSERVERLICENSETERMS
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
ACTION="Install"
; Setup will display progress only, without any user interaction.
Q... |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-5.ps1 | 978-1-4842-0711-6_Listing_3-5.ps1 | sqlcmd.exe -S ".\PROSQLADMINCORE" -Q "SELECT @@SERVERNAME" |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-3.ps1 | 978-1-4842-0711-6_Listing_3-3.ps1 | .\SETUP.EXE /IACCEPTSQLSERVERLICENSETERMS /ACTION="Install" /FEATURES=SQLEngine,Replication,Conn /INSTANCENAME="PROSQLADMINCORE2" /SQLSYSADMINACCOUNTS="Administrator" /SQLCOLLATION="Latin1_General_CI_AS" /qs |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-1.ps1 | 978-1-4842-0711-6_Listing_3-1.ps1 | Get-windowsfeature |
PowerShellCorpus/Github/Apress_pro-sql-server-admin/Chapter 3/978-1-4842-0711-6_Listing_3-15.ps1 | 978-1-4842-0711-6_Listing_3-15.ps1 | None |
PowerShellCorpus/Github/OPSTest_E2E_Provision_1485234340569/.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/kareemrady_backup_soln/restorefromdatastore.ps1 | restorefromdatastore.ps1 | $currentPath = split-path -parent $MyInvocation.MyCommand.Definition
Import-Module "$currentPath\hostconnect.psm1"
Import-Module "$currentPath\restorevm.psm1"
ConnectHost
$datastore = Get-Datastore
$datastore1 = $datastore | ? {$_.Name -match "001"}
$datastore2 = $datastore | ? {$_.Name -match "002"}
$folders = ... |
PowerShellCorpus/Github/kareemrady_backup_soln/snapshot.ps1 | snapshot.ps1 | $currentPath = split-path -parent $MyInvocation.MyCommand.Definition
Import-Module "$currentPath\eventlogchecker.psm1"
Import-Module "$currentPath\hostconnect.psm1"
ConnectHost
$vms = Get-VM
$rawDate = get-date
$date = $rawDate.ToString("yy-MM-dd-HH:mm")
$date1= $rawDate.AddDays(-1).ToString("yy-MM-dd-HH:mm")
$... |
PowerShellCorpus/Github/kareemrady_backup_soln/copytodatastore.ps1 | copytodatastore.ps1 | $currentPath = split-path -parent $MyInvocation.MyCommand.Definition
Import-Module "$currentPath\eventlogchecker.psm1"
Import-Module "$currentPath\hostconnect.psm1"
ConnectHost
$vms = Get-VM
$datastore = Get-Datastore
$datastore1 = $datastore | ? {$_.Name -match "001"}
$datastore2 = $datastore | ? {$_.Name -matc... |
PowerShellCorpus/Github/kareemrady_backup_soln/restorehostconfig.ps1 | restorehostconfig.ps1 | $currentPath = split-path -parent $MyInvocation.MyCommand.Definition
Import-Module "$currentPath\eventlogchecker.psm1"
Import-Module "$currentPath\hostconnect.psm1"
ConnectHost
$datastore = Get-Datastore
$datastore1 = $datastore | ? {$_.Name -match "001"}
$datastore2 = $datastore | ? {$_.Name -match "002"}
$loc... |
PowerShellCorpus/Github/kareemrady_backup_soln/backuphostconfig.ps1 | backuphostconfig.ps1 | $currentPath = split-path -parent $MyInvocation.MyCommand.Definition
Import-Module "$currentPath\eventlogchecker.psm1"
Import-Module "$currentPath\hostconnect.psm1"
ConnectHost
$datastore = Get-Datastore
$datastore1 = $datastore | ? {$_.Name -match "001"}
$datastore2 = $datastore | ? {$_.Name -match "002"}
$loc... |
PowerShellCorpus/Github/HaveABeer_AzureDeployment/DomainController.ps1 | DomainController.ps1 | #
# DomainController.ps1
#
param (
$vmAdminUsername,
$vmAdminPassword,
$fsServiceName,
$tsServiceName,
$resourceLocation
)
$password = ConvertTo-SecureString $vmAdminPassword -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential("$env:USERDOMAIN\$vmAdminUsername", $pa... |
PowerShellCorpus/Github/HaveABeer_AzureDeployment/DeployFunctions.ps1 | DeployFunctions.ps1 | #
# tuServDeployFunctions.ps1
#
function Add-ADServiceAccounts
{
[CmdletBinding()]
param
(
$domain,
$serviceAccountOU,
$password
)
Write-Verbose -Verbose "Adding service accounts to Active Directory"
Write-Verbose -Verbose "---"
# build up the OU= parameter
$domainparts = $domain.Split(".")
$domainp... |
PowerShellCorpus/Github/TerryTry1_OLSource1.cs-cz/.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 ur... |
PowerShellCorpus/Github/hamdiozcan_VMfreeSpaceAlert/VMfreeSpaceAlert.ps1 | VMfreeSpaceAlert.ps1 | # VM Free Space Alert
# July 2016 Hamdi OZCAN http://ozcan.com
#
# task schedule
# C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -file C:\PowerCLI\VMfreeSpaceAlert.ps1
add-pssnapin VMware.VimAutomation.Core
Connect-VIServer vcenterHostName
$outArray = @()
$Output2 = ""
ForEach ($VM in Get-V... |
PowerShellCorpus/Github/myvmx_myvmx/Azure/CheckService.ps1 | CheckService.ps1 | ##########################################
## Must run powershell using your admin account and have permissions to the server
## Used to get service and then restart the server
##
## Author Kin Yung 18/04/2017
###########################################
## Import csv file where all the computer names are
## C... |
PowerShellCorpus/Github/myvmx_myvmx/Azure/NicsNotAttached.ps1 | NicsNotAttached.ps1 | #########################
#This script is to find all network cards which are not attached to anything
#
#V0.1
##########################
###Variables
#Store Sub ID details
$SubId = "Enter Your Sub ID"
###Script Starts
#Login to your Azure Subscription
Login-AzurRmAccount
#Select your subscription ... |
PowerShellCorpus/Github/myvmx_myvmx/Azure/FailedBackups.ps1 | FailedBackups.ps1 | ##########################################
## To list all the failed jobs in Azure Recovery Backup within a time frame
## Author : KY
## Date : 18/04/2017
##########################################
## Get all the vaults
$vaults = Get-AzureRmRecoveryServicesVault
## Loop through each of the vaults
foreach (... |
PowerShellCorpus/Github/myvmx_myvmx/Azure/AzureStorageFile.ps1 | AzureStorageFile.ps1 | ################
## To write to azure file storage
## https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-files
## Author : Kin Yung
## 23/04/2017
################
## Store the Storage Account Name and Key in Variable
$StorName = "Replace Storage Account Name"
$StorKey = "Replace Storage ... |
PowerShellCorpus/Github/myvmx_myvmx/ad/GetGroupMembers.ps1 | GetGroupMembers.ps1 | ######################################
## Get Group Membership
## Author : Kin Yung
## 18/04/2017
######################################
## Store Group Name
$groupname = "Group Name"
## Get the group and store the value
$group = get-adgroup -Filter {name -eq $groupname}
## Get the members within the group a... |
PowerShellCorpus/Github/beanxyz_Powershell/Clear-ComputersContainer.ps1 | Clear-ComputersContainer.ps1 | $a=Get-ADComputer -SearchBase "cn=computers,dc=omnicom,dc=com,dc=au" -Filter * -Properties ipv4address,operatingsystem, whencreated
foreach($b in $a){
if($b.IPv4Address -like "10.2*" -or $b.IPv4Address -like "172.16*"){
switch($b.OperatingSystem)
{
"Mac OS X"{ Move-ADObject -Identity $b.Distinguish... |
PowerShellCorpus/Github/beanxyz_Powershell/runspace study.ps1 | runspace study.ps1 | $rs=[runspacefactory]::CreateRunspace()
$rs.name="MyRunSpace"
$rs.open()
get-runspace
$ps=[powershell]::create()
$ps.runspace=$rs
$ps.addscript('C:\users\yli\documents\github\Powershell\Restart-WSUSComputers.ps1') > $null
$async=$ps.BeginInvoke()
get-runspace
Debug-Runspace Myrunspace
#example1
$Powe... |
PowerShellCorpus/Github/beanxyz_Powershell/Get-Module.ps1 | Get-Module.ps1 |
function load-ADModule{
$s= New-PSSession -ComputerName "syddc01"
Invoke-Command -Session $s {Import-Module activedirectory}
Import-PSSession -Session $s -Module activedirectory
}
load-ADModule
break
function Load-PowerCLI
{
#pls download and install module first
Add-PSSnapin VMware.VimAuto... |
PowerShellCorpus/Github/beanxyz_Powershell/CheckDotNet3.5.ps1 | CheckDotNet3.5.ps1 | $a=Get-ADComputer -Filter {operatingsystem -like "*windows*"} | select -ExpandProperty name
$a=Invoke-Command -ComputerName $a -ErrorAction SilentlyContinue -ErrorVariable err{
""| select @{name=".Net 3 Installed";expression={
$temp=Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse |
Ge... |
PowerShellCorpus/Github/beanxyz_Powershell/Get-UserProperty.ps1 | Get-UserProperty.ps1 | $a=get-aduser yli -Properties *
$col=@()
$a| gm | Where-Object {$_.definition -like "*String*" -and $_.membertype -eq "Property"} |
foreach {
if ($a.($_.name) -like "*sy*"){
#$_.name + " "+$a.($_.name)
$col+=$_.name
}
}
$a | select $col |
PowerShellCorpus/Github/beanxyz_Powershell/HtmlExample.ps1 | HtmlExample.ps1 | $style=@"
<style>
BODY{background-color:Lavender ;}
TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}
TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;b
ackground-color:thistle}
TD{border-width: 1px;padding: 0px;border-style: solid;border-color: b... |
PowerShellCorpus/Github/beanxyz_Powershell/ReportTo.ps1 | ReportTo.ps1 | $userlists=Import-Excel 'C:\users\yli\Desktop\DDB Org Chart.xlsx'
foreach($user in $userlists){
$name = $user.'Name Surname'
$manager=$user.'Reports to'
$managerSamName=get-aduser -Filter {name -like $manager} | select -ExpandProperty samaccountName
#$manager
get-aduser -filter { name... |
PowerShellCorpus/Github/beanxyz_Powershell/Get-DiskInfoGUI.ps1 | Get-DiskInfoGUI.ps1 | #ERASE ALL THIS AND PUT XAML BELOW between the @" "@
$inputXML = @"
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2... |
PowerShellCorpus/Github/beanxyz_Powershell/Set-CellColor.ps1 | Set-CellColor.ps1 | Function Set-CellColor
{ <#
.SYNOPSIS
Function that allows you to set individual cell colors in an HTML table
.DESCRIPTION
To be used inconjunction with ConvertTo-HTML this simple function allows you
to set particular colors for cells in an HTML table. You provide the criteria
... |
PowerShellCorpus/Github/beanxyz_Powershell/Remove-VSS.ps1 | Remove-VSS.ps1 | #The following script will only keep the last VSS copy in each day before today
$delsnap=@()
Get-WmiObject -ComputerName sydittest -Class win32_shadowcopy |
select deviceobject,ID,@{n='datetime';e={[management.managementDateTimeConverter]::ToDateTime($_.installdate)}},@{n='dayofyear';e={[management.managementDa... |
PowerShellCorpus/Github/beanxyz_Powershell/GetSwitchPortInfo.ps1 | GetSwitchPortInfo.ps1 | #ping 10.2.1.255
#sh ip arp vlan ....> t1
#sh mac address-table vlan 10 ....> t2
$t1=import-csv C:\temp\arptable.csv -head Protocol, IP, Age, Mac, Type, Interface
$t2=gc C:\temp\mactable.txt
$obj=$t1| foreach{
$info=$t2 | select-string -Pattern $_.mac
if($info -ne $null){
$te... |
PowerShellCorpus/Github/beanxyz_Powershell/Install-Java.ps1 | Install-Java.ps1 | new-item \\sydittest\temp\jre8.exe -force
copy-item C:\test\jre8.exe \\sydittest\c$\temp\jre8.exe | out-null
invoke-Command -ComputerName sydittest -ScriptBlock { Start-Process -filepath "c:\temp\jre8.exe" -argumentlist "/s /L c:\temp\install.txt" -Verb runas -PassThru -Wait }
#Configure LCM in the Client
[DSC... |
PowerShellCorpus/Github/beanxyz_Powershell/Test-Proxy.ps1 | Test-Proxy.ps1 | function Test-Proxy{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
position=0
)
]
[string]$server,
[string]$url = "http://www.microsoft.com"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.