full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/5_4_CreateWestCentralUsSQL04.ps1 | 5_4_CreateWestCentralUsSQL04.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure02'
$location = 'WestCentralUs'
$asName='asSQLServer02'
$vmSize ="Standard_A0"
$machineName="SQL04"
$vnetName= "VnetProductionWestCentralUs"
$subnetName="subnetSQLWestCentralUs"
... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/2_CreateVnetsAndSubnets.ps1 | 2_CreateVnetsAndSubnets.ps1 | #Create The Virtual Network in Dublin
$vnetName= "VnetProductionWestEurope"
$Vnet = New-AzureRmVirtualNetwork -ResourceGroupName rgInfrastructure01 -Name $vnetName -AddressPrefix 192.168.0.0/16 -Location westeurope
#Create 2 different Subnets in West Europe to segment the workloads, one for the DCs and another o... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_3_CreateWestEuropeSQL01.ps1 | 3_3_CreateWestEuropeSQL01.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure01'
$location = 'WestEurope'
$asName='asSQLServer01'
$vmSize ="Standard_A0"
$machineName="SQL01"
$vnetName= "VnetProductionWestEurope"
$subnetName="subnetSQLWestEurope"
$ipAddre... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/7_1_AddDisksForS2DWestCentralUs.ps1 | 7_1_AddDisksForS2DWestCentralUs.ps1 | #First remove auto-pooling
Get-StorageSubSystem Cluster* | Set-StorageHealthSetting -Name "System.Storage.PhysicalDisk.AutoPool.Enabled" -Value False
$machineName="Storage03"
$rgName = 'rgInfrastructure02'
$diskName="Data01"
$location = 'WestCentralUs'
$dataDisk= New-AzureRmDisk -DiskName $diskName -Disk (... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_2_CreateWestEuropeDC02.ps1 | 3_2_CreateWestEuropeDC02.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure01'
$location = 'WestEurope'
$asName='asDomainControllers01'
$vmSize ="Standard_A0"
$machineName="DC02"
$vnetName= "VnetProductionWestEurope"
$subnetName="subnetDCWestEurope"
$i... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_10_CreateSQLServerFCICluster.ps1 | 3_10_CreateSQLServerFCICluster.ps1 | #Run the following on each sql server
Add-Computer -DomainName Azuring.local -Credential pcondeca
Restart-Computer -force
#install failover clustering and File share role
Install-WindowsFeature –Name Failover-Clustering –IncludeManagementTools
#Create Cluster
New-Cluster -Name WWSQLCluster01 -Node SQL01,SQL02... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_6_CreateWestEuropeStorage01.ps1 | 3_6_CreateWestEuropeStorage01.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure01'
$location = 'WestEurope'
$asName='asStorage01'
$vmSize ="Standard_A0"
$machineName="Storage01"
$vnetName= "VnetProductionWestEurope"
$subnetName="subnetStorage"
$ipAddress =... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_8_AddDataDisksForS2DWestEurope.ps1 | 3_8_AddDataDisksForS2DWestEurope.ps1 | #data1
$machineName="Storage01"
$rgName = 'rgInfrastructure01'
$diskName="Data01"
$location = 'WestEurope'
$dataDisk= New-AzureRmDisk -DiskName $diskName -Disk (New-AzureRmDiskConfig -AccountType StandardLRS -Location $location -CreateOption Empty -DiskSizeGB 64) -ResourceGroupName $rgName
$vm = Get-AzureRmV... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/0_CreateResourceGroup.ps1 | 0_CreateResourceGroup.ps1 | # Login to access the subscription:
Login-AzureRmAccount
#Pay attention if your account has access to multiple subscriptions, make sure you are on the correct one :)
Get-AzureRmSubscription
#Select correct subscription
Select-AzureRmSubscription -SubscriptionId e7c49cc2-f1dd-458b-b592-a9f941b5c9a5
#Creatin... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_7_CreateWestEuropeStorage02.ps1 | 3_7_CreateWestEuropeStorage02.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure01'
$location = 'WestEurope'
$asName='asStorage01'
$vmSize ="Standard_A0"
$machineName="Storage02"
$vnetName= "VnetProductionWestEurope"
$subnetName="subnetStorage"
$ipAddress =... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_5_AddBackedNICsForSQLServerWestEurope.ps1 | 3_5_AddBackedNICsForSQLServerWestEurope.ps1 | $machineName="SQL01"
$rgName = 'rgInfrastructure01'
$asName='asSQLServer01'
$location = 'WestEurope'
$vnetName= "VnetProductionWestEurope"
$subnetName="subnetSQLBackedWestEurope"
$ipAddress ="192.168.113.11"
#VM WILL BE STOPPED
Stop-AzureRmVM -Name $machineName -ResourceGroupName $rgName
$vm = Get-Azure... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/1_CreateAvailabilitySets.ps1 | 1_CreateAvailabilitySets.ps1 | #Starting in Ireland, lets create our Availability sets.
# In a nutshell: to avoid having a single point of failure on network/rack/software updates
# FaulDomain number != from datacenter 2 datancer
#latest version
Install-Module AzureRM.Compute -RequiredVersion 2.6.0
#DCs
#WestEurope
New-AzureRmAvailabilitySe... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/4_1_ConfigureInternalLoadBalancerForSQLFCIWestEurope.ps1 | 4_1_ConfigureInternalLoadBalancerForSQLFCIWestEurope.ps1 | #View Resouces
Get-ClusterResource
$ClusterNetworkName = "Cluster Network 1" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name).
$IPResourceName = "SQL IP Address 1 (WESQL01)" # the IP Address cluster resource name.
$ILBIP = "192.168.112.19" # the IP Address of ... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/5_6_CreateWestCentralUsStorage04.ps1 | 5_6_CreateWestCentralUsStorage04.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure02'
$location = 'WestCentralUs'
$asName='asStorage02'
$vmSize ="Standard_A0"
$machineName="Storage04"
$vnetName= "VnetProductionWestCentralUs"
$subnetName="subnetStorage"
$ipAdd... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/9_VPN_VNetToVnet_BetweenEuropeAndUs.ps1 | 9_VPN_VNetToVnet_BetweenEuropeAndUs.ps1 | #West Europe
$RG1 ="rgInfrastructure01"
$Location1 = "WestEurope"
$VNetName1 ="VnetProductionWestEurope"
$GWIPconfName1 = "gwipconf1"
$GWName1 = "VnetProductionWestEuropeGW"
$GWIPName1 = "VnetProductionWestEuropeGWIP"
#New Public IP to be allocated to the gateway of the VNET
$gwpip1 = New-AzureRmPublicIpAddre... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/5_5_CreateWestCentralUsStorage03.ps1 | 5_5_CreateWestCentralUsStorage03.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure02'
$location = 'WestCentralUs'
$asName='asStorage02'
$vmSize ="Standard_A0"
$machineName="Storage03"
$vnetName= "VnetProductionWestCentralUs"
$subnetName="subnetStorage"
$ipAdd... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/3_4_CreateWestEuropeSQL02.ps1 | 3_4_CreateWestEuropeSQL02.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure01'
$location = 'WestEurope'
$asName='asSQLServer01'
$vmSize ="Standard_A0"
$machineName="SQL02"
$vnetName= "VnetProductionWestEurope"
$subnetName="subnetSQLWestEurope"
$ipAddre... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/8_5_ConfigureInternalLoadBalancerForAlwaysOnListener.ps1 | 8_5_ConfigureInternalLoadBalancerForAlwaysOnListener.ps1 | #This needs to run twice for each location:
#View Resouces
Get-ClusterResource
$ClusterNetworkName = "Cluster Network 1" # the cluster network name (Use Get-ClusterNetwork on Windows Server 2012 of higher to find the name).
$IPResourceName = "IP Address 192.168.112.0" # the IP Address cluster resource name.
$... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/5_2_CreateWestCentralUsDC04.ps1 | 5_2_CreateWestCentralUsDC04.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure02'
$location = 'WestCentralUs'
$asName='asDomainControllers02'
$vmSize ="Standard_A0"
$machineName="DC04"
$vnetName= "VnetProductionWestCentralUs"
$subnetName="subnetDCWestCentr... |
PowerShellCorpus/Github/MrNetic_IaC/AzurePreBuiltEnvironmentSQLServer_HA_DR/5_3_CreateWestCentralUsSQL03.ps1 | 5_3_CreateWestCentralUsSQL03.ps1 | #Create VMs
#Administrative Account to be locally created on the servers:
$cred = Get-Credential
$rgName = 'rgInfrastructure02'
$location = 'WestCentralUs'
$asName='asSQLServer02'
$vmSize ="Standard_A0"
$machineName="SQL03"
$vnetName= "VnetProductionWestCentralUs"
$subnetName="subnetSQLWestCentralUs"
... |
PowerShellCorpus/Github/czadd_git/GitAliases.ps1 | GitAliases.ps1 | <#
.Synopsis
This is a quick translation of git commands to PowerShell functions with short aliases.
.NOTES
I can't remember where I downloaded the original, but I will give credit if I can find it.
.FUNCTIONALITY
The functionality that best describes this cmdlet
.NOTES
Author: Chad R. Smith (czad... |
PowerShellCorpus/Github/fourston_webapp/MvcApplication2/packages/EntityFramework.5.0.0/tools/init.ps1 | init.ps1 | param($installPath, $toolsPath, $package, $project)
$importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' }
if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 )))
{
$thisModuleManifest = 'EntityFramework.PS3.psd1'
}
else
{
$thisModuleManifest = 'EntityFramework.psd1'
}
$thisModule... |
PowerShellCorpus/Github/fourston_webapp/MvcApplication2/packages/EntityFramework.5.0.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project)
{
$appDomain = [AppDomain]::CreateDomain(
'EntityFramework.PowerShell',
$null,
(New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' }))
... |
PowerShellCorpus/Github/fourston_webapp/MvcApplication2/packages/jQuery.1.7.1.1/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/fourston_webapp/MvcApplication2/packages/jQuery.1.7.1.1/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$supportsJsIntelliSenseFile = [System.Version]::Parse($dte.Version).Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
Write-Host "IntelliSense JS files are n... |
PowerShellCorpus/Github/fourston_webapp/MvcApplication2/packages/jQuery.1.7.1.1/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/spoonypirate_Get-Ascii/Tests/get-ascii.tests.ps1 | get-ascii.tests.ps1 | Import-Module -Force $PSScriptRoot\..\get-ascii.psm1
Describe 'Get-Ascii' {
Context 'no parameter is provided' {
It 'prompts for a name' {
Get-Ascii | Should Not BeNullorEmpty
}
}
Context 'parameter is provided' {
It 'returns the correct item' {
Get... |
PowerShellCorpus/Github/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/kMVC.0.6.0/tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
$projectIsVB = $false
try {
$item = $project.ProjectItems.Item("global.asax").ProjectItems.Item("global.asax.cs")
} catch {
$item = $project.ProjectItems.Item("global.asax").ProjectItems.Item("global.asax.vb")
$projectIsVB = $true
}
if ($projec... |
PowerShellCorpus/Github/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/jQuery.2.1.1/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/jQuery.2.1.1/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/jQuery.2.1.1/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/Aleksandr-Lytysov_Teams-matches-info/Mathes/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/jQuery.1.8.3/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/jQuery.1.8.3/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/packages/jQuery.1.8.3/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/Aleksandr-Lytysov_Teams-matches-info/Mathes/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/connexta_cons3rt-ddf-windows/src/test/setup.ps1 | setup.ps1 | chocolatey feature enable -n=allowGlobalConfirmation
choco install jdk8
choco install pester
# Disable Automatic Updates
New-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name WindowsUpdate
New-Item HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AU
New-ItemProperty HKLM:\SOFTWARE\Policies\Micro... |
PowerShellCorpus/Github/connexta_cons3rt-ddf-windows/src/test/run.ps1 | run.ps1 | Write-Host "Executing Pester Tests"
Invoke-Pester C:\test\install_ddf.Tests.ps1
|
PowerShellCorpus/Github/connexta_cons3rt-ddf-windows/src/test/install_chocolatey.ps1 | install_chocolatey.ps1 | $ChocoInstallPath = "$env:SystemDrive\ProgramData\Chocolatey\bin"
if (!(Test-Path $ChocoInstallPath)) {
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
}
|
PowerShellCorpus/Github/connexta_cons3rt-ddf-windows/src/test/install_ddf.Tests.ps1 | install_ddf.Tests.ps1 | $here = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host "HERE: $here"
$scriptdir = Join-Path (Split-Path -parent $MyInvocation.MyCommand.Definition) -ChildPath "scripts"
Write-Host "Script-Dir: $scriptdir"
$sut = Join-Path $scriptdir -ChildPath "install-ddf.ps1"
Write-Host "Sut: $sut"
. "$sut"
funct... |
PowerShellCorpus/Github/connexta_cons3rt-ddf-windows/src/scripts/install-ddf.ps1 | install-ddf.ps1 | function install-ddf {
# Options
param (
[string]$destination = "\ddf",
[switch]$run = $false,
[switch]$service = $false
)
# Determine Installer Home
$ScriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$VersionFile = Join-Path $ScriptPath -ChildPath "DDF_VERSION"
... |
PowerShellCorpus/Github/terrytrent_Send-Mass-Email/email.ps1 | email.ps1 | param(
[string]$ConfigFile
)
cls
if($ConfigFile -eq ""){
echo "You did not specify a configuration file.`n`nPlease specify a configuration file using the -ConfigFile Parameter.`n`nExample:`n .\email.ps1 -ConfigFile C:\temp\config.xml`n"
Write-Host -NoNewLine 'Press any key to exit...';
$null = $Host.U... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/jQuery.1.9.1/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/jQuery.1.9.1/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/jQuery.1.9.1/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/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/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/wp8/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/wp8/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/sl5/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/sl5/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/windows8/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/windows8/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/MonoTouch/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/MonoTouch/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/MonoAndroid/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/MonoAndroid/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/wpa81/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/wpa81/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/net40/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, '..\' + $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Cu... |
PowerShellCorpus/Github/devnarayan_WebApi-with-Entity-Ralationship/WebservicesApi/packages/AutoMapper.3.3.1/tools/net40/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
$msbuild = [Microsoft.Build.Evaluatio... |
PowerShellCorpus/Github/abix-_powershell-practical/exchange/Check-BlacklistWhitelist.ps1 | Check-BlacklistWhitelist.ps1 | [cmdletbinding()]
Param (
$inboxes = @{"blacklist@domain.local"="blacklist.cf";"whitelist@domain.local"="whitelist.cf"},
$usernames = ("blacklist","whitelist"),
$password = "REMOVED",
$domain = "domain.local",
$scriptpath = "G:\jobs\",
$listpath = "G:\jobs"
)
function connectMailbox... |
PowerShellCorpus/Github/abix-_powershell-practical/exchange/Get-GroupMailboxData.ps1 | Get-GroupMailboxData.ps1 | [cmdletbinding()]
Param (
[parameter(Mandatory=$true)]
$group
)
$session = new-pssession -cn dc
try {
icm { import-module activedirectory } -session $session
$members = icm -session $session -script { param($adgroup) get-adgroupmember $adgroup -ea "STOP" } -args $group
}
catch {
Wri... |
PowerShellCorpus/Github/abix-_powershell-practical/exchange/Set-MailboxQuotas.ps1 | Set-MailboxQuotas.ps1 | None |
PowerShellCorpus/Github/abix-_powershell-practical/exchange/Audit-ExchangeCC.ps1 | Audit-ExchangeCC.ps1 | [cmdletbinding()]
Param(
$settingsfile = "audit-exchangecc-settings.csv",
$exportfilename = "audit-exchangecc-results.csv",
$knownccfilename = "audit-exchangecc-known.csv",
$unknownccfilename = "audit-exchangecc-unknown.csv"
)
#$ewsprofile = New-MessageOps.EWSProfile -ExchangeVersion "Exchange2... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/windows-server.ps1 | windows-server.ps1 | function Set-DNS {
[CmdletBinding(SupportsShouldProcess=$false, ConfirmImpact='Medium')]
param (
[Parameter(Position = 1,Mandatory = $true)]
[alias("c")]
$csv,
[switch]$cred
)
if($cred) { $usercred = Get-Credential }
$servers = @(Import-Csv $csv)
forea... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/vmware-community.ps1 | vmware-community.ps1 | Function Get-DatastoreMountInfo {
<#
.DESCRIPTION https://communities.vmware.com/docs/DOC-18008
.NOTES Author: Alan Renouf
#>
[CmdletBinding()]
Param (
[Parameter(ValueFromPipeline=$true)]
$Datastore
)
Process {
$AllInfo = @()
if (-not $Datastore) {
$Datastore = Get-Datasto... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/GuestDiskExpansion_Windows2012_Custom.ps1 | GuestDiskExpansion_Windows2012_Custom.ps1 | $SCSIBus = "0"
$SCSITarget = "3"
$ScriptFile = "C:\Temp\diskpart_script.txt"
#WMI: Determine the DriveLabel and DriveLetter from SCSIBus and SCSITarget
$volumes = @()
Get-WmiObject -Class win32_diskDrive | ?{$_.SCSIBus -eq $SCSIBus -and $_.SCSITargetID -eq $SCSITarget} | %{
$disk = $_
$query = "ASSOCIA... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/internal.ps1 | internal.ps1 | function Set-PowerCLITitle($vcenter) {
$productName = "PowerCLI"
$version = Get-PowerCLIVersion
if($vcenter) { $windowTitle = "[{2}] - $productName {0}.{1}" -f $version.Major, $version.Minor, $vcenter }
else { $windowTitle = "$productName {0}.{1}" -f $version.Major, $version.Minor }
$host.ui.R... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/hp.ps1 | hp.ps1 | function Get-HPOAInventory {
[cmdletbinding()]
Param (
[Parameter(Mandatory=$true,Position=0)][string]$OA,
[string]$Username = "Admin"
)
#Todo
#-support Mezz cards
$pw = Get-SecureStringCredentials Admin -PlainPassword
Write-Host "$($OA): Connecting to Onboard ... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/vmware-internal.ps1 | vmware-internal.ps1 | function SetException($h) {
try { $ex = Get-VMHostFirewallException -VMHost $h -Name $exception -ErrorAction Stop }
catch { Write-Host "$h - $exception Exception not found"; return }
if($ex.Enabled -ne $enabled) {
Write-Host "$h - changing $exception Exception to $enabled"
Set-VMHostFir... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/automation.ps1 | automation.ps1 | function connectvCenter {
if(-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)){
Add-PSSnapin VMware.VimAutomation.Core
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false | Out-Null
Set-PowerCLIConfiguration -DefaultVIServerMode multiple... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/vmware-tests.ps1 | vmware-tests.ps1 | function Test-MigrationResults {
[cmdletbinding()]
param (
$servers
)
Write-Host
Write-Host "Starting to compare 5.1 and 6.0 results"
$serversclean = $servers | ForEach-Object{$_ -replace ".txt" -replace "\." -replace "\\"}
$results51file = @(Get-ChildItem "C:\Scripts\Rep... |
PowerShellCorpus/Github/abix-_powershell-practical/Aluminium/vmware.ps1 | vmware.ps1 | function Set-VMHostAdvancedSetting {
<#
.SYNOPSIS
(1.0)
Change the advanced settings for multiple vSphere VM Hosts.
.DESCRIPTION
Uses Get-AdvancedSetting and Set-AdvancedSetting to change the advanced setting.
#>
[cmdletbinding()]
Param (
$vmhosts,
[Paramet... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Get-VMNIC.ps1 | Get-VMNIC.ps1 | [cmdletbinding()]
Param (
$servers,
[switch]$cred
)
function GetNic($server,$credential,$eaction) {
if(!$cred) {
$nic = get-vm $server | Get-VMGuestNetworkInterface -ea $eaction| where {($_.name -like "*Local Area Connection*") -and ($_.description -like "*Ethernet Adapter*")}
} else ... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Disconnect-DVS.ps1 | Disconnect-DVS.ps1 | [cmdletbinding()]
Param (
[Parameter(Mandatory=$true)]$server
)
function WriteHost($message,$color="White") { Write-Host "$($server): $($message)" -ForegroundColor $color; if($color -eq "Red") { Exit } }
try { WriteHost "Getting VMHost data"; $vmhost = Get-VMHost $server -ErrorAction Stop }
catch { WriteHos... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Check-VMSnapshots.ps1 | Check-VMSnapshots.ps1 | Add-PSSnapin VMware.VimAutomation.Core
$vcenter = "my-vcenter.domain.local"
$threshold = -3
$absthreshold = [math]::Abs($threshold)
Connect-VIServer $vcenter | Out-Null
$snaps = Get-VM | get-snapshot | select VM,Name,SizeMB,Created | sort VM | ?{$_.VM -notlike "*VDI-SOURCE*" -and $_.VM -notlike "replica*" -a... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/MoveVM-DVStoVSS.ps1 | MoveVM-DVStoVSS.ps1 | [cmdletbinding()]
Param (
[Parameter(Mandatory=$true)]$vcenter,
[Parameter(Mandatory=$true)]$server
)
function WriteHost($message,$color="White") { Write-Host "$($server): $($message)" -ForegroundColor $color; if($color -eq "Red") { Exit } }
try { Connect-VIServer $vcenter -ErrorAction Stop | Out-Null... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Enable-VMNIC.ps1 | Enable-VMNIC.ps1 | [cmdletbinding()]
Param (
$csv
)
function GetCSV($csvfile) {
if(!(Test-Path $csvfile)) {
Write-Verbose "$($csvfile) does not exist. Try again."
}
elseif(!($csvfile.substring($csvfile.LastIndexOf(".")+1) -eq "csv")) {
Write-Verbose "$($csvfile) is not a CSV. Try again."
}
... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Set-DEVQCShares.ps1 | Set-DEVQCShares.ps1 | [cmdletbinding()]
Param (
$configfile = "Set-DEVQCShares.csv",
$catchall = "zMisc"
)
Add-PSSnapin vmware.vimautomation.core
Connect-VIServer my-vcenter.domain.local | Out-Null
function getPool($cluster,$poolname) {
try {
$rpool = Get-ResourcePool -Location $cluster -Name $poolname -Erro... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Migrate-vCenter.ps1 | Migrate-vCenter.ps1 | [cmdletbinding()]
Param (
[Parameter(ParameterSetName="server")][Parameter(ParameterSetName="cluster")]$SourcevCenter = "my-vcenter.domain.local",
[Parameter(ParameterSetName="server")][Parameter(ParameterSetName="cluster")]$DestvCenter = "jaxf-vc101.domain.local",
[Parameter(ParameterSetName="server",M... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Extend-Volume3.ps1 | Extend-Volume3.ps1 | [cmdletbinding()]
Param (
$servers
)
#$vms = get-vm | ?{$_.Name -like "JAX-*-SRCH*"} | sort
#$vms = get-vm | ?{$_.Name -like "ORD-*-SRCH*"} | sort
#
#foreach($vm in $vms ) { $vm | get-harddisk | ?{$_.capacitygb -eq 6} | Set-HardDisk -CapacityKB 10485760 -Confirm:$false}
if($servers.EndsWith(".txt")) { $... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Migrate-DatastoreCluster.ps1 | Migrate-DatastoreCluster.ps1 | [cmdletbinding()]
Param (
$sourcecluster = "sourceCluster",
$destcluster = "destCluster",
$transferlimit = 3500,
$svmotionlimit = 5,
$servers,
$sourcevmcluster
)
function MoveVM($vm) {
$destdatastore = get-datastorecluster $destcluster | get-datastore | sort freespacegb -descendi... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Check-ClusterConfig.ps1 | Check-ClusterConfig.ps1 | [cmdletbinding()]
Param (
$clusters = @("CLUSTER1","CLUSTER2")
)
if(($clusters.gettype()).basetype.name -ne "Array" -and $clusters.EndsWith(".txt")) { $clusters = gc $clusters }
Add-PSSnapin vmware.vimautomation.core
Connect-VIServer my-vcenter.domain.local | Out-Null
$clusters = Get-Cluster | Select -... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Invoke-VMScript-Template.ps1 | Invoke-VMScript-Template.ps1 | [cmdletbinding()]
Param (
$servers,
$file
)
if($servers.EndsWith(".txt")) { $servers = gc $servers }
$cred = get-Credential -Message "Local admin on the servers"
foreach($server in $servers) {
$i++
Write-Host "Working on $server"
Write-Progress -Activity "Working on $server [$i/$($serv... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Get-ProcessorCount.ps1 | Get-ProcessorCount.ps1 | $vmhosts = Get-VMHost
$allprocessors = 0
foreach($vmhost in $vmhosts) {
$processors = $vmhost.extensiondata.hardware.cpuinfo.numcpupackages
Write-Host "$($vmhost.name) - $processors"
$allprocessors += $processors
}
Write-Host "There are currently $allprocessors in use" |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Create-VMCSVfromCSV.ps1 | Create-VMCSVfromCSV.ps1 | [cmdletbinding()]
Param (
[parameter(Mandatory=$true)]
$csv
)
$report = @()
$servers = import-csv $csv
foreach($server in $servers) {
$line = "" | Select VMName, VMIp, MAC, WebURL, Protocol, Port, Path
$line.VMName = $server.Name
try { $line.VMIp = [System.Net.Dns]::GetHostByName("$($ser... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Get-Firmware.ps1 | Get-Firmware.ps1 | [cmdletbinding()]
Param (
$vmhost
)
function writeToObj($vmhost,$firmware="N/A",$driver="N/A") {
return
}
if($vmhost.EndsWith(".txt")) { $vmhost = gc $vmhost }
$allobj = @()
foreach($v in $vmhost) {
$i++
$nic = "N/A"
Write-Progress -Activity "Reading data from $v" -Status "[$i/$($... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Set-CompellentFixedPaths.ps1 | Set-CompellentFixedPaths.ps1 | [cmdletbinding()]
Param (
$cluster
)
foreach($c in $cluster) { $i = 0
foreach($lun in (Get-Cluster $c | Get-VMHost | Get-ScsiLun | ?{$_.Vendor -eq "COMPELNT" -and $_.CapacityMB -GT 100000})) {
$paths = Get-ScsiLunPath -ScsiLun $lun
if($i -ge $paths.count) { $i = 0 }
Write-Host ... |
PowerShellCorpus/Github/abix-_powershell-practical/vmware/Set-PG.ps1 | Set-PG.ps1 | $vms = Get-Cluster CLUSTER | Get-VM | sort Name
$pgs = $newdev | select -Unique -ExpandProperty NIC1_PortGroup
foreach($_p in $pgs) {
$destpg = Get-VirtualPortGroup -name $_p
foreach($_n in $newdev) {
$vm = $null
$adapter = $null
try {
$vm = $vms | ?{$_.name -eq $_n.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.