full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/Claustn_Clarifai/PSClarifai/Public/Add-ImageFromURLWithConcepts.ps1
Add-ImageFromURLWithConcepts.ps1
#requires #requires -Version 3.0 function Add-ImageFromURLWithConcepts { [CmdletBinding()] param ( [string]$ImageURL, [string]$Token = (Get-ClarifaiToken), [string[]]$Concepts, [string[]]$Not_Concepts ) $uri = 'https://api.clarifai.com/v2/inputs' $headers = @{ ...
PowerShellCorpus/Github/Claustn_Clarifai/tests/Meta.tests.ps1
Meta.tests.ps1
Set-StrictMode -Version latest #Taken with love from Brandon Olins Password State module https://github.com/devblackops/PasswordState/blob/master/Tests/ # Make sure MetaFixers.psm1 is loaded - it contains Get-TextFilesList Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'MetaFixers.psm1') -Verbose:$fa...
PowerShellCorpus/Github/Claustn_Clarifai/tests/Syntax.tests.ps1
Syntax.tests.ps1
$moduleRoot = Resolve-Path "$PSScriptRoot\.." $moduleName = 'PSClarifai' Describe "General project validation: $moduleName" { $scripts = Get-ChildItem $moduleRoot -Include *.ps1, *.psm1, *.psd1 -Recurse # TestCases are splatted to the script so we need hashtables $testCase = $scripts | Foreach-Ob...
PowerShellCorpus/Github/Claustn_Clarifai/tests/Manifest.tests.ps1
Manifest.tests.ps1
#Taken with love from Brandon Olins Password State module https://github.com/devblackops/PasswordState/blob/master/Tests/ $moduleName = 'PSClarifai' $here = Split-Path -Parent $MyInvocation.MyCommand.Path $root = Split-Path -Path $here -Parent $modulePath = Join-Path -Path $root -ChildPath $moduleName $manifestPa...
PowerShellCorpus/Github/alfredruiz_Ejercicios-net/DemoEF/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/alfredruiz_Ejercicios-net/DemoEF/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/alfredruiz_Ejercicios-net/DemoEF/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/alfredruiz_Ejercicios-net/DemoEF/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/alfredruiz_Ejercicios-net/DemoEF/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/Sukiyakijango_testlab/Powershell/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
# There's usually much more than this in my profile! $VIMPATH = "C:\Program Files (x86)\Vim\vim74\vim.exe" Set-Alias vi $VIMPATH Set-Alias vim $VIMPATH # # for editing your PowerShell profile Function Edit-Profile { vim $profile } # for editing your Vim settings Function Edit-Vimrc { vim $home...
PowerShellCorpus/Github/ecsousa_ConEmu/launch.ps1
launch.ps1
$psutils = Join-Path $PSScriptRoot 'PSUtils' $isLocal = -not (new-object Uri($psutils)).IsUNC function Find-InPath { param([string] $name) @( $env:Path.Split(';') | ? { $_ } | % { Join-Path $_ $name } | ? { Test-Path $_ } ) | Select-Object -First 1 } func...
PowerShellCorpus/Github/dannoh_TfsGitReleaseNotes/create-release-notes.ps1
create-release-notes.ps1
<# .SYNOPSIS Displays a list of work items that have been associated to a given branch .EXAMPLE create-release-notes.ps1 -tfsUserName me@hotmail.com -tfsAccount myTfs -oldBranch release/2015.11.10 -newBranch release/2015.11.24 This command will look in all the commits that are unique to th...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.7_ARM_Release_RT_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.4_ARM_Release_RT_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.5_x86_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.3_x86_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.5_ARM_Release_RT_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.4_x86_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.2_AnyCPU_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.6_x86_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.5_x64_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.7_x64_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.6_x64_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.0_AnyCPU_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.3_ARM_Release_RT_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.1_AnyCPU_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.7_x86_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/SamTheBay_LegendsOfDescent/DungeonGame/DungeonGame/AppPackages/LegendsOfDescentW8_0.5.2.6_ARM_Release_RT_Test/Add-AppDevPackage.ps1
Add-AppDevPackage.ps1
# # Add-AppxDevPackage.ps1 is a PowerShell script designed to install app # packages created by Visual Studio for developers. To run this script from # Explorer, right-click on its icon and choose "Run with PowerShell". # # Visual Studio supplies this script in the folder generated with its # "Prepare Package" c...
PowerShellCorpus/Github/jsntcy_testdependency-fix-docs/.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/offline4ever_PSInterfaceliftDownloader/PSInterfaceliftDownloader.ps1
PSInterfaceliftDownloader.ps1
Param( [string]$url="https://www.interfacelift.com/wallpaper/downloads/date/wide_16:9/1920x1080/", [string]$userAgent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36", [string]$outputDir = $env:TEMP ) While ($url -ne "") { Write-Debug "Process...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1487647542568/.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/dragon788_Packer-Windows81/disable-hibernate.ps1
disable-hibernate.ps1
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Power\ -name HiberFileSizePercent -value 0 Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Power\ -name HibernateEnabled -value 0
PowerShellCorpus/Github/dragon788_Packer-Windows81/update-windows.ps1
update-windows.ps1
param($global:RestartRequired=0, $global:MoreUpdates=0, $global:MaxCycles=5, $MaxUpdatesPerCycle=500) $Logfile = "C:\Windows\Temp\win-updates.log" function LogWrite { Param ([string]$logstring) $now = Get-Date -format s Add-Content $Logfile -value "$now $logstring" Write...
PowerShellCorpus/Github/dragon788_Packer-Windows81/enable-uac.ps1
enable-uac.ps1
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 1
PowerShellCorpus/Github/dragon788_Packer-Windows81/install-vmware-tools.ps1
install-vmware-tools.ps1
# Set the path of the VMWare Tools ISO - this is set in the Packer JSON file $isopath = "C:\Windows\Temp\windows.iso" # Mount the .iso, then build the path to the installer by getting the Driveletter attribute from Get-DiskImage piped into Get-Volume and adding a :\setup64.exe # A separate variable is used for t...
PowerShellCorpus/Github/dragon788_Packer-Windows81/configure-private-network.ps1
configure-private-network.ps1
# windows powershell Network type script $host.ui.RawUI.WindowTitle = "Set Network to Private" # supress network location Prompt New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" -Force # set network to private $ifaceinfo = Get-NetConnectionProfile Set-NetConnectionProfile -I...
PowerShellCorpus/Github/dragon788_Packer-Windows81/configure-winrm.ps1
configure-winrm.ps1
cmd.exe /c winrm quickconfig -q cmd.exe /c winrm quickconfig '-transport:http' cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' cmd.exe /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="2048"}' cmd.exe /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}' cmd.exe /c winrm set "win...
PowerShellCorpus/Github/dragon788_Packer-Windows81/enable-rdp.ps1
enable-rdp.ps1
# windows powershell enable remote desktop script $host.ui.RawUI.WindowTitle = "Enable Remote Desktop" #enable rdp Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name fDenyTSConnections -Type DWord -Value 0 #remove NLA # NLA (Network Level Authentication) $NLA = Get-WmiObjec...
PowerShellCorpus/Github/anchnk_nugetpackages/automatic/reaper/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$packageName = '{{PackageName}}' $fileType = 'exe' $url = '{{DownloadUrl}}' $url64 = '{{DownloadUrlx64}}' $silentArgs = '/S' $validExitCodes = @(0,1223) Install-ChocolateyPackage "$packageName" "$fileType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
PowerShellCorpus/Github/anchnk_nugetpackages/automatic/reaper/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
$packageName = '{{PackageName}}' $fileType = 'exe' $silentArgs = '/S' $validExitCodes = @(0) $processor = Get-WmiObject Win32_Processor $is64bit = $processor.AddressWidth -eq 64 if ($is64bit) { $unpath = "$Env:ProgramFiles\Reaper (x64)\uninstall.exe" } else { $unpath = "${Env:ProgramFiles(x86)}\Reaper\un...
PowerShellCorpus/Github/anchnk_nugetpackages/automatic/netbeans-jee/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
$packageName = '{{PackageName}}' $installerType = 'EXE' $url = '{{DownloadUrl}}' $silentArgs = '--silent' $validExitCodes = @(0) Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" -validExitCodes $validExitCodes
PowerShellCorpus/Github/anchnk_nugetpackages/automatic/sublimetext3/tools/chocolateyInstall.ps1
chocolateyInstall.ps1
# Variables $package = '{{PackageName}}' $build = '{{PackageVersion}}' # Determine if Sublime Text 3 $build Version is installed # - Return the path if found # - Return $false if not function getInstallationDirectory($buildArg) { $installFolder = 'Sublime Text 3' $installedPath = [string]::empty ...
PowerShellCorpus/Github/anchnk_nugetpackages/automatic/sublimetext3/tools/chocolateyUninstall.ps1
chocolateyUninstall.ps1
# Variables $package = '{{PackageName}}' $build = '{{PackageVersion}}' # Determine if Sublime Text 3 $build Version is installed # - Return the path if found # - Return $false if not function getInstallationDirectory($buildArg) { $installFolder = 'Sublime Text 3' $installedPath = [string]::empty ...
PowerShellCorpus/Github/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/Final Project/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/JennJackson_IT-2320/Final Project/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/JennJackson_IT-2320/Final Project/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/JennJackson_IT-2320/AJAX/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $compilerPackageName = 'Microsoft.Net.Compilers' $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $libDirectory = Join-Path $installPath 'lib\net45' $packageDirectory = Split-Path $installPath $compilerPackage = Get-Chil...
PowerShellCorpus/Github/JennJackson_IT-2320/AJAX/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) $roslynSubFolder = 'roslyn' if ($project -eq $null) { $project = Get-Project } $projectRoot = $project.Properties.Item('FullPath').Value $binDirectory = Join-Path $projectRoot 'bin' $targetDirectory = Join-Path $binDirectory $roslynSubFolder if (Te...
PowerShellCorpus/Github/dean1609_PowerShell/ScriptingGames/Get-RSSFeed.ps1
Get-RSSFeed.ps1
Function Get-RSSFeed { <# .SYNOPSIS Retrieves most recent articles for an RSS feed(s). .DESCRIPTION Retrieves most recent articles for an RSS feed(s). By default, this will return the article headline. Optional parameters will retrive the link and description of the article. This function requires Windows Pow...
PowerShellCorpus/Github/dean1609_PowerShell/ScriptingGames/2015_December.ps1
2015_December.ps1
# http://powershell.org/wp/2015/12/05/december-2015-scripting-games-puzzle/ $List = @" 1 Partridge in a pear tree 2 Turtle Doves 3 French Hens 4 Calling Birds 5 Golden Rings 6 Geese a laying 7 Swans a swimming 8 Maids a milking 9 Ladies dancing 10 Lords a leaping 11 Pipers piping 12 Drummers drumming "@...
PowerShellCorpus/Github/dean1609_PowerShell/ScriptingGames/2015-September-Scripting-Games-Puzzle.ps1
2015-September-Scripting-Games-Puzzle.ps1
# Single line using one pair of curly brackets. Import-Csv -Path .\Input.csv | ForEach-Object {$_ | Add-Member -MemberType NoteProperty -Name OSVERSION -Value (Get-WmiObject -Class Win32_OperatingSystem -ComputerName $_.MACHINENAME).Caption -PassThru} | Export-Csv .\Output.csv -NoTypeInformation # Single line usin...
PowerShellCorpus/Github/dean1609_PowerShell/ScriptingGames/Get-Uptime.ps1
Get-Uptime.ps1
Function Get-Uptime { <# .SYNOPSIS Gets the uptime for a local or remote computer. .DESCRIPTION The Get-Uptime function gets the uptime for specified computers by retrieving the LastBootUpTime from Win32_OperatingSystem WMI class. The uptime period is calculated in days by comparing the interval between the L...
PowerShellCorpus/Github/dean1609_PowerShell/ScriptingGames/Get-GeoIP.ps1
Get-GeoIP.ps1
Function Get-GeoIP { <# .SYNOPSIS Retrieves IP geolocation data. .DESCRIPTION Connects to GeoIP REST API (www.telize.com/geoip) and retrieves JSON-encoded IP geolocation data and converts to custom objects. .PARAMETER IP Address Specify IP address or addresses to retrieve IP geolocatio...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Write-Log.ps1
Write-Log.ps1
Function Write-Log { <# .SYNOPSIS Generates an event message. .DESCRIPTION This command generates an event message to either both a log file location and Windows PowerShell session or to a Windows PowerShell session only. The event level generation supports Info (Information), Warning and Error...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Update-YouTrackItem.ps1
Update-YouTrackItem.ps1
Function Update-YouTrackItem { <# .SYNOPSIS Updates and existing item in a JetBrains YouTrack project. .DESCRIPTION The Update-YouTrack item cmdlet sends a POST request method to update an existing item for a specified project in YouTrack JetBrains using the execute command REST API method. The cmdlet re...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Get-VMHostManagementNetwork.ps1
Get-VMHostManagementNetwork.ps1
Function Get-VMHostManagementNetwork { <# .NOTES Author: Dean Grant Date: Wednesday, 19th August 2015 Version: 1.0 Keywords: PowerCLI, VMware, HostSystem, Management Network .NAME Get-VMHostManagementNetwork .SYNOPSIS Gets the IP address of the Management Network...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Set-vCenterPowerState.ps1
Set-vCenterPowerState.ps1
Function Set-vCenterPowerState { <# .SYNOPSIS Sets the power state of all virtual machines. .DESCRIPTION The cmdlet will set the power state of all virtual machines on a vCenter Server System. The cmdlet requires VMware vSphere PowerCLI to import the module Vim.VMwareAutomation.Core (supported version o...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/New-YouTrackItem.ps1
New-YouTrackItem.ps1
Function New-YouTrackItem { <# .SYNOPSIS Creates a new item in a JetBrains YouTrack project. .DESCRIPTION TheNew-YouTrackItem cmdlet sends a PUT request method to create a new item for a specified project in YouTrack JetBrains, creating both a summary and description of the item. The cmdlet requires a we...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Get-VulnerabilityRSSFeed.ps1
Get-VulnerabilityRSSFeed.ps1
Function Get-VulnerabilityRSSFeed { <# .SYNOPSIS Retrieves items from RSS feed(s) to create tecnhical vulnerability items. .DESCRIPTION Invokes request to specified URIs to retrieve information from Microsoft Security Bulletin and/or the National Vulnerability Database (NVD) that have been created in the ...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/New-EncryptedString.ps1
New-EncryptedString.ps1
Function New-EncryptedString { <# .SYNOPSIS Creates a encrypted standard string file. .DESCRIPTION The New-Encrypted String cmdlet converts the secure string for a credential object password using the specified encryption key and sends the output to a password file. The cmdlet requires Windows PowerShell ...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/New-EncryptionKey.ps1
New-EncryptionKey.ps1
Function New-EncryptionKey { <# .SYNOPSIS Creates an encryption key. .DESCRIPTION The New-EncryptionKey cmdlet creates an Advanced Encryption Standard (AES) encryption key to retrieve encrypted standard strings and convert to a secure string. The cmdlet creates a random byte array using the Security.Crypt...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Send-ToSlack.ps1
Send-ToSlack.ps1
Function Send-ToSlack { <# .SYNOPSIS Posts message to slack channel. .DESCRIPTION Posts a message to a public channel, private group or IM channel using the Slack Web API method. The Web API consists of HTTP RPC-style methods as described at https://api.slack.com/methods/chat.postMessage. All methods must b...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Get-PSCredentialObject.ps1
Get-PSCredentialObject.ps1
Function Get-PSCredentialObject { <# .SYNOPSIS Creates PSCredential object. .DESCRIPTION The Get-PSCredentialObject cmdlet converts an encrypted standard string from content in a file using a specified encryption key to a secure string. The cmdlet creates a PSCredential object from the specified username ...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/ConvertTo-CertificateContainer.ps1
ConvertTo-CertificateContainer.ps1
Function ConvertTo-CertificateContainer { <# .SYNOPSIS Creates concatenated certificate container file. .DESCRIPTION Creates a concatenated certfificate container file by retrieving the content from certificate files specified in a correct order by adding the content retrieved to an output file. .PARAMETER...
PowerShellCorpus/Github/dean1609_PowerShell/Functions/Connect-YouTrack.ps1
Connect-YouTrack.ps1
Function Connect-YouTrack { <# .SYNOPSIS Establishes a connection to the JetBrains YouTrack REST API. .DESCRIPTION The Connect-YouTrack cmdlet sends a POST request method to the YouTrack REST API to authenticate and returns the web request session object. The cmdlet can store the web request session ob...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Invoke-ConsolidateVMDisks.ps1
Invoke-ConsolidateVMDisks.ps1
<# .NOTES Author: Dean Grant Date: Thursday, 20th August 2015 Version: 1.0 Keywords: PowerCLI, VMware, vRanger, ConsolidateVMDisk .NAME Invoke-ConsolidateVMDisks.ps1 .SYNOPSIS Consolidates virtual machine hard disks. .SYNTAX Invoke-ConsolidateVMDisks.ps1 [[-V...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Join-ESXiHostToDomain.ps1
Join-ESXiHostToDomain.ps1
<# .NOTES Author: Dean Grant Date: Tuesday, 2nd December 2014 Version: 1.0 .SYNOPSIS Joins ESXi hosts to a specific domain. .PARAMETERS -vCenter Hostname or IP address of the vCenter server(s). -Datacenter Specify data...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/New-SecureCredentialObject.ps1
New-SecureCredentialObject.ps1
<# .SYNOPSIS Creates secure credential object. .DESCRIPTION The script will create an AES 256-bt encryption key using the RNG cryptography service provider. The encryption key is then used to create a secure credential object that may be used in security operations. The script will prompt the user for a password...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Invoke-WindowsUpdate.ps1
Invoke-WindowsUpdate.ps1
<# .SYNOPSIS Performs orchestrated installed of Windows updates. .DESCRIPTION Retrieves collection of virtual machines that return a property value match for the vCenter Server System tag 'Patch Schedule'. This script provides an orchestrated workflow to create a virtual machine snapshot and then ...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Consolidate-VMDisks.ps1
Consolidate-VMDisks.ps1
<# .NOTES Author: Dean Grant Date: Monday, 29th December 2014 Version: 1.1 .REVISION Invokes Get-VM cmdlet to call ConsolidateVMDisks() action. .SYNOPSIS Consolidates virtual machine hard disks. .PARAMETERS -vCenter Hostna...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Get-SecurityGroupMembers.ps1
Get-SecurityGroupMembers.ps1
#======================================================================================================================================================================================================== # NAME: Get-SecurityGroupMembers.ps1 # AUTHOR: Dean Grant # DATE: 26/10/2011 # # VERSION: 1.0 # # /...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Set-VMHostServiceStatus.ps1
Set-VMHostServiceStatus.ps1
<# .NOTES Author: Dean Grant Date: Tuesday, 2nd December 2014 Version: 1.0 .SYNOPSIS Performs bulk actions on VMHostServices by specifying the key value to perform a stop or start action. .PARAMETERS -vCenter Hostname or IP addres...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Create-VirtualHardDisks.ps1
Create-VirtualHardDisks.ps1
<# .NOTES Author: Dean Grant Date: Sunday, 14th December 2014 Version: 1.0 .SYNOPSIS Creates virtual machine hard disks. .PARAMETERS -VIServer Hostname or IP address of the vCenter server(s) -VM Specify virtual machine t...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Set-SQLServerConfiguration.ps1
Set-SQLServerConfiguration.ps1
<# .NOTES Author: Dean Grant Date: Saturday, 21st February 2015 Version: 1.1 .SYNOPSIS Configures SQL Server Maximum Memory and Max Degree of Parallelism for SQL Server Instance. .PARAMETERS -Instance Specify the instance name of the S...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Set-GuestNetworkInterface.ps1
Set-GuestNetworkInterface.ps1
<# .NOTES Author: Dean Grant Date: Friday, 28th November 2014 Version: 1.0 .SYNOPSIS Configures guest network interface on a virtual machine. .PARAMETERS -vCenter Hostname or IP address of the vCenter server(s). -VM Specifi...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Set-softResetClearTSC.ps1
Set-softResetClearTSC.ps1
<# .NOTES Author: Dean Grant Date: Tuesday, 17th February 2014 Version: 1.0 .SYNOPSIS Sets the key value pair for each virtual machine in the collection. .PARAMETERS -VIServer Specify the vCenter Server System to establish a conn...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Invoke-DatastoreUnmap.ps1
Invoke-DatastoreUnmap.ps1
Function Invoke-DatastoreUnmap { <# #> [CmdletBinding()] Param ( [String] $vCenter = "colprdvc1", [String[]] $Datacenters, [String[]] $Clusters, [String[]] $HostSystems, [String[]] $Datastores, [Switch] $SendToSlack, [Int] $ReclaimSize ) Begin { Try ...
PowerShellCorpus/Github/dean1609_PowerShell/Scripts/Create-NTFSMountedFolder.ps1
Create-NTFSMountedFolder.ps1
<# .NOTES Author: Dean Grant Date: Sunday, 14th December 2014 Version: 1.0 .SYNOPSIS Creates NTFS mounted folder. .PARAMETERS -VIServer Hostname or IP address of the vCenter server(s) -VM Specify virtual machine to invoke...
PowerShellCorpus/Github/arjundhanjal_ps_new-homedrive/New-HomeDrive.ps1
New-HomeDrive.ps1
<# New-HomeDrive.ps1 Copyright (C) 2015 Arjun Dhanjal This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
PowerShellCorpus/Github/lkstruck_TestRepo/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) # Load posh-git module from current directory Import-Module C:\tools\poshgit\dahlbyk-posh-git-5bb4844\posh-git # If module is installed in a default location ($env:PSModulePath), # use this instead (see about_Modules for more informatio...
PowerShellCorpus/Github/lkstruck_TestRepo/Microsoft.PowerShellISE_profile.ps1
Microsoft.PowerShellISE_profile.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent) # Load posh-git module from current directory Import-Module C:\tools\poshgit\dahlbyk-posh-git-5bb4844\posh-git # If module is installed in a default location ($env:PSModulePath), # use this instead (see about_Modules for more informatio...
PowerShellCorpus/Github/Seniore_PowerShell/disk_usage_average.ps1
disk_usage_average.ps1
$startDate = (Get-Date -Year 2015 -Month 11 -Day 12 -Hour 12 -Minute 0 -Second 0).AddMinutes(-1) $endDate = (Get-Date -Year 2015 -Month 11 -Day 12 -Hour 15 -Minute 0 -Second 0).AddMinutes(-1) $vm_list = Get-VM -Datastore datastore_name $results = @() $vm_list | % { $vm = $_ $stats = get-stat -Entity (Get-VM $...
PowerShellCorpus/Github/Seniore_PowerShell/disk_maxTotalLatency.ps1
disk_maxTotalLatency.ps1
$startDate = (Get-Date -Year 2015 -Month 11 -Day 12 -Hour 12 -Minute 0 -Second 0).AddMinutes(-1) $endDate = (Get-Date -Year 2015 -Month 11 -Day 12 -Hour 15 -Minute 0 -Second 0).AddMinutes(-1) $vm_list = ('vm_name_1', 'vm_name_2') #if you wish to have the stats for all VMs in a datastore uncomment the line below #...
PowerShellCorpus/Github/Seniore_PowerShell/check-datastore-connection.ps1
check-datastore-connection.ps1
#Version 20160623.1 - Added problematic hosts and verification of only shared storage if(-not (Get-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) { Add-PSSnapin VMware.VimAutomation.Core } if ($Global:DefaultVIServers.count -lt 1) { Write-Host "Please connect to a vCenter"; exit; } $is_err...
PowerShellCorpus/Github/Seniore_PowerShell/check_ATS_setting_on_ESX.ps1
check_ATS_setting_on_ESX.ps1
<# This script checks the ATS setting on a ESXi hosts http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2113956 http://blogs.vmware.com/vsphere/2012/05/vmfs-locking-uncovered.html #> $sx_hosts = Get-VMHost $sx_results = @() foreach ($sx_host in $sx_hosts) { $r...
PowerShellCorpus/Github/Seniore_PowerShell/ConfigureVM.ps1
ConfigureVM.ps1
Add-PSSnapin VMware.VimAutomation.Core Connect-Viserver 10.0.0.3 -User administrator@vsphere.local -Password 'VMware1!' $VM = "testVM" $ESXiPass = "VMWare1!" $ESXiHost = "esxi01.seniore.internal" $VMUser = "Administrator" $VMPass = "VMware1!" #===== IR Config $IR_IP = "192.168.200.32" $IR_GW = "192.168.200.1...
PowerShellCorpus/Github/Seniore_PowerShell/other_vm_inventory.ps1
other_vm_inventory.ps1
Add-PSSnapin vmware.vimautomation.core Connect-Viserver localhost ##################################### ## http://kunaludapi.blogspot.com ## Version: 1 ## Tested this script on ## 1) Powershell v3 ## 2) Powercli v5.5 ## 3) Vsphere 5.x #################################### function Get-...
PowerShellCorpus/Github/Seniore_PowerShell/VM_inventory.ps1
VM_inventory.ps1
@" =============================================================================== Title: VM_Inventory.ps1 Description: Exports VM Information from vCenter into a .CSV file for importing into anything Usage: .\VM_Inventory.ps1 Date: 01/Oct/2014 ==========================================...
PowerShellCorpus/Github/Seniore_PowerShell/VMs_per_DS_Cluster.ps1
VMs_per_DS_Cluster.ps1
Connect-VIServer vcenter_host $dsClusters = ('DS_CLUSTER_NAME') ##Temp hash array to speed up the script $sxHashArray = @{} ForEach ($dsClusterName in $dsClusters) { $sxDatastores = Get-DatastoreCluster -Name $dsClusterName | Get-DataStore Foreach ($sxDS in $sxDatastores) { $sxHashArray[$sxDS.Name] = $ds...
PowerShellCorpus/Github/Seniore_PowerShell/GetDatastore_and_LUN_ID.ps1
GetDatastore_and_LUN_ID.ps1
$esxName = "my_esx_hosts" Get-VMHost -Name $esxName | Get-Datastore | Where-Object {$_.ExtensionData.Info.GetType().Name -eq "VmfsDatastoreInfo"} | ForEach-Object { if ($_) { $_.ExtensionData.Info.Vmfs.Extent | Select-Object -Property @{Name="Name";Expression={$Datastore.Name}}, DiskName } }
PowerShellCorpus/Github/Seniore_PowerShell/Get-FreeScsiLun.ps1
Get-FreeScsiLun.ps1
function Get-FreeScsiLun { <# .SYNOPSIS Find free SCSI LUNs .DESCRIPTION The function will find the free SCSI LUNs on an ESXi server .NOTES Author: Luc Dekens .PARAMETER VMHost The VMHost where to look for the free SCSI LUNs .EXAMPLE PS> Get-FreeScsiLun -VMHost $esx .EXAMPLE PS> Get...
PowerShellCorpus/Github/Seniore_PowerShell/DS_Inventory.ps1
DS_Inventory.ps1
$VC=localhost Connect-Viserver $VC $report = @() $SCRIPT_PARENT = Split-Path -Parent $MyInvocation.MyCommand.Definition #Get all Datastore Cluster $dataStoreClusters = Get-DatastoreCluster #save characteristics #get all corresponding datastores: ForEach ($dataStoreCluster in $dataStoreClusters) { ForEa...