full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/Bpedigo_powershell-scripts/run-profiles.ps1
run-profiles.ps1
<# .SYNOPSIS Creates a new blank PowerShell profile with a description built in and opens the ISE .DESCRIPTION .PARAMETER <-all> .EXAMPLE new-script .INPUTS .OUTPUTS .NOTES Author: Brian Pedigo Created: March 2015 .LINK https://github.com/Bpedigo #> ...
PowerShellCorpus/Github/Bpedigo_powershell-scripts/new-script.ps1
new-script.ps1
<# .SYNOPSIS Creates a new blank PowerShell scirpt file with a description built in and opens the ISE .DESCRIPTION .PARAMETER -filename .EXAMPLE new-script .INPUTS .OUTPUTS .NOTES Author: Brian Pedigo Created: March 2015 .LINK https://github.com/Bpedigo ...
PowerShellCorpus/Github/OPSTest_E2E_Provision_1488668742022/.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/DramaticDevelopment_Dramatic.NZBIndex/Search-Striparchief2015NZB.ps1
Search-Striparchief2015NZB.ps1
# Search-StripArchief2015NZB.ps1 # Search the NZBIndex.nl site for StripArchief_2015 items # Jan 2015 # If this works, this was written by Victor Vogelpoel (victor@victorvogelpoel.nl) # If it doesn't work, I don't know who wrote this. # # This program is free software; you can redistribute it and/or modify it und...
PowerShellCorpus/Github/DramaticDevelopment_Dramatic.NZBIndex/Search-NZBIndex.ps1
Search-NZBIndex.ps1
# Search-NZBIndex.ps1 # Search the NZBIndex.nl site # Jan 2015 # If this works, this was written by Victor Vogelpoel (victor@victorvogelpoel.nl) # If it doesn't work, I don't know who wrote this. # # This program is free software; you can redistribute it and/or modify it under the terms # of the GNU General Pub...
PowerShellCorpus/Github/DramaticDevelopment_Dramatic.NZBIndex/install/install.ps1
install.ps1
$module = 'Dramatic.NZBIndex' $gitrepository = 'https://github.com/dramaticdevelopment/Dramatic.NZBIndex' # Make sure the module is not loaded Remove-Module $module -ErrorAction SilentlyContinue # Download latest version $webclient = New-Object System.Net.WebClient $url = "$gitrepository/archive/m...
PowerShellCorpus/Github/DramaticDevelopment_Dramatic.NZBIndex/examples/Example_DownloadComic_NZB.ps1
Example_DownloadComic_NZB.ps1
# Load the module and its CmdLets Import-Module Dramatic.NZBIndex # Search t NZBIndex for a specific comic: $NZBs = Search-StripArchief2015NZB -searchTerm thorgal, kriss $NZBs # NZBTitle NZBUrl ...
PowerShellCorpus/Github/hjyao_git-workshop/sayHi.ps1
sayHi.ps1
$names = [string](Get-Content .\names.txt) $names.Split(",") | ForEach-Object {Write-Host "Hello" $_}
PowerShellCorpus/Github/waref_Weather-WithDirective/WebApplication1/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/waref_Weather-WithDirective/WebApplication1/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/jediry_tether-y/Tether-Y.ps1
Tether-Y.ps1
# equires -RunAsAdministrator Param([Switch] $WhatIf=$False, [String] $ConfigFile="$($Env:USERPROFILE)\.tether-y.xml") $Script:KeyBuffer = $Null Function Get-Key { $Key = $Null # If we previously pushed a key back, that's the key we want to return If ($Script:KeyBuffer -ne $Null) { ...
PowerShellCorpus/Github/jediry_tether-y/ProxyEngines/WindowsProxy.ps1
WindowsProxy.ps1
Param([string] $Action, [string] $ProxyIP = $Null, [string] $ProxyPort = $Null, $ExcludeAddresses = $Null, [switch] $WhatIf = $False) $Script:ProxyRegKey = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" Function Start-ProxyEngine([string] $ProxyIP, ...
PowerShellCorpus/Github/jediry_tether-y/ProxyEngines/Proxifier.ps1
Proxifier.ps1
Param([string] $Action, [string] $ProxyIP = $Null, [string] $ProxyPort = $Null, $ExcludeAddresses = $Null, [switch] $WhatIf = $False) Function Get-ProxifierPath { $ProgramFiles_x86 = (Get-Item "Env:\ProgramFiles(x86)").Value $Path = "$ProgramFiles_x86\Proxifier\Proxifier.exe" ...
PowerShellCorpus/Github/JonathanParrilla_Reset_Internet_Information_Services/PerformIISReset.ps1
PerformIISReset.ps1
<# Author:Jonathan Parrilla Created: 2/13/2015 Last Updated: 2/28/2015 #> #Function that will perform the IIS Reset on the list of servers provided by the user. Function PerformIISReset([String] $server) { #Write-Host Waiting 20 Seconds... #Wait 20 seconds between servers. This is done to prevent a...
PowerShellCorpus/Github/JonathanParrilla_Reset_Internet_Information_Services/GUI_IIS_Reset.ps1
GUI_IIS_Reset.ps1
#******************************* #Author: Jonathan Parrilla #Created: 2/15/2015 #Last Updated: 3/2/2015 #******************************* #Import the function that will perform the reset. . PerformIISReset.ps1 . WriteToLog.ps1 #Clear the console screen Clear-Host #Called in order to draw the GUI frame....
PowerShellCorpus/Github/JonathanParrilla_Reset_Internet_Information_Services/WriteToLog.ps1
WriteToLog.ps1
<# Author:Jonathan Parrilla Created: 2/23/2015 Last Updated: 2/23/2015 #> Function WriteToLog ([String] $user, [String] $script, [String] $logName) { #Get the user running this script #$userRunningScript = $user #Get the current date $currentDate = Get-Date #Get Script Na...
PowerShellCorpus/Github/jgregmac_AAD-Ops/Provision-MSOLUsers-student-only.ps1
Provision-MSOLUsers-student-only.ps1
# Provision-MSOLUsers.ps1 script, by J. Greg Mackinnon, 2014-07-30 # Updated 2014-11-20, new license SKU, corrections to error capture commands, and stronger typing of variables. # # Provisions all active student accounts in Active Directory with an Office 365 ProPlus license. # # Requires: # - PowerShell Module ...
PowerShellCorpus/Github/jgregmac_AAD-Ops/convertUserLicenses.ps1
convertUserLicenses.ps1
set-psdebug -Strict $sku1 = Get-MsolAccountSku | ? {$_.accountSkuId -match 'STANDARDWOFFPACK_IW_STUDENT'} $skuId1 = $sku1.AccountSkuId #$sku2 = Get-MsolAccountSku | ? {$_.accountSkuId -match 'OFFICESUBSCRIPTION_STUDENT'} #$skuId2 = $sku2.AccountSkuId $stuLicOpts = New-MsolLicenseOptions -AccountSkuId $studAdv.Ac...
PowerShellCorpus/Github/jgregmac_AAD-Ops/Provision-MSOLUsers.ps1
Provision-MSOLUsers.ps1
# Provision-MSOLUsers.ps1 script, by J. Greg Mackinnon, 2014-07-30 # Updated 2014-11-20, new license SKU, corrections to error capture commands, and stronger typing of variables. # Updated 2014-11-21, added "license options" package to the add license command, for granular service provisioning. # Updated 2014-12-22,...
PowerShellCorpus/Github/blackducksoftware_hub_powershell_api_example/hubProjects.ps1
hubProjects.ps1
<# author : Ton Schoots tested on Powershell version PS C:\Users\tschoots> $PSVersionTable.PSVersion Major Minor Build Revision ----- ----- ----- -------- 5 0 10586 494 HUB version: <server url>/debug?manifest Product-version: 3.3.0 Build: jenkins-HubV3.3...
PowerShellCorpus/Github/DCAG_Azure/LabTemplateAuthoringAndDeployment/VMDeploy/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 = 'LabTemplateAuthoringAndDeployment', [switch] $UploadArtifacts, [string] $StorageAccountName, [strin...
PowerShellCorpus/Github/yang7129_AngularjsExcel/MyTestWebBack/packages/Microsoft.AspNet.Providers.LocalDB.1.1/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) try { # Set up variables $timestamp = (Get-Date).ToString('yyyyMMddHHmmss') $projectName = [IO.Path]::GetFileName($project.ProjectName.Trim([IO.PATH]::DirectorySeparatorChar, [IO.PATH]::AltDirectorySeparatorChar)) $catalogName = "aspnet-$project...
PowerShellCorpus/Github/yang7129_AngularjsExcel/MyTestWebBack/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/yang7129_AngularjsExcel/MyTestWebBack/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/yang7129_AngularjsExcel/MyTestWebBack/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/yang7129_AngularjsExcel/MyTestWebBack/packages/EntityFramework.5.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) $importedModule = Get-Module | ?{ $_.Name -eq 'EntityFramework' } if ($PSVersionTable.PSVersion -ge (New-Object Version @( 3, 0 ))) { $thisModuleManifest = 'EntityFramework.PS3.psd1' } else { $thisModuleManifest = 'EntityFramework.psd1' } $thisModule...
PowerShellCorpus/Github/yang7129_AngularjsExcel/MyTestWebBack/packages/EntityFramework.5.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) function Invoke-ConnectionFactoryConfigurator($assemblyPath, $project) { $appDomain = [AppDomain]::CreateDomain( 'EntityFramework.PowerShell', $null, (New-Object System.AppDomainSetup -Property @{ ShadowCopyFiles = 'true' })) ...
PowerShellCorpus/Github/yang7129_AngularjsExcel/MyTestWebBack/packages/jQuery.UI.Combined.1.8.24/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $juiFileNameRegEx
PowerShellCorpus/Github/yang7129_AngularjsExcel/MyTestWebBack/packages/jQuery.UI.Combined.1.8.24/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 $juiFileNameRegEx ...
PowerShellCorpus/Github/yang7129_AngularjsExcel/MyTestWebBack/packages/jQuery.UI.Combined.1.8.24/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/yang7129_AngularjsExcel/MyTestWebBack/packages/jQuery.1.8.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/yang7129_AngularjsExcel/MyTestWebBack/packages/jQuery.1.8.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/yang7129_AngularjsExcel/MyTestWebBack/packages/jQuery.1.8.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/RaoulHolzer_DevIaaC/installDotNet.ps1
installDotNet.ps1
Function Install-Chocolaty { Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression } Function Install-Software { choco install visualstudio2015community -iy choco install pscx -iy choco install git.install -iy choco install 7zip -iy choco ...
PowerShellCorpus/Github/craibuc_dot-sourced/New-Guid.ps1
New-Guid.ps1
Function New-Guid { $guid = [guid]::NewGuid() Write-Host "Copying GUID to clipboard..." Add-Type -AssemblyName System.Windows.Forms $tb = New-Object System.Windows.Forms.TextBox $tb.Multiline = $true $tb.Text = $guid $tb.SelectAll() $tb.Copy() $guid } Set-Alias g...
PowerShellCorpus/Github/craibuc_dot-sourced/Set-Clipboard.ps1
Set-Clipboard.ps1
function Set-ClipBoard() { Param( [Parameter(ValueFromPipeline=$true)] [string] $text ) Add-Type -AssemblyName System.Windows.Forms $tb = New-Object System.Windows.Forms.TextBox $tb.Multiline = $true $tb.Text = $text $tb.SelectAll() $tb.Copy() } Set-Alias cpy Se...
PowerShellCorpus/Github/craibuc_dot-sourced/Touch-File.ps1
Touch-File.ps1
function touch-file([string[]]$paths) { begin { function updateFileSystemInfo([System.IO.FileSystemInfo]$fsInfo) { $datetime = get-date $fsInfo.CreationTime = $datetime $fsInfo.LastWriteTime = $datetime $fsInfo.LastAccessTime = $datetime } ...
PowerShellCorpus/Github/craibuc_dot-sourced/Get-Clipboard.ps1
Get-Clipboard.ps1
function Get-ClipBoard { Add-Type -AssemblyName System.Windows.Forms $tb = New-Object System.Windows.Forms.TextBox $tb.Multiline = $true $tb.Paste() $tb.Text } Set-Alias pst Get-ClipBoard
PowerShellCorpus/Github/craibuc_dot-sourced/Get-FileEncoding.ps1
Get-FileEncoding.ps1
function Get-FileEncoding { param ( [string] $FilePath ) [byte[]] $byte = get-content -Encoding byte -ReadCount 4 -TotalCount 4 -Path $FilePath if ( $byte[0] -eq 0xef -and $byte[1] -eq 0xbb -and $byte[2] -eq 0xbf ) { $encoding = 'UTF8' } elseif ($byte[0] -eq 0xfe -and $byte[1] -eq 0...
PowerShellCorpus/Github/craibuc_dot-sourced/Set-FileEncoding.ps1
Set-FileEncoding.ps1
Function Set-FileEncoding { Param( [string]$Path, [Microsoft.PowerShell.Commands.FileSystemCmdletProviderEncoding]$Encoding=[FileSystemCmdletProviderEncoding]::ASCII ) Set-Content $path -Encoding $Encoding -Value (Get-Content $Path) } Set-Alias sfe Set-FileEncoding
PowerShellCorpus/Github/craibuc_dot-sourced/ConvertTo-PlainText/ConvertTo-PlainText.Tests.ps1
ConvertTo-PlainText.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' . "$here\$sut" Describe "ConvertTo-PlainText" { $expected = 'pa55w0rd' $securePassword = ConvertTo-SecureString -String $expected -AsPlainText -Force Context "Value ...
PowerShellCorpus/Github/craibuc_dot-sourced/ConvertTo-PlainText/ConvertTo-PlainText.ps1
ConvertTo-PlainText.ps1
<# .SUMMARY Convert an encrypted string ([System.Security.SecureString]) to its plain-text equivalent ([System.String]) .DESCRIPTION Convert an encrypted string ([System.Security.SecureString]) to its plain-text equivalent ([System.String]) .PARAMETER $SecureString The encrypted value to be converted. .EXA...
PowerShellCorpus/Github/MicrosoftDocs_dynamics365smb-docs-pr.en-nz/.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/sachabarber_CassandraCQLFileImporter/Deploy.ps1
Deploy.ps1
<# PREREQUISITES May sure you have done the following 1. Installed Cassandra shell 2. Make sure you have this one non network drive, or at least drive you have permissions to 3. Install Paython. 2.7 is best one to work with Cassandra shell 4. Make sure you have added Python to Path environment variable ...
PowerShellCorpus/Github/jeffweilee_Windows-App-Game-HitPlay/HitPlay.Windows/AppPackages/HitPlay.Windows_1.1.0.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/jeffweilee_Windows-App-Game-HitPlay/HitPlay.Windows/AppPackages/HitPlay.Windows_1.1.0.2_AnyCPU_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/jeffweilee_Windows-App-Game-HitPlay/HitPlay.Windows/AppPackages/HitPlay.Windows_1.1.0.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/jeffweilee_Windows-App-Game-HitPlay/HitPlay.Windows/AppPackages/HitPlay.Windows_1.1.0.3_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/catmanjan_phrase-splitter/phrase-splitter.ps1
phrase-splitter.ps1
# powershell # type .\input.txt | .\phrase-splitter.ps1 > output.txt Write-Host "Loading dictionary, this may take a while..." $dictionary = Get-Content dictionary.txt # noise words are removed from entries before parsing $noise = @("_", "-") # prefix noise words are only removed from the start of entries...
PowerShellCorpus/Github/sjcnyc_PowerShell/Start-UserOnboarding.ps1
Start-UserOnboarding.ps1
param ( [Parameter(Mandatory, ValueFromPipelineByPropertyname)] [ValidateNotNullOrEmpty()] [string]$FirstName, [Parameter(Mandatory, ValueFromPipelineByPropertyname)] [ValidateNotNullOrEmpty()] [string]$LastName, [Parameter(Mandatory, ValueFromPipelineByPropertyname)] [Vali...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Get-ADFSMORole.ps1
Get-ADFSMORole.ps1
#鳳龰AD遠噫笢腔紱釬翋儂褒伎 function Get-ADFSMORole { Trap { "涴爵潰聆善賸祑都: $($_.Exception.Message)"; Continue } # Query with the current credentials $ForestRoles = Get-ADForest $DomainRoles = Get-ADDomain # Define Properties $Properties = @{ SchemaMaster = $ForestRoles.SchemaMaster DomainNamingMaster =...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Enable-RemoteDeskTop.ps1
Enable-RemoteDeskTop.ps1
function Enable-RemoteDesktop #备注这个脚本是从lazyadmin的脚本库里面修改过来的。增加了返回信息,并优化为适合GUI程序调用的形式。 { <# .SYNOPSIS The function Enable-RemoteDesktop will enable RemoteDesktop on a local or remote machine. .DESCRIPTION The function Enable-RemoteDesktop will enable RemoteDesktop on a local or remote machine. .PA...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/BatchDisable-ADUserAccount.ps1
BatchDisable-ADUserAccount.ps1
function batchdisable-aduseraccount { #定义用户名的来源,来自于textbox3 $bjdisableusers = Import-Csv $textbox3.Text -Encoding default $ErrorActionPreference = 'SilentlyContinue' $disableDate = Get-Date -UFormat "%Y-%m-%d" foreach ($bjdisableuser in $bjdisableusers) { $batchbjdisableuser = $bjdisableuse...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Get-ExQueue.ps1
Get-ExQueue.ps1
#삿혤뎠품뻔쓱櫓錟숭溝固돨뚠죗헙워,矜狼瓊품돔흙exchange돨밗잿친욥,賈痰츱즈add-pssnapin *exchange* function Get-ExQueue { $exservicename = Get-TransportService | sort -Property name foreach ($exservice in $exservicename) { $queuecount = ($exservice | Get-Queue | ?{ $_.DeliveryType -ne "ShadowRedundancy" } | measure messagecount -sum | ...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Test-pingstatus.ps1
Test-pingstatus.ps1
#这是一个ping脚本,我做了修改,适合在powershell GUI中调用 function Ping_Test { PROCESS { #$ws = New-Object -ComObject WScript.Shell $ping = $false $results = Get-WmiObject -query "SELECT * FROM Win32_PingStatus WHERE Address = '$_'" $RT = $results.ResponseTime $TTL = $results.ResponseTimeToLive #start-sleep 5 #等...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Resolve-DNSConfiguration.ps1
Resolve-DNSConfiguration.ps1
#这是一个官方的脚本,我进行了修改,适合在Powershell GUI中使用 Function Resolve-DNSConfiguration { <# .SYNOPSIS Resolve-DNSConfiguration is used to find the IP address for a given DNS name or vice-versa .DESCRIPTION used to find the IP address for a given DNS name or vice-versa using .NET Classes DNS and Act...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Disable-IPv6Components.ps1
Disable-IPv6Components.ps1
function Disable-IPv6Components #已经在windows 10和windows 2012R2平台上面进行验证,可以修改成功,需要重启才能生效 #此脚本式官方发布的开源脚本,经过我的修改,适合放在GUI程序里面 { <# .SYNOPSIS This Script allows you to disable certain IPv6 components in Windows 7 and Windows Server 2008. .DESCRIPTION This Script allows you to disable certain IPv6 components in...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Disable-ADUserAccount.ps1
Disable-ADUserAccount.ps1
function disable-aduseraccount { #定义用户名的来源,来自于textbox2 $bjdisableusers = $textbox2.Text $ErrorActionPreference = 'SilentlyContinue' $bjdisableusers100 = (Get-ADUser $bjdisableusers).samaccountname $disableDate = Get-Date -UFormat "%Y-%m-%d" #比较用户输入的用户名称是否在AD中存在,如果不存在则返回错误 if ($bjdisableusers100 ...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Enable-TelnetClientRole.ps1
Enable-TelnetClientRole.ps1
function Enable-TelnetClientRole { #目前此function仅支持Windows10和Windows 2012R2操作系统 $computername = $env:COMPUTERNAME #这个地方之所以加foreach,是为了方便地将当前的脚步改造为能够操作多台机器,因为前面的computername变量不仅仅可以指定当前机器 foreach ($cn in $computername) { $cnwmi = Get-WmiObject win32_operatingsystem -ComputerName $cn if (Get-WmiObj...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Read-OpenFileDialog.ps1
Read-OpenFileDialog.ps1
#蚚衾婓powershell GUI笢湖羲珨跺恅璃恁寁敦諳 function Read-OpenFileDialog([string]$WindowTitle, [string]$InitialDirectory, [string]$Filter = "All files (*.*)|*.*", [switch]$AllowMultiSelect) { Add-Type -AssemblyName System.Windows.Forms $openFileDialog = New-Object System.Windows.Forms.OpenFileDialog $openFileDialog.Title =...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/ConvertHashTabletoObject.ps1
ConvertHashTabletoObject.ps1
#将哈希表转换为对象 function ConvertHashTableToObject { begin { $object = New-Object Object } process { $_.GetEnumerator() | ForEach-Object { Add-Member -inputObject $object -memberType NoteProperty -name $_.Name -value $_.Value } } end { $object } } #使用方式:将生成的哈希表变量传递给ConvertHashTableTo...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Enable-DnetFramework.ps1
Enable-DnetFramework.ps1
function Enable-DnetFramework { #目前此function仅支持Windows10和Windows 2012R2操作系统 $computername = $env:COMPUTERNAME #这个地方之所以加foreach,是为了方便地将当前的脚步改造为能够操作多台机器,因为前面的computername变量不仅仅可以指定当前机器 foreach ($cn in $computername) { $cnwmi = Get-WmiObject win32_operatingsystem -ComputerName $cn if (Get-WmiObject...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Disable-WindowsFirewall.ps1
Disable-WindowsFirewall.ps1
function Disable-WindowsFirewall #此function适合于测试环境,生产环境下请谨慎关闭防火墙 { #检测防火墙状态 $firewallstatus = (Get-NetFirewallProfile -Name Domain, Public, Private).Enabled #如果防火墙处于开启状态,则修改所有防火墙设置为关闭 if ($firewallstatus -contains "True") { Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled false ...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Disable-UserAccessControl.ps1
Disable-UserAccessControl.ps1
function Disable-UserAccessControl { Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 $useraccesscontrolturnoff = "用户访问控制UAC已关闭,请重启当前的计算机确保生效!" $useraccesscontrolturnoff }
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Disable-InternetExplorerESC.ps1
Disable-InternetExplorerESC.ps1
function Disable-InternetExplorerESC #关闭IE ESC设置 { $computerlist = $Env:COMPUTERNAME foreach ($cl in $computerlist) { $computerversion = Get-WmiObject Win32_OperatingSystem -ComputerName $cl if ($computerversion.version -eq "6.3.9600")#操作系统版本为windows 2012 R2 { $AdminKey = "HKLM:\SOFTWARE\Micros...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Test-ExService.ps1
Test-ExService.ps1
function Test_ExService { #单独为Exchange的服务设置一个function,因为后面筛选服务状态的条件不太一样,不想做太复杂的判断逻辑 $ServerListmailservice = (Get-ExchangeServer | Where-Object { $_.AdminDisplayVersion -match "15.0" }).name $exserviceDownCount = 0 foreach ($exmachineName in $ServerListmailservice) { $ErrorActionPreference = "stop" ...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Test-Port.ps1
Test-Port.ps1
#这是一个powershell中文站上面的示例脚本,我做了修改,适合在GUI中调用 function Test-Port { Param ([string]$ComputerName, $port, $timeout) try { $tcpclient = New-Object -TypeName system.Net.Sockets.TcpClient $iar = $tcpclient.BeginConnect($ComputerName, $port, $null, $null) $wait = $iar.AsyncWaitHandle.WaitOne($timeout, $false) ...
PowerShellCorpus/Github/ChuixinZeng_PowershellGUIForWindows/GUIFunction/Enable-HypervRole.ps1
Enable-HypervRole.ps1
function Enable-HypervRole { #目前此function仅支持Windows10和Windows 2012R2操作系统 $computername = $env:COMPUTERNAME #这个地方之所以加foreach,是为了方便地将当前的脚步改造为能够操作多台机器,因为前面的computername变量不仅仅可以指定当前机器 foreach ($cn in $computername) { $cnwmi = Get-WmiObject win32_operatingsystem -ComputerName $cn if (Get-W...
PowerShellCorpus/Github/gk-8_Predict-NBA-Stats/06. bot/NBADraftBot/packages/Newtonsoft.Json.8.0.3/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://www.newtonsoft.com/json/install?version=" + $package.Version $dte2 = Get-Interface $dte ([EnvDTE80.DTE2]) if ($dte2.ActiveWindo...
PowerShellCorpus/Github/gk-8_Predict-NBA-Stats/06. bot/NBADraftBot/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/gk-8_Predict-NBA-Stats/06. bot/NBADraftBot/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/OPSTest_E2E_Provision_1487127940725/.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/arveduil_TodoList/TodoList/packages/EntityFramework.6.0.0/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 # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/arveduil_TodoList/TodoList/packages/EntityFramework.6.0.0/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/arveduil_TodoList/TodoList/packages/System.Data.SQLite.EF6.1.0.105.1/tools/net45/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/arveduil_TodoList/TodoList/packages/System.Data.SQLite.EF6.1.0.105.1/tools/net451/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/arveduil_TodoList/TodoList/packages/System.Data.SQLite.EF6.1.0.105.1/tools/net46/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/arveduil_TodoList/TodoList/packages/System.Data.SQLite.EF6.1.0.105.1/tools/net40/install.ps1
install.ps1
############################################################################### # # provider.ps1 -- # # Written by Joe Mistachkin. # Released to the public domain, use at your own risk! # ############################################################################### param($installPath, $toolsPath, $package, ...
PowerShellCorpus/Github/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/packages/WebGrease.1.5.2/tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) # Visual Studio execution done via NuGet Package Manager Function VSExecution($toolsPath, $project) { $project.DTE.ExecuteCommand("File.SaveAll", [system.string]::Empty) # Get the msbuild version of the project and add the import $msbuild = [Microsof...
PowerShellCorpus/Github/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/packages/WebGrease.1.5.2/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) # Return a relative path with reference to root as Uri object # $rootPath - root path # $relativePath - relative path # $appendToRelativePath - Optional parameter. If provided will be appended to relative Path using Path.Combine() Function GetRelativeUri($root...
PowerShellCorpus/Github/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab1/WcfPurse/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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/nadiushkaNA_Labs_Web_Service/Lab2/WebApplication/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...