full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/absmart_PowerShell/Citrix/Trending-XAEventLog.ps1
Trending-XAEventLog.ps1
Import-Module (Join-Path $env:POWERSHELL_HOME "Libraries\General_Functions.psm1") Import-Module (Join-Path $env:POWERSHELL_HOME "Libraries\General_Variables.psm1") Import-Module (Join-Path $env:POWERSHELL_HOME "Libraries\SharePoint_Functions.ps1") Import-Module (Join-Path $env:POWERSHELL_HOME "Citrix\Citrix_Function...
PowerShellCorpus/Github/absmart_PowerShell/Citrix/Trending-XAApplicationUsage.ps1
Trending-XAApplicationUsage.ps1
<# .SYNOPSIS This script was developed to provide a way to schedule a job (in this example every 5min) to get a list of processes and log their utilization to a SQL database. These logs were used to understand and better provide information on the frequency and usage on multiple applications in both 6.0 and 7....
PowerShellCorpus/Github/absmart_PowerShell/Chef/Set-ChefRequiredWinRMSettings.ps1
Set-ChefRequiredWinRMSettings.ps1
winrm quickconfig -q winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}' winrm set winrm/config '@{MaxTimeoutms="1800000"}' #winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service/auth '@{Basic="true"}' netsh advfirewall firewall add rule name="WinRM 5985" protocol=TC...
PowerShellCorpus/Github/absmart_PowerShell/PRTG/Get-SPCrawlStatus.ps1
Get-SPCrawlStatus.ps1
param( $ComputerName, $Username, $Password ) $securePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ($Username, $securePassword) $sources = Invoke-Command -ComputerName $ComputerName -Credential $Credential...
PowerShellCorpus/Github/absmart_PowerShell/PRTG/Get-SPTimerStatus.ps1
Get-SPTimerStatus.ps1
param( $JobName, $ComputerName, $Username, $Password ) $securePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force $Credential = New-Object System.Management.Automation.PSCredential ($Username, $securePassword) Write-Host "<prtg>" foreach($job in $jobName){ $...
PowerShellCorpus/Github/absmart_PowerShell/Trending/Trending-UNCShare.ps1
Trending-UNCShare.ps1
<# .SYNOPSIS This script is used to trend filesystem usage of a particular application. Supply the script with a XML config with the appropriate information contained. Example XML Config: <Trending> <dst>http://sharepoint.domain.tld/Department/Support/</dst> <output_path>D:\LogFiless\ContentGrowth</...
PowerShellCorpus/Github/absmart_PowerShell/Trending/Trending-FreeDiskSpace.ps1
Trending-FreeDiskSpace.ps1
param ( [Parameter(Mandatory=$true)] [string] $file ) if( (Get-PSSnapin | Where { $_.Name -eq "StoragePoint.PowershellCmdlets" }) -eq $nul ) { Add-PSSnapIn StoragePoint.PowershellCmdlets } . (Join-Path $env:POWERSHELL_HOME "Libraries\General_Functions.psm1") . (Join-Path $env:POWERSHELL_HOME "Libraries\S...
PowerShellCorpus/Github/absmart_PowerShell/Setup/Enable-PSRemote.ps1
Enable-PSRemote.ps1
# http://ss64.com/ps/syntax-elevate.html powershell.exe -noprofile -executionPolicy bypass -command {Set-Item WSMan:\localhost\Shell\AllowRemoteShellAccess -Value $true} Start-Process powershell.exe -Verb runAs -ArgumentList "-noProfile -command {Set-Item WSMan:\localhost\Shell\AllowRemoteShellAccess -Value $true...
PowerShellCorpus/Github/absmart_PowerShell/VMware/Get-VMDetails.ps1
Get-VMDetails.ps1
Get-VM | Select Name, PowerState, Version, Description, Notes, Guest, NumCPU, MemoryMB, MemoryGB, @{name='HardDisks';expression={$_.HardDisks}}, Host, UsedSpaceGB, ProvisionedSpaceGB | Export-Csv -NoTypeInformation -Path C:\Temp\VMExport.csv
PowerShellCorpus/Github/sup3rmark_XKCDcheck/XKCDcheck.ps1
XKCDcheck.ps1
param( # Optionally define the address to send the report to # If not otherwise specified, send to the From address [string]$EmailTo = '_@gmail.com', # Specify the SMTP server address (if not gmail) # Assumes SSL, because security! [string]$SMTPserver = 'smtp.gmail.com', # Specify...
PowerShellCorpus/Github/kbatsalaruban_Azure/Stuff/file.ps1
file.ps1
#something here Get-AzureVM # $var = (Get-Alias).Name $var
PowerShellCorpus/Github/ssrikantan_DxNextReadiness/IISInstal.ps1
IISInstal.ps1
configuration IISInstall { node ("localhost") { WindowsFeature IIS { Ensure = "Present" Name = "Web-Server" } } }
PowerShellCorpus/Github/colealtdelete_DB2-CheckBackup/DB2-CheckBackup.ps1
DB2-CheckBackup.ps1
<# .NOTES =========================================================================== Created with: SAPIEN Technologies, Inc., PowerShell Studio 2015 v4.2.86 Created on: 6/10/2015 4:02 PM Created by: Cole Lavallee Filename: DB2Check.ps1 ================================================...
PowerShellCorpus/Github/aartemjevas_Get-DHCPScopePCStatus/psake.ps1
psake.ps1
Properties { $scripts = Get-ChildItem "$PSScriptRoot\Get-DHCPScopePCStatus" -Filter *.ps1 -Recurse } Task Default -Depends LintTests,UnitTests Task LintTests { 'Running PSScriptAnalyzer' $saResults = Invoke-ScriptAnalyzer -Path "$PSScriptRoot\Get-DHCPScopePCStatus" -Severity @('Error','Warning') -Ve...
PowerShellCorpus/Github/aartemjevas_Get-DHCPScopePCStatus/build.ps1
build.ps1
[cmdletbinding()] param( [string[]]$Task = 'default' ) Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null Install-Module Psake, PSDeploy, PSScriptAnalyzer -force Install-Module Pester -Force -SkipPublisherCheck Import-Module Psake, Pester, PSScriptAnalyzer try { Invoke-psake -buildFile "...
PowerShellCorpus/Github/aartemjevas_Get-DHCPScopePCStatus/Get-DHCPScopePCStatus/Private/Get-DHCPScopePC.ps1
Get-DHCPScopePC.ps1
Function Get-DHCPScopePC { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string]$ScopeID, [Parameter(Mandatory=$true)] [string]$Server ) try { Get-DhcpServerv4Lease -ComputerName $Server -ScopeId $ScopeID -ErrorAction Stop | Sele...
PowerShellCorpus/Github/aartemjevas_Get-DHCPScopePCStatus/Get-DHCPScopePCStatus/Public/Get-DHCPScopePCStatus.ps1
Get-DHCPScopePCStatus.ps1
<# .SYNOPSIS Gets Computers status from DHCP scope .DESCRIPTION The Get-DHCPScopePCStatus function gets computers from specified DHCP scope and checks if computers in the scope is turned on or off. It returns an object wiht parameters - IPAddress, Status, MACAddress, Computername .PARAMETER ScopeID DHCP S...
PowerShellCorpus/Github/aartemjevas_Get-DHCPScopePCStatus/Tests/Unit.Tests.ps1
Unit.Tests.ps1
$projectRoot = Resolve-Path "$PSScriptRoot\.." $moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1") $moduleName = Split-Path $moduleRoot -Leaf $scripts = Get-ChildItem -Path $moduleRoot -Filter "*.ps1" -Recurse foreach($script in $scripts) { . $script.fullname } Describe "Get-DHCPScopePCStatu...
PowerShellCorpus/Github/annejsimmons_create_website_iis/install_website.ps1
install_website.ps1
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i $website_name = "MyWebsite" $website_source_directory = resolve-path "..\MyWebsite" $website_virtual_directory = "IIS:\Sites\MyWebsite" $app_pool_name = "MyWebsite_AppPool" $app_pool_virtual_directory = "IIS:\AppPools\MyWebsite_AppPool" $sub...
PowerShellCorpus/Github/fabriciorissetto_ORM-CommonMistakes/src/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/fabriciorissetto_ORM-CommonMistakes/src/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/LazyRichard_Windows-ADK-Powershell/Copy-WinPE.ps1
Copy-WinPE.ps1
[cmdletbinding()] param ( $Architecture, $Destination, $locale = "en-us" ) # # Environment Variables # $TEMPL = "media" $FWFILES = "fwfiles" $WinKitsPath = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit" $WinPEPath = "$WinKitsPath\Windows Preinstallation Environment" ...
PowerShellCorpus/Github/ENikS_bitcoin-dev-msvc/workarounds/Get-HexDump.ps1
Get-HexDump.ps1
############################################################################## #.Synopsis # Display the hex dump of a file. # #.Parameter Path # Path to file as a string or as a System.IO.FileInfo object; # object can be piped into the function, string cannot. # #.Parameter Width # Number of hex by...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1488780843536/.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/OPSTest_NewC/.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/Technix2002_Deploy/TightVNC.ps1
TightVNC.ps1
# usage .\TightVNC.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $arc = '32bit' } If($architecture.AddressWidth -eq 64) { $arc = '64bit' } # poplulating more variables $ErrorAction...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Disable-Standby-Sleep.ps1
Windows7-Disable-Standby-Sleep.ps1
# usage .\Disable-Standby-Sleep.ps1 # populating variables $target = 'c:\temp\Payload' $hkey = 'HKEY_LOCAL_MACHINE' $keys = 'SYSTEM\CurrentControlSet\Services\ACPI' $name = 'Parameters' $type = 'DWORD' $value = '112' # changes registry value to enable standby Set-ItemProperty -Path Microsoft.PowerShell...
PowerShellCorpus/Github/Technix2002_Deploy/3CDaemon.ps1
3CDaemon.ps1
# usage .\3CDaemon.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $ProgFiles...
PowerShellCorpus/Github/Technix2002_Deploy/Gigaware-USBtoSerial.ps1
Gigaware-USBtoSerial.ps1
# usage .\Gigaware-USBtoSerial.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) {...
PowerShellCorpus/Github/Technix2002_Deploy/Un-Artemis.ps1
Un-Artemis.ps1
# Usage .\Un-Artemis.ps1 # setting variables $target = 'c:\temp\Payload' $loggedin = Get-WmiObject -Namespace root\cimv2 -Class Win32_ComputerSystem -erroraction silentlycontinue | Select-Object -Property Username $username = Split-Path $loggedin.Username.ToString() -Leaf $objUser = New-Object System.Security....
PowerShellCorpus/Github/Technix2002_Deploy/Adobe-Flash.ps1
Adobe-Flash.ps1
# usage .\Flash.ps1 # create folders on target New-Item -Path "c:\temp\Payload\" -type directory -Force # Checks architecture $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth # download newest redistributable flash player from Adobe $source = "http://download.macromedia.com/get/fla...
PowerShellCorpus/Github/Technix2002_Deploy/TeraTerm.ps1
TeraTerm.ps1
# usage .\TeraTerm.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' } If($architecture.AddressWidth -eq 64) { $ProgFiles = 'Program Files (x86)' } # poplul...
PowerShellCorpus/Github/Technix2002_Deploy/CitrixReceiver.ps1
CitrixReceiver.ps1
# usage .\CitrixReceiver.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Fil...
PowerShellCorpus/Github/Technix2002_Deploy/HOSTS.ps1
HOSTS.ps1
#usage .\HOSTS.ps1 # Checks architecture to set Program Files $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) {$ProgFiles = "Program Files"} If($query.AddressWidth -eq 64) {$ProgFiles = "Program Files (x86)"} # poplulating variables $file = 'HOSTS...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-IE-Jscript-fix.ps1
Microsoft-IE-Jscript-fix.ps1
# usage .\IE-Jscript.ps1 # populating variables $target = 'c:\temp\Payload' $system32 = 'c:\windows\system32' $regsvr = "$system32\regsvr32.exe" $dlls = 'vbscript.dll','jscript.dll' $switches = '/s' # execute command Foreach ($dll in $dlls) { $arglist = "$system32\$dll $switches" $newProc=([WMICLASS]"...
PowerShellCorpus/Github/Technix2002_Deploy/Template-Install.ps1
Template-Install.ps1
# ============================================================ # Install APPLICATION NAME & VERSION # ============================================================ # Date: # Author: # ============================================================ # Script Details: # # EXIT CODES # 0 - SUCCESSFUL # 1 -...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-DotNet4.ps1
Microsoft-DotNet4.ps1
# usage .\Microsoft-DotNet4.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $...
PowerShellCorpus/Github/Technix2002_Deploy/Plantronics-Hub.ps1
Plantronics-Hub.ps1
# usage .\Plantronics-Hub.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Fi...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Disable-OfflineFiles.ps1
Windows7-Disable-OfflineFiles.ps1
# usage .\OfflineFilesDisable.ps1 # populating variables $target = 'c:\temp\Payload\' $service = 'CscService' $start = 'Disable' # stop process Stop-Process -Name $service -Force Set-Service -Name $service -StartupType $start # remove files Remove-Item -Path $target -Recurse -Force
PowerShellCorpus/Github/Technix2002_Deploy/Mozilla-Thunderbird.ps1
Mozilla-Thunderbird.ps1
# usage .\Mozilla-Thunderbird.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { ...
PowerShellCorpus/Github/Technix2002_Deploy/TRENDnet-TU2-ET100-Ethernet2USB.ps1
TRENDnet-TU2-ET100-Ethernet2USB.ps1
# usage .\TRENDnet-TU2-ET100-Ethernet2USB.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidt...
PowerShellCorpus/Github/Technix2002_Deploy/Adobe-Shockwave.ps1
Adobe-Shockwave.ps1
# usage .\Shockwave.ps1 # Checks architecture $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth # applies variables $URL = "http://www.adobe.com/go/adobeconnect_9_addin_win" $download = "ac_addin_win_392.zip" $target = "c:\temp\Payload" $file = "setup.exe" $switches = "/verysile...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-Office-MonthViewControl.ps1
Microsoft-Office-MonthViewControl.ps1
# usage .\Office-MonthViewControl.ps1 # populating variables $target = 'c:\temp\Payload' $URL = 'http://activex.microsoft.com/controls/vb6/mscomct2.cab' $file = 'mscomct2.cab' $switches = "-F:*.* $target\$file c:\Windows\System32" # create folder on target New-Item -Path "$target" -type directory -Force ...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Enable-USBStorage.ps1
Windows7-Enable-USBStorage.ps1
# usage .\USBStorageEnable.ps1 # populating variables $target = 'c:\temp\Payload\' $hkey = 'HKEY_LOCAL_MACHINE' $keys = 'SYSTEM\CurrentControlSet\Services\UsbStor' $name = 'Start' $type = 'DWORD' $value = '3' $usbstors = 'c:\Windows\Inf\usbstor.inf','c:\Windows\Inf\usbstor.PNF','c:\Windows\system32\drivers\...
PowerShellCorpus/Github/Technix2002_Deploy/SpyAdBlocker.ps1
SpyAdBlocker.ps1
# .\SpyAdBlocker.ps1 # Checks architecture to set Program Files $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) {$ProgFiles = "Program Files"} If($query.AddressWidth -eq 64) {$ProgFiles = "Program Files (x86)"} # poplulating variables $script = 'S...
PowerShellCorpus/Github/Technix2002_Deploy/Libre-Office.ps1
Libre-Office.ps1
# usage .\LibreOffice.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Files ...
PowerShellCorpus/Github/Technix2002_Deploy/Adobe-AcrobatReader.ps1
Adobe-AcrobatReader.ps1
# usage .\AcrobatReader.ps1 - installs Adobe Acrobat Reader 11.0.04 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWid...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Add-Telnet.ps1
Windows7-Add-Telnet.ps1
# usage .\TelnetAdd.ps1 # to add Telnet back to Windows 7 $newProc=([WMICLASS]"root\cimv2:win32_Process").create("c:\Windows\System32\dism.exe /online /Enable-Feature /FeatureName:TelnetClient") While(Get-WmiObject Win32_Process -filter "ProcessID='$($newProc.ProcessID)'"){start-sleep -seconds 5} # cleanup ...
PowerShellCorpus/Github/Technix2002_Deploy/SlingPlayer-ActiveX.ps1
SlingPlayer-ActiveX.ps1
# usage .\SlingPlayer-ActiveX.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { ...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-IE-Cleanup.ps1
Microsoft-IE-Cleanup.ps1
# usage .\IE-Cleanup.ps1 # ends task on Internet Explorer Stop-Process -processname "iexplore" -Force Stop-Process -processname "chrome" -Force # deletes temporary Internet files across all profiles remove-item "c:\Users\*\AppData\Local\Microsoft\Windows\Temporary Internet Files\*.*" -recurse -force remov...
PowerShellCorpus/Github/Technix2002_Deploy/TeamViewer.ps1
TeamViewer.ps1
# usage .\TeamViewer.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $ProgFil...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-InternetExplorer9.ps1
Microsoft-InternetExplorer9.ps1
# usage .\InternetExplorer9.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software' $URL = 'http://download.microsoft.com/download/C/3/B/C3BF2E...
PowerShellCorpus/Github/Technix2002_Deploy/Google-Earth.ps1
Google-Earth.ps1
# usage .\Google-Earth.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $ProgF...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Enable-Hibernate.ps1
Windows7-Enable-Hibernate.ps1
# usage .\HibernateEnable.ps1 # populating variables $target = 'c:\temp\Payload\' $hkey = 'HKEY_LOCAL_MACHINE' $keys = 'SYSTEM\CurrentControlSet\Control\Power' $name = 'HibernateEnabled' $type = 'DWORD' $value = '1' # changes registry value to enable hibernation Set-ItemProperty -Path Microsoft.PowerSh...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Spooler.ps1
Windows7-Spooler.ps1
# usage .\Template-Payload.ps1 # poplulating more variables $ErrorActionPreference = "Stop" $target = 'c:\temp\Payload' $service = 'Spooler' $spool = 'c:\windows\system32\spool\printers' # create folder on target New-Item -Path "$target" -type directory -Force # stop spooler Set-Service -name $serv...
PowerShellCorpus/Github/Technix2002_Deploy/Libre-Office-Remove.ps1
Libre-Office-Remove.ps1
# Usage .\LibreRemove.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Files (x86)'} # populating variables $appre...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-Bing3D.ps1
Microsoft-Bing3D.ps1
# usage .\Bing3D.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Files (x86)...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-Office-Remove.ps1
Microsoft-Office-Remove.ps1
# Usage .\OfficeRemove.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Files (x86)'} # populating variables $targ...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-IE-SeperateProcesses.ps1
Microsoft-IE-SeperateProcesses.ps1
# usage .\IE-SeperateProcesses.ps1 # populating variables $target = 'c:\temp\Payload\' $loggedin = Get-WmiObject -Namespace root\cimv2 -Class Win32_ComputerSystem -erroraction silentlycontinue | Select-Object -Property Username $username = Split-Path $loggedin.Username.ToString() -Leaf $objUser = New-Object S...
PowerShellCorpus/Github/Technix2002_Deploy/PlantronicsURE.ps1
PlantronicsURE.ps1
# usage .\PlantronicsURE.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Fil...
PowerShellCorpus/Github/Technix2002_Deploy/puTTY.ps1
puTTY.ps1
# usage .\puTTY.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $ProgFiles = ...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Enable-Standby-Sleep.ps1
Windows7-Enable-Standby-Sleep.ps1
# usage .\Enable-Standby-Sleep.ps1 # populating variables $target = 'c:\temp\Payload' $hkey = 'HKEY_LOCAL_MACHINE' $keys = 'SYSTEM\CurrentControlSet\Services\ACPI' $name = 'Parameters' # changes registry value to enable standby Remove-ItemProperty -Path Microsoft.PowerShell.Core\Registry::"$hkey\$keys" -...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-Disable-Hibernate.ps1
Windows7-Disable-Hibernate.ps1
# usage .\HibernateDisable.ps1 # populating variables $target = 'c:\temp\Payload' $hkey = 'HKEY_LOCAL_MACHINE' $keys = 'SYSTEM\CurrentControlSet\Control\Power' $name = 'HibernateEnabled' $type = 'DWORD' $value = '0' # changes registry value to enable hibernation Set-ItemProperty -Path Microsoft.PowerSh...
PowerShellCorpus/Github/Technix2002_Deploy/QuickTime.ps1
QuickTime.ps1
# ============================================================ # Install QuickTime # ============================================================ # Date: 11/28/14 # Author: Brad # ============================================================ # Script Details: # # # EXIT CODES # 0 - SUCCESSFUL # 1 - I...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-IE-LeftClick-Fix.ps1
Microsoft-IE-LeftClick-Fix.ps1
# usage .\IE-LeftClickFix.ps1 # populating variables $process = 'iexplore' $target = 'c:\temp\Payload\' $hkey = 'HKEY_LOCAL_MACHINE' # Checks architecture to set set registry key values $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $keys = '...
PowerShellCorpus/Github/Technix2002_Deploy/PublicDesktopPerms.ps1
PublicDesktopPerms.ps1
# usage .\PublicDesktopPerms.ps1 # sets permissions on Public\Desktop to allow for icons to be removed $newProc=([WMICLASS]"root\cimv2:win32_Process").create("c:\windows\system32\cacls.exe ""c:\Users\Public\Desktop"" /t /e /p Users:F") While(Get-WmiObject Win32_Process -filter "ProcessID='$($newProc.ProcessID)'"){...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-Project-Remove.ps1
Microsoft-Project-Remove.ps1
# Usage .\Microsoft-Project-Remove.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Files (x86)'} # populating vari...
PowerShellCorpus/Github/Technix2002_Deploy/Plantronics-URE.ps1
Plantronics-URE.ps1
# usage .\PlantronicsURE.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Fil...
PowerShellCorpus/Github/Technix2002_Deploy/FileZilla.ps1
FileZilla.ps1
# usage .\FileZilla.ps1 # Checks architecture to set variables $query = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($query.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software' } If($query.AddressWidth -eq 64) { $ProgFiles = 'Program Files ...
PowerShellCorpus/Github/Technix2002_Deploy/VLC-Player.ps1
VLC-Player.ps1
# usage .\VLC-Player.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software' $arc = 'win32' } If($architecture.AddressWidth -...
PowerShellCorpus/Github/Technix2002_Deploy/Microsoft-Office-Excel-DDE-error.ps1
Microsoft-Office-Excel-DDE-error.ps1
# usage .\Office-Excel-DDE-error.ps1 # populating variables $target = 'c:\temp\Payload' $hkey = 'HKEY_CLASSES_ROOT' $type = 'String' # function ToArray function ToArray { begin { $output = @(); } process { $output += $_; } end { return ,$output; } } # ...
PowerShellCorpus/Github/Technix2002_Deploy/Windows7-PublicDesktopPerms.ps1
Windows7-PublicDesktopPerms.ps1
# usage .\PublicDesktopPerms.ps1 # sets permissions on Public\Desktop to allow for icons to be removed $newProc=([WMICLASS]"root\cimv2:win32_Process").create("c:\windows\system32\cacls.exe ""c:\Users\Public\Desktop"" /t /e /p Users:F") While(Get-WmiObject Win32_Process -filter "ProcessID='$($newProc.ProcessID)'"){...
PowerShellCorpus/Github/Technix2002_Deploy/WinSQL.ps1
WinSQL.ps1
# usage .\WinSQL.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $ProgFiles =...
PowerShellCorpus/Github/Technix2002_Deploy/SnagIt-Pro.ps1
SnagIt-Pro.ps1
# usage .\SnagIt-Pro.ps1 # Checks architecture to set variables $architecture = Get-WmiObject -Class Win32_Processor | Select-Object AddressWidth If($architecture.AddressWidth -eq 32) { $ProgFiles = 'Program Files' $Keyvalue = 'HKEY_LOCAL_MACHINE\Software'} If($architecture.AddressWidth -eq 64) { $ProgFil...
PowerShellCorpus/Github/Technix2002_Deploy/Push.ps1
Push.ps1
# .\Push.ps1 $ErrorActionPreference = "Stop" # center text, credit for this is here: http://project500.squarespace.com/journal/2014/1/5/powershell-centering-console-text Function Write-Centered { Param( [string] $message, [string] $color = "black") $offsetvalue = [Math]::Round(([Console...
PowerShellCorpus/Github/Technix2002_Deploy/Tools/Bin2S.ps1
Bin2S.ps1
# usage .\Bin2S.ps1 -Path c:\whatever.exe , this copies output to clip board to paste in a new script param ( [string] $Path = $(throw "-Path is required")) function Convert-BinaryToString { [CmdletBinding()] param ( [string] $FilePath = $(throw "-FilePath is required") ...
PowerShellCorpus/Github/FrodeHus_Workshop/Source/End/EnigmaApp/Scripts/Deploy-FabricApplication.ps1
Deploy-FabricApplication.ps1
<# .SYNOPSIS Deploys a Service Fabric application type to a cluster. .DESCRIPTION This script deploys a Service Fabric application type to a cluster. It is invoked by Visual Studio when deploying a Service Fabric Application project. .NOTES WARNING: This script file is invoked by Visual Studio. Its paramet...
PowerShellCorpus/Github/FrodeHus_Workshop/Source/End/AzureResources/New-ServiceFabricClusterCertificate.ps1
New-ServiceFabricClusterCertificate.ps1
#Requires -Module AzureRM.KeyVault # Use this script to create a certificate that you can use to secure a Service Fabric Cluster # This script requires an existing KeyVault that is EnabledForDeployment. The vault must be in the same region as the cluster. # To create a new vault and set the EnabledForDeployment p...
PowerShellCorpus/Github/FrodeHus_Workshop/Source/End/AzureResources/Scripts/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 #Requires -Module AzureRM.Resources #Requires -Module Azure.Storage Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'Begin', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageContainerName = $...
PowerShellCorpus/Github/FrodeHus_Workshop/Unity/AppPackages/WorkshopClient_1.0.4.0_Debug_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/kezcol_pks/pks/src/pks.api/Properties/PublishProfiles/pksapi - Web Deploy-publish.ps1
pksapi - Web Deploy-publish.ps1
[cmdletbinding(SupportsShouldProcess=$true)] param($publishProperties=@{}, $packOutput, $pubProfilePath) # to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 try{ if ($publishProperties['ProjectGuid'] -eq $null){ $publishProperties['ProjectGuid'] = '0bc72d16-256f-462...
PowerShellCorpus/Github/wumb0_ISTS-PS-Scripts/PowerCLI-Skeleton.ps1
PowerCLI-Skeleton.ps1
# PowerCLI script skeleton param ( #add script params here [Parameter(Mandatory=$true)][String]$VCenterServerAddress, [String]$VCenterUser, [String]$VCenterPassword ) begin { #define functions in here Add-PSSnapin vmware.vimautomation.core -ErrorAction Stop if (!$global:DefaultVIServer)...
PowerShellCorpus/Github/wumb0_ISTS-PS-Scripts/resource/Add-DnsRecordsFromCSV.ps1
Add-DnsRecordsFromCSV.ps1
param ( [Parameter(Mandatory=$true)][string]$FileName, [Parameter(Mandatory=$true)][int32]$TeamNumber, [switch]$CreatePtrs = $true ) Import-Csv $FileName | % { $fqdn = $_.Name.replace("teamX","team$TeamNumber") $name = $fqdn.split(".")[0] $domain_split = $fqdn.split(".") $domain =...
PowerShellCorpus/Github/wumb0_ISTS-PS-Scripts/resource/Deploy-ISTSDomainController.ps1
Deploy-ISTSDomainController.ps1
param ( [switch]$Uninstall = $false, [String]$DomainName, [String]$NetBiosName, [String]$SafeModePassword = "Password1!" ) if ($Uninstall){ Write-Host "Uninstalling DNS and ADDS Roles" Import-Module ADDSDeployment Uninstall-ADDSDomainController -LastDomainControllerInDomain -Ignor...
PowerShellCorpus/Github/wumb0_ISTS-PS-Scripts/resource/misc/Invoke-PowerOnOrPoweroff.ps1
Invoke-PowerOnOrPoweroff.ps1
param ( [Parameter(Mandatory=$true)][int32]$TeamNumber, [switch]$PowerOn = $false ) Connect-VIServer -Server 10.0.1.100 -Protocol https -Force -V $VMS = Get-VM | where {$_.Name -eq "Team$TeamNumber-" -or $_.Name -eq "Team$TeamNumber-" -or $_.Name -eq "Team$TeamNumber-" -or } ...
PowerShellCorpus/Github/wumb0_ISTS-PS-Scripts/resource/misc/addusers.ps1
addusers.ps1
# adds users in the form name|password from CSV users.txt param ( [switch]$DryRun = $false, [string]$UserFile = "users.txt", [Parameter(Mandatory=$true)][Int32]$TeamNumber, [switch]$DeleteUsers ) $csv = Import-CSV $UserFile -Delimiter "|" foreach ($l in $csv){ $name = $l.name.split(" ") $fname = $n...
PowerShellCorpus/Github/wumb0_ISTS-PS-Scripts/resource/misc/Move-Vms.ps1
Move-Vms.ps1
param ( [int]$TeamN ) get-vm | where {$_.Name -eq "Team$TeamN-Helpdesk" -or $_.Name -eq "Team$TeamN-win10" -or $_.Name -eq "Team$TeamN-Team0-kali1"} | % { Move-VM -Datastore "team$TeamN" -VM $_ -Destination 10.2.$TeamN.10 -DiskStorageFormat Thin }
PowerShellCorpus/Github/mcdonaldbm_HandsOnHacking2016/Cmdlets.ps1
Cmdlets.ps1
# Computer System Get-WmiObject -Class Win32_ComputerSystem # Operating System Get-WmiObject -class win32_OperatingSystem # BIOS Get-WmiObject -class win32_BIOS
PowerShellCorpus/Github/mcdonaldbm_HandsOnHacking2016/Example2.ps1
Example2.ps1
Function Get-ComputerInformation { PARAM ($ComputerName) # Computer System $ComputerSystem = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $ComputerName # Operating System $OperatingSystem = Get-WmiObject -class win32_OperatingSystem -ComputerName $ComputerName # BIOS $Bios...
PowerShellCorpus/Github/mcdonaldbm_HandsOnHacking2016/Example1.ps1
Example1.ps1
Function Get-ComputerInformation { # Computer System Get-WmiObject -Class Win32_ComputerSystem # Operating System Get-WmiObject -class win32_OperatingSystem # BIOS Get-WmiObject -class win32_BIOS } Get-ComputerInformation
PowerShellCorpus/Github/CBurbidge_GitHooks/GitHooks/Install.ps1
Install.ps1
# This assumes that the Install file is in a folder called GitHooks at the root of the repo # It won't work if this isn't the case. function BackupFileIfExists($file) { if((Test-Path $file)) { $dateSuffix = (Get-Date).ToString("s").Replace(":","") $backupFile = "$file.backup.$dateSuffix" ...
PowerShellCorpus/Github/CBurbidge_GitHooks/GitHooks/CommitMessageReplace.ps1
CommitMessageReplace.ps1
param([string] $commitFile) $messageFileContent = Get-Content ($commitFile) $jiraItemRegex = "^feature\/[A-Za-z0-9]+(\-|_)\d+" $currentBranch = git rev-parse --abbrev-ref HEAD # Only do things if is a feature branch if($currentBranch -match $jiraItemRegex) { Write-Host "Matches JIRA feature branch"...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Tasks/RestoreSqlDatabaseToSqlDatabase/RestoreSqlDatabaseToSqlDatabase.ps1
RestoreSqlDatabaseToSqlDatabase.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { # Get inputs. $ServerName = Get-VstsInput -Name ServerName -Require $SourceDatabaseName = Get-VstsInput -Name SourceDatabaseName -Require $TargetDatabaseName = Get-VstsInput -Name TargetDatabaseName -Require # I...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Tasks/ExecuteSql/ExecuteSql.ps1
ExecuteSql.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { $ScriptType = Get-VstsInput -Name ScriptType -Require $ScriptPath = Get-VstsInput -Name ScriptPath $PredefinedScript = Get-VstsInput -Name PredefinedScript $Variables = Get-VstsInput -Name Variables $Inline...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Tasks/SqlMultiDacpacDeployment/SqlMultiDacpacDeployment.ps1
SqlMultiDacpacDeployment.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { $DacpacFiles = Get-VstsInput -Name DacpacFiles -Require $AdditionalArguments = Get-VstsInput -Name AdditionalArguments $ServerName = Get-VstsInput -Name ServerName -Require $DatabaseName = Get-VstsInput -Name DatabaseN...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Tasks/StopWebApp/StopWebApp.ps1
StopWebApp.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { # Get inputs. $WebAppName = Get-VstsInput -Name WebAppName -Require $Slot = Get-VstsInput -Name Slot $StoppedUrl = Get-VstsInput -Name StoppedUrl # Initialize Azure. Import-Module $PSScriptRoot\ps_modules\VstsAzureH...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Tasks/SwapSlots/SwapSlots.ps1
SwapSlots.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { # Get inputs. $WebAppName = Get-VstsInput -Name WebAppName -Require $SourceSlot = Get-VstsInput -Name SourceSlot -Require $DestinationSlot = Get-VstsInput -Name DestinationSlot -Require $DestinationUrl = Get-VstsIn...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Tasks/StartWebApp/StartWebApp.ps1
StartWebApp.ps1
[CmdletBinding()] param() Trace-VstsEnteringInvocation $MyInvocation try { # Get inputs. $WebAppName = Get-VstsInput -Name WebAppName -Require $Slot = Get-VstsInput -Name Slot $StartedUrl = Get-VstsInput -Name StartedUrl # Initialize Azure. Import-Module $PSScriptRoot\ps_modules\VstsAzureH...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Common/PowerShell3/VstsAzureHelpers/HelperFunctions.ps1
HelperFunctions.ps1
function Get-AgentStartIPAddress { $data = (Invoke-WebRequest -Uri "whatismyip.org" -UseBasicParsing -Verbose).Content $ipRegex = "(?<Address>((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))" if ($data -Match $ipRegex) { $startIP = $Matches.Address } ...
PowerShellCorpus/Github/geeklearningio_gl-vsts-tasks-azure/Common/PowerShell3/VstsAzureHelpers/FindSqlPackagePath.ps1
FindSqlPackagePath.ps1
function Get-SqlPackageOnTargetMachine { try { $sqlDacPath, $sqlVersion = Get-HighestVersionSqlPackageWithSqlLocation $sqlVersionNumber = [decimal] $sqlVersion } catch [System.Exception] { Write-VstsTaskVerbose -Message ("Failed to get Dac Framework (installed with SQL Server) ...