full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/ini.ps1
ini.ps1
<# Copyright 2014 Cloudbase Solutions Srl Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/GetFileHash.ps1
GetFileHash.ps1
# Get-FileHash has been introduced only in PowerShell 4.0 # Here's a compatible implementation for previous versions (SHA1 only for now) function Get-FileHash { [CmdletBinding()] param ( [parameter(Mandatory=$true)] [string]$Path, [string]$Algorithm = "SHA1" ) pro...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/jenkins-slave-install.ps1
jenkins-slave-install.ps1
& "$ENV:ProgramFiles\7-Zip\7z.exe" x jre-7u55-windows-x64.tar.gz & "$ENV:ProgramFiles\7-Zip\7z.exe" x -oC:\ jre-7u55-windows-x64.tar del jre-7u51-windows-x64.tar $javaHome = "c:\jre1.7.0_55" $jenkinsBaseUrl="http://10.0.0.10:8080" $username = "Administrator" $password = "Passw0rd" echo "deployment.security.l...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/DeployFreeRDPPowershell.ps1
DeployFreeRDPPowershell.ps1
$filename = "$ENV:TEMP\7z922-x64.msi" Invoke-WebRequest -uri "http://freefr.dl.sourceforge.net/project/sevenzip/7-Zip/9.22/7z922-x64.msi" -outFile $filename Start-Process -Wait msiexec.exe -ArgumentList "/i $filename /qn" del $filename $modules_dir="C:\Windows\System32\WindowsPowerShell\v1.0\Modules\" $filenam...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/SetupWinRMAccess.ps1
SetupWinRMAccess.ps1
$ErrorActionPreference = "Stop" function SetAdminOnlyACL($path) { $acl = New-Object System.Security.AccessControl.DirectorySecurity # Disable inheritance from parent $acl.SetAccessRuleProtection($true,$true) $fsRights = [System.Security.AccessControl.FileSystemRights]::FullControl $inherit...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/Get-RandomPassword.ps1
Get-RandomPassword.ps1
<# Copyright 2014 Cloudbase Solutions Srl Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/nova-havana-windows-install.ps1
nova-havana-windows-install.ps1
# Totally unsupported script to quickly install Nova on Windows # Get ready for some clicks on "Next,Next,Next"... # # Note: start from an elevated Powershell $ErrorActionPreference = "Stop" function Expand7z($archive) { &7z.exe x -y $archive if ($LastExitCode) { throw "7z.exe failed on archive: $archive"...
PowerShellCorpus/Github/cloudbase_unattended-setup-scripts/SetupClientWinRMCertificateAuthSelfSigned.ps1
SetupClientWinRMCertificateAuthSelfSigned.ps1
$client_cert_pfx = "$(pwd)\winrm_client_cert.pfx" $client_cert_pfx_password = "Passw0rd" $remote_host = "192.168.209.147" $store = New-Object System.Security.Cryptography.X509Certificates.X509Store( [System.Security.Cryptography.X509Certificates.StoreName]::My, [System.Security.Cryptography.X509Certifica...
PowerShellCorpus/Github/DaniJC_adfs/DSC/wapDSCConfiguration.ps1
wapDSCConfiguration.ps1
Configuration Main { Param ( [string] $nodeName ) Import-DscResource -ModuleName PSDesiredStateConfiguration Node $nodeName { WindowsFeature WebAppProxy { Name = "Web-Application-Proxy" Ensure = "Present" } <# Script DownloadWebDeploy { TestScript = { ...
PowerShellCorpus/Github/DaniJC_adfs/DSC/adfsDSCConfiguration.ps1
adfsDSCConfiguration.ps1
Configuration Main { Param ( [string] $nodeName ) Import-DscResource -ModuleName PSDesiredStateConfiguration Node $nodeName { WindowsFeature ADFS { Name = "ADFS-Federation" Ensure = "Present" } <# Script DownloadWebDeploy { TestScript = { Test-...
PowerShellCorpus/Github/DaniJC_adfs/DSC/dscPrereq.ps1
dscPrereq.ps1
Configuration Main { Param ( [string] $nodeName ) Import-DscResource -ModuleName PSDesiredStateConfiguration Node $nodeName { Script DSCWave { GetScript = { @{ Result = (Test-Path -Path "$env:windirtempDSC Resource Kit Wave 6 08212014.zip"); } }; SetScript = { $Uri = 'ht...
PowerShellCorpus/Github/DaniJC_adfs/DSC/adDSCConfiguration.ps1
adDSCConfiguration.ps1
Configuration Main { Param ( [string] $nodeName ) Import-DscResource -ModuleName PSDesiredStateConfiguration Node $nodeName { WindowsFeature ADDSInstall { Ensure = "Present" Name = "AD-Domain-Services" } ...
PowerShellCorpus/Github/DaniJC_adfs/Scripts/Deploy-AzureResourceGroup.ps1
Deploy-AzureResourceGroup.ps1
#Requires -Version 3.0 Param( [string] [Parameter(Mandatory=$true)] $ResourceGroupLocation, [string] $ResourceGroupName = 'Create-ADFS-Servers', [switch] $UploadArtifacts, [string] $StorageAccountName, [string] $StorageAccountResourceGroupName, [string] $StorageContainerName = $ResourceGroupName...
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_D_NewRepo_2017_4_22_14_58_34/.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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/packages/Newtonsoft.Json.7.0.1/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/addamb_ShopifyCSharpApp/FirstNumShopifyApp/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/reicheltp_cake-docfx-sample/build.ps1
build.ps1
########################################################################## # This is the Cake bootstrapper script for PowerShell. # This file was downloaded from https://github.com/cake-build/resources # Feel free to change this file to fit your needs. ###############################################################...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/operators/logic.ps1
logic.ps1
<# .Synopsis 逻辑与运算 .DESCRIPTION 逻辑与运算 .EXAMPLE 且 $真 $假 且 $真 $真 $假 .EXAMPLE 且 (比较 $十 大于 $三) 且 {比较 $三 小于 $十} 且 (比较 $十 大于 $三) {比较 $三 小于 $十} $真 #> function 且 # operator -and 'Qiě' { foreach ($expr in $args) { if($expr -is [scriptblock]) { $expr= & $expr } if( ($expr -eq $false ...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/operators/comparisons.ps1
comparisons.ps1
function 比较 { param( $前者, [ValidateSet('等于','不等于','大于', '大于等于','小于', '小于等于','相似','不相似','匹配','不匹配','包含','不包含','在','不在')] $条件, $后者 ) switch($条件) { '等于'{ return $前者 -eq $后者 } # equal '不等于'{ return $前者 -ne $后者 } # not equle '大于'{ return $前者 -gt $后者 } # large than '大于等于'{ return $前...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/langstructures/basicwhile.ps1
basicwhile.ps1
#simple while loop # REPEAT 重复 Chóngfù DO $做 Zuò WHEN $当 Dāng function 重复 ($做,$当) { if (!($当 -is [scriptblock] )) { #"Only scriptblocks for the condition 当" throw "条件'当'只接受脚本块." } if (!($做 -is [scriptblock] )) { #"Only scriptblocks for the condition 当" throw "条件'做'只接受脚本块." } while(. $当)...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/langstructures/basicdo.ps1
basicdo.ps1
#simple do-while loop # FIRST REPEAT 先重复 Xiān chóngfù DO $做 Zuò WHEN $当 Dāng function 先重复 ($做,$当={$false}) { if (!($当 -is [scriptblock] )) { #"Only scriptblocks for the condition 当" throw "条件'当'只接受脚本块." } if (!($做 -is [scriptblock] )) { #"Only scriptblocks for the condition 当" throw "条件'做'只...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/langstructures/basicif.ps1
basicif.ps1
#if -non pipeline simple if # 如果 Rúguǒ 条件 tiáojiàn 满足 tiáojiàn 就 jiù $否则 fǒuzé function 如果 ($条件,$就,$否则) { if (!($条件 -is [bool] -or $条件 -is [scriptblock] )) { #"Only scriptblocks or booleans for the condition 条件" throw "条件只接受布尔类型和脚本块." #TODO a syntax with a dictionary and chinese and english messages ...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/aliases/corealiases.ps1
corealiases.ps1
set-alias 说 write-host -Scope 'global'
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/proxyfuncs/measureobject.ps1
measureobject.ps1
#region Measure-Object function 度量对象 { [CmdletBinding(DefaultParameterSetName='GenericMeasure', HelpUri='http://go.microsoft.com/fwlink/?LinkID=113349', RemotingCapability='None')] param( [Parameter(ValueFromPipeline=$true)] [psobject] ${输入对象}, [Parameter(Position=0)] [ValidateNotNullOrEm...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/proxyfuncs/proxyhelpers.ps1
proxyhelpers.ps1
#Convert hashtable to readonly dictionary function ConvertTo-ReadOnlyDictionary([System.Collections.Hashtable]$Hashtable=@{}) { $dict=New-Object 'System.Collections.Generic.Dictionary[[string],[object]]' $Hashtable.Keys.ForEach({$dict.Add($_,$Hashtable[$_])}) return [System.Collections.ObjectModel.Read...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/constants/bool.ps1
bool.ps1
Set-Variable -Name 真 -Value $true -Scope global -Option ReadOnly -Force Set-Variable -Name 假 -Value $false -Scope global -Option ReadOnly -Force
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/constants/numbers.ps1
numbers.ps1
Set-Variable -Name 零 -Value 0 -Scope global -Option ReadOnly -Force Set-Variable -Name 一 -Value 1 -Scope global -Option ReadOnly -Force Set-Variable -Name 二 -Value 2 -Scope global -Option ReadOnly -Force Set-Variable -Name 三 -Value 3 -Scope global -Option ReadOnly -Force Set-Variable -Name 四 -Value 4 -Scope global ...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/daybreak/constants/misc.ps1
misc.ps1
Set-Variable -Name 空 -Value $null -Scope global -Option ReadOnly -Force
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/examples/CmdletsExamples.ps1
CmdletsExamples.ps1
# Measure-Object # dir $env:windir | Measure-Object -Property length -Sum -Average -Maximum -Minimum dir $env:windir | 度量对象 -属性 length -总计 -平均值 -最大值 -最小值
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/examples/LogicOperatersExamples.ps1
LogicOperatersExamples.ps1
# -and example 且 $真 $假 且 $真 $真 $假 且 (比较 $十 大于 $三) 且 {比较 $三 小于 $十} 且 (比较 $十 大于 $三) {比较 $三 小于 $十} $真 # -or example 或 $真 $假 或 $真 $真 $假 或 (比较 $十 大于 $三) 或 {比较 $三 小于 $十} 或 (比较 $十 大于 $三) {比较 $三 小于 $十} $真 # -not example 非 $真 非 $假 非 (比较 $十 大于 $三) 非 {比较 $三 小于 $十} # -xor example 异或 $真 $假 异或 $真 $假 $假 $真 ...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/examples/ComparisonsOperatersExamples.ps1
ComparisonsOperatersExamples.ps1
# -lt,-le,-eq,-ge,-gt 比较 $三 小于 $四 比较 $三 小于等于 $四 比较 $三 不等于 $四 比较 $四 大于 $三 比较 $四 大于等于 $三 # contains 比较 $三,$四,$六 包含 $四 # not contains 比较 $三,$四,$六 不包含 $五 # like 比较 'mistool' 相似 '*tool' # not like 比较 'mistool' 不相似 '*too' # match 比较 'mistool' 匹配 'to{2}l' # not match 比较 'mistool' 不匹配 'to{3}l' #...
PowerShellCorpus/Github/klumsy_DayBreak-ChinesePowerShell/examples/basicstructureexamples.ps1
basicstructureexamples.ps1
#if then else $妈妈的年龄 = 34 $爸爸的年龄 = 36 如果 { 比较 $妈妈的年龄 大于 $爸爸的年龄} -就 { 说 '妈妈年长'} -否则 { 说 "爸爸年长" } # while loop $苹果数 = 5 说 '开始吃苹果...' 重复 -做 { 说 "我还有 $苹果数 个苹果, 吃掉一个" $苹果数=$苹果数 - 1 } -当 { 比较 $苹果数 大于 $零} 说 '苹果吃完了' #do loop with no while 先重复 -做 { "一次“} #do while $个 = $一 先重复 -做 { $个;$个++ } -当 {比较 $个 小于 ...
PowerShellCorpus/Github/EddyErkel_Poweshell_updateHostsFile/updateHostsFile.ps1
updateHostsFile.ps1
<# .CREATION Created by : Eddy Erkel Version : 1.5 Date : 5 November 2016 .SYNOPSIS Update your hosts file by using different sources from the internet. .DESCRIPTION This PowerShell script will combine local host files with online host files into one, unique host file for safe internet browsing....
PowerShellCorpus/Github/Airum_PowerShell-Scripts/Temp_format.ps1
Temp_format.ps1
#This script creates the input for substations to be added to the dynamic temperature app. #Input the segment list and the line limits csv function Join-Object{ [CmdletBinding()] Param ( [Parameter(Mandatory=$true)] [object[]] $Left, # List to join with $Left [P...
PowerShellCorpus/Github/Airum_PowerShell-Scripts/WorkstationSetup.ps1
WorkstationSetup.ps1
#This script makes the administrative changes necessary for your system to install and run XXX well. #Map DSRC and Developer_tools to drives for this PS admin session if not already mapped if(!(Test-Path("Z:"))) { net use Z: \\ZZZ "TOSE Mapped to drive Z:" } if(!(Test-Path("W:"))) { net use W: \\WWW "Develo...
PowerShellCorpus/Github/Airum_PowerShell-Scripts/xl-csv.ps1
xl-csv.ps1
function xl-csv { #This function copies input Excel file as a csv with the same name in the same directory #The contents of the CSV will be stored as the variable $CSV [cmdletbinding()] param ( [parameter(Mandatory=$true)] [string] $XL_Path ) $CSV=$XL_Path|%{$_ -replace "(\s*)\.\w*","$1.csv"} ...
PowerShellCorpus/Github/Airum_PowerShell-Scripts/AGCLink.ps1
AGCLink.ps1
#Given a directory, this script finds the two AGC output files that are active, then compares their values #This output is redirected to an Excel file, and a VBA macro is activated to present it nicely to an auditor Param ( [Parameter(Mandatory=$true)] [string] $WorkingDirectory ) #...
PowerShellCorpus/Github/Airum_PowerShell-Scripts/TieLine.ps1
TieLine.ps1
#This script compares two sets of tie line data and outputs those that are only found in one of them Param ( [Parameter(Mandatory=$true)] [string] $WorkingDirectory, [Parameter(Mandatory=$true)] [string] $BPA, [Parameter(Mandatory = $true)] [string] $...
PowerShellCorpus/Github/joubbi_check_ohm_temperatures/check_ohm_temperatures.ps1
check_ohm_temperatures.ps1
<# .SYNOPSIS This is a PowerShell script used by NSClient++ to check the temperatures on a host running Windows. NSClient++ can then be called by Nagios (Op5 Monitor, Icinga or similar) to run this script. .DESCRIPTION Open Hardware Monitor (openhardwaremonitor.org) is used as a driver for the temperature sensor...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/ADFS/Import-TransformRulesAndAttributes.ps1
Import-TransformRulesAndAttributes.ps1
#========================================================================== # NAME: Import-TransformRulesAndAttributes.ps1 # # DESCRIPTION: Defines all SAML2.0 attributes and AD attributes that are # used to create TransformRules and Claims # # # AUTHOR: Johan Peterson (Linköping University) # DA...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/ADFS/New-RelyingPartyFromMetadata.ps1
New-RelyingPartyFromMetadata.ps1
#========================================================================== # NAME: New-RelyingPartyFromMetadata.ps1 # # DESCRIPTION: Creates ADFS Relying Parties from the SWAMID Metadata # # # AUTHOR: Johan Peterson (Linköping University) # DATE : 2014-03-18 # # PUBLISH LOCATION: C:\Published Powershell Sc...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/ADFS/Import-ADFSIssusanceTransformRuleFunctions.ps1
Import-ADFSIssusanceTransformRuleFunctions.ps1
#========================================================================== # NAME: Import-ADFSIssusanceTransformRuleFunctions.ps1 # # DESCRIPTION: Makes TransformRules from EntityCategories and/or manual # Entities # # # AUTHOR: Johan Peterson (Linköping University) # DATE : 2014-03-18 # # P...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Get-LiULastCommand.ps1
Get-LiULastCommand.ps1
#========================================================================== # NAME: Get-LiULastCommand.ps1 # # DESCRIPTION: Copies the last (or chosen command from history) PS command to the clipboard # # # AUTHOR: Johan Peterson (adm) # DATE : 2015-06-04 # # PUBLISH LOCATION: C:\Published Powershell Script...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Write-LiUItem.ps1
Write-LiUItem.ps1
#========================================================================== # NAME: Write-LiUItem.ps1 # # DESCRIPTION: Writes text to host. Should be used to easily write output # like: "Working with 'johpe12'... Done!" # # # AUTHOR: Johan Peterson (adm) # DATE : 2016-02-05 # # PUBLISH LOCATIO...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Get-LiUAnswer.ps1
Get-LiUAnswer.ps1
#========================================================================== # NAME: Get-LiUAnswer.ps1 # # DESCRIPTION: Prompts yes/no and returns true/false # # # AUTHOR: Johan Peterson # DATE : 2012-04-10 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #=================================...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Read-LiULine.ps1
Read-LiULine.ps1
#========================================================================== # NAME: Read-LiULines.ps1 # # DESCRIPTION: Paste rows to the cmdlet and it will return them as a array # # # AUTHOR: Johan Peterson # DATE : 2013-06-20 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #===========...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Get-UserAccountControlFlags.ps1
Get-UserAccountControlFlags.ps1
#========================================================================== # NAME: Get-UserAccountControlFlags.ps1 # # DESCRIPTION: # # # AUTHOR: Johan Peterson # DATE : 2011-03-07 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #=======================================================...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Import-PSCredential.ps1
Import-PSCredential.ps1
#========================================================================== # NAME: Import-PSCredential.ps1 # # DESCRIPTION: Imports Credential from a encrypted xml file # # # AUTHOR: Johan Peterson # DATE : 2012-03-05 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #====================...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Write-LiUProgress.ps1
Write-LiUProgress.ps1
#========================================================================== # NAME: Write-LiUProgress.ps1 # # DESCRIPTION: Use this cmdlet to show a progressbar that take minimal of execution time. # # # # AUTHOR: Johan Peterson # DATE : 2015-09-01 # # PUBLISH LOCATION: C:\Published Powershel...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Export-PSCredential.ps1
Export-PSCredential.ps1
#========================================================================== # NAME: Export-PSCredential.ps1 # # DESCRIPTION: Exports a Get-Credential to a encrypted xml file # # # AUTHOR: Johan Peterson # DATE : 2012-03-05 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #================...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Write-LiULog.ps1
Write-LiULog.ps1
#========================================================================== # NAME: Write-LiULog.ps1 # # DESCRIPTION: Loggs to a file/event viewer # # # AUTHOR: Johan Peterson # DATE : 2012-01-02 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #===========================================...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Test-LiULockFile.ps1
Test-LiULockFile.ps1
#========================================================================== # NAME: Test-LiULockFile.ps1 # # DESCRIPTION: Use this cmdlet to enable a lockfile for the script. With a # lockfile the script cannot be run twice the same time. # # # AUTHOR: Johan Peterson # DATE : 2012-01-03 # # PU...
PowerShellCorpus/Github/SUNET_adfs-metadata-sync/Functions/Split-Collection.ps1
Split-Collection.ps1
#========================================================================== # NAME: Split-Collection.ps1 # # DESCRIPTION: Splits a collection into smaller collections # # # AUTHOR: Johan Peterson (adm) # DATE : 2014-06-02 # # PUBLISH LOCATION: C:\Published Powershell Scripts\Functions # #=================...
PowerShellCorpus/Github/Skeptech_PSSoundCloud/PSSoundCloud.ps1
PSSoundCloud.ps1
$baseURL = "https://api.soundcloud.com" $clientID = "cc96dfbae2768d9291e729d107f89792" $endURL = "client_id=$clientID" $resolveURL = "$baseURL/resolve.json?url=" Function Get-SoundCloudUser { param([int]$userID,[string]$userURL) if ($userID) { $apiURL = "$baseURL/users/${userID}?$endURL" ...
PowerShellCorpus/Github/adingman_scripts/get_vm_datastore_per_cluster.ps1
get_vm_datastore_per_cluster.ps1
$Cluster = Read-Host -Prompt 'Input the name of the Cluster' $FileLocation = "C:\temp\VM_CLuster_Host_Datastore_GHQ.csv" Get-VM -Location $Cluster | Select Name, @{N="Cluster";E={Get-Cluster -VM $_}}, ` @{N="ESX Host";E={Get-VMHost -VM $_}}, ` @{N="Datastore";E={Get-Datastore -VM $_}} | Sort Name | Export-Csv -No...
PowerShellCorpus/Github/aspnet_Docs.ja-jp/.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/OPS-E2E-PPE_E2E_D_NewRepo_2017_6_14_12_39_18/.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/chrisschamper_UnitNumberSortingExerciseDotNetCore/UnitNumberSortingExercise/src/UnitNumberSortingExercise/Properties/PublishProfiles/Local-publish.ps1
Local-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'] = 'c910993b-f017-4e7...
PowerShellCorpus/Github/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/r0cco_ADO_database_project/ADO_database_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/ru-faraon_NME/Runtime.ps1
Runtime.ps1
<# .SYNOPSIS Environment configuration module for NME. .DESCRIPTION This module configures the NME runtime environment. It loads global variables and functions, and creates the needed folders. #> Write-Host 'Setting global variables' $Global:NMEVars = [ordered]@{ CurrentUser = [Security.Principal.Wind...
PowerShellCorpus/Github/ru-faraon_NME/Environment/ImpersonateUser/quick&dirty.ps1
quick&dirty.ps1
$ip = "127.0.0.1" #NetUseAdd $paramErrorIndex = $null $unc = "`\`\$ip`\ipc$" $useInfo = New-Object ([NativeTestPasswords+USE_INFO_2]) -Property @{ ui2_local = $null ui2_remote = $unc ui2_password = $null ui2_asg_type = 3 ui2_usecount = 1 ui2_username = $null u...
PowerShellCorpus/Github/MichaelKraft_ps-toolbox/show_membership.ps1
show_membership.ps1
Import-Module ActiveDirectory if ( (Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 } $groups = Get-ADPrincipalGroupMembership $args[0] write-host @" Group Membership ----------------...
PowerShellCorpus/Github/MichaelKraft_ps-toolbox/locate_email.ps1
locate_email.ps1
Import-Module ActiveDirectory if ( (Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 } $search = $args[0] $found = 0 if(-Not ($search -match '@')) { write-host "Invalid email specified"...
PowerShellCorpus/Github/MichaelKraft_ps-toolbox/about_distgroup.ps1
about_distgroup.ps1
Import-Module ActiveDirectory if ( (Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 } $identity = $args[0] if(((Get-DistributionGroup -Identity $identity -ErrorAction 'SilentlyContinue')....
PowerShellCorpus/Github/MichaelKraft_ps-toolbox/address_digest.ps1
address_digest.ps1
Import-Module ActiveDirectory if ( (Get-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue) -eq $null ) { add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 } $identity = $args[0] write-host @" Account email addressses ------------------------ "@ Get-Mai...
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/Retire PC.ps1
Retire PC.ps1
<# Planning: Prompt user for Computer Name of PC Get the current day and add 14 to that and put it under the descrtion of the PC Move the Retire PC OU #> Import-Module ActiveDirectory Import-Module Microsoft.PowerShell.Management Import-Module Microsoft.PowerShell.Utility Add-Type -AssemblyName...
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/Laps.ps1
Laps.ps1
$PCname = Read-Host -Prompt 'PC Name' Get-AdmPwdPassword -ComputerName:$PCname | select -ExpandProperty Password | Out-String | Set-Clipboard Get-AdmPwdPassword -ComputerName:$PCname | select ComputerName, Password
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/GroupUnknown.ps1
GroupUnknown.ps1
#Used to find any group with no notes, comments and users get-adgroup -filter * -Properties SamAccountName, description, Info, Members | Where-Object { !$_.Members } | Select-Object SamAccountName, description, Info, Members |sort SamAccountName | where Info -Like "" | where description -Like "" | export-csv C:\temp\F...
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/Software Uninstalls/SoftwareUninstall example.ps1
SoftwareUninstall example.ps1
$app = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like “Spiri*”} $app.Uninstall()
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/Software Uninstalls/SoftwareList.ps1
SoftwareList.ps1
Get-WmiObject -Class Win32_Product |Sort-Object Name | Select Name | Out-File c:\temp\"$env:computername".txt
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/Software Uninstalls/Win10AppRemoval.ps1
Win10AppRemoval.ps1
# Example Get-AppxPackage -allusers PackageFullName | Remove-AppxProvisionedPackage #Messaging and Skype Video get-appxpackage -allusers messaging* | Remove-AppxProvisionedPackage #Sway get-appxpackage -allusers *sway* | Remove-AppxProvisionedPackage #Phone and Phone Companion get-appxpackage -allusers *pho...
PowerShellCorpus/Github/GourleyTech_Powershell-Early-Learning/Software Uninstalls/IDFUninstallStrings.ps1
IDFUninstallStrings.ps1
$IDFVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object {$_.DisplayName -like "Identity Find*" } | Select-Object -Property DisplayName, UninstallString ...
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Template.ps1
Template.ps1
[CmdletBinding()] Param( [Parameter(Mandatory=$False)] [string]$OutputPath, [Parameter(Mandatory=$False)] [string]$OutputPathForErrors ) [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Adm...
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/ModifiedDateReport.ps1
ModifiedDateReport.ps1
[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.SharePoint....
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/GetLastModifiedDate.ps1
GetLastModifiedDate.ps1
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Portal") function Get-LastModifiedDate() { #$farm = [micros...
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/Generate Document Info Report.ps1
Generate Document Info Report.ps1
[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") [System.Reflection.Assembly]::Load("Microsoft.SharePoint....
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/SPqu.ps1
SPqu.ps1
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Portal") function Get-LastModifiedDate() { #$farm = [micros...
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/Get-ListSummaryPerSite-LastModifiedDate.ps1
Get-ListSummaryPerSite-LastModifiedDate.ps1
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Portal") function Get-ListSummaryPerSite-LastModifiedDate() { ...
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/Get-SPSite-LastModifiedDate.ps1
Get-SPSite-LastModifiedDate.ps1
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") function Get-LastModifiedDate($url) { #$farm = [microsoft.sharepoint.administration.spfarm]::Local $site = New-Object Microsoft.SharePoint.SPSite($url) $siteId = $site.ID.toString() Write-Host $siteId 'sep=,' | Out-File...
PowerShellCorpus/Github/kumarksendhi_ekmuc/Projects/MedicalProj/Phase1/MedicalProj/Report/Get-LastModifiedDate.ps1
Get-LastModifiedDate.ps1
[Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") [Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Portal") function Get-LastModifiedDate() { #$farm = [micros...