full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/icebrian_azure/powershell/Exec-template.ps1 | Exec-template.ps1 | ######################################################################################
# Description: Created unique resource group and deployes specified templated with
# specified parameters
# Author: Istvan Cebrian / Date: 17/01/2016
# Version: 0.1
###############################################################... |
PowerShellCorpus/Github/icebrian_azure/powershell/DSC.ps1 | DSC.ps1 |
# Repositories: Chocolatey + PowerShell Gallery
# Find all Modules
Find-Module
# Find all DSC Resources (x = experimental, c = community,
Find-DscResource
# Count all DSC Resources
Find-DscResource -ov r | measure
# Grid View of contents of var $r
$r | ogv
#########################################... |
PowerShellCorpus/Github/icebrian_azure/powershell/CreateDirectory.ps1 | CreateDirectory.ps1 | $date = Get-Date
$directory = "C:\test_" + $date.Month + "-" + $date.Day + "_" + $date.Hour + "-" + $date.Minute
md $directory |
PowerShellCorpus/Github/icebrian_azure/powershell/CopyVHD_2_NewStorAcct.ps1 | CopyVHD_2_NewStorAcct.ps1 | #Login-AzureRmAccount
#Get-AzureRmSubscription
#Select-AzureRmSubscription -SubscriptionId fb8f8229-3cbd-4811-843c-ce7344396f8a
### Source VHD (West US) - authenticated container ###
$srcUri = "https://lrstor0linstd.blob.core.windows.net/vhds/cos72a20164404313.vhd"
### Source Storage Account (West US) ###
$sr... |
PowerShellCorpus/Github/icebrian_azure/powershell/Create-VM.ps1 | Create-VM.ps1 |
# Login into Azure
Login-AzureRmAccount
# Subscriptions
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionId fb8f8229-3cbd-4811-843c-ce7344396f8a
# Get All Available Locations with Machine Sizes
Get-AzureLocation
# Get Available Virtual Machine Sizes in Central US and stor into $storageloca... |
PowerShellCorpus/Github/icebrian_azure/powershell/Make-P2S-VPN-Certs.ps1 | Make-P2S-VPN-Certs.ps1 |
$RootCertificate = New-SelfSignedCertificate `
-Type Custom `
-KeySpec Signature `
-KeyExportPolicy Exportable `
-HashAlgorithm sha1 `
-KeyLength 2048 `
-Subject "CN=MyRootCertificate" `
-CertStoreLocation "Cert:\CurrentUser\My" -KeyUsage None -KeyUsageProperty All
$JacksClientCertificate = New-SelfSigned... |
PowerShellCorpus/Github/icebrian_azure/powershell/Exec-template4.ps1 | Exec-template4.ps1 |
$year = (Get-Date).Year
$month = (Get-Date).Month
$day = (Get-Date).Day
$hour = (Get-Date).Hour
$minute = (Get-Date).Minute
$seconds = (Get-Date).Second
$rgName = "iis2_$year$month$day-$hour$minute$seconds"
$location = "West Europe"
#Write-Host "Resource Group Name: $name"
Login-AzureRmAccount
#Get-... |
PowerShellCorpus/Github/icebrian_azure/powershell/Exec-template3.ps1 | Exec-template3.ps1 | ######################################################################################
# Description: Created unique resource group and deployes specified templated with
# specified parameters
# Author: Istvan Cebrian / Date: 17/01/2016
# Version: 0.1
###############################################################... |
PowerShellCorpus/Github/icebrian_azure/powershell/Remove-ADServicePrincipals.ps1 | Remove-ADServicePrincipals.ps1 |
Login-AzureRmAccount
Get-AzureRmADServicePrincipal | Remove-AzureRmADServicePrincipal -ObjectId { $_.Id } |
PowerShellCorpus/Github/icebrian_azure/powershell/Alter-Subnet.ps1 | Alter-Subnet.ps1 |
Login-AzureRmAccount
#Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionId fb8f8229-3cbd-4811-843c-ce7344396f8a
# Obtain VM reference and check Availability Set #
$RGname = "emdb-ase-winvm"
$VMName = “emdb-ase-winvm”
$VirtualMachine = Get-AzureRmVM -ResourceGroupName $RGname -Name $VMNam... |
PowerShellCorpus/Github/icebrian_azure/powershell/Exec-template-with-Extension.ps1 | Exec-template-with-Extension.ps1 | ######################################################################################
# Template with Extensions
######################################################################################
Login-AzureRmAccount
Get-AzureVMAvailableExtension | select ExtensionName,Publisher,Version,PublishedDate
Ne... |
PowerShellCorpus/Github/icebrian_azure/powershell/GettingStarted.ps1 | GettingStarted.ps1 | Login-AzureRmAccount
Get-AzureRmSubscription
Select-AzureRmSubscription -SubscriptionId fb8f8229-3cbd-4811-843c-ce7344396f8a
Get-AzureRmResourceGroup -Name icvps
Get-AzureRmVM -Name icvps -ResourceGroupName icvps
Get-AzureRmVMUsage -Location "West Europe" -Verbose |
PowerShellCorpus/Github/icebrian_azure/powershell/ExpressRoute-Authorizations.ps1 | ExpressRoute-Authorizations.ps1 | # https://azure.microsoft.com/en-us/documentation/articles/expressroute-howto-circuit-portal-resource-manager/
# https://azure.microsoft.com/en-us/documentation/articles/expressroute-howto-linkvnet-portal-resource-manager/
# https://azure.microsoft.com/en-us/documentation/articles/expressroute-howto-linkvnet-arm/
... |
PowerShellCorpus/Github/icebrian_azure/powershell/Extensions2.ps1 | Extensions2.ps1 |
Login-AzureRmAccount
Get-AzureRmSubscription
#Select-AzureRmSubscription -SubscriptionId fb8f8229-3cbd-4811-843c-ce7344396f8a
Select-AzureRmSubscription -SubscriptionId c5574319-d49a-4acf-a21d-f4d6de436b4f
#Settings wont work, puppet.confg in c:\ProgramData needs to be manually updated
Set-AzureRmVMExten... |
PowerShellCorpus/Github/icebrian_azure/powershell/Extensions.ps1 | Extensions.ps1 |
##
## XPlat-CLI
##
# List Extension publishers
azure vm extension list-image-publishers --location "West Europe"
# List extensions in West Europe for PuppetLabs
azure vm extension list-image-types --location "West Europe" --publisher "PuppetLabs"
azure vm extension list-image-types --location "West Europe"... |
PowerShellCorpus/Github/icebrian_azure/powershell/Say-Hello-To.ps1 | Say-Hello-To.ps1 | # Exec by running only "Say-Hello-To -Name "Istvan Cebrian"
#
workflow Say-Hello-To {
param(
[string] $Name
)
Write-Output ("Hello " + $Name)
} |
PowerShellCorpus/Github/icebrian_azure/powershell/Upload-VHD.ps1 | Upload-VHD.ps1 | ##
## Upload VHD to existing storage account
## Source: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-upload-image/
# Variables
$subId = "fb8f8229-3cbd-4811-843c-ce7344396f8a"
$rgName = "ic.net"
$urlOfUploadedImageVhd = "https://icnetdata001.blob.core.windows.net/vhdx/pfSen... |
PowerShellCorpus/Github/icebrian_azure/powershell/CreateARM_VM-from-Existing_ARM_VM.ps1 | CreateARM_VM-from-Existing_ARM_VM.ps1 | #Login-AzureRmAccount
#Get-AzureRmSubscription
#Select-AzureRmSubscription -SubscriptionId fb8f8229-3cbd-4811-843c-ce7344396f8a
# Create VM from an existing image
$location = "westeurope"
$vmSize = "Standard_DS2"
#Existing resource name parameters:
$rgName = "iscebria"
$vnetName= "iscebria-VNET"
$stName ... |
PowerShellCorpus/Github/icebrian_azure/powershell/Exec-template-diskraid.ps1 | Exec-template-diskraid.ps1 | ######################################################################################
# Script:
# Description:
# Author: Istvan Cebrian / Date: 15/03/2016
# Version: 0.1
######################################################################################
$day = (Get-Date).Day
$month = (Get-Date).Month
$y... |
PowerShellCorpus/Github/icebrian_azure/powershell/Deploy-ServiceFabric-Package.ps1 | Deploy-ServiceFabric-Package.ps1 | # Deploy SF Package
##
## Connect & Publish v1
##
Import-Module "$ENV:ProgramFiles\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1"
#Connect-ServiceFabricCluster localhost:19000
Connect-ServiceFabricCluster icsf.westeurope.cloudapp.azure.com:19000
#Publish-NewServiceFa... |
PowerShellCorpus/Github/icebrian_azure/powershell/VNET-to-VNET.ps1 | VNET-to-VNET.ps1 | #
# https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-vnet-vnet-rm-ps/
# https://ranjanajain.wordpress.com/2016/03/03/quick-n-easy-vnet-to-vnet-vpn-from-new-azure-portal-using-gui/
#
##Declare your variables for TestVNet1
$Sub1 = "fb8f8229-3cbd-4811-843c-ce7344396f8a"
$RG1 ... |
PowerShellCorpus/Github/icebrian_azure/powershell/Exec-template2.ps1 | Exec-template2.ps1 | ######################################################################################
# Description: Created unique resource group and deployes specified templated with
# specified parameters
# Author: Istvan Cebrian / Date: 17/01/2016
# Version: 0.1
###############################################################... |
PowerShellCorpus/Github/icebrian_azure/powershell/AzureAutomationShutdownVMs/Create-AzureAutomationShutdownVMs.ps1 | Create-AzureAutomationShutdownVMs.ps1 | # Creates and configures an Azure Automation account
# Creates and exports the Azure Automation/Management certificate
# Configures the Automation certificate and connection assets
# Creates the Stop-AllVMs and Connect-Azure runbooks (must be in local files)
# Creates the EveryNight schedule and associates it with ... |
PowerShellCorpus/Github/icebrian_azure/powershell/AzureAutomationShutdownVMs/Stop-AllVMs.ps1 | Stop-AllVMs.ps1 | workflow Stop-AllVMs
{
# Specify Azure Subscription Name
$subName = '[YOUR-AZURE-SUBSCRIPTION-NAME]'
# Connect to Azure Subscription
Connect-Azure `
-AzureConnectionName $subName
Select-AzureSubscription `
-SubscriptionName $subName
Wr... |
PowerShellCorpus/Github/icebrian_azure/powershell/AzureAutomationShutdownVMs/Connect-Azure.ps1 | Connect-Azure.ps1 | <#
.SYNOPSIS
Sets up the connection to an Azure subscription
.DESCRIPTION
WARNING: This runbook is deprecated. Please use OrgID credential auth to connect to Azure, instead of
certificate auth using this runbook. You can learn more about using credential auth with Azure here:
http://aka.ms/Sspv1l
... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/signscript.ps1 | signscript.ps1 | $cert = Get-ChildItem cert:\CurrentUser\My -CodeSigningCert
Set-AuthenticodeSignature -Certificate $cert -FilePath C:\users\account\Desktop\lockoutstatus.ps1 |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/get all servers from ad and get version of specific file.ps1 | get all servers from ad and get version of specific file.ps1 | #get a list from ad with all windows server 2003 and 2003 r2 machines
$list= get-ADComputer -Filter {OperatingSystem -Like "Windows Server*2003*"}
#intantiate an empty array
$hashlist=@{}
$admin=get-credential
#connect to each computer, get the file, and select it's version
foreach($computer in $list){
$answer ... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/tests/dothing.ps1 | dothing.ps1 | write-host "ehlo -sleeping"
for($i=0; $i -ne 17;$i++)
{
$var=10-$i
write-host "sleeping for" $var
sleep 1
} |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/tests/test.ps1 | test.ps1 | #cd $exscripts
#$jobname = start-job -FilePath .\StartDagServerMaintenance.ps1 -ArgumentList mailboxserver | select name
$serverlist= Get-MailboxServer | where {$_.admindisplayversion -like "*14.3*"}
function dotheaction([string] $servername)
{
$jobname = start-job -FilePath .\dothing.ps1 | select name
$r... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/tests/test2.ps1 | test2.ps1 | Add-Type -AssemblyName System.Windows.Forms
$form = New-Object Windows.Forms.Form
$progressbar1 = New-Object Windows.Forms.Progressbar
$progressbar1.Location = New-Object System.Drawing.Size(10,10)
$progressbar1.value
$form.Controls.Add($progressbar1)
$drc = $form.ShowDialog()
$jobname = start-job -File... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/tests/test3.ps1 | test3.ps1 | function eentjemeer()
{
if($global:i -le 100)
{
$progressbar1.value = $global:i
write-host $global:i
$global:i=$global:i+10
$Form.Refresh()
}
}
Add-Type -AssemblyName System.Windows.Forms
$Form = New-Object Windows.Forms.Form
$progressbar1 = New-Object Windows.Forms.Progressbar
$progressbar1... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/ad/lockoutstatus.ps1 | lockoutstatus.ps1 | Function Get-LockedOutLocation
{
<#
.SYNOPSIS
This function will locate the computer that processed a failed user logon attempt which caused the user account to become locked out.
.DESCRIPTION
This function will locate the computer that processed a failed user logon attempt which caused the user ... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/ad/fixhomedrives.ps1 | fixhomedrives.ps1 | #powershell -version 2.0
###########################
##################################################
# Script: Repair-HomeFolderPermissions.ps1
# Author: Chris Brown http://www.flamingkeys.com
# Date: 20/10/2010
# Keywords:
# Comments:
# Pre-Requisites: Full Control over destination folder.
#... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/ad/scptest.ps1 | scptest.ps1 | #finds all registered SCP's in domain
Get-ADObject -SearchBase "cn=configuration,dc=corp,dc=contoso,dc=com" -Filter "objectclass -eq 'serviceconnectionpoint'" |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/write logs.ps1 | write logs.ps1 | #write all the importrequests and their report to a file for later reviewing
$reqs=get-mailboximportrequest
foreach($entry in $reqs){$filename=$entry.mailbox.name; $entry | Get-MailboxImportRequestStatistics -IncludeReport | Format-List > $filename".txt"} |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/some exchange commands.ps1 | some exchange commands.ps1 | #get all mailboxes
$thelist = get-mailbox *
#get name from the request en create a new wone
$failed = get-mailboximportrequest -status failed
foreach($mailbox in $failed)
{
$name= $mailbox.MAILBOX.name
new-mailboxexportrequest -mailbox $name -FilePath \\123.123.123.123\exports\$name.pst
}
#can be subsitute... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/createroom.ps1 | createroom.ps1 | #global vars
$CityArray = "Kontich","Waver","Gent"
$BuildingArrayKontich = "23","20"
$Addresses = @{
"Kontich" = "straat, 2550 Kontich";
"Waver"="ERgens 11, 1300 Waver";
"Gent"="ergens in gent 23, 9000 Gent"
}
#$permissions="ReadItems","EditOwnedItems","DeleteOwnedItems","FolderVisible" #custom folder permis... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/thescript - moveandsuspend.ps1 | thescript - moveandsuspend.ps1 | .'C:\Program Files\Microsoft\Exchange Server\V14\Bin\RemoteExchange.ps1';
Connect-ExchangeServer -auto;
write-host "getting existing move requests..."
#lijst van bestaande move requests
$alreadymoving=Get-MoveRequest | select -expand alias
write-host "getting all users!"
#neem 40 man uit mailservers
#$ever... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/getusers.ps1 | getusers.ps1 | $RPC =Get-Counter "\MSExchange RpcClientAccess\User Count" -computername "exchangea"
$OWA =Get-Counter "\MSExchange OWA\Current Unique Users" -computername "exchangea"
$POP = Get-Counter "\MSExchangePop3(1)\Connections Current" -ComputerName "exchangea"
$IMAP = get-counter "\MSExchangeImap4(1)\Current Connections" -... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/retry failed.ps1 | retry failed.ps1 | #modify amount of accepted failed items
Get-MailboxImportRequest -status failed | set-mailboximportrequest -baditemlimit 5
#resume from where left
get-mailboximportrequest -status failed | resume-mailboximportrequest
#pretty much the same
$allfailed = get-mailboximportrequest -status failed
foreach($failed in... |
PowerShellCorpus/Github/mendel129_Projects/PowerShell/exchange/retry script.ps1 | retry script.ps1 | #set some variables
$pathkruibeke= "\\localhost\exports\ "
$pathlier= "\\localhost\exports\lier\ "
$allmbx = get-mailbox *
$allmbxstats = $allmbx | get-mailboxstatistics
$imports = get-mailboximportrequest
$failedreqs = $imports | where { $_.status -eq "failed"}
$allemptymbx = $allmbxstats | where { $_.itemcou... |
PowerShellCorpus/Github/Azure-Samples_storage-powershell-getting-started/AzureQueues.ps1 | AzureQueues.ps1 | # Azure Queue Service Sample - The Queue Service provides reliable messaging for workflow processing and for communication
# between loosely coupled components of cloud services. This sample demonstrates how to perform common tasks including
# creating, listing, and deleting queues.
# For more documentation, refer t... |
PowerShellCorpus/Github/Azure-Samples_storage-powershell-getting-started/AzureBlobs.ps1 | AzureBlobs.ps1 | # Azure Storage Blob Sample - Demonstrates how to use the Blob Storage service.
# Blob storage stores unstructured data such as text, binary data, documents or media files.
# For more documentation, refer to http://go.microsoft.com/fwlink/?LinkId=786321
# For Cmdlet reference, see http://go.microsoft.com/fwlink/?Lin... |
PowerShellCorpus/Github/Azure-Samples_storage-powershell-getting-started/AzureTables.ps1 | AzureTables.ps1 | # Azure Table Service Sample - Demonstrates how to perform common tasks using the Microsoft Azure Table storage
# including creating, listing, and deleting tables.
# For more documentation, refer to http://go.microsoft.com/fwlink/?LinkId=786321
# For Cmdlet reference, refer to http://go.microsoft.com/fwlink/?LinkId=... |
PowerShellCorpus/Github/Azure-Samples_storage-powershell-getting-started/AzureFiles.ps1 | AzureFiles.ps1 | # Azure Storage File Sample - Demonstrates how to use the File Storage service.
# For more documentation, refer to http://go.microsoft.com/fwlink/?LinkId=785077
# For Cmdlet reference, refer to http://go.microsoft.com/fwlink/?LinkId=785079
# Set the name of selected subscription.
# To Retrieve the name of your su... |
PowerShellCorpus/Github/Azure-Samples_storage-powershell-getting-started/AzureManagement.ps1 | AzureManagement.ps1 | # Azure Storage Management Sample - Demonstrates how to create and manage storage accounts.
# For more documentation, refer to http://go.microsoft.com/fwlink/?LinkId=786321
# For Cmdlet reference, refer to http://go.microsoft.com/fwlink/?LinkId=786324
# Set the name of selected subscription.
# To retrieve the nam... |
PowerShellCorpus/Github/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/xixi4Den_Calendar/Calendar/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/BaskiGIT_Powershell/GetVersionOfMachine.ps1 | GetVersionOfMachine.ps1 | New-Alias -Name ver -Value Get-TMVersion -ErrorAction SilentlyContinue
Function Get-TMVersion {
$OS = Get-CimInstance -ClassName Win32_OperatingSystem
if ($OS.Name -like 'Microsoft Windows*')
{
$Version = "$($OS.Name) " + "$($os.Version)"
}
Write-Output -Verbose $Version
} |
PowerShellCorpus/Github/BaskiGIT_Powershell/Untitled1.ps1 | Untitled1.ps1 | gci Cert:\LocalMachine\My
ipconfig
appcmd set site /site.name:"Test" /+bindings.[protocol='https',]
appcmd list site
.\appcmd.exe set site /site.name:”Test” "/+bindings.[protocol=’https’,bindingInformation=’102.101.2.4:443:’].BindingInformation='102.101.2.4:443:Test'"
.\appcmd.exe set site --% /site.na... |
PowerShellCorpus/Github/BaskiGIT_Powershell/Untitled2.ps1 | Untitled2.ps1 | <#$process = get-process -Name winword
$process
$process.Company#>
set-location E:\Puppet
gci | select-object Name, Length
Get-ChildItem | Where-Object {$_.Length -gt 10kb} | Sort-Object Length | Format-Table -Property Name, Length -AutoSize
get-psprovider
Get-PSDrive
Get-PSSnapin -Registered
Add-PSSnapin WD... |
PowerShellCorpus/Github/BaskiGIT_Powershell/ReleaseManagementBuildExe.ps1 | ReleaseManagementBuildExe.ps1 | # Author : Baskar Lingam Ramachandran
# Date : 18th Oct 2016
# Purpose : Execute a Release
" This script will trigger a Release using Release parameter of ReleaseManagementBuild.exe "
<#param([string] $ReleaseTempName, [string] $BuildNumber, [string] $StageName, [string] $BuildDefName)
#>
$RMBuildExePath = Get-W... |
PowerShellCorpus/Github/BaskiGIT_Powershell/ReleaseManagementBuildExe_1.0.ps1 | ReleaseManagementBuildExe_1.0.ps1 | # Author : Baskar Lingam Ramachandran
# Date : 18th Oct 2016
# Purpose : Execute a Release
" This script will trigger a Release using Release parameter of ReleaseManagementBuild.exe "
<#param([string] $ReleaseTempName, [string] $BuildNumber, [string] $StageName, [string] $BuildDefName)
#>
$RMBuildExePath = Get-W... |
PowerShellCorpus/Github/BaskiGIT_Powershell/FreeDiskSpaceCalculator.ps1 | FreeDiskSpaceCalculator.ps1 | $FreeDiskSpace = get-wmiobject win32_logicaldisk # -Filter "DriveType='3'" | Select-Object Size, FreeSpace
$FreeDiskSpace
$FreeDiskSpace[0].FreeSpace
$count = $FreeDiskSpace.Count
$count
for($i = 0; $i -le $count; $i++)
{
if(($FreeDiskSpace[$i].FreeSpace)/1GB > 1)
{
Write-Host "No alert needed"... |
PowerShellCorpus/Github/BaskiGIT_Powershell/Learning/VariableScope.ps1 | VariableScope.ps1 | Clear-Host
$var = 42
& {Write-Host "$var inside script block"}
Write-Host "$var outside script block"
Clear-Host
& {$var = 33; Write-Host "`$var inside script block is $var";
Write-Host "Parent `$var inside script block is" (Get-Variable var -valueonly -Scope 1) }
# Using global and local variables
Cl... |
PowerShellCorpus/Github/BaskiGIT_Powershell/TFS/SQLScriptDeploymentAutomation/task.ps1 | task.ps1 | ##
## "Author : Baskar Lingam Ramachandran"
## "Created Date : 18th May 2017"
## "Purpose : To execute .sql scripts from a folder using sqlcmd.exe in a server using vNext TFS Release"
##
[CmdletBinding()]
Param()
Trace-VstsEnteringInvocation $MyInvocation
try
{
[string]$... |
PowerShellCorpus/Github/BaskiGIT_Powershell/TFS/ReplaceText/task.ps1 | task.ps1 | [CmdletBinding()]
param()
Trace-VstsEnteringInvocation $MyInvocation
try
{
Import-VstsLocStrings "$PSScriptRoot\task.json"
# Get the inputs.
[string]$PathToFile = Get-VstsInput -Name PathToFile
[string]$TextToReplace = Get-VstsInput -Name TextToReplace
Write-Host "`t`tThe Path... |
PowerShellCorpus/Github/OPS-E2E-PPE_E2E_NewRepo_2017_3_30_24_5_36/.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/jamescro_TestDocSet/.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/kmorrical_10-FullStackTodo/Frontend/04-VSTDA/bower_components/bootstrap/nuget/MyGet.ps1 | MyGet.ps1 | $nuget = $env:NuGet
# parse the version number out of package.json
$bsversion = ((Get-Content $env:SourcesPath\package.json) -join "`n" | ConvertFrom-Json).version
# create packages
& $nuget pack "nuget\bootstrap.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version ... |
PowerShellCorpus/Github/kmorrical_10-FullStackTodo/Backend/VSTDA/packages/Microsoft.ApplicationInsights.WindowsServer.2.1.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/kmorrical_10-FullStackTodo/Backend/VSTDA/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/kmorrical_10-FullStackTodo/Backend/VSTDA/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/kmorrical_10-FullStackTodo/Backend/VSTDA/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/kmorrical_10-FullStackTodo/Backend/VSTDA/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/kmorrical_10-FullStackTodo/Backend/VSTDA/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/l1751413376_Progect1/Progect/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/jQuery.2.1.1/Tools/uninstall.ps1 | uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Determine the file paths
$projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName
$origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName
if (Test-Path $projectIntelliSense... |
PowerShellCorpus/Github/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/jQuery.2.1.1/Tools/install.ps1 | install.ps1 | param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# VS 11 and above supports the new intellisense JS files
$vsVersion = [System.Version]::Parse($dte.Version)
$supportsJsIntelliSenseFile = $vsVersion.Major -ge 11
if (-not $supportsJsIntelliSenseFile) {
$displayVersio... |
PowerShellCorpus/Github/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/jQuery.2.1.1/Tools/common.ps1 | common.ps1 | function Get-Checksum($file) {
$cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider"
$fileInfo = Get-Item $file
trap { ;
continue } $stream = $fileInfo.OpenRead()
if ($? -eq $false) {
# Couldn't open file for reading
return $null
}
$bytes = $... |
PowerShellCorpus/Github/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/Microsoft.Bcl.Build.1.0.14/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
# This is the MSBuild targets file to add
$targetsFile = [System.IO.Path]::Combine($toolsPath, $package.Id + '.targets')
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=ne... |
PowerShellCorpus/Github/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/Microsoft.Bcl.Build.1.0.14/tools/Uninstall.ps1 | Uninstall.ps1 | param($installPath, $toolsPath, $package, $project)
# Need to load MSBuild assembly if it's not loaded yet.
Add-Type -AssemblyName 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
# Grab the loaded MSBuild project for the project
# Normalize project path before calli... |
PowerShellCorpus/Github/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/EntityFramework.6.1.1/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/EntityFramework.6.1.1/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/Modernizr.2.8.3/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/sangeethasrk_Assignment_DB_5200/DBCS5200_BloodDonor/packages/Modernizr.2.8.3/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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.