code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
$networkDomainName = "Test API network"
$location = "NASH_PCS01_N2_VMWARE_1"
$osImageName = "RedHat 6 64-bit 2 CPU"
$administratorPassword= "password123"
$vlanName = "testV1"
#import Caas Module
Import-Module CaaS
#capture the Caas credentials and create a new Caas conneciton
$login = Get-Credential
New-CaasConnecti... | DimensionDataCBUSydney/DimensionData.ComputeClient | PowerShell Examples/Mcp2DeployServer.ps1 | PowerShell | mit | 914 |
<#
Sample DSC Configuration for a DNS/DHCP Server
DNS is configured to house addresses for a server pool and a sql server
DHCP is configured for reservations to the server pool
Script was tested in a DSC push configuration.
Tested using Server 2012 R2 DC Core running PowerShell v4.
Server is not joined to a domain.
Tes... | jonathanelbailey/PowerShell-Code-Samples | DSC/SamplePushConfig.ps1 | PowerShell | mit | 10,007 |
#
# .SYNOPSIS
#
# Complete the -Counter argument to Get-Counter cmdlet
#
function CounterParameterCompletion
{
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
$optionalCn = @{}
$cn = $fakeBoundParameter["ComputerName"]
if($cn)
{
$optionalCn.Compute... | lzybkr/TabExpansionPlusPlus | Microsoft.PowerShell.Diagnostics.ArgumentCompleters.ps1 | PowerShell | bsd-2-clause | 4,033 |
function Join-DbaPath {
<#
.SYNOPSIS
Performs multisegment path joins.
.DESCRIPTION
Performs multisegment path joins.
.PARAMETER Path
The basepath to join on.
.PARAMETER Child
Any number of child paths to add.
.EXAMPLE
PS C:\> Join-DbaPath -Path 'C:\te... | alevyinroc/dbatools | internal/functions/utility/Join-DbaPath.ps1 | PowerShell | mit | 1,161 |
function Stop-DbaProcess {
<#
.SYNOPSIS
This command finds and kills SQL Server processes.
.DESCRIPTION
This command kills all spids associated with a spid, login, host, program or database.
If you are attempting to kill your own login sessions, the process performing the kills wil... | alevyinroc/dbatools | functions/Stop-DbaProcess.ps1 | PowerShell | mit | 6,979 |
$InstallPath = Join-Path $($env:ChocolateyInstall) 'lib\\TfsCmdlets'
$ToolsDir = Join-Path $InstallPath 'Tools'
if ($env:PSModulePath -like "*$ToolsDir*")
{
Write-Output "TfsCmdlets: Removing installation directory from PSModulePath environment variable"
$NewModulePath = $Env:PSModulePath.Replace($ToolsDir, ''... | igoravl/tfscmdlets | PS/chocolateyUninstall.ps1 | PowerShell | mit | 708 |
param($installPath, $toolsPath, $package, $project)
$analyzerPath = join-path $toolsPath "analyzers"
$analyzerFilePath = join-path $analyzerPath "AsyncAwaitAnalyzer.dll"
$project.Object.AnalyzerReferences.Remove("$analyzerFilePath") | olohmann/AsyncAwaitAnalyzer | src/AsyncAwaitAnalyzer/AsyncAwaitAnalyzer/tools/uninstall.ps1 | PowerShell | mit | 237 |
# Initialize variables if they aren't already defined.
# These may be defined as parameters of the importing script, or set after importing this script.
# CI mode - set to true on CI server for PR validation build or official build.
[bool]$ci = if (Test-Path variable:ci) { $ci } else { $false }
# Build configuration.... | cshung/clrmd | eng/common/tools.ps1 | PowerShell | mit | 31,527 |
jekyll serve -c "_config.yml,_config.local.yml" | mvsouza/mvsouza.github.io | runServerLocal.ps1 | PowerShell | mit | 47 |
#!/usr/bin/env powershell
function Send-TeamsCard
{
<#
.SYNOPSIS
Sends an actioncard to a MS Teams channel
.DESCRIPTION
Sends an actioncard to a MS Teams channel. Please note that you may have to enable developer preview.
.EXAMPLE
PS C:\> <example usage>
Explanation of what the example does
.INPUTS
Actio... | dizzi90/PoSh-MSTeams | Function/Send-TeamsCard.ps1 | PowerShell | mit | 1,204 |
$script:ErrorActionPreference = "Stop"
$adminDomain = $ptfpropDomain
$adminName = $ptfpropUser1Name
$adminPassword = $ptfpropUser1Password
$sutVersion = $ptfpropSutVersion
$adminAccount = $adminDomain + "\" + $adminName
if($sutVersion -ge "ExchangeServer2010")
{
$securePassword = ConvertTo-SecureString $adminPasswo... | OfficeDev/Interop-TestSuites | ExchangeActiveSync/Source/MS-ASPROV/Adapter/SUTControlAdapter/Implementation/AccountOnlyWipeData.ps1 | PowerShell | mit | 1,757 |
$errorActionPreference = 'Stop'
Set-StrictMode -Version 'Latest'
<#
.SYNOPSIS
Tests if the package with the given Id is installed.
.PARAMETER ProductId
The ID of the package to test for.
#>
function Test-PackageInstalledById
{
[OutputType([Boolean])]
[CmdletBinding()]
param
(
... | mgreenegit/xPSDesiredStateConfiguration | Tests/MSFT_xPackageResource.TestHelper.psm1 | PowerShell | mit | 78,440 |
[CmdletBinding()]
Param
(
[switch] $Preview,
[ValidateSet('2017', '2019', '2022')] [string] $VisualStudioYear = '2017'
)
Set-StrictMode -Version 5
#Requires -Version 5
$ErrorActionPreference = 'Stop'
$InformationPreference = 'Continue'
$repoRoot = Split-Path -Parent -Path (Split-Path -Parent -Path $PSScriptR... | jberezanski/ChocolateyPackages | tools/VS2017/Update-VisualStudio2017Packages.ps1 | PowerShell | mit | 8,365 |
function Get-ADSIFsmo
{
<#
.SYNOPSIS
This function will query Active Directory for all the Flexible Single Master Operation (FSMO) role owner.
.PARAMETER Credential
Specify the Credential to use
.PARAMETER DomainDistinguishedName
Specify the DistinguishedName of the Domain to query
.PARAMETER SizeLimit
... | lazywinadmin/AdsiPS | Archives/Get-ADSIFsmo.ps1 | PowerShell | mit | 3,102 |
function Get-CPowershellPath
{
<#
.SYNOPSIS
Gets the path to powershell.exe.
.DESCRIPTION
Returns the path to the powershell.exe binary for the machine's default architecture (i.e. x86 or x64). If you're on a x64 machine and want to get the path to x86 PowerShell, set the `x86` switch.
... | pshdo/Carbon | Carbon/Functions/Get-PowershellPath.ps1 | PowerShell | apache-2.0 | 2,762 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-1605-x64.7z'
$checksum = 'ae1b33ee7e3377370e7db43da5823efac4204f5184f0771067869a677a84e2cc'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.1605/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 790 |
function Set-WindowsExplorerOptions {
<#
.SYNOPSIS
Sets options on the Windows Explorer shell
.PARAMETER EnableShowHiddenFilesFoldersDrives
If this flag is set, hidden files will be shown in Windows Explorer
.PARAMETER DisableShowHiddenFilesFoldersDrives
Disables the showing on hidden files in Windows Explorer, see E... | smaglio81/boxstarter | Boxstarter.WinConfig/Set-WindowsExplorerOptions.ps1 | PowerShell | apache-2.0 | 5,507 |
$packageName = '{{PackageName}}'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$url64 = "$url"
$checksum64 = "$checksum"
$checksumType64 = "checksumType"
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Install-ChocolateyZipPackage -PackageName "$packageName" `
... | maharishi/chocolatey-packages | automatic/desktops/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,128 |
#
# Module manifest for module 'PSGet_Azure.Storage'
#
# Generated by: Microsoft Corporation
#
# Generated on: 10/31/2016
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '2.4.0'
# Supported PSEditions
# CompatiblePSEdition... | alfantp/azure-powershell | src/Storage/Azure.Storage.psd1 | PowerShell | apache-2.0 | 7,253 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = '1b6ef621fe47b99aa2ded0d1f55e0fddb209022d'
$checksumType = 'sha1'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvrt.exe"
try {
Get-Chocolat... | dtgm/chocolatey-packages | automatic/_output/kvrt/2016.04.23.1700/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 931 |
#
# Module manifest for module 'Microsoft.Azure.Commands.NotificationHubs'
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/19/2015
#
@{
# Version number of this module.
ModuleVersion = '0.10.1'
# ID used to uniquely identify this module
GUID = 'f875725d-8ce4-423f-a6af-ea880bc63... | pomortaz/azure-powershell | src/ResourceManager/NotificationHubs/AzureRM.NotificationHubs.psd1 | PowerShell | apache-2.0 | 2,587 |
# copies file to the solution directory
# creates ".Settings" solution folder
# adds shipped files to the solution
function Init
{
param($installPath, $toolsPath, $package, $project)
# Checks if a partical file already added to a solution/project as project item
function CheckIfFileExistsInProject
{
p... | AITGmbH/ApplyCompanyPolicy.Template | src/ApplyCompanyPolicy/tools/scripts/PrepareProject.ps1 | PowerShell | mit | 5,824 |
# Global Variables
$localCredDemo = new-object -typename System.Management.Automation.PSCredential `
-argumentlist "Demo", (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force)
$localCred = new-object -typename System.Management.Automation.PSCredential `
-argumentlist "Administrator", (Conv... | timbodv/Virtualization-Documentation | demos/2015-Ignite-Whats-New/scripts/WorkloadSetup.ps1 | PowerShell | mit | 13,897 |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
. "$here\$sut"
Describe "Grani_TopShelf : TargetResource" {
$Key = "HKEY_LOCAL_MACHINE\SOFTWARE\hoge/piyo\fuga/nyao"
$key2 = "HKLM:\SOFTWARE\hoge/piyo\fuga/nyao"
$invalid... | guitarrapc/GraniResource | Tests/Grani_RegistryKey/TargetResource.Tests.ps1 | PowerShell | mit | 4,842 |
$packageName = 'speedfan'
$installerType = 'EXE'
$url = 'http://www.almico.com/speedfan450.exe'
$silentArgs = '/S'
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
Install-ChocolateyPackage "$packageName" "$installerType"... | dtgm/chocolatey-packages | automatic/_output/speedfan/4.50/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 376 |
# Be sure to run "Set-ExecutionPolicy RemoteSigned" before running powershell scripts
# Use TestExceptions to filter out tests with known problems, separated by a colon
# i.e. run_all_tests.ps1 -TestExceptions VkLayerTest.RequiredParameter:VkLayerTest.UnrecognizedValue
# To trigger Debug tests, specify the parameter ... | endlessm/chromium-browser | third_party/angle/third_party/vulkan-loader/src/tests/_run_all_tests.ps1 | PowerShell | bsd-3-clause | 847 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# The Get-TargetResource cmdlet is used to fetch the desired state of the DSC managed node through a powershell script.
# This cmdlet executes the user supplied script (i.e., the script is responsible for validating the desir... | Cowmonaut/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Security/TestData/CatalogTestData/UserConfigProv/DSCResources/UserConfigProviderModVersion3/UserConfigProviderModVersion3.psm1 | PowerShell | mit | 2,165 |
Start-AutoRestCodeGeneration -ResourceProvider "locationbasedservices/resource-manager" -AutoRestVersion "latest"
| shahabhijeet/azure-sdk-for-net | src/SDKs/LocationBasedServices/Management.LocationBasedServices/generate.ps1 | PowerShell | mit | 114 |
<#
.SYNOPSIS
Creates a test package
.PARAMETER Id
The ID of the package to create
.PARAMETER Version
The version of the package to create (defaults to 1.0.0)
.PARAMETER Title
The title of the package to create (defaults to the ID)
.PARAMETER Description
The description of the package to create (... | mtian/SiteExtensionGallery | tools/New-TestPackage.ps1 | PowerShell | apache-2.0 | 2,320 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# 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... | zhencui/azure-powershell | src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ElasticPoolCrudTests.ps1 | PowerShell | apache-2.0 | 7,528 |
###NOTE: This test module requires use of credentials. The first run through of the tests will prompt for credentials from the logged on user.
###This module has the following additional requirements;
### * Requires that the ActiveDirectory module is installed
### * Requires that the DAG computer account has been precr... | KarolKaczmarek/xExchange | Test/MSFT_xExchDatabaseAvailabilityGroup.Integration.Tests.ps1 | PowerShell | mit | 13,695 |
function New-ComplexNumber {
<#
.SYNOPSIS
Creates a new System.Numerics.Complex object.
.DESCRIPTION
Creates a Numerics.Complex object using either Real and Imaginary inputs or Magnitude and Phase inputs.
Can also create a complex object from Real One, Imaginary One, or Zero cons... | endowdly/PSComplexNumbers | Public/New-ComplexNumber.ps1 | PowerShell | mit | 4,626 |
Function New-HtmlRepairFooter
{
[CmdletBinding()]
param(
)
$emailSection = ''
$emailSection += '</body>'
return $emailSection;
} | HiltonGiesenow/PoShMon | src/Functions/PoShMon.MessageFormatters.Html.Repairs/New-HtmlRepairFooter.ps1 | PowerShell | mit | 166 |
param(
[Parameter()]
[string]$OfficeDeploymentPath,
[Parameter(Mandatory=$true)]
[String]$OfficeDeploymentFileName = $NULL,
[Parameter()]
[string]$Quiet = "True"
)
Set-Location $OfficeDeploymentPath
$scriptPath = "."
. $scriptPath\SharedFunctions.ps1
$officeProducts = Get-OfficeVersion -Show... | OfficeDev/Office-IT-Pro-Deployment-Scripts | Office-ProPlus-Deployment/Setup-GPOOfficeInstallation/DeploymentFiles/DeployOfficeInstallationFile.ps1 | PowerShell | mit | 1,035 |
#
# Run the new parser, return either errors or the ast
#
function Get-ParseResults
{
[CmdletBinding()]
param(
[Parameter(ValueFromPipeline=$True,Mandatory=$True)]
[string]$src,
[switch]$Ast
)
$errors = $null
$result = [System.Management.Automation.Language.Parser]::ParseI... | PowerShell/PowerShell-Tests | Scripting/LanguageTestSupport.psm1 | PowerShell | mit | 5,135 |
##########################################################################
# Picassio is a provisioning/deployment script which uses a single linear
# JSON file to determine what commands to execute.
#
# Copyright (c) 2015, Matthew Kelly (Badgerati)
# Company: Cadaeic Studios
# License: MIT (see LICENSE for details)
##... | Badgerati/Picassio | src/Tools/PicassioTools.psm1 | PowerShell | mit | 13,904 |
<#
.Synopsis
Convert an integer from the common object model (JSON)
{"Date": "2019-04-15T00:00:00+02:00"} => 2019-04-15T00:00:00
#>
[CmdletBinding()]
[OutputType([datetime])]
param(
[Parameter(Mandatory,ValueFromPipeline)][string]$InputObject
)
process {
# Support piped ($_) and parameter input ($InputObject... | cawoodm/powowshell | core/adaptors/datetime.in.ps1 | PowerShell | mit | 423 |
# Copyright (c) 2002-2015 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Neo4j is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... | glennsarti/spike-Neo4J-Windows-Experiments | posh-neo-cm/packaging/standalone/src/main/distribution/shell-scripts/bin/Neo4j-Management/Start-Neo4jShell.ps1 | PowerShell | mit | 4,890 |
$betaProjectItemFragment = Get-Content -Raw "$PSScriptRoot/BetaProjectItemFragment.graphql"
function Add-GitHubBetaProjectItem {
<#
.SYNOPSIS
EXPERIMENTAL: Adds an item to a GitHub project (Beta).
#>
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
... | pcgeek86/PSGitHub | Functions/Public/Projects/Add-GitHubBetaProjectItem.ps1 | PowerShell | mit | 2,595 |
#requires -version 3.0
param
(
[string]$DeployEnvironment,
[switch]$ExecuteRemoteDeployment = $false,
[switch]$Interactive = $false
)
$ErrorActionPreference = "Stop"
function PSScriptRoot { $MyInvocation.ScriptName | Split-Path }
#Set-StrictMode -Version Latest
function Get-DeployEnvironment() {
... | kamsar/Beaver | Build/System/deploy.ps1 | PowerShell | mit | 2,025 |
$packageName = 'byteball'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://github.com/byteball/byteball/releases/download/v1.11.0/Byteball-win32.exe'
$checksum = '07f97d16b84a9ac158b3cb07a7d244430a65d51ed2189b9e6011f950f70b8abe'
$checksumType = 'sha256'
$url64 = 'http... | dtgm/chocolatey-packages | automatic/_output/byteball/1.11.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,064 |
$packageName = '{{PackageName}}'
$packageSearch = $packageName
$installerType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKCU:\Softw... | dtgm/chocolatey-packages | automatic/winedt/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 742 |
function Add-VSAmazonMQBrokerUser {
<#
.SYNOPSIS
Adds an AWS::AmazonMQ::Broker.User resource property to the template. The list of ActiveMQ users (persons or applications who can access queues and topics. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . ... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSAmazonMQBrokerUser.ps1 | PowerShell | apache-2.0 | 5,532 |
function Add-VSWAFv2WebACLSingleHeader {
<#
.SYNOPSIS
Adds an AWS::WAFv2::WebACL.SingleHeader resource property to the template.
.DESCRIPTION
Adds an AWS::WAFv2::WebACL.SingleHeader resource property to the template.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/U... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSWAFv2WebACLSingleHeader.ps1 | PowerShell | apache-2.0 | 2,186 |
<#
.Synopsis
My implementation of an command line for customized for the .net developer. Specifically tailored to my preferred tools.
(msbuild, mercurial, Visual Studio, and TeamCity)
.Description
My implementation of an improved command line for the .net developer. Specifically for those using my preferred t... | jbuedel/AgentRalphPlugin | .project-commands.psm1 | PowerShell | bsd-3-clause | 2,507 |
pandoc slides.md -f markdown -t beamer -o slides.pdf
| bjornbm/dimensional-dk-experimental | makeslides.ps1 | PowerShell | bsd-3-clause | 53 |
# PSJob Perf Test
$code = {
$begin = Get-Date
$result = Get-Process
$end = Get-Date
$begin
$end
$result
}
# Start job creation; also used for other reference
$start = Get-Date
$job = Start-Job -ScriptBlock $code
[void](Wait-Job $job)
#Job completed
$completed = Get-Date
$result = Receive-Job $job
... | proxb/Presentations | Tampa - A Look at PowerShell Runspaces/4_2_1_RunspacesDemo_PSJobPerf.ps1 | PowerShell | mit | 874 |
###############################################################################
##
## Description:
## Check NIC's RX and TX after reboot
##
###############################################################################
##
## Revision:
## V1.0 - boyang - 10/23/2017 - Build script
##
####################################... | VirtQE-S1/ESX-LISA | testscripts/nw_check_rx_tx_after_reboot.ps1 | PowerShell | apache-2.0 | 6,560 |
<#######################################################################################
# MSDSCPack_IPAddress : DSC Resource that will set/test/get the current IP
# Address, by accepting values among those given in MSDSCPack_IPAddress.schema.mof
####################################################################... | grayzu/BasicCI | Resources/xNetworking/DSCResources/MSFT_xIPAddress/MSFT_xIPAddress.psm1 | PowerShell | mit | 10,952 |
function Confirm-Host {
param(
[string] $Title = $null,
[string] $Message = "Are you sure you want to continue?",
[string[]] $Options = @("&Yes", "&No"),
[int] $DefaultOptionIndex = 0
)
$choices = new-object Collections.ObjectModel.Collection[Management.Automation.... | Microsoft-Build-2016/CodeLabs-Data | Module4-Modern_Applications/Deployment/Deployment/deploy_utils.ps1 | PowerShell | mit | 562 |
<#Copyright 2017 Devia Software, LLC www.devia.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis... | deviasoftware/azure-powershell | pageflex/PageflexWindowsFeatures.ps1 | PowerShell | mit | 2,226 |
./genCmake.ps1
cmake --build "build64" | Infinity95/crypto | build.ps1 | PowerShell | mit | 39 |
function Get-DbaPrivilege {
<#
.SYNOPSIS
Gets the users with local privileges on one or more computers.
.DESCRIPTION
Gets the users with local privileges 'Lock Pages in Memory', 'Instant File Initialization', 'Logon as Batch' on one or more computers.
Requires Local Admin rights on... | dsolodow/dbatools | functions/Get-DbaPrivilege.ps1 | PowerShell | mit | 7,718 |
function Expand-Result {
[CmdletBinding()]
param(
[Parameter( Mandatory, ValueFromPipeline )]
$InputObject
)
process {
foreach ($container in $script:PagingContainers) {
if (($InputObject) -and ($InputObject | Get-Member -Name $container)) {
Write-Deb... | AtlassianPS/JiraPS | JiraPS/Private/Expand-Result.ps1 | PowerShell | mit | 449 |
param($global:RestartRequired=0,
$global:MoreUpdates=0,
$global:MaxCycles=5)
function Check-ContinueRestartOrEnd() {
$RegistryKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
$RegistryEntry = "InstallWindowsUpdates"
switch ($global:RestartRequired) {
0 {
$p... | ScoreBig/packer-templates | scripts/win-updates.ps1 | PowerShell | mit | 7,094 |
# 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 writing, software
# distributed under ... | lweniger/PowerShell | Modules/downloaded/powershellgallery/Carbon/2.2.0/Functions/Add-TrustedHost.ps1 | PowerShell | mit | 1,858 |
Function Set-PVUserPhoto {
<#
.SYNOPSIS
Saves a User’s photo in the Vault.
.DESCRIPTION
Exposes the PACLI Function: "PUTUSERPHOTO"
.PARAMETER destUser
The name of the User in the photograph.
.PARAMETER localFolder
The location of the folder in which the photograph is stored
.PARAMETER localFile
T... | pspete/PoShPACLI | PoShPACLI/Functions/UserMangement/Set-PVUserPhoto.ps1 | PowerShell | mit | 1,217 |
function Get-Gamma {
<#
.SYNOPSIS
.DESCRIPTION
.EXAMPLE
Get-Gamma 4
.LINK
http://www.johndcook.com/Gamma.cs
http://www.johndcook.com/stand_alone_code.html
http://en.wikipedia.org/wiki/Gamma_function
https://communary.wordpre... | gravejester/Communary.ToolBox | Functions/Math/Get-Gamma.ps1 | PowerShell | mit | 3,358 |
# ---------------------------------------------------------------------------
# Author: Jachymko
# Desc: Jachym's prompt, colors and host window title updates.
# Date: Nov 07, 2009
# Site: http://pscx.codeplex.com
# Usage: In your options hashtable place the following setting:
#
# PromptTheme = 'Jachym'... | nylyst/Powershell | Modules/pscx/Modules/Prompt/Themes/Jachym.ps1 | PowerShell | mit | 12,932 |
function Test-DateDifference([array]$date, [datetime]$compare, [int]$range) {
<#
.SYNOPSIS
Compares a series of dates against a desired date to find the closest matching date/time
.DESCRIPTION
The Rubrik API returns snapshot dates down to the millisecond, but the user may not provide this much detai... | rubrikinc/PowerShell-Module | Rubrik/Private/Test-DateDifference.ps1 | PowerShell | mit | 2,419 |
# Copyright 2012 Aaron Jensen
#
# 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 ... | MattHubble/carbon | Carbon/DscResources/Carbon_FirewallRule/Carbon_FirewallRule.psm1 | PowerShell | apache-2.0 | 13,902 |
# ************************************************************************
# *
# * Copyright 2016 OSIsoft, LLC
# * 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... | hpaul-osi/PI-Security-Audit-Tools | PISecurityAudit/Scripts/PISYSAUDIT/PISYSAUDITCORE.psm1 | PowerShell | apache-2.0 | 204,541 |
#
# Module manifest for module 'Azure'
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/23/2012
#
@{
# Version number of this module.
ModuleVersion = '0.9.9'
# ID used to uniquely identify this module
GUID = 'D48CF693-4125-4D2D-8790-1514F44CE325'
# Author of this module
Author = 'Microsoft Corporation'
... | mayurid/azure-powershell | src/ServiceManagement/Services/Commands.Utilities/Azure.psd1 | PowerShell | apache-2.0 | 7,378 |
function Add-VSLakeFormationPermissionsDataLakePrincipal {
<#
.SYNOPSIS
Adds an AWS::LakeFormation::Permissions.DataLakePrincipal resource property to the template. The AWS Lake Formation principal.
.DESCRIPTION
Adds an AWS::LakeFormation::Permissions.DataLakePrincipal resource property to ... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSLakeFormationPermissionsDataLakePrincipal.ps1 | PowerShell | apache-2.0 | 2,526 |
function New-VSNetworkManagerGlobalNetwork {
<#
.SYNOPSIS
Adds an AWS::NetworkManager::GlobalNetwork resource to the template. Creates a new, empty global network.
.DESCRIPTION
Adds an AWS::NetworkManager::GlobalNetwork resource to the template. Creates a new, empty global network.
.LI... | scrthq/Vaporshell | VaporShell/Public/Resource Types/New-VSNetworkManagerGlobalNetwork.ps1 | PowerShell | apache-2.0 | 11,719 |
#requires -Version 3.0
#region Info
<#
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2016, Quality Software Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the fol... | jhochwald/NETX | Profile/functions/Initialize-ModuleUpdate.ps1 | PowerShell | bsd-3-clause | 14,491 |
# Returns Branch Cache Client Status details BranchCacheServiceStartType
# Example - Manual, Automatic
# Get-BCStatus | Select-Object -ExpandProperty BranchCacheServiceStartType
# Return Type: String
# Execution Context: System
$branchcache = Get-BCStatus
write-output $branchcache.BranchCacheServiceStartType
| vmwaresamples/AirWatch-samples | Windows-Samples/Sensors/bc_status_branchcacheservicestarttype.ps1 | PowerShell | bsd-3-clause | 315 |
if ($deployHelpLoaded -eq $null)
{
$DeployToolsDir = Split-Path ((Get-Variable MyInvocation -Scope 0).Value.MyCommand.Path)
. $DeployToolsDir\deployHelp.ps1
}
if ($compressionHelperLoaded -eq $null)
{
. $DeployToolsDir\compressionHelper.ps1
}
Write-Host "Ensconce - WebHelper Loading"
Function UploadFileAndG... | 15below/Ensconce | src/Scripts/webHelper.ps1 | PowerShell | mit | 3,260 |
$env = "test"
$regex = "(esw)"
$rg = ""
$vaultName = "colin-test"
$sqlPass = "#testing1234"
$kvKeyName = "sqlkvtest"
Remove-Module -Name DevOpsFlex.Automation.PowerShell -ErrorAction SilentlyContinue -Verbose
Import-Module $PSScriptRoot\..\DevOpsFlex.Automation.PowerShell.psd1 -Force -Verbose
#Register-AzureServiceB... | eShopWorld/devopsflex-automation | src/DevOpsFlex.Automation.PowerShell/Debug/RegisterAzureServicesInKeyVault.ps1 | PowerShell | mit | 734 |
function Invoke-DbMirrorValidation {
<#
.SYNOPSIS
Validates if a mirror is ready
.DESCRIPTION
Validates if a mirror is ready
Thanks to https://github.com/mmessano/PowerShell/blob/master/SQL-ConfigureDatabaseMirroring.ps1
.PARAMETER Primary
S... | wsmelton/dbatools | internal/functions/Invoke-DbMirrorValidation.ps1 | PowerShell | mit | 9,313 |
$packageName = 'cmake.portable'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'http://www.cmake.org/files/v3.2/cmake-3.2.1-win32-x86.zip'
$checksum = '4011f4f18c002a9ff97c76ea1d397eca9b675f98'
$checksumType = 'sha1'
Install-ChocolateyZipPackage -PackageName "$packageName" `
... | dtgm/chocolatey-packages | automatic/_output/cmake.portable/3.2.1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 564 |
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandatory = $true)]
[System.String]
$Identity,
[parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$Credential,
... | phongdly/puppetlabs-dsc | lib/puppet_x/dsc_resources/xExchange/DSCResources/MSFT_xExchClientAccessServer/MSFT_xExchClientAccessServer.psm1 | PowerShell | apache-2.0 | 4,903 |
[T4Scaffolding.Scaffolder(Description = "Creates a repository")][CmdletBinding()]
param(
[parameter(Position = 0, Mandatory = $true, ValueFromPipelineByPropertyName = $true)][string]$ModelType,
[string]$DbContextType,
[string]$Area,
[string]$Project,
[string]$CodeLanguage,
[switch]$NoC... | kissarat/dandy | packages/T4Scaffolding.1.0.5/tools/EFRepository/T4Scaffolding.EFRepository.ps1 | PowerShell | bsd-3-clause | 2,728 |
#Requires -Version 3.0
Param(
[string] $ResourceGroupLocation = 'West US',
[string] $ResourceGroupName = 'VMwithPublicIP',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerName = $ResourceGroupName.ToLowerInvariant() + '-stageartifacts',
[string] $TemplateFile = '..\Temp... | praveenrajpl/FortiGateOne | VMwithPublicIP.Solution/VMwithPublicIP/Scripts/Deploy-AzureResourceGroup.ps1 | PowerShell | mit | 4,576 |
if ([System.IntPtr]::Size -eq 8) {
$arch = "x64\*.*"
} elseif (([System.IntPtr]::Size -eq 4) -and (Test-Path Env:\PROCESSOR_ARCHITEW6432)) {
$arch = "x64\*.*"
} elseif ([System.IntPtr]::Size -eq 4) {
$arch = "x86\*.*"
}
$nativePath = $(Join-Path $installPath "lib\native")
$nativePath = $(Join-Path $nativ... | RoyAwesome/Watertight-Engine | packages/NLua.1.3.0.2/tools/net45/GetLibLuaPostBuildCmd.ps1 | PowerShell | mit | 408 |
[CmdletBinding()]
param()
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
$serviceConnectionName = "random connection name"
$composeFilePath = "docker-compose.yml"
$applicationName = "fabric:/Application1"
$serverCertThumbprint = "random thumbprint"
$userName = "random user"
$password = "random password"
$conn... | grawcho/vso-agent-tasks | Tasks/ServiceFabricComposeDeployV0/Tests/Deploy.2.8.ps1 | PowerShell | mit | 3,554 |
# This file is a temporary workaround for internal builds to be able to restore from private AzDO feeds.
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
#... | jmarolf/roslyn | eng/common/SetupNugetSources.ps1 | PowerShell | mit | 6,615 |
$ErrorActionPreference = "Stop"
$currentPath = Split-Path -Parent $MyInvocation.MyCommand.Path
import-module $currentPath\..\..\xSqlServerAlwaysOnUtil.psm1 -ErrorAction Stop
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[parameter(Mandato... | johlju/xSqlServerAlwaysOn | DSCResources/xSQLServerAlwaysOnAvailabilityGroupListner/xSQLServerAlwaysOnAvailabilityGroupListner.psm1 | PowerShell | mit | 11,729 |
# You'll need node.js and docco to build the documentation. If you don't have
# docco yet, you can install it via
#
# npm install -g docco
# Make the project root directory the working directory (regardless of where the
# script has been called from).
$scriptPath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scri... | FACT-Finder/FACT-Finder-PHP-Library-Demo | build-doc.ps1 | PowerShell | mit | 530 |
Function Get-UnityVMwareNFS {
<#
.SYNOPSIS
Queries the EMC Unity array to retrieve informations about VMware NFS LUN.
.DESCRIPTION
git Queries the EMC Unity array to retrieve informations about VMware NFS LUN.
You need to have an active session with the array.
.NOTES
Written... | equelin/Unity-Powershell | Unity-Powershell/Public/Get-UnityVMwareNFS.ps1 | PowerShell | mit | 4,031 |
Param ($ParentDiskPath,$vmPath,$OSVHDX,$Unattendpath,$Assetspath)
$VMName = "CONTOSODC"
$ProgressPreference = "SilentlyContinue"
#Local Credential
$localCred = new-object -typename System.Management.Automation.PSCredential -argumentlist "Administrator", (ConvertTo-SecureString "Password01" -AsPlainText -For... | billcurtis/Public | SDNNESTED/VMConfigs/ProvisionContosoDC.ps1 | PowerShell | mit | 5,871 |
<#
.SYNOPSIS
Manages a Visual Studio Tools for Office (VSTO) add-in
.DESCRIPTION
Launches the installation or uninstallation of a VSTO add-in.
.PARAMETER Operation
The operation to perform on the VSTO add-in.
Valid operations are:
- Install
- Uninstall
.PARAMETER ManifestPath... | ralish/PSWinGlue | Scripts/Manage-VSTOAddin.ps1 | PowerShell | mit | 2,420 |
<#
.SYNOPSIS
Creates a dummy empty file of a specified size
.DESCRIPTION
This will create one or a number of empty files of a specified size
Useful for creating demos or dummy files to delete as an emergency when
drives are full
.PARAMETER FilePath
The Directory for the files
.PARAMETER Name
The Name of the file, wi... | SQLDBAWithABeard/Functions | New-DummyFile.ps1 | PowerShell | mit | 3,134 |
function setVersionInfo() {
$assemblyVersion = git describe --abbrev=0 --tags
$assemblyInformationalVersion = git describe --tags --long
(Get-Content .\Chainly\project.json) -replace "1.0.0-*", "$assemblyVersion-" | Out-File .\Chainly\project.json
}
function makeBuildFolder() {
if(Test-Path -Path ".\Chainly\" ){... | smatsson/Chainly | Tools/build_nuget.ps1 | PowerShell | mit | 1,117 |
<#
.SYNOPSIS
Copy-PhotoRecFilesbyExtension copies all files from the PhotoRec folders to new folders named by file extension.
.DESCRIPTION
Copy-PhotoRecFilesbyExtension uses the file extensions to create folders and then copy in the folder all the files founds with the same extension.
If a file with the same name... | lconte/Copy-PhotoRecFilesbyExtension.ps1 | Copy-PhotoRecFilesbyExtension.ps1 | PowerShell | mit | 6,850 |
function push-nuget() {
$SOLUTION_DIR = Resolve-Path "."
$ARTIFACTS = Join-Path $SOLUTION_DIR "artifacts/nuget"
$NUGET_API_KEY = $env:NUGET_API_KEY
if (!$NUGET_API_KEY) {
Write-Host "`$NUGET_API_KEY is not set" -f yellow
return
}
Get-ChildItem -Path $ARTIFACTS -Filter *... | ITGlobal/MarkDocs | push.ps1 | PowerShell | mit | 2,818 |
#Requires -Version 3.0
<#
Get-SPClientContentType.ps1
Copyright (c) 2017 karamem0
This software is released under the MIT License.
https://github.com/karamem0/SPClient/blob/master/LICENSE
#>
function Get-SPClientContentType {
<#
.SYNOPSIS
Gets one or more content types.
.DESCRIPTION
The Get-SPClientCo... | karamem0/SPClient | source/SPClient/functions/SPClientContentType/Get-SPClientContentType.ps1 | PowerShell | mit | 4,212 |
param([bool]$nuget=$false)
$root = Split-Path -Parent $PSCommandPath
Push-Location $root
Get-ChildItem *.nupkg | Remove-Item
.\nuget.exe pack .\Framework.Shared\OmniBus.Framework.Shared.csproj -Build -Symbols -IncludeReferencedProjects -ForceEnglishOutput -Properties Configuration=Release
.\nuget.exe pack .\Framewor... | jdunkerley/AlteryxAddIns | PublishFrameworkToNuGet.ps1 | PowerShell | mit | 954 |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name PagingFiles -Value "" | dschelchkov/windows-imaging | scripts/Delete-Pagefile.ps1 | PowerShell | apache-2.0 | 125 |
function Add-VSOpsWorksInstanceEbsBlockDevice {
<#
.SYNOPSIS
Adds an AWS::OpsWorks::Instance.EbsBlockDevice resource property to the template. Describes an Amazon EBS volume. This data type maps directly to the Amazon EC2 EbsBlockDevice: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBloc... | scrthq/Vaporshell | VaporShell/Public/Resource Property Types/Add-VSOpsWorksInstanceEbsBlockDevice.ps1 | PowerShell | apache-2.0 | 7,092 |
function New-VSDocDBDBCluster {
<#
.SYNOPSIS
Adds an AWS::DocDB::DBCluster resource to the template. The AWS::DocDB::DBCluster Amazon DocumentDB (with MongoDB compatibility resource describes a DBCluster. Amazon DocumentDB is a fully managed, MongoDB-compatible document database engine. For more informa... | scrthq/Vaporshell | VaporShell/Public/Resource Types/New-VSDocDBDBCluster.ps1 | PowerShell | apache-2.0 | 29,904 |
configuration XD7LabStorefrontHttps {
param (
## Citrix XenDesktop installation source root
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[System.String] $XenDesktopMediaPath,
## Pfx certificate thumbprint
[Parameter(Mandatory)]
[System.String] $... | VirtualEngine/CitrixXenDesktop7Lab | DSCResources/XD7LabStorefrontHttps/XD7LabStorefrontHttps.schema.psm1 | PowerShell | mit | 3,495 |
<#
# Copyright (c) 2014 All Rights Reserved by the SDL Group.
#
# 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 appl... | beutepa/ISHBootstrap | Automation/Modules/SDLDevTools/0.3/SDLDevTools.psd1 | PowerShell | apache-2.0 | 4,817 |
<#
.SYNOPSIS
Get-AMInfectionStatusStack.ps1
Returns frequency count of the following fields:
ComputerStatus, CriticallyFailedDetections, PendingFullScan,
PendingManualSteps, PendingOfflineScan, PendingReboot,
RecentlyCleanedDetections, SchemaVersion
Requires:
Process data matching *AMInfectionStatus.tsv in pwd logp... | jvaldezjr1/Kansa | Analysis/config/Get-AMInfectionStatus.ps1 | PowerShell | apache-2.0 | 1,440 |
###
# ==++==
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# 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 a... | bingbing8/PowerShell | src/Modules/Shared/PackageManagement/PackageProviderFunctions.psm1 | PowerShell | mit | 10,269 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "Get-PSBreakpoint" -Tags "CI" {
$scriptName = "Get-PSBreakpoint.Tests.ps1"
$fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName
AfterEach {
Get-PSBreakpoint -Script $fullScriptPath | Remove-PSBreakp... | JamesWTruher/PowerShell-1 | test/powershell/Modules/Microsoft.PowerShell.Utility/Get-PSBreakpoint.Tests.ps1 | PowerShell | mit | 1,276 |
function Install-ChocolateyInstallPackage {
<#
.SYNOPSIS
Installs a package
.DESCRIPTION
This will run an installer (local file) on your machine.
.PARAMETER PackageName
The name of the package - this is arbitrary, call it whatever you want.
It's recommended you call it the same as your nuget package id.
... | chocolatey/chocolatey | src/helpers/functions/Install-ChocolateyInstallPackage.ps1 | PowerShell | apache-2.0 | 3,201 |
Properties {
if ([string]::IsNullOrWhitespace($Version)) {
$Version = "0.0.0"
}
$ModuleName = "Psst"
$Authors = "Jake Bruun"
$ProjectDir = "$PSScriptRoot"
$SrcDir = "$ProjectDir\src"
$TestDir = "$ProjectDir\src"
$TestResults = "PesterTestResults.xml"
$ReleaseDir = ... | Cobster/psst | default.ps1 | PowerShell | mit | 1,273 |
$checksums = join-path -path $PSScriptRoot -childpath "\checksums.txt"
if ([System.IO.File]::Exists($checksums)) {
del $checksums
}
$installerpath = join-path -path $PSScriptRoot -childpath "..\..\Installer_advinst\Installer_advinst-SetupFiles"
Get-ChildItem $installerpath -Filter *.msi |
Foreach-Object {
Get-FileH... | roots84/DNS-Swapper | DNS-Swapper/tools/get-checksums.ps1 | PowerShell | mit | 387 |
[CmdletBinding()]
param ()
begin {
}
process {
$instanceName ="SPDistributedCacheService Name=AppFabricCachingService"
$serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
if ($serviceInstance)
{
$ser... | egor-yudkin/PS-SharePoint | DistributedCacheMgmt/Start-DistributedCacheHost.ps1 | PowerShell | mit | 565 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.