full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/imcuteani_Azure-HDInsight/Add-AzureTrafficManager.ps1 | Add-AzureTrafficManager.ps1 | Get-AzureTrafficManagerProfile
$profiles | Format-Table
Get-AzureTrafficManagerProfile -Name "MyProfile"
|
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/EndScript.ps1 | EndScript.ps1 | # Everything in this script will run at the end of vCheck
|
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/vCheckUtils.ps1 | vCheckUtils.ps1 | $global:vCheckPath = $MyInvocation.MyCommand.Definition | Split-Path
function Get-VCheckPlugin
{
<#
.SYNOPSIS
Retrieves installed vCheck plugins and available plugins from the Virtu-Al.net repository.
.DESCRIPTION
Get-VCheckPlugin parses your vCheck plu... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/GlobalVariables.ps1 | GlobalVariables.ps1 | # You can change the following defaults by altering the below settings:
#
# Set the following to true to enable the setup wizard for first time run
$SetupWizard =$False
# Start of Settings
# Please Specify the IP address or Hostname of the server to connect to
$Server ="scvmm.domain.local"
# Please Specify t... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/vCheck.ps1 | vCheck.ps1 | param ([Switch]$config, $Outputpath)
###############################
# vCheck - Daily Error Report #
###############################
# Thanks to all who have commented on my blog to help improve this project
# all beta testers and previous contributors to this script.
#
$Version = "6.15"
function Write-Cu... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/008 Hyper-V Legacy VM NIC Adapters.ps1 | 008 Hyper-V Legacy VM NIC Adapters.ps1 | $Title = "Hyper-V emulated VM NIC Adapters"
$Header ="Hyper-V emulated VM NIC Adapters"
$Comments = "Due to performance emulated VM NIC Adapters should only be used when Integration Components is not available for the guest Operating System. VMware VMs is excluded since they are listed with emulated NICs in SC VMM."
... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/014 Hyper-V Capacity Report.ps1 | 014 Hyper-V Capacity Report.ps1 | # Start of Settings
$VMAverageDiskSizeInGB = "40"
$VMAverageMemoryinGB =" 2"
$VMAverageCPUCount = "1"
# End of Settings
$Title = "Hyper-V 2008 R2 SP1 Capacity Report"
$Header ="Hyper-V 2008 R2 SP1 Capacity Report"
$Comments = "Estimated Hyper-V 2008 R2 SP1 Capacity Report based on official documentation: http:... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/003 SC VMM Basic Host Information.ps1 | 003 SC VMM Basic Host Information.ps1 | $Title = "System Center Virtual Machine Manager - Basic Host Information"
$Header ="System Center Virtual Machine Manager - Basic Host Information"
$Comments = "System Center Virtual Machine Manager - Basic Host Information"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "Hype... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/006 SC VMM VM Operating System Statistics.ps1 | 006 SC VMM VM Operating System Statistics.ps1 | $Title = "VM Operating System Statistics"
$Header ="VM Operating System Statistics"
$Comments = "VM Operating System Statistics"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "SC VMM"
$VMs | Group-Object operatingsystem | Select-Object name,count | Sort-Object count -Desce... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/011 SC VMM Dynamically Expanding Disks.ps1 | 011 SC VMM Dynamically Expanding Disks.ps1 | $Title = "Dynamically Expanding Disks"
$Header ="Dynamically Expanding Disks"
$Comments = "Virtual Disks of type 'DynamicallyExpanding'"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "SC VMM"
switch -wildcard ($VMMServer.ProductVersion)
{
"2.*" {$VMs | Get-... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/Plugins Not up to date or installed.ps1 | Plugins Not up to date or installed.ps1 | # Start of Settings
# If you use a proxy to access the internet please specify the proxy address here, for example http://127.0.0.1:3128 else use $false
$proxy ="$false"
# End of Settings
# Changelog
## 1.1 : Adding proxy support for Get-vCheckPlugin cmdlet
## 1.2 : Added support for only vSphere plugins
.... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/010 Hyper-V Cluster Shared Volumes.ps1 | 010 Hyper-V Cluster Shared Volumes.ps1 | # Start of Settings
# Free space threshold for Hyper-V Cluster Shared Volumes (value in percent)
$CSVFreeSpaceThreshold =" 10"
# End of Settings
$Title = "Hyper-V Cluster Shared Volumes"
$Header ="Hyper-V Cluster Shared Volumes"
$Comments = "Hyper-V Cluster Shared Volumes with less than $CSVFreeSpaceThreshold p... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/005 SC VMM New VMs.ps1 | 005 SC VMM New VMs.ps1 | # Start of Settings
# Threshold for virtual machine age (days)
$VMCreationThreshold ="30"
# End of Settings
$Title = "New VMs"
$Header ="New VMs"
$Comments = "Virtual machines created during the last $VMCreationThreshold days"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/013 Hyper-V Integration Components Version.ps1 | 013 Hyper-V Integration Components Version.ps1 | ��$Title = "Hyper-V Integration Components Version"
$Header ="Hyper-V Integration Components Version"
$Comments = "Hyper-V Virtual Machines with missing or out-dated Integration Services"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "Hyper-V"
# This plugin... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/007 VMs with mounted ISO.ps1 | 007 VMs with mounted ISO.ps1 | $Title = "VMs with mounted ISO"
$Header ="VMs with mounted ISO"
$Comments = "VMs with mounted ISO. ISO files should be dismounted when no longer needed."
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "SC VMM"
switch -wildcard ($VMMServer.ProductVersion)
{
"... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/004 VMs with snapshots.ps1 | 004 VMs with snapshots.ps1 | # Start of Settings
# Snapshot age threshold (days)
$SnapshotThreshold =" 7"
# End of Settings
$Title = "VMs with old snapshots"
$Header ="VMs with old snapshots"
$Comments = "Virtual Machines with snapshots older than $SnapshotThreshold days"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/009 VMs with static MAC address.ps1 | 009 VMs with static MAC address.ps1 | $Title = "VMs with static MAC address"
$Header ="VMs with static MAC address"
$Comments = "VMs with static MAC address"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "SC VMM"
switch -wildcard ($VMMServer.ProductVersion)
{
"2.*" {$vms | Get-VirtualNetworkAda... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/Report on Plugins.ps1 | Report on Plugins.ps1 | # Report on Plugins.ps1
# List plugins and whether they're enabled or disabled by Select-Plugins.ps1
# Start of Settings
# List Enabled Plugins First
$ListEnabledPluginsFirst =$False
# End of Settings
$Title = "Report on Plugins"
$Author = "Phil Randal"
$PluginVersion = 1.0
$Header = "Plugins Report"
$... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/002 General Information.ps1 | 002 General Information.ps1 | $Title = "General information"
$Header ="General information"
$Comments = "General information about the virtualization infrastructure"
$Display = "List"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "SC VMM"
New-Object -TypeName PSObject -Property @{
"Number of Hosts:" = (@($VMHosts).Coun... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/012 SC VMM Dynamically Expanding Disks Consolidation Forecast.ps1 | 012 SC VMM Dynamically Expanding Disks Consolidation Forecast.ps1 | $Title = "Dynamically Expanding Disks Consolidation Forecast"
$Header ="Dynamically Expanding Disks Consolidation Forecast"
$Comments = "Estimatation of disk space needed to convert all Virtual Disks of type 'DynamicallyExpanding' to type 'FixedSize'"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1... |
PowerShellCorpus/Github/vCheckReport_vCheck-SCVMM/Plugins/001 SC VMM Connection Plugin.ps1 | 001 SC VMM Connection Plugin.ps1 | $Title = "SC VMM Connection Plugin"
$Header ="SC VMM Connection Plugin"
$Comments = "SC VMM Connection Plugin"
$Display = "Table"
$Author = "Jan Egil Ring"
$PluginVersion = 1.0
$PluginCategory = "SC VMM"
if (-not (Get-Module virtualmachinemanager) -or (Get-PSSnapin -Name Microsoft.SystemCenter.VirtualMachineMa... |
PowerShellCorpus/Github/SysSudharsan_chef/bootstrap.ps1 | bootstrap.ps1 | # Copyright 2015 Nordstrom, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
PowerShellCorpus/Github/SysSudharsan_chef/install.ps1 | install.ps1 | (Invoke-WebRequest -Uri https://raw.githubusercontent.com/Nordstrom/chefdk_bootstrap/master/bootstrap.ps1).Content | Invoke-Expression
|
PowerShellCorpus/Github/alfredjose22_MyRepo_MVC_CRUD/SampleCRUD/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/alfredjose22_MyRepo_MVC_CRUD/SampleCRUD/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/alfredjose22_MyRepo_MVC_CRUD/SampleCRUD/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/alfredjose22_MyRepo_MVC_CRUD/SampleCRUD/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/alfredjose22_MyRepo_MVC_CRUD/SampleCRUD/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/vxav_Scripting/VMPing.ps1 | VMPing.ps1 | Function VMPing {
[CmdletBinding(DefaultParameterSetName="1")]
param(
[parameter(position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True,Mandatory=$True)]
$VM,
[parameter(parametersetname=1)][Alias('n')][int]$Count = 4,
[parameter(parametersetname=2)][Alias('t')][switch]$Con... |
PowerShellCorpus/Github/vxav_Scripting/Move-VMCold.ps1 | Move-VMCold.ps1 | function Move-VMCold {
[CmdletBinding(SupportsShouldProcess = $true,ConfirmImpact = 'High')]
param (
[parameter(position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True,Mandatory=$True)]
[VMware.VimAutomation.ViCore.types.V1.Inventory.VirtualMachine[]]
$VM,
[Parameter(Mandat... |
PowerShellCorpus/Github/vxav_Scripting/Assign-TagQOS.ps1 | Assign-TagQOS.ps1 | function Assign-TagQOS {
param(
[Parameter(Mandatory = $True)]
[ValidateNotNullOrEmpty()]
[string]$vCenterServer
)
$ErrorActionPreference = 'stop'
Add-PSSnapin VMware.VimAutomation.Core
$Session = Connect-VIServer -Server $vCenterServer 3>&1 | Out-Null
Get-Tag -Name "QOS_*" | ... |
PowerShellCorpus/Github/vxav_Scripting/Evacuate-VMHost.ps1 | Evacuate-VMHost.ps1 | Function Evacuate-VMHost {
param (
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True)]
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost]
$VMHost,
[ValidateRange(1,100)]
[int]
$VMHostMaxCPUUsagePercent = 75,
[ValidateRange(... |
PowerShellCorpus/Github/vxav_Scripting/Pingou.ps1 | Pingou.ps1 | Function Port-Ping {
param(
[Parameter(ValueFromPipeline = $True)]
[string]
$IP,
[ValidateRange(1,65535)]
[int]
$Port,
[int]
$Timeout
)
$before = get-date
$PortPing = New-Object System.Net.Sockets.TCPClient
$PortConnect = $PortPing.beginConnect("$IP",$Port,$nul... |
PowerShellCorpus/Github/vxav_Scripting/Backup-ESXiConfigs.ps1 | Backup-ESXiConfigs.ps1 | Function Backup-ESXiConfigs {
param (
[ValidateNotNullOrEmpty()]
[string]
$BackupLocation,
[ValidateNotNullOrEmpty()]
[int]
$FileRotation,
[ValidateNotNullOrEmpty()]
[string]
$Server
)
Add-PSSnapin VMware.VimAutomation.Core -ErrorAction Stop
C... |
PowerShellCorpus/Github/vxav_Scripting/Get-Datastore2.ps1 | Get-Datastore2.ps1 | Function Get-Datastore2 {
param(
[parameter(position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True)]
[VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.VmfsDatastore[]]
$Datastore
)
Process{
$Datastore | ForEach-Object {
[pscustomobject]@{
Na... |
PowerShellCorpus/Github/vxav_Scripting/Get-VMCPULimit.ps1 | Get-VMCPULimit.ps1 | Function Get-VMCpuLimit {
Param(
[parameter(position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True,Mandatory=$True)]
[VMware.VimAutomation.ViCore.types.V1.Inventory.VirtualMachine[]]
$VM
)
$VM | ForEach-Object {
[pscustomobject]@{
VM = $_.name
L... |
PowerShellCorpus/Github/vxav_Scripting/Get-VMHostQuickview.ps1 | Get-VMHostQuickview.ps1 | function Get-VMHostQuickview {
Param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True)]
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VMHost[]]
$VMHost,
[int]
$LengthBar = 30,
[int]
$CPURed = 80,
[int]
$CPUYellow... |
PowerShellCorpus/Github/vxav_Scripting/New-RandomPassword.ps1 | New-RandomPassword.ps1 | Function New-RandomPassword {
param(
[ValidateRange(6,30)]
[int]$length = 12,
[switch]$uppercase,
[switch]$lowercase,
[switch]$numbers,
[switch]$special,
[string[]]$excludedchars
)
IF (!$uppercase -and !$lowercase -and !$numbers -and !$special) {write-warning "Please specify ch... |
PowerShellCorpus/Github/vxav_Scripting/Get-ThinHardDisk.ps1 | Get-ThinHardDisk.ps1 | Function Get-ThinHardDisk {
param(
[parameter(position=0,ValueFromPipeline=$True,ValueFromPipelineByPropertyname=$True)]
[ValidateNotNullOrEmpty()]
[VMware.VimAutomation.ViCore.types.V1.Inventory.VirtualMachine[]]
$VM = (get-VM)
)
Process{
$VM | ForEach-Object {
(Get-HardDis... |
PowerShellCorpus/Github/vxav_Scripting/zListener.ps1 | zListener.ps1 | Function zListener {
[CmdletBinding(DefaultParameterSetName="Close")]
Param(
[parameter(Mandatory=$true,position=0)]
[ValidateRange(1,65536)]
[int]
$Port,
[parameter(parametersetname='Close')]
[int]
$Timeout,
[parameter(parametersetname='NoClose')]
[switch]
... |
PowerShellCorpus/Github/Visual-Studio-China_mim-docs-psprocessing/.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/SQLHorizons_SQLHorizons/RoboCopy.ps1 | RoboCopy.ps1 | $source = "Source Directory (drive:\path or \\server\share\path)."
$destination = "Destination Dir (drive:\path or \\server\share\path)."
$process = "$env:windir\SysWOW64\Robocopy.exe"
$Arguments = @(
"$source $destination /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log"
)
Start-Process $p... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Install-DscResource.ps1 | Install-DscResource.ps1 | Function Install-DscResource
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
Param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$Source,
[string]$Destination = "C:\Program Files\Win... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Get-StringInFile.ps1 | Get-StringInFile.ps1 | #Function to return Restore Script for Backup Source
Function Get-SQLRestoreScript
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
param
(
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[string]$SQLServer,
[parameter(Mandator... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/pop-Gitfile.ps1 | pop-Gitfile.ps1 | $GitHub = "https://github.com"
$SQLHorizons = "SQLHorizons/Build/tree/dev/SQLServer"
$WebResponse = Invoke-WebRequest "$GitHub/$SQLHorizons"
$Scripts = $WebResponse.Links | Where-Object { $_.href -like "*.ps1" }
$Script = $Scripts | Select-Object title, href | Out-GridView -PassThru -Title "Select PowerShell S... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Get-Assembly.ps1 | Get-Assembly.ps1 | Function Get-Assembly
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
param
(
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[string]$SearchString
)
foreach($assembly in [AppDomain]::CurrentDomain.GetAssemblies())
{
... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/FindOwner.ps1 | FindOwner.ps1 | $path = "C:\Downloads"
ForEach ($Item in Get-ChildItem $path* -recurse)
{
$acl = Get-ACL $Item.FullName
$acl|Select-Object Path, Owner
}
|
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Migrate-Databases.ps1 | Migrate-Databases.ps1 | Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force -ErrorAction SilentlyContinue
$library = "\\library\PoSh\MigrateDatabases"
Push-Location -Path $library
Push-Location -Path "$library\Modules"
foreach($module in Get-ChildItem)
{
Import-Module ".\$module"
}
Pop-Location
Get-SQ... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Modules/Copy-DBUser.ps1 | Copy-DBUser.ps1 | Function Copy-DBUsers
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
Param (
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[object]$Source,
[object]$Destination,
[object]$Database
)
$sourceserver ... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Modules/Copy-Database.ps1 | Copy-Database.ps1 | Function Copy-Database
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
Param (
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[object]$Source,
[object]$Destination,
[object]$Database
)
$sourceserver ... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Modules/Set-MirrorEndpoint.ps1 | Set-MirrorEndpoint.ps1 | Function Set-MirrorEndpoint
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
Param (
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[object]$Source,
[object]$Destination
)
# End of Parameters
$ePntname = 'Ha... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Modules/Restore-DatabaseNLog.ps1 | Restore-DatabaseNLog.ps1 | Function Restore-DatabaseNLog
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
Param (
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[object]$BackupPath,
[object]$Destination,
[object]$Database
)
... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Modules/Backup-DatabaseNLog.ps1 | Backup-DatabaseNLog.ps1 | Function Backup-DatabaseNLog
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
Param (
[parameter(Mandatory = $true, ValueFromPipeline = $true)]
[object]$Source,
[object]$BackupPath,
[object]$Database
)
# End of Para... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Modules/Get-SQLPSModule.ps1 | Get-SQLPSModule.ps1 | Function Get-SQLPSModule
{
if (-not (Get-Module -name 'SQLPS'))
{
if (Get-Module -ListAvailable | Where-Object { $_.Name -eq 'SQLPS' })
{
Push-Location
Import-Module -Name 'SQLPS' -DisableNameChecking
Pop-Location
}
}
}
|
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Migrate-Databases/Tests/Test.Copy-Database.ps1 | Test.Copy-Database.ps1 | Get-SQLPSModule
$srcSrv = 'DB-OC01'
$tgtSrv = 'DB-OC02'
$dbName = 'SQLInfo'
Copy-Database -Source $srcSrv -Destination $tgtSrv -Database $dbName -Verbose
|
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Server/Modules/Update-PingFiles.ps1 | Update-PingFiles.ps1 | Function Update-PingFiles
{
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess = $true)]
param
(
[parameter(Mandatory = $true)]
[string]$Server,
[parameter(Mandatory = $true)]
[string]$Path
)
Push-Location $path
$file = Get-Chil... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/Server/Tests/Test.Update-PingFiles.ps1 | Test.Update-PingFiles.ps1 | $parameters = @{
Server = "A-Server01"
Path = "\\sqlhorizons.com\FS\Collaboration\ICT\Dept\Working\Infrastructure\Servers\Patching\Text Files"
}
Update-PingFiles @parameters
|
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/SQL Browser/Parse-ServerResponse.ps1 | Parse-ServerResponse.ps1 | function Parse-ServerResponse([byte[]]$responseData)
{
[PSObject[]]$instances = @()
if (($responseData -ne $null) -and ($responseData[0] -eq 0x05))
{
$responseSize = [System.BitConverter]::ToInt16($responseData, 1)
if ($responseSize -le $responseData.Length - 3)
... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/SQL Browser/Parse-ServerResponseDac.ps1 | Parse-ServerResponseDac.ps1 | function Parse-ServerResponseDac([byte[]]$responseData)
{
$dacPort = 0
if (($responseData -ne $null) -and ($responseData[0] -eq 0x05))
{
$responseSize = [System.BitConverter]::ToUInt16($responseData, 1)
if (($responseData.Length -eq 6) -and ($responseSize -eq 6))
... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/SQL Browser/Get-SqlBrowserInstanceInfo.ps1 | Get-SqlBrowserInstanceInfo.ps1 | function Get-SqlBrowserInstanceInfo
{
<#
.SYNOPSIS
Gets information about the specified SQL Instance from the server.
.DESCRIPTION
Gets information about the specified SQL Instance from the server by querying the SQL Browser Service on port 1434.
.EXAMPLE
Get-SqlBrowserInstanceInfo servername instancename
.EXA... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/SQL Browser/Get-SqlBrowserInstanceList.ps1 | Get-SqlBrowserInstanceList.ps1 | function Get-SqlBrowserInstanceList
{
<#
.SYNOPSIS
Gets the list of available SQL Instances on the server.
.DESCRIPTION
Gets the list of available SQL Instances on the server by querying the SQL Browser Service on port 1434.
.EXAMPLE
Get-SqlBrowserInstanceList servername
.EXAMPLE
Get-SqlBrowserInstanceList se... |
PowerShellCorpus/Github/SQLHorizons_SQLHorizons/SQL Browser/Get-SqlBrowserInstanceDac.ps1 | Get-SqlBrowserInstanceDac.ps1 | function Get-SqlBrowserInstanceDac
{
<#
.SYNOPSIS
Gets the Dedicated Administrator Connection port number for the specified SQL Instance on the server.
.DESCRIPTION
Gets the Dedicated Administrator Connection port number for the specified SQL Instance on the server by querying the SQL Browser Service on port 1434... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_Provision_2017_5_20_25_58_31/.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/mcdonaldbm_Azure-AutoLab/Private/Enable-Networking.ps1 | Enable-Networking.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Configurations/Simple Exchange Env/VMConfiguration.ps1 | VMConfiguration.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Configurations/Simple Exchange Env/VMValidate.tests.ps1 | VMValidate.tests.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Reset-AzureLab.ps1 | Reset-AzureLab.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Set-AzureLab.ps1 | Set-AzureLab.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/New-AzureLabSnapshot.ps1 | New-AzureLabSnapshot.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Set-AzureHost.ps1 | Set-AzureHost.ps1 | #requires -version 5.0
#requires -runasadministrator
# Log in to Azure Account
$creds = Login-AzureRmAccount
# Store Azure login information to be called back on
#end Credential Storage
# Set subscription account (Query account then present options to user)
# Set resource group location
$resourceGr... |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Start-AzureLab.ps1 | Start-AzureLab.ps1 | function Start-AzureLab {
Param(
[string]$Path=$PSScriptRoot
)
Write-Host -ForegroundColor Green -Object @"
This is the "Run" script for Azure Autolab. This script will perform the following:
* Start the lab
Please note: If this is the first time you are running the com... |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Stop-AzureLab.ps1 | Stop-AzureLab.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/New-UnattendAzureLab.ps1 | New-UnattendAzureLab.ps1 | <#
.Synopsis
Automatically creates a new lab in Azure DevTest
.DESCRIPTION
Based on the input defined via -config, this will create a new lab in Azure DevTest.
.EXAMPLE
Unattend-AzureLab -Config C:/Path/To/Config.json
#>
function Unattend-AzureLab
{
[CmdletBinding()]
[Alias()]
[OutputT... |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Remove-AzureLab.ps1 | Remove-AzureLab.ps1 | |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/New-AzureLab.ps1 | New-AzureLab.ps1 | <#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
function New-AzureLab
{
[CmdletBinding()]
[Alias()]
Param
(
#
[Parameter(Mandatory=$true,
... |
PowerShellCorpus/Github/mcdonaldbm_Azure-AutoLab/Public/Test-AzureLab.ps1 | Test-AzureLab.ps1 | |
PowerShellCorpus/Github/harringg_Powershell/EAD-UpdateUPN.ps1 | EAD-UpdateUPN.ps1 | #Requires -Version 3
function EAD-UpdateUPN {
<#
.SYNOPSIS
Renames AD User's SAM and UPN names to match email address
.DESCRIPTION
Using the Department field (to filter by individual Research Unit), and the Email Address,
a new sAMAccountNa... |
PowerShellCorpus/Github/harringg_Powershell/TEMPLATE_Function-ParamSet_Switch_Production_Live_Review.ps1 | TEMPLATE_Function-ParamSet_Switch_Production_Live_Review.ps1 | # Place in function head
param
(
[Parameter(Mandatory = $TRUE)]
[ValidateSet('REVIEW', 'LIVE')]
[string]$PRODUCTION = 'REVIEW'
)
#Place in PROCESS section
Switch ($PRODUCTION) {
LIVE { <# SCRIPT ACTION #> }
REVIEW { <# SCRIPT REVIEW #> }
} #end Switch-Production
|
PowerShellCorpus/Github/harringg_Powershell/EAD-RenamePC-RemotePC_Batch.ps1 | EAD-RenamePC-RemotePC_Batch.ps1 | $global:RemotePCList = 'localhost','ARSNDFAR5WHRDZ1'
WORKFLOW Get-GHChassis {
param ([string[]]$RemotePCList)
FOREACH -parallel($PC in $RemotePCList) {
function Get-PCChassisType {
<#
.SYNOPSIS
Converts WMI Class win32_systemenclosure to a value to create new PC name for EAD rena... |
PowerShellCorpus/Github/harringg_Powershell/EAD-Get-ADUCUserAccountControl.ps1 | EAD-Get-ADUCUserAccountControl.ps1 | Get-ADUser -Filter {sAMAccountName -like "*LastName*"} -Properties * | Select Name, UserAccountControl,SmartCardLogonRequired | ft -AutoSize
Get-ADComputer -Filter {sAMAccountName -eq 'COMPUTERNAME$'} -Properties * | Select Name, OperatingSystem, UserAccountControl | ft -AutoSize
# http://www.netvision.com/ad_use... |
PowerShellCorpus/Github/harringg_Powershell/EAD-RenameRemotePC.ps1 | EAD-RenameRemotePC.ps1 | $global:DomainAdmin = "Fargo\Administrator"
$global:Password = Read-Host "Enter Admin Password" -AsSecureString
$global:DomainCredential = new-object -typename System.Management.Automation.PSCredential -argumentlist $DomainAdmin, $Password
function EAD-RenameRemotePC {
<#
.SYNOPSIS
Rena... |
PowerShellCorpus/Github/harringg_Powershell/EAD-Move-ADGroupMembers.ps1 | EAD-Move-ADGroupMembers.ps1 | $global:DomainAdmin = "Administrator"
$global:Password = Read-Host "Enter Admin Password" -AsSecureString
$global:DomainCredential = new-object -typename System.Management.Automation.PSCredential -argumentlist $DomainAdmin, $Password
function Move-ADGroupMembers {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER... |
PowerShellCorpus/Github/harringg_Powershell/EAD-RenamePC-Batch-CSV.ps1 | EAD-RenamePC-Batch-CSV.ps1 | $global:DomainAdmin = "fargo\administrator"
$global:Password = Read-Host "Enter Admin Password" -AsSecureString
$global:DomainCredential = new-object -typename System.Management.Automation.PSCredential -argumentlist $DomainAdmin, $Password
function EAD-RenameComputersBatchCSV {
<#
.SYNOPSIS
... |
PowerShellCorpus/Github/harringg_Powershell/EAD-Set-UPNtoHSPDPID.ps1 | EAD-Set-UPNtoHSPDPID.ps1 | function Set-UPNtoHSPDPID {
<#
.SYNOPSIS
Updates users UPN to 1200+HSPDPID
.DESCRIPTION
Using a CSV that contains sAMAccountName and the 10 digit HSPDPID to update the UPN in ADUC
.PARAMETER PRODUCTION
This will enable a switch that will either give you a preview of
the res... |
PowerShellCorpus/Github/harringg_Powershell/Get-ADUC_AllFields.ps1 | Get-ADUC_AllFields.ps1 | function Get-ADUC_AllFields {
<#
.SYNOPSIS
Creates a CSV file that contains the selected Active Directory (AD) Fields based on $SELECT<param>
NOTE: This only returns results if the $_.Department field is filled in with a properly formated RU name
See Update-ADDepart... |
PowerShellCorpus/Github/harringg_Powershell/CAServer-GET-MFAAccountStatus.ps1 | CAServer-GET-MFAAccountStatus.ps1 | #Requires -RunAsAdministrator
#Requires -Version 3
function Get-MFAAccountStatus {
<#
.SYNOPSIS
Reports the compliance for MFA in local AD
.DESCRIPTION
Reports the compliance for MFA in local AD in the following categories
Standard Users, MFA Not Enforced
EP Users, MFA Not Enforced
Standard ... |
PowerShellCorpus/Github/harringg_Powershell/BITLOCKER-Get-KeyPWFromADUC.ps1 | BITLOCKER-Get-KeyPWFromADUC.ps1 | #Requires -RunAsAdministrator
#Requires -Version 3
function Get-KeyPWFromADUC {
<#
.SYNOPSIS
Retrieves the Bitlocker Key ID and Recovery Key from ADUC
.DESCRIPTION
Retrieves the Bitlocker Key ID and Recovery Key from ADUC
.PARAMETER param1
param1 Description
.EXAMPLE
PS C:\> Get-Key... |
PowerShellCorpus/Github/harringg_Powershell/TEMPLATE_IF-ELSE-Test-Connection.ps1 | TEMPLATE_IF-ELSE-Test-Connection.ps1 | if (Test-Connection -ComputerName $PC -Count 2 -ErrorAction SilentlyContinue) {
"DO SOMETHING HERE WITH $PC"
}
ELSE {
Write-Output "$PC is not online"
}#end if Test-Connection
|
PowerShellCorpus/Github/harringg_Powershell/TEMPLATE_Function-ParamSet_Switch_InputTypes.ps1 | TEMPLATE_Function-ParamSet_Switch_InputTypes.ps1 | param
(
[Parameter(Mandatory = $TRUE)]
[ValidateSet("Array", "TextFile", "StaticList", "SinglePC")]
[string]$InputType
)
BEGIN {
$StaticList = 'SOME_PC_NAME'
switch ($InputType) {
Array { $ArrayToRead = Read-Host "Enter Array"; $GV = Get-Variable -name $ArrayToRead; $PCList = $GV.Value }
Text... |
PowerShellCorpus/Github/harringg_Powershell/EAD-RenamePC-LocalPC.ps1 | EAD-RenamePC-LocalPC.ps1 | #REQUIRES -Version 3
function Get-PCChassisType {
<#
.SYNOPSIS
Converts WMI Class win32_systemenclosure to a value to create new PC name for EAD rename
.DESCRIPTION
Converts WMI Class win32_systemenclosure to a value to create new PC name for EAD rename
... |
PowerShellCorpus/Github/harringg_Powershell/EAD-Set-ADUser_SAM_UPN.ps1 | EAD-Set-ADUser_SAM_UPN.ps1 | #Requires -Version 3
function EAD-SetADUserSamUPN {
<#
.SYNOPSIS
Renames AD User's SAM and UPN names to match email address
.DESCRIPTION
Using the Department field (to filter by individual Research Unit), and the Email Address,
a new sAMA... |
PowerShellCorpus/Github/harringg_Powershell/TEMPLATE_Function-Shell.ps1 | TEMPLATE_Function-Shell.ps1 | function Get-Function
{
<#
.SYNOPSIS
Default Synopsis
.DESCRIPTION
Default Description
.PARAMETER param1
param1 Description
.EXAMPLE
PS C:\> Get-Function -param1 'Value1'
.NOTES
NAME: Get-ADTitle
AUTHOR: Grant Harrington
EMAIL: grant.harrington@ars... |
PowerShellCorpus/Github/harringg_Powershell/CAServer-SET-ADUSER_SmartCardLoginRequired.ps1 | CAServer-SET-ADUSER_SmartCardLoginRequired.ps1 | function Set-SmartCardLoginRequired {
<#
.SYNOPSIS
Sets the SmartcardLogonRequired flag to True (checked)
.DESCRIPTION
Sets the SmartcardLogonRequired flag to True (checked) programatically
In the GUI, this setting can be found here:
First.Last-adm > Properties > Account > Acco... |
PowerShellCorpus/Github/harringg_Powershell/MOVE_DEPARTING-EMPLOYEE-FOLDER-TO-SUPERVISOR-v3-AsJob.ps1 | MOVE_DEPARTING-EMPLOYEE-FOLDER-TO-SUPERVISOR-v3-AsJob.ps1 | $FunctionScriptMoveEMPtoSUP = {
function Move-EMPtoSUP {
<#
.SYNOPSIS
Searches for outgoing employee and current supervisor directory and moves employee's folder to supervisor's folder with the name ARCHIVE-employee
.DESCRIPTION
NAME: Move-EMPtoSUP
... |
PowerShellCorpus/Github/harringg_Powershell/CAServer-SET-ADUserX509Cert.ps1 | CAServer-SET-ADUserX509Cert.ps1 | function Set-ADUSER_X509_CERT {
<#
.SYNOPSIS
Adds the PIV Cert information to the ADUC EP user using the HSPDPID number
.DESCRIPTION
Default Description
.PARAMETER param1
param1 Description
.EXAMPLE
PS C:\> Get-Function -param1 'Value1'
.NOTES
NAME: Set-ADUSER_X509_CERT
... |
PowerShellCorpus/Github/harringg_Powershell/NESSUS/DLLQuery.ps1 | DLLQuery.ps1 | # [Modified, 7/11/2016 4:33 PM, Grant Harrington]
# Checks version of ws2_32.dll
get-item "C:\Windows\System32\ws2_32.dll" |
select @{n='ComputerName';e={$env:COMPUTERNAME}},FullName,CreationTime,@{n='Version';e={$_.versioninfo.productversion}} | fl
# [Modified, 7/11/2016 5:22 PM, Grant Harrington]
# Modified ... |
PowerShellCorpus/Github/harringg_Powershell/NESSUS/MS15-124.ps1 | MS15-124.ps1 | #[Modified, 7/11/2016 4:02 PM, Grant Harrington]
<#
ASLR hardening settings for Internet Explorer in KB3125869
have not been applied. The following DWORD keys must be
created with a value of 1:
- HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_ALLOW_USER32_EXCEPTION_HANDLER_HARDENING\ie... |
PowerShellCorpus/Github/harringg_Powershell/NESSUS/DRIVERSQuery.ps1 | DRIVERSQuery.ps1 | cls
#[Modified, 7/12/2016 10:24 AM, Grant Harrington]
### Gathers version of multiple .SYS files located in C:\Windows\System32\drivers
$DRIVERSQuery = 'ubstore','srvnet'
#region Get-Item for all items in DLLQuery and add to Array
$DRIVERSItem_Array = @()
Foreach ($DRIVERS in $DRIVERSQuery) {
$DRIVERSPath = ... |
PowerShellCorpus/Github/harringg_Powershell/NESSUS/EXEQuery.ps1 | EXEQuery.ps1 | cls
#[Modified, 7/12/2016 10:30 AM, Grant Harrington]
### Gathers version of multiple .EXE files located in C:\Windows\System32
$EXEQuery = 'ntoskrnl'
#region Get-Item for all items in DLLQuery and add to Array
$EXEItem_Array = @()
Foreach ($EXE in $EXEQuery) {
$EXEPath = "C:\Windows\System32\{0}.exe" -f $EX... |
PowerShellCorpus/Github/harringg_Powershell/NESSUS/SYSQuery.ps1 | SYSQuery.ps1 | cls
#[Modified, 7/12/2016 10:16 AM, Grant Harrington]
### Gathers version of multiple .SYS files located in C:\Windows\System32
$SYSQuery = 'win32k'
#region Get-Item for all items in DLLQuery and add to Array
$SYSItem_Array = @()
Foreach ($SYS in $SYSQuery) {
$SYSPath = "C:\Windows\System32\{0}.sys" -f $SYS
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.