full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/kdsnice_Scripts/PowerShell/acminaz/CreateHost.ps1 | CreateHost.ps1 | <#
Created by Karanfilov Dmitry
#>
# dot source script with Volt environment variables
. ($PSScriptRoot + "\Vars.ps1")
. ($PSScriptRoot + "\Functions.ps1")
[string] $VMURL = $CloudServiceName_ + ".cloudapp.net"
Select-AzureSubscription $SubscriptionName_
#create azure cloud service
New-AzureService -Se... |
PowerShellCorpus/Github/ilismal_peticionesPorPais/petpais.ps1 | petpais.ps1 | <#
Identificación del país de origen
Se consulta la dirección de correo electrónico asociada al userID del peticionario
Si termina en .xx -> petición país A
Si termina en .yy -> petición país B
Si el usuario ya no está en el AD -> mala suerte
#>
Import-Csv .\export.csv -Delimiter "," | ForE... |
PowerShellCorpus/Github/mynumber1_Tipsystem/TPS/packages/NLog.Config.4.4.10/tools/Install.ps1 | Install.ps1 | param($installPath, $toolsPath, $package, $project)
$configItem = $project.ProjectItems.Item("NLog.config")
# set 'Copy To Output Directory' to 'Copy if newer'
$copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory")
$copyToOutput.Value = 1
# set 'Build Action' to 'Content'
$buildAction = $confi... |
PowerShellCorpus/Github/mynumber1_Tipsystem/TPS/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/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/mynumber1_Tipsystem/TPS/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3/tools/install.ps1 | install.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'
$projectRoot = $project.Properties.Item('FullPath').Value
$binDirectory... |
PowerShellCorpus/Github/smacken_PoshShed/weekly.ps1 | weekly.ps1 | # Weekly tasks |
PowerShellCorpus/Github/smacken_PoshShed/init-tasks.ps1 | init-tasks.ps1 | $runtime = 08.00AM
$weekdays = "Monday", "Tuesday", "Wednesday", "Thursday", "Friday"
$daily = New-JobTrigger -Daily -At $runtime
$weekly = New-JobTrigger -Weekly -WeeksInterval 1 -At $runtime -DaysOfWeek $weekdays
$monthly = New-JobTrigger -Weekly -WeeksInterval 4 -At $runtime -DaysOfWeek $weekdays
$options = N... |
PowerShellCorpus/Github/smacken_PoshShed/monthly.ps1 | monthly.ps1 | # monthly tasks |
PowerShellCorpus/Github/smacken_PoshShed/daily.ps1 | daily.ps1 | # Daily scheduled tasks
"Starting the daily task list" |
PowerShellCorpus/Github/smacken_PoshShed/tasks.ps1 | tasks.ps1 | # get daily job results
import-module PSScheduledJob
<#
# Gets the results from a given task being run under schedule.
#>
function Get-TaskResults($taskName){
Get-job -Name $taskName |
select -First 1 |
Receive-Job -Keep
}
function Get-TaskStatus($TaskName){
get-job -name $TaskName ... |
PowerShellCorpus/Github/smacken_PoshShed/ping-site.ps1 | ping-site.ps1 | $siteList = "http://google.com", "http://msn.com"
Register-ScheduledJob -Name Ping -Trigger (New-JobTrigger -once -RepetitionInterval (New-TimeSpan -Hour 1) -RepetitionDuration ([TimeSpan]::MaxValue)) -ScriptBlock {
foreach ($site in $siteList)
{
Invoke-WebRequest -Uri $site
}
} |
PowerShellCorpus/Github/filipnovoselec_BreweryWebApp_v2/BreweryWebApp/src/BreweryWebApp/Properties/PublishProfiles/HomeBrewery - Web Deploy-publish.ps1 | HomeBrewery - Web Deploy-publish.ps1 | [cmdletbinding(SupportsShouldProcess=$true)]
param($publishProperties=@{}, $packOutput, $pubProfilePath)
# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327
try{
if ($publishProperties['ProjectGuid'] -eq $null){
$publishProperties['ProjectGuid'] = '8e749459-20df-448... |
PowerShellCorpus/Github/Apoc70_Copy-ScriptsToRepository/Copy-ScriptsToRepository.ps1 | Copy-ScriptsToRepository.ps1 | <#
.SYNOPSIS
Copy all files from a source directory and it's sub-directories to a target directory.
Author: Thomas Stensitzki
THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE
RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
Version... |
PowerShellCorpus/Github/mrbrianholle_DesktopNotesV2/ChangeBackground.ps1 | ChangeBackground.ps1 | Add-Type @"
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace Wallpaper
{
public enum Style : int
{
Tile, Center, Stretch, NoChange
}
public class Setter {
public const int SetDesktopWallpaper = 20;
public const int UpdateIniFile = 0x01;
... |
PowerShellCorpus/Github/Ninja-Tw1sT_WMIOps/WMIOps.ps1 | WMIOps.ps1 | #requires -version 2
<#
WMIOps v1.2
License: GPLv3
Author: @ChrisTruncer
#>
function Invoke-ExecCommandWMI
{
<#
.SYNOPSIS
This function is used to run a command/start a process on either the local or a remote machine. This requires local admin access wherever the command is to be ... |
PowerShellCorpus/Github/BrendanSturges_getSite/getSite.ps1 | getSite.ps1 | <#
Script created by Brendan Sturges, reach out if you have any issues.
This script queries a file the user chooses and checks all servers within to see which sccm site this server is connected to and outputs that info to a file that the user specifies.
#>
Function Get-FileName($initialDirectory){
[Sys... |
PowerShellCorpus/Github/PoshCode_PSGit/Build.ps1 | Build.ps1 | #requires -Version "4.0" -Module PackageManagement, Configuration, Pester
[CmdletBinding()]
param(
# The step(s) to run. Defaults to "Clean", "Update", "Build", "Test", "Package"
# You may also "Publish"
# It's also acceptable to skip the "Clean" and particularly "Update" steps
[ValidateSet("Clean... |
PowerShellCorpus/Github/PoshCode_PSGit/Get-Version.ps1 | Get-Version.ps1 | #.Synopsis
# Calculate the build number.
param(
$Module,
# If set, override the module's revision
[Nullable[int]]$RevisionNumber
)
[Version]$Version = if(Test-Path $Module -Type Leaf) {
(Import-LocalizedData -BaseDirectory (Split-Path $Module) -FileName (Split-Path ${Module} -Leaf)).ModuleVers... |
PowerShellCorpus/Github/PoshCode_PSGit/src/PSGitPowerline.ps1 | PSGitPowerline.ps1 | function New-PowerLineBlock {
[CmdletBinding()]
param(
[Parameter(ValueFromPipelineByPropertyName=$true, Position=0)]
[Alias("Content","text")]
$Object,
[Parameter(ValueFromPipelineByPropertyName=$true)]
[Alias("fg","Foreground")]
$ForegroundColor,
... |
PowerShellCorpus/Github/PoshCode_PSGit/src/PSGitPrompt.ps1 | PSGitPrompt.ps1 | function Set-PromptSettings {
[CmdletBinding()]
param(
[string]$AfterChangesText = "]:",
[ConsoleColor]$AfterChangesForeground,
[ConsoleColor]$AfterChangesBackground,
[string]$AfterNoChangesText = "]:",
[ConsoleColor]$AfterNoChangesForeground,
[ConsoleCo... |
PowerShellCorpus/Github/PoshCode_PSGit/Tests/Status.Steps.ps1 | Status.Steps.ps1 | if(!(git config --get user.email)) {
git config --global user.email "Anonymous@PoshCode.org"
git config --global user.name "Nobody Important"
git config --global core.autocrlf "true"
}
BeforeScenario {
$script:repo = Convert-Path TestDrive:\
Push-Location TestDrive:\
[Environment]::Cur... |
PowerShellCorpus/Github/PoshCode_PSGit/Tests/Must.Steps.ps1 | Must.Steps.ps1 | # These are not really steps!
# This is the deffinition of the Must assertion for Pester tests.
function Must {
[CmdletBinding(DefaultParameterSetName='equal', HelpUri='http://go.microsoft.com/fwlink/?LinkID=113423', RemotingCapability='None')]
param(
[Parameter(ValueFromPipeline=$true)]
... |
PowerShellCorpus/Github/PoshCode_PSGit/Tests/Must.Tests.ps1 | Must.Tests.ps1 | Set-StrictMode -Version Latest
. $PSScriptRoot\Must.Steps.ps1
Describe "Simple booleans" {
Context "for positive assertions" {
It "returns true if the test is true" {
$True | Must -Equal $True
}
}
Context "for negative assertions" {
It "returns true if the ... |
PowerShellCorpus/Github/PoshCode_PSGit/Tests/Send-CodeCov.ps1 | Send-CodeCov.ps1 | #.Synopsis
# Send Pester CodeCoverage to CodeCov.io
#.Example
# Invoke-Gherkin -Passthru | Send-CodeCov
#.Notes
# Original from https://github.com/TravisEz13/PoshBuildTools
# MIT License
param(
# The CodeCoverage report from Pester (accepts pipeline input)
[Parameter(ValueFromPipelineByPropertyNam... |
PowerShellCorpus/Github/PoshCode_PSGit/Tests/Internal.Steps.ps1 | Internal.Steps.ps1 | <#
When "WriteMessage ((?<type>\S+)\s+(?<message>\S+))? ?is called" {
param($type,$message)
Mock Write-Host -ParameterFilter {$object -eq "TIP: test"} -Verifiable
if($type) {
$script:result = &(gmo psgit){WriteMessage -type test -message $message -InformationVariable information -Informa... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/ExcCERTREPORT.ps1 | ExcCERTREPORT.ps1 | <#
.SYNOPSIS
CertificateReport.ps1 - Exchange Server 2010 SSL Certificate Report Script
.DESCRIPTION
Generates a report of the SSL certificates installed on Exchange Server 2010 servers
.OUTPUTS
Outputs to a HTML file.
.EXAMPLE
.\CertificateReport.ps1
Reports SSL certificates for Exchange Server 2010 servers ... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Scripts342.ps1 | Scripts342.ps1 |
#Region ---------- Disabled ADusers -------------- ###
$Users | % {Remove-DistributionGroupMember -Identity "$_.MemberOF" -Member "$_.ObjectGUID"
$Groups = Get-distributionGroup -ResultSize Unlimited | FT Guid -HideTableHeaders
$Groups = (Get-distributionGroup -ResultSize Unlimited).Guid
$Groups | % {Ge... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/RemoveSignature.ps1 | RemoveSignature.ps1 |
#region
<#
.Synopsis
Delete the medica COrporate Signature from One or more Computers
.DESCRIPTION
This command can accept ComputerNames, cnames, Aliases and Ipadresses. Winrm and Powershell must be enabled.
and you must run this command with Admin RIghts for any Remote Computer.
.PARAMETER
One... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/GET-GPOPrinters.ps1 | GET-GPOPrinters.ps1 | <#
.SYNOPSIS
The script finds all shared printers deployed with GPO (both deployed printers GPP.) in your domain.
.NOTES
File Name: Get-GPOPrinters.ps1
Author : Johan Dahlbom, johan[at]dahlbom.eu
The script are provided “AS IS” with no guarantees, no warrant... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/ExchangeServerPlus.ps1 | ExchangeServerPlus.ps1 | function Get-ExchangeServerPlus
{
<#
Get-ExchangeServerPlus
Written By Paul Flaherty, http://blogs.flaphead.com
Modified by Jeff Guillet, http://www.expta.com
Modified by Mark E. Smith, http://marksmith.netrends.com
Modified by Jason Sherry, http://blog.jasonsherry.net | Version 2.0
Modified yet again by Marc... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Start-ExchangeServerMaintenanceMode v1.8.ps1 | Start-ExchangeServerMaintenanceMode v1.8.ps1 | <#
.Synopsis
Script to automatically put an Exchange 2013 Server into Maintenance Mode.
Current Version: 1.8
Version History:
----------------
v1.8: fixed copy/paste bug (AGAIN!); removed code twice; made some overall improvements while at it :-)
v1.7: removed the need to dot-source the scr... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/INVENTReport.ps1 | INVENTReport.ps1 | #INVENTORY
<#
gwmi -Class Win32_NetworkadapterConfiguration | Where Ipaddress
GWMI Win32_NetworkAdapterConfiguration -Filter "IPEnabled = $true" | select @{N='IPv4'; E={($_."IPAddress").split(",")[0]}}
ipconfig | sls "IPv4"
#>
#ComputerJobs
#region
function ConvertTo-EnhancedHTML {
<#
.SYNOPSIS
Provides ... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Get-IpGeolocation.ps1 | Get-IpGeolocation.ps1 | function Get-IPGeolocation
{
Param
(
[string]$IPAddress
)
$request = Invoke-RestMethod -Method Get -Uri "http://geoip.nekudo.com/api/$IPAddress"
[PSCustomObject]@{
IP = $request.IP
City = $request.City
Country = $request.Country.Name
... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/TS.ps1 | TS.ps1 | Import-Csv "C:\Users\gmbanda\Desktop\Mappe2.CSV" -Delimiter ";" |
% {
$Aduser = Get-ADUser $_.SamAccountName | Select DistinguishedName,SamAccountName,GivenName,SurName,
@{Name="TermPath";Expression={([adsi]("LDAP://$($_.distinguishedName)")).psbase.InvokeGet("... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/SciptTool.ps1 | SciptTool.ps1 | # Good Programmers Write good Code, Great Programmers steal great code
# I may not have gone where i intended to go, but i think i have ended up where i need to be (Douglas Adams, THe long dark Tea-Time of the Soul)
#region -------- Tools Making 1
Function Get-Osinfo {
Param (
[String]$Computername = 'Localhos... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/GetLocalUsers.ps1 | GetLocalUsers.ps1 | function get-localusers {
param(
[Parameter(Mandatory=$true,valuefrompipeline=$true)]
[string]$StrComputer)
begin {}
Process {
$adminlist =""
$computer = [ADSI]("WinNT://" + $StrComputer + ",computer")
$AdminGroup = $computer.psbase.children.find("Administrators")
$Adminmembers= $AdminGroup.psbase.inv... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Learn.ps1 | Learn.ps1 | #When you call the function with a number, the “Number” parameter set is identified,
#and the argument is bound to the -Length parameter. If you submit a text, it ends up in the –Name parameter.
function Test-Binding
{
#Content
[CmdletBinding(DefaultParameterSetName='Number')]
param
(
[String]
... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Get-ExchangeDatabaseQuotas.ps1 | Get-ExchangeDatabaseQuotas.ps1 | <#
.SYNOPSIS
Get-ExchangeDatabaseQuotas.ps1 - Exchange Database Storage Quota Report Script
.DESCRIPTION
Generates a report of the storage quota configurations for Exchange Server databases
.OUTPUTS
Outputs to CSV files
.EXAMPLE
.\StorageQuotas.ps1
Reports storage quota configuration for all Exchange mailbox ... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/OutlookSign.ps1 | OutlookSign.ps1 | param ([Switch]$force = $false)
$SignatureEnforcing = $true
$AppData=(Get-Item env:appdata).value
$SigPath = '\Microsoft\Signatures'
$SignatureName = 'Siggy Standard'
$DomainName = 'siggy.com'
$SigSource = "\\siggy1\Signatures\$SignatureName"
$LocalLogFile = "C:\Siggy\Siggy\siggy_... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/GetTempPassword.ps1 | GetTempPassword.ps1 | #Here is sample code to get you started. Feel free to refine your personal temp password generator!
function Get-TempPassword
{
param
(
$Length = 15
)
$upper = [Char[]](65..90) -ne 'O' -ne 'Q' -ne 'L' -ne 'I'
$lower = [Char[]](97..122) -ne 'o' -ne 'q' -ne 'l'
$special = [Char[]]'§&"/+#*... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/GPOInventory.ps1 | GPOInventory.ps1 | Import-Module -name GroupPolicy
$now = Get-date
$date = get-date -uformat "%Y_%m_%d_%I%M%p"
$CSVpath = "C:\TEMP\GPO_Inventory_$date.csv"
# ------ Next four lines for emailing of report
$SMTPServer = "Server"
$From = "User@domain.com"
$To = "User@domain.com"
$Subject = "GPO Inventory $Date"
[array]$Repo... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/HtmlReportDemo.ps1 | HtmlReportDemo.ps1 | #equires -module EnhancedHTML
<#
.SYNOPSIS
Generates an HTML-based system report for one or more computers.
Each computer specified will result in a separate HTML file;
specify the -Path as a folder where you want the files written.
Note that existing files will be overwritten.
.PARAMETER ComputerName
One or... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/ReportFolder.ps1 | ReportFolder.ps1 | #requires -version 3.0
<#
Function Get-FolderSize {
[cmdletbinding()]
Param(
[Parameter(Position=0)]
[ValidateScript({Test-Path $_})]
[string]$Path="."
)
Write-Verbose "Analyzing $path"
Get-ChildItem -path $Path -Directory |
foreach -begin {
#measure files in $Path
$stats = Get-ChildItem -... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Microsoft.PowerShellISE_profile.ps1 | Microsoft.PowerShellISE_profile.ps1 | Function get-remoteexch
{
$cred=Get-Credential -UserName gmbanda@thera-trainer.de -Message 'Enter your Corporate (Medica) Password'
$Session=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://svrexch01.medica.med/powershell -Credential $cred -Authentication Kerberos
Import-PSSession $session
... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/Test-AdRecycleBin.ps1 | Test-AdRecycleBin.ps1 | function Test-ADRecycleBin
{
$enabledScopes = (Get-ADOptionalFeature -Filter 'name -like "Recycle Bin Feature"').EnabledScopes
if ($enabledScopes)
{
Write-Output -InputObject 'Enabled'
}
else
{
Write-Output -InputObject 'Disabled'
}
} |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/FsNotifcation.ps1 | FsNotifcation.ps1 | {Add-PSSnapin Quest.ActiveRoles.ADManagement
Set-Location "C:\Users\Public\Scripts\GetUserQuota\"
$Date = (get-date).adddays(-1)
$Users = Get-EventLog -ComputerName SERVERNAME -LogName System -Source ntfs -after $Date | where {$_.eventID -eq 36} | Select-Object Username -Unique | Sort-Object Username
$e... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/EnhanceHtml2.ps1 | EnhanceHtml2.ps1 | $script = ''
function ConvertTo-EnhancedHTML {
<#
.SYNOPSIS
Provides an enhanced version of the ConvertTo-HTML command that includes
inserting an embedded CSS style sheet, JQuery, and JQuery Data Tables for
interactivity. Intended to be used with HTML fragments that are produced
by ConvertTo-EnhancedHTMLFragment... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/ADinf.ps1 | ADinf.ps1 | <#
.SYNOPSIS
Get-ADInfo.ps1 - PowerShell script to collect Active Directory information
.DESCRIPTION
This PowerShell Script collects some basic information about an Active Directory
environment that is useful for verifying the pre-requisites for an Exchange
Server deployment or upgrade.
.OUTPUTS
Results are ou... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/GetFolderSize.ps1 | GetFolderSize.ps1 | #requires -version 3.0
Function Get-FolderSize {
[cmdletbinding()]
Param(
[Parameter(Position=0)]
[ValidateScript({Test-Path $_})]
[string]$Path="."
)
Write-Verbose "Analyzing $path"
Get-ChildItem -path $Path -Directory |
foreach -begin {
#measure files in $Path
$stats = Get-ChildItem -Pa... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/GetExchangeServerPlus.ps1 | GetExchangeServerPlus.ps1 | function Get-ExchangeServerPlus
{
<#
Get-ExchangeServerPlus
Written By Paul Flaherty, http://blogs.flaphead.com
Modified by Jeff Guillet, http://www.expta.com
Modified by Mark E. Smith, http://marksmith.netrends.com
Modified by Jason Sherry, http://blog.jasonsherry.net | Version 2.0
Modified yet again by Marc... |
PowerShellCorpus/Github/vilickgaby_POWERSHELL-LAB/File_copier.ps1 | File_copier.ps1 | #"D:\Change" is the folder to watch
#"D:\ftp\" is the destination folder which can be shared folder of another server
Function checkFilestatus
{
#Synchronize files between two servers.
#Files which are created or modified in source folder, it will copied to destination folder automatically
Param($k)
... |
PowerShellCorpus/Github/emusick_BEAR/bear.ps1 | bear.ps1 | # Bastion Environment for Advanced Response / Audit and Reporting (BEAR)
#
# TODO:
# - Audit-Registry: add wrapper to ensure path exists
# - Audit-Registry: ensure all entries have a default value
# - Audit-Registry: determine best entries for
# all "desktop" and "namespace" hide modifications
# Autorun for al... |
PowerShellCorpus/Github/bkrishna-hari_storsimple-disaster-recovery-using-azure-site-recovery/Cleanup-After-Test-Failover.ps1 | Cleanup-After-Test-Failover.ps1 | <#
.DESCRIPTION
This runbook acts as a cleanup script for the Test Failover scenario
This runbook deletes all the volumes, backups, backup policies and volume contaienrs on the target device.
This runbook also shuts down the SVA after the manual action in case of a Test Failover
.ASSETS (The foll... |
PowerShellCorpus/Github/bkrishna-hari_storsimple-disaster-recovery-using-azure-site-recovery/Mount-Volumes-After-Failover.ps1 | Mount-Volumes-After-Failover.ps1 | <#
.DESCRIPTION
This runbook creates a script and stores it in a storage account. This script will connect the iSCSI target and mount the volumes on the VM after a failover.
It then uses the Custom VM Script Extension to run the script on the VM.
.DEPENDENCIES
Azure VM agent should be installed in... |
PowerShellCorpus/Github/bkrishna-hari_storsimple-disaster-recovery-using-azure-site-recovery/Failover-StorSimple-Volume-Containers.ps1 | Failover-StorSimple-Volume-Containers.ps1 | <#
.DESCRIPTION
This runbook performs a failover of the StorSimple volume containers corresponding to the particular Azure Site Recovery failover.
Unplanned failover - The specified volume containers are failed over to the target Device
Planned failover - Backups of all the volumes in the volume contain... |
PowerShellCorpus/Github/bkrishna-hari_storsimple-disaster-recovery-using-azure-site-recovery/Start-StorSimple-Virtual-Appliance.ps1 | Start-StorSimple-Virtual-Appliance.ps1 | <#
.DESCRIPTION
This runbook starts the StorSimple Virtual Appliance (SVA) in case it is in a shut down state
.ASSETS
[You can choose to encrypt these assets ]
The following have to be added with the Recovery Plan Name as a prefix, eg - TestPlan-StorSimRegKey [where TestPlan is the name of th... |
PowerShellCorpus/Github/bkrishna-hari_storsimple-disaster-recovery-using-azure-site-recovery/Uninstall-Custom-Script-Extension.ps1 | Uninstall-Custom-Script-Extension.ps1 | <#
.DESCRIPTION
This runbook uninstalls the Custom Script Extension from the Azure VMs (brought up after a failover)
This is required so that after a failover -> failback -> failover, the Custom Script Extension can trigger the iSCSI script
.ASSETS (The following need to be stored as Automation Asset... |
PowerShellCorpus/Github/rmattos_NGeoIP/NGeopIP.Package/NuGetPackage.ps1 | NuGetPackage.ps1 | Param (
[switch]$Publish
)
$ErrorActionPreference = "Stop"
$global:ExitCode = 1
function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true)]
[array] $Messages,
[Parameter()] [ValidateSet("Error", "Warn", "Info")]
[string] $Level = "Info",... |
PowerShellCorpus/Github/rmattos_NGeoIP/NGeopIP.Package/NuGetSetup.ps1 | NuGetSetup.ps1 | Param (
[string]$Url,
[string]$Base64EncodedMessage
)
$ErrorActionPreference = "Stop"
$ExitCode = 1
function Write-Log {
#region Parameters
[cmdletbinding()]
Param(
[Parameter(ValueFromPipeline=$true)]
[array] $Messages,
[Parameter()] [ValidateSet("Error", "Warn", "Info")]
[st... |
PowerShellCorpus/Github/rmattos_NGeoIP/NGeopIP.Package/tools/init.ps1 | init.ps1 | # Runs the first time a package is installed in a solution, and every time the solution is opened.
param($installPath, $toolsPath, $package, $project)
# $installPath is the path to the folder where the package is installed.
# $toolsPath is the path to the tools directory in the folder where the package is instal... |
PowerShellCorpus/Github/rmattos_NGeoIP/NGeopIP.Package/tools/uninstall.ps1 | uninstall.ps1 | # Runs every time a package is uninstalled
param($installPath, $toolsPath, $package, $project)
# $installPath is the path to the folder where the package is installed.
# $toolsPath is the path to the tools directory in the folder where the package is installed.
# $package is a reference to the package object.
... |
PowerShellCorpus/Github/rmattos_NGeoIP/NGeopIP.Package/tools/install.ps1 | install.ps1 | # Runs every time a package is installed in a project
param($installPath, $toolsPath, $package, $project)
# $installPath is the path to the folder where the package is installed.
# $toolsPath is the path to the tools directory in the folder where the package is installed.
# $package is a reference to the packag... |
PowerShellCorpus/Github/RitwikChatterjee_Azure-Powershell/Capturing VM Images.ps1 | Capturing VM Images.ps1 | <#
.SYNOPSIS
Captures VM Image of a given VM and Service Name
.DESCRIPTION
Captures VM Image of a given VM and Service Name. It accepts the Service Name and VM Name of the VM you wish to capture image for. It also captures an image name and image label.
It appends SP or GN to the image name based on whether... |
PowerShellCorpus/Github/RitwikChatterjee_Azure-Powershell/Creating VM from Custom Images.ps1 | Creating VM from Custom Images.ps1 | <#
.SYNOPSIS
Creates a VM from a specified custom image
.DESCRIPTION
Creates a VM of the specified size at the specified location from a previous captured custom image.
It requests confirmation whether this is a specialized script. If not, requires admin user and password to be specified.
#>
# Varia... |
PowerShellCorpus/Github/RitwikChatterjee_Azure-Powershell/RitwikPr1ADVMScript1.ps1 | RitwikPr1ADVMScript1.ps1 | $subscription = Get-AzureSubscription
$subcriptionname = $subscription.SubscriptionName
$image = "a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201408.01-en.us-127GB.vhd"
$location = "West US"
$vmname = "ritwikpr1vnetvm1"
$cloudservicename = "ritwikpr1vnetsvc"
$vnetname = "ritwikpr1vnet"
$agname = "... |
PowerShellCorpus/Github/Kevin-Robertson_Conveigh/Conveigh.ps1 | Conveigh.ps1 | function Invoke-Conveigh
{
<#
.SYNOPSIS
Invoke-Conveigh is a Windows PowerShell LLMNR/NBNS spoofer detection tool.
.DESCRIPTION
Invoke-Conveigh is a Windows PowerShell LLMNR/NBNS spoofer detection tool with the following features:
Generates and sends IPv4 LLMNR/NBNS requests with random or set hostnames
... |
PowerShellCorpus/Github/openqbit_SaaS-Digital.Library/OpenQbit.DigitalLibSystem.git/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/openqbit_SaaS-Digital.Library/OpenQbit.DigitalLibSystem.git/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/shankargurav_StudentsApp/PublishScripts/Publish-WebApplicationVM.ps1 | Publish-WebApplicationVM.ps1 | #Requires -Version 3.0
<#
.SYNOPSIS
Creates and deploys a Microsoft Azure Virtual Machine for a Visual Studio web project.
For more detailed documentation go to: http://go.microsoft.com/fwlink/?LinkID=394472
.EXAMPLE
PS C:\> .\Publish-WebApplicationVM.ps1 `
-Configuration .\Configurations\WebApplication1-VM... |
PowerShellCorpus/Github/JohnnyBurst_DeleteFiles/DelFiles.ps1 | DelFiles.ps1 | $Path = "C:\users\username\test"
$DaysBack = "-90"
$CurrentDate = Get-Date
$DatetoDelete = $CurrentDate.AddDays($DaysBack)
Get-ChildItem $Path | Where-Object { $_.LastWriteTime -lt $DatetoDelete } | Remove-Item
|
PowerShellCorpus/Github/dukex_dotfiles-windows/Alias.ps1 | Alias.ps1 | Remove-Item alias:IP -ErrorAction SilentlyContinue
Remove-Item alias:gpsh -ErrorAction SilentlyContinue
Remove-Item alias:gplr -ErrorAction SilentlyContinue
Remove-Item alias:gpp -ErrorAction SilentlyContinue
Remove-Item alias:gcm -Force -ErrorAction SilentlyContinue
Function Get-IP4 {Ipconfig | sls IPv4}
... |
PowerShellCorpus/Github/muthu67_Docs/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
# Main
$errorActionPreference = 'Stop'
# Step-1 Download buildcore script to local
echo "download build core script to local with source ur... |
PowerShellCorpus/Github/muthu67_Docs/samples/core/docker/building-net-docker-images/dockerTask.ps1 | dockerTask.ps1 | <#
.SYNOPSIS
Builds and runs a Docker image.
.PARAMETER Compose
Runs docker-compose.
.PARAMETER Build
Builds a Docker image.
.PARAMETER Clean
Removes the image api and kills all containers based on that image.
.PARAMETER ComposeForDebug
Builds the image and runs docker-compose.
.PARAMETER StartDebugging
Fin... |
PowerShellCorpus/Github/muthu67_Docs/samples/framework/docker/ConsoleRandomAnswerGenerator/ConsoleRandomAnswerGenerator/run.ps1 | run.ps1 | param([string]$QuestionArgs="Is this a square container?")
# Docker image name for the application
$ImageName="console-random-answer-generator"
function Invoke-Docker-Run ([string]$DockerImage, [string]$Question) {
echo "Asking $Question"
Invoke-Expression "docker run --rm $ImageName $Question"
}
Invoke-... |
PowerShellCorpus/Github/muthu67_Docs/samples/framework/docker/ConsoleRandomAnswerGenerator/ConsoleRandomAnswerGenerator/build.ps1 | build.ps1 | <#
.SYNOPSIS
Build the Console Application and Docker Image for Windows container
.DESCRIPTION
Build the Console Application and Docker Image for Windows container
#>
Set-StrictMode -Version Latest
$ErrorActionPreference="Stop"
$ProgressPreference="SilentlyContinue"
# Docker image name for the appli... |
PowerShellCorpus/Github/muthu67_Docs/samples/framework/docker/MVCRandomAnswerGenerator/run.ps1 | run.ps1 | docker build -t mvcrandomanswers .
docker images
docker run -d -p 8000:8000 --name randomanswers mvcrandomanswers
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" randomanswers
|
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/setnetcoreenv.ps1 | setnetcoreenv.ps1 | dotnet --version
$path = Get-ChildItem Env:path
Write-Host $path.Value
$pathValue = $path.Value -Replace "C:\\Program Files\\dotnet","C:\dotnet"
Write-Host $pathValue
$env:Path = $pathValue
dotnet --version |
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/scheduleinspector.ps1 | scheduleinspector.ps1 | SchTasks /Create /SC MINUTE /MO 1 /TN "Jenkins Agent Inspector" /TR "powershell.exe -File C:\prstack\inspector.ps1 -WindowStyle Hidden" |
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/installcore.ps1 | installcore.ps1 | Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile "./dotnet-install.ps1"
./dotnet-install.ps1 -Version 1.0.0-preview2-003121 -InstallDir "C:\dotnet" |
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/provisionvm.ps1 | provisionvm.ps1 | Param([string]$serverAddress, [string]$vmName, [string]$userName, [string]$apiKey)
# ---------------------------------------------------
# Script used to provision Windows Server 2012 VMs
# for .NET sample testing.
# Originally referenced here: https://gist.github.com/snallami/5aa9ea2c57836a3b3635
# Modified by ... |
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/getlist.ps1 | getlist.ps1 | ## Script that gets the list of projects that need to be built.
## This script it used by the VSTS build agents.
## Author: Den Delimarsky (dendeli)
## Last Modified: 8/12/2016
$homePath = (Get-Item -Path ".\" -Verbose).FullName
$corePath = $homePath + "\samples\core"
[System.Collections.ArrayList]$globalProj... |
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/agentman.ps1 | agentman.ps1 | $jnlpProcess = Get-Process java -ErrorAction SilentlyContinue
if (!$jnlpProcess) { |
PowerShellCorpus/Github/muthu67_Docs/ci-scripts/itbuild.ps1 | itbuild.ps1 | ## Script that iteratively builds the samples in the repository
## This script it used by the VSTS build agents.
## Author: Den Delimarsky (dendeli)
## Last Modified: 8/12/2016
## This is needed for JSON parsing
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
dotnet --version
$ho... |
PowerShellCorpus/Github/fenxuorg_fenxu_vs_20160805/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
# Main
$errorActionPreference = 'Stop'
# Step-1: Download buildcore script to local
echo "download build core script to local with source u... |
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1488675940162/.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/andyliuliming_AzureResourceRetention/moveblobtorecyclebin.ps1 | moveblobtorecyclebin.ps1 | |
PowerShellCorpus/Github/andyliuliming_AzureResourceRetention/storageretention.ps1 | storageretention.ps1 | $subscriptionNameArray=@("OSTC Shanghai Dev","OSTC Shanghai Test","OSTC Shanghai PM")
[System.Collections.ArrayList]$vhdNotModifiedList = @()
Foreach($subscriptionName in $subscriptionNameArray)
{
$existingSubscription = Get-AzureSubscription -SubscriptionName $subscriptionName
if($existingSubscription... |
PowerShellCorpus/Github/andyliuliming_AzureResourceRetention/disknotattached.ps1 | disknotattached.ps1 | $subscriptionNameArray=@("OSTC Shanghai Dev","OSTC Shanghai Test","OSTC Shanghai PM")
[System.Collections.ArrayList]$azureDiskNotAttachedList = @()
Foreach($subscriptionName in $subscriptionNameArray)
{
$existingSubscription = Get-AzureSubscription -SubscriptionName $subscriptionName
if($existingSubscr... |
PowerShellCorpus/Github/andyliuliming_AzureResourceRetention/RecycleIt.ps1 | RecycleIt.ps1 | .\storageretention.ps1
.\disknotattached.ps1
.\machineretention.ps1 |
PowerShellCorpus/Github/andyliuliming_AzureResourceRetention/machineretention.ps1 | machineretention.ps1 | $subscriptionNameArray=@("OSTC Shanghai Dev","OSTC Shanghai Test","OSTC Shanghai PM")
[System.Collections.ArrayList]$largeVMs = @()
[System.Collections.ArrayList]$mediumVMs = @()
Foreach($subscriptionName in $subscriptionNameArray)
{
$existingSubscription = Get-AzureSubscription -SubscriptionName $subscr... |
PowerShellCorpus/Github/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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/joaotrindade_restriphoto/api_code/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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.