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 |
|---|---|---|---|---|---|
#requires -RunAsAdministrator
#requires -Version 4.0
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
param (
## Name of the node in the PowerShell DSC configuration document (.psd1) to apply
[Parameter(ValueFromPipeline, ValueFromPipelineByPropertyName)]
[ValidateNotNullOrEmpty()]
[Sys... | VirtualEngine/LabilityBootstrap | Src/Private/Bootstrap.ps1 | PowerShell | mit | 17,491 |
Function Get-BitLockerStatus
{
[CmdletBinding()]
[Alias("gbs","bitlocker","blstatus")]
[OutputType([PSObject])]
param(
[String[]]$ComputerName = $env:COMPUTERNAME
)#Param
Begin {
#Check Computer Online?
$good = @()
$bad = @()
$multiDrive = @()
$singleDrive = @()
... | SolidOceanTrust/Public-PowerShell | Scripts/Get-BitLockerStatus.ps1 | PowerShell | mit | 4,716 |
#region Info
<#
#################################################
# modified by : Joerg Hochwald
# last modified : 2016-04-03
#################################################
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2012-2016, NET-Experts <h... | jhochwald/MyPowerShellStuff | Modules/ToolBox/Public/JsonTools.ps1 | PowerShell | mit | 14,669 |
$InstallPath = Join-Path $($env:ChocolateyInstall) 'lib\\TfsCmdlets'
$ToolsDir = Join-Path $InstallPath 'Tools'
if ($env:PSModulePath -notlike "*$ToolsDir*")
{
Write-Output "TfsCmdlets: Adding installation directory to PSModulePath environment variable"
SETX @('PSModulePath', "$env:PSModulePath;$ToolsDir", '/M... | igoravl/tfscmdlets | PS/chocolateyInstall.ps1 | PowerShell | mit | 1,017 |
function Invoke-TravisTest
{
Write-LogHeader "Executing tests"
$additionalArgs = $null
if($PSEdition -eq "Core" -and $IsWindows)
{
if(!(gmo pester))
{
ipmo pester
}
if((gmo pester).Version.Major -lt 4)
{
$additionalArgs = @{ExcludeTag = ... | lordmilko/PrtgAPI | build/CI/Travis/Invoke-TravisTest.ps1 | PowerShell | mit | 713 |
$repoRoot = (Resolve-Path "$PSScriptRoot\..\..").Path;
#Style rules based on Pester v. 4.0.2-rc2
Describe 'Linting\Style' -Tags "Style" {
$excludedPaths = @(
'.git*',
'.vscode',
'DSCResources', # We'll take the public DSC resources as-is
... | iainbrighton/PScribo | Tests/Linting/Style.Tests.ps1 | PowerShell | mit | 5,305 |
[CmdletBinding()] # Needed to support -Verbose
param(
[Parameter(Position = 0, Mandatory=$true)]
[ValidateSet("Release", "Debug")]
[string]$Configuration,
[Parameter(Position = 1, Mandatory=$true)]
[ValidateSet("AnyCPU", "x86", "x64")]
[string]$Platform,
[Parameter(Position = 2)]
[Val... | JJVertical/dotnet-apiport | build.ps1 | PowerShell | mit | 3,825 |
Remove-Module -Name 'Rubrik' -ErrorAction 'SilentlyContinue'
Import-Module -Name './Rubrik/Rubrik.psd1' -Force
foreach ( $privateFunctionFilePath in ( Get-ChildItem -Path './Rubrik/Private' | Where-Object extension -eq '.ps1').FullName ) {
. $privateFunctionFilePath
}
Describe -Name 'Public/Get-RubrikDatabaseRec... | rubrikinc/PowerShell-Module | Tests/Get-RubrikDatabaseRecoverableRange.Tests.ps1 | PowerShell | mit | 4,589 |
$regpath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation";
if (Get-ItemProperty -Path $regpath -Name "Manufacturer") {
Set-ItemProperty -Path $regpath -Name "Manufacturer" -Value "Patrick Hufford";
} else {
New-ItemProperty -Path $regpath -Name "Manufacturer" -PropertyType String -Value "Patr... | angryhussord/autobox | Update-OEMInformation.ps1 | PowerShell | apache-2.0 | 1,549 |
function Out-ZipArchive
{
<#
.SYNOPSIS
Creates a ZIP Archive
.DESCRIPTION
Creates a ZIP Archive with all given Files (and subdirectories)
.PARAMETER Path
Input Path
.PARAMETER ArchiveName
Name of the archive to create.
.PARAMETER fo... | jhochwald/PowerShell-collection | Misc/Out-ZipArchive.ps1 | PowerShell | bsd-3-clause | 8,566 |
configuration Sample_IISFeatureDelegation
{
param
(
# Target nodes to apply the configuration
[string[]]$NodeName = 'localhost'
)
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration
Node $NodeName
{
... | devopsteamberlin/xWebAdministration | Examples/Sample_xIisFeatureDelegation_AllowSome.ps1 | PowerShell | mit | 1,083 |
Function Get-UnityvmDisk {
<#
.SYNOPSIS
Virtual Machine disk object.
.DESCRIPTION
Virtual Machine disk object.
You need to have an active session with the array.
.NOTES
Written by Erwan Quelin under MIT licence - https://github.com/equelin/Unity-Powershell/blob/master/LI... | equelin/Unity-Powershell | Tools/Functions/Result_UnityVSA_41/Get-UnityvmDisk.ps1 | PowerShell | mit | 1,937 |
<#
Copyright (c) 2012-2014 VMware, Inc.
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, publish, distribu... | vmware/webcommander | powershell/Broker/brokerSetHtmlAccess.ps1 | PowerShell | mit | 3,125 |
param($installPath, $toolsPath, $package, $project)
Write-Host "installPath:" "${installPath}"
Write-Host "toolsPath:" "${toolsPath}"
Write-Host " "
if ($project) {
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
# Create paths and list them
$projectPath = (Get-Item $project.Properties.Item("FullPath").Value).FullN... | TobiasSK/AarhusWebDevCoop | packages/UmbracoCms.7.4.1/tools/install.ps1 | PowerShell | mit | 3,485 |
$packageName = 'quicksetdns'
$url = 'http://www.nirsoft.net/utils/quicksetdns.zip'
$checksum = '8f64bd89682f5cad8b3563755cb14ff47ef1e3ef'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
Install-ChocolateyZipPackage -... | dtgm/chocolatey-packages | automatic/_output/quicksetdns/1.05/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 672 |
$packageName = 'noindent'
$url = 'http://www.pc-tools.net/files/win32/freeware/noindt10.zip'
$checksum = '326e58ad034384270c54541838503f6b4c7790fe'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
Install-ChocolateyZi... | dtgm/chocolatey-packages | automatic/_output/noindent/1.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 711 |
# Test file for the Vester module - https://github.com/WahlNetwork/Vester
# Called via Invoke-Pester VesterTemplate.Tests.ps1
# Test title, e.g. 'DNS Servers'
$Title = 'Sync Time Settings'
# Test description: How New-VesterConfig explains this value to the user
$Description = 'VMware Tools sets the time of the guest ... | vScripter/windows-docker-files | vester-ws-nano/Vester/Tests/VM/Sync-TimeSettings.Vester.ps1 | PowerShell | mit | 1,186 |
$helpersPath = (Split-Path -parent $MyInvocation.MyCommand.Definition);
$DebugPreference = "SilentlyContinue"
if ($env:ChocolateyEnvironmentDebug -eq 'true') {$DebugPreference = "Continue";}
# grab functions from files
Get-Item $helpersPath\functions\*.ps1 |
? { -not ($_.Name.Contains(".Tests.")) } |
... | chocolatey/chocolatey | src/helpers/chocolateyInstaller.psm1 | PowerShell | apache-2.0 | 438 |
Deploy MSOnlineExt {
By AppVeyorModule {
FromSource src\MSOnlineExt
To AppVeyor
Tagged Test
WithOptions @{
Version = $env:APPVEYOR_BUILD_VERSION
}
}
}
| Persistent13/MSOnlineExt | src/Deploy/Appveyor.PSDeploy.ps1 | PowerShell | mit | 211 |
<#
.EXAMPLE
This example performs a standard Sql encryption setup. Forcing all connections to be encrypted.
#>
Configuration Example
{
Import-DscResource -ModuleName SqlServerDsc
node localhost {
SqlServerSecureConnection SecureConnectionAbsent
{
InstanceName = 'MSSQLSERVER'
... | PowerShell/xSQLServer | Examples/Resources/SqlServerSecureConnection/3-SecureConnectionAbsent.ps1 | PowerShell | mit | 449 |
$packageName = 'powergist'
$path = Split-Path -Parent $MyInvocation.MyCommand.Definition
$pathLib = "$path\..\lib\"
$iseInstances = get-process | ?{$_.ProcessName -like "powershell_ise"}
if ($iseInstances.Length -gt 0)
{
Write-Host "ISE Running, recomend stopping before install"
}
$addinDll = "$pathLib\GripD... | lawrencegripper/PowerGist | chocolateyInstall.ps1 | PowerShell | mit | 1,555 |
class PaRadiusProfile : PaConfigObject {
[string]$Name
[bool]$AdminUseOnly
[int]$Timeout
[int]$Retries
[array]$Servers
[string]$ConfigNode = "server-profile/radius"
# XPath
[string] getXPath() {
$returnXPath = $this.getBaseXPath()
# Add Name
if ($this.Name) {
... | brianaddicks/poweralto3 | poweralto3/src/classes/main/PaRadiusProfile.ps1 | PowerShell | mit | 756 |
#Load Up SQLite libraries
Add-Type -Path "$PSScriptRoot\System.Data.SQLite.dll"
#Provider Class
. "$PSScriptRoot\provider.ps1"
#Open Cmdlet
Function Open-SQLiteConnection {
<#
.Synopsis
Open a connection to a SQLite database file.
.Description
Open a connection to a SQLite database file.
... | mithrandyr/SimplySql | SimplySql/Providers/SQLite/config.ps1 | PowerShell | mit | 2,915 |
$projectRoot = Resolve-Path "$PSScriptRoot\.."
$script:ModuleName = 'PSRedgate'
Describe "Basic function feature tests" -Tags Build {
}
| sqlwhale/PSRedgate | tests/Feature.Tests.ps1 | PowerShell | mit | 139 |
#
# Module 'Dynamite.PowerShell.Toolkit'
# Generated by: GSoft, Team Dynamite.
# Generated on: 10/24/2013
# > GSoft & Dynamite : http://www.gsoft.com
# > Dynamite Github : https://github.com/GSoft-SharePoint/Dynamite-PowerShell-Toolkit
# > Documentation : https://github.com/GSoft-SharePoint/Dynamite-PowerShell-Toolkit/... | GSoft-SharePoint/Dynamite-2010 | Source/Scripts/Dynamite.PowerShell.Toolkit/SiteCollection.ps1 | PowerShell | mit | 7,834 |
# $PoshACMERoot = "\Posh-ACME"
$Public = @( Get-ChildItem -Path $PoshACMERoot\Public\*.ps1 -ErrorAction Ignore )
$Private = @( Get-ChildItem -Path $PoshACMERoot\Private\*.ps1 -ErrorAction Ignore )
Add-Type -Path "$($PoshACMERoot)\..\..\..\BouncyCastle.Crypto.dll"
# Dot source the files (in the same manner as Posh-... | webprofusion/Certify | src/Certify.Shared/Scripts/DNS/PoshACME/Posh-ACME-Wrapper.ps1 | PowerShell | mit | 945 |
@{
ModuleVersion = "1.0.0"
Author = "Matt McNabb"
PrivateData = @{
PSData = @{
Extensions = @(
@{
Module = "Plaster"
MinimumVersion = "1.0.1"
Details = @{
TemplatePaths = "AppveyorCI"
... | mattmcnabb/PlasterTemplates | PlasterTemplates.psd1 | PowerShell | mit | 388 |
function Test-ChocolateyInstall
{
[CmdletBinding()]
Param(
[Parameter(
Mandatory = $false
)]
[ValidateNotNullOrEmpty()]
[string]
$InstallDir
)
Write-Verbose "Loading machine Path Environment variable into session"
$env:Path = [Environment]::GetEnv... | gaelcolas/PackageProviderBootstrap | PackageProviderBootstrap/public/Test-ChocolateyInstall.ps1 | PowerShell | mit | 1,107 |
[CmdletBinding()]
param(
[string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve)
)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ea 0
$ErrorActionPreference = 'stop'
Set-StrictMode -Version latest
$RepoRoot = (Resolve-Path $... | wulfland/xSharePoint | Tests/xSharePoint/xSharePoint.xSPUserProfileSection.Tests.ps1 | PowerShell | mit | 12,548 |
<#
This script will find the sample folder for the PR - Test are run on that folder only
If the PR contains more than one sample the build must fail
If the PR does not contain changes to a sample folder, it will currently fail but we'll TODO this to
pass the build in order to trigger a manual review
#>
Get-ChildItem e... | nzthiago/azure-quickstart-templates | test/ci-scripts/Get-SampleFolder.ps1 | PowerShell | mit | 2,612 |
. $PSScriptRoot\..\wsl2\.env.ps1
$ip="192.168.199.100"
flanneld `
--iface=$ip `
--ip-masq=1 `
--etcd-endpoints=${K8S_ETCD_ENTRYPOINTS} `
--etcd-cafile="$PSScriptRoot/../wsl2/certs/etcd-ca.pem" `
--etcd-certfile="$PSScriptRoot/../wsl2/certs/flanneld-etcd-client.pem" `
--etcd-keyfile="$PSScriptRoot/../wsl2/certs/flanne... | khs1994-docker/lnmp | kubernetes/windows/flanneld.ps1 | PowerShell | apache-2.0 | 382 |
function Set-VirtualMachineDiskConfiguration {
<#
.SYNOPSIS
Set the disk configuration of a virtual machine
.NOTES
See module manifest for required software versions and dependencies at:
http://dfch.biz/biz/dfch/PS/Cumulus/VI/biz.dfch.PS.Cumulus.VI.psd1/
#>
PARAM
(
[Parameter(Mandatory = $true, Position = 1)]
[... | dfch/biz.dfch.PS.Cumulus.VI | Set-VirtualMachineDiskConfiguration.ps1 | PowerShell | apache-2.0 | 12,261 |
#Requires -Modules platyPS
function Generate-MarkdownHelp
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory = $true, Position = 0)]
[String]$HelpFolderPath
)
$HelpFolder = Get-Item $HelpFolderPath
$ModuleFolder = $HelpFolder.Parent
$ModuleFolderPath = $ModuleFolder.FullName
... | devigned/azure-powershell | tools/HelpGeneration/HelpGeneration.psm1 | PowerShell | apache-2.0 | 11,721 |
# powershell v2 compatibility
$psVer = $PSVersionTable.PSVersion.Major
if ($psver -ge 3) {
function Get-ChildItemDir {Get-ChildItem -Directory $args}
} else {
function Get-ChildItemDir {Get-ChildItem $args}
}
$warningPreference = "Continue"
$chocoLib = Join-Path $env:ChocolateyInstall "lib"
if (Test-Path -PathType ... | dtgm/chocolatey-packages | automatic/_output/handbrake/0.10.5.20160304/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 948 |
# See dsc_configuration.ps1 | MattHodge/Hubot-DSC-Resource | Examples/HubotInstall_Example.ps1 | PowerShell | mit | 30 |
# ----------------------------------------
# PUB 02: VIEW ITEM DETAILS
# ----------------------------------------
param([string]$LogFolderPath)
$UserStory = "PUB_02"
$0 = $myInvocation.MyCommand.Definition
$CommandDirectory = [System.IO.Path]::GetDirectoryName($0)
##### STEP 1: CREATE SEARCH RESULT SOURCES
$values... | GSoft-SharePoint/Dynamite-Components | Source/GSoft.Dynamite.Models.CrossSitePublishingCMS/Modules/Publishing/PUB_02/Install-PUB02.ps1 | PowerShell | mit | 1,527 |
$packageName = 'avginternetsecurity'
$installerType = 'EXE'
$LCID = (Get-Culture).LCID
$SelectedLanguage = "/SelectedLanguage=$LCID"
$silentArgs = '/UILevel=silent /AppMode=setup /InstallToolbar=0 /ChangeBrowserSearchProvider=0 "$SelectedLanguage" /InstallSidebar=0 /ParticipateProductImprovement=0 /DontRestart /Disabl... | dtgm/chocolatey-packages | automatic/_output/avginternetsecurity/14.0.4569/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 901 |
#
# Module manifest for module 'PSGet_AzureRM.DataLakeStore'
#
# Generated by: Microsoft Corporation
#
# Generated on: 8/7/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '4.3.1'
# Supported PSEditions
# CompatiblePSE... | hungmai-msft/azure-powershell | src/ResourceManager/DataLakeStore/AzureRM.DataLakeStore.psd1 | PowerShell | apache-2.0 | 7,280 |
$packageName = 'hpusbdisk'
#$url = 'http://tonigellida.x10.mx/packages/hpusbdisk/HPUSBDisk.exe'
$url = 'http://tonigellida.x10.mx/packages/hpusbdisk/HPUSBDisk.exe'
try {
$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
$nodePath = Join-Path $scriptPath 'HPUSBDisk.exe'
Get-ChocolateyWebFile... | dtgm/chocolatey-packages | automatic/_output/hpusbdisk/2.2.3.20130601/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 623 |
$imageTimestamp = Get-Date -Format yyyy-MM-dd
$dummyImageName = "FreeBSD11_0-2017-02-24"
$dummyVersion = "11.0.20170224"
$dummyPublishDate = "02/24/2017"
$dummyVHDFilePath = "C:\home\Work\Azure\vhd\FreeBSD_11_0_20170224.vhd"
# Specify the values of the following items before publishing images
... | clovertrail/rocket | powershell/BSDPublishImage/frbsd11/env_config.ps1 | PowerShell | apache-2.0 | 480 |
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
# For more informat... | tburgin/osquery | tools/provision/chocolatey/boost-msvc14.ps1 | PowerShell | bsd-3-clause | 3,563 |
<#
.SYNOPSIS
Gets all available domains or the specified domain.
.DESCRIPTION
The Get-Domain command returns all the domains or the specified domain.
.PARAMETER Name
The name of the domain
.INPUTS
System.String
Represents the name of a domain.
... | ostat/Console | Documentation/Get-Domain.ps1 | PowerShell | mit | 1,238 |
# http://www.incyclesoftware.com/2014/10/change-build-controller-multiple-build-definitions/
$cs = Get-TfsConfigServer http://ditfssb01:8080/tfs
$tpcIds = Get-TfsTeamProjectCollectionIds $cs
Write-Verbose "Iterating through each TPC"
foreach($tpcId in $tpcIds){
Write-Verbose "Get TPC instance for $tpcId"
$tp... | agileramblings/powershell | Update-Builds.ps1 | PowerShell | mit | 2,265 |
# install.ps1
# -------------------------------------------------
# Installs a transport agent on an Exchange Server 2010 development server
#
# Copyright (c) 2013 SF-Tools (http://www.sf-tools.net)
# Send any comments to info@sf-tools.net
#
# $EXDIR needs to be adjusted to the target environment
$EXDIR="D:\P... | Apoc70/TransportAgent2010 | install.ps1 | PowerShell | mit | 1,947 |
$lic_path = "$env:USERPROFILE\drivesnapshot_lic"
$icon_name = (Get-ChildItem "$env:ALLUSERSPROFILE\Microsoft\Windows\Start Menu\Programs" -Filter "Drive Snapshot.lnk" -ErrorAction SilentlyContinue).FullName
if(Test-Path $lic_path)
{
Remove-Item $lic_path -Recurse -Force -ErrorAction SilentlyContinue
}
Rem... | sippi90/chocolateyautomaticpackages | drivesnapshot/tools/chocolateyUninstall.ps1 | PowerShell | mit | 369 |
#
# Module manifest for module 'IAUtility'
#
# Generated by: Tomas Deceuninck
#
# Generated on: 7/27/2017
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'IAUtility.psm1'
# Version number of this module.
ModuleVersion = '0.2.0.9'
# ID used to uniquely identify ... | Invoke-Automation/IAUtility | IAUtility/IAUtility.psd1 | PowerShell | mit | 3,663 |
<#
.SYNOPSIS
Configuration Manager PowerShell Module
.DESCRIPTION
This will copy the files needed to the computer this script is being executed on. It must be run using an AD account that has priviledges to both the directory on the ConfigMgr server and to the program files directory on the local computer... | MicksITBlogs/PowerShell | InstallConfigMgrModule.ps1 | PowerShell | mit | 6,229 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 80d306fa-8bd4-4a8d-9f7a-bf40df95e661
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS
.LICENSEURI https://github.com/dsccommunity/SharePointDsc/blob/master/LICENSE
.PROJECTURI https://github.com/dsccommunity/S... | PowerShell/xSharePoint | SharePointDsc/Examples/Resources/SPTrustedRootAuthority/3-RemoveRootAuthority.ps1 | PowerShell | mit | 1,145 |
# NOTE: this install will likely restart the machine
# To be PS 2.0 compatible, dont use Invoke-WebRequest
$packageName = "DotNet4_5.exe"
$downloadUrl = "https://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_setup.exe"
$targetFile = "C:\tmp\$packageName"
$fileArgs = @("/pa... | sparerd/vagrant | SharedScripts/Windows/DotNet/install_dotnet_45.ps1 | PowerShell | mit | 681 |
function New-DbaDbMaskingConfig {
<#
.SYNOPSIS
Generates a new data masking configuration file to be used with Invoke-DbaDbDataMasking
.DESCRIPTION
Generates a new data masking configuration file. This file is important to apply any data masking to the data in a database.
Note that... | dsolodow/dbatools | functions/New-DbaDbMaskingConfig.ps1 | PowerShell | mit | 32,229 |
# -----------------------------------------------------------------------
# Copyright : GSoft @2014
# Model : Standard Publishing CMS
# File : Remove-TermGroups.template.ps1
# Description : Remove Portal Taxonomy
# -----------------------------------------------------------------------
# Define working d... | GSoft-SharePoint/Dynamite-Components | Source/GSoft.Dynamite.Models.StandardPublishingCMS/Modules/Publishing/PUB_01/Remove-TermGroups.template.ps1 | PowerShell | mit | 1,354 |
param (
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
# Load libraries in "lib" folder
Get-ChildItem -Recurse "$($scriptDirectory)\BoxTurtlePs\Private" -Filter *.ps1 |
... | brianwoelfel/BoxTurtlePs | BoxTurtleLoad.ps1 | PowerShell | mit | 933 |
[CmdletBinding()]
param(
[string] $SharePointCmdletModule = (Join-Path $PSScriptRoot "..\Stubs\SharePoint\15.0.4693.1000\Microsoft.SharePoint.PowerShell.psm1" -Resolve)
)
$ErrorActionPreference = 'stop'
Set-StrictMode -Version latest
$RepoRoot = (Resolve-Path $PSScriptRoot\..\..).Path
$Global:CurrentSharePointStu... | HiltonGiesenow/xSharePoint | Tests/xSharePoint/xSharePoint.xSPJoinFarm.Tests.ps1 | PowerShell | mit | 4,782 |
function Add-OneLoginUserRole
{
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = "Medium")]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[OneLogin.User]
$Identity,
[Parameter(Mandatory = $true)]
[int[]]
$RoleId
)
begin
... | mattmcnabb/OneLogin | OneLogin/functions/Add-OneLoginUserRole.ps1 | PowerShell | mit | 699 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]$logFilePath
)
#Checks to see if a log file exists
if (Test-Path $logFilePath)
{
#Gets the last line of the log file with each row only containing a datetime value.
$lastLine = (Get-Content $logPath | Select-Object -Last 1)
$lastRunDate = [datetime... | mitchelladams/powershell | FileSystem/Get-LastRuntimeFromLog.ps1 | PowerShell | mit | 931 |
<#
.SYNOPSIS
Queries current AD Domain for data useful for IT Audit Purposes.
.DESCRIPTION
This function will extract key information from Active Directory that can be used to analyze The
management of an AD Domain. It queries information regarding Users, Groups, OUs,
Group Policy Objects, Group Policy Inheritance, Fi... | aentringer/ADAudit | PowerShell/Get-ADAuditData.ps1 | PowerShell | mit | 51,710 |
function Find-SqlServerUpdate {
<#
.SYNOPSIS
Returns a SQL Server KB filesystem object based on parameters
.DESCRIPTION
Recursively searches specified folder for a file that matches the following pattern:
"SQLServer$MajorVersion*-KB$KB-*$Architecture*.exe"
... | dsolodow/dbatools | internal/functions/Find-SqlServerUpdate.ps1 | PowerShell | mit | 2,415 |
#requires -Version 3
function Get-RubrikVAppSnapshot
{
<#
.SYNOPSIS
Retrieves details on one or more virtual machines known to the Rubrik cluster as a vCD-managed vApp
.DESCRIPTION
The Get-RubrikVAppSnapshot cmdlet pulls detailed information from a vCD vApp snapshot
.NOTES
Written by Matt ... | rubrikinc/PowerShell-Module | Rubrik/Public/Get-RubrikVAppSnapshot.ps1 | PowerShell | mit | 2,716 |
<#
.SYNOPSIS
Automated unit test for DSC_SqlAgentAlert DSC resource.
#>
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1')
if (-not (Test-BuildCategory -Type 'Unit'))
{
return
}
$script:dscModuleName = 'SqlServerDsc'
$script:dscResourceName = 'DSC_S... | bozho/xSQLServer | tests/Unit/DSC_SqlAgentAlert.Tests.ps1 | PowerShell | mit | 26,999 |
# limbus-buildgen - A "build anywhere" C/C++ makefile/project generator.
# Written in 2014-2016 by Jesper Oskarsson jesosk@gmail.com
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain worldwide.
# This software is ... | redien/limbus-buildgen | dependencies/fetch_dependencies.ps1 | PowerShell | cc0-1.0 | 1,650 |
#
# Module manifest for module 'PSGet_AzureRM.KeyVault'
#
# Generated by: Microsoft Corporation
#
# Generated on: 1/17/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '2.5.0'
# Supported PSEditions
# CompatiblePSEditio... | seanbamsft/azure-powershell | src/ResourceManager/KeyVault/AzureRM.KeyVault.psd1 | PowerShell | apache-2.0 | 5,913 |
<#############################################################################
The DoPx module provides a rich set of commands that extend the automation
capabilities of the DigitalOcean (DO) cloud service. These commands make it
easier to manage your DigitalOcean environment from Windows PowerShell. When
used with th... | KirkMunro/DoPx | functions/Get-DoPxAction.ps1 | PowerShell | apache-2.0 | 6,327 |
$packageName = 'advtor'
$url = 'https://sourceforge.net/projects/advtor/files/AdvOR-0.3.1.3/AdvOR-0.3.1.3.zip/download'
$checksum = '{checksum}'
$checksumType = 'sha256'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir (Join-Path "AdvOR" "AdvOR.exe")
Install-Ch... | dtgm/chocolatey-packages | automatic/_output/advtor/0.3.1.3/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 650 |
<#
Copyright 2018 Iain Brighton
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
d... | iainbrighton/NetScaler | NetScaler/Public/New-NSTACACSAuthenticationPolicy.ps1 | PowerShell | apache-2.0 | 2,649 |
[CmdletBinding()]
param()
Trace-VstsEnteringInvocation $MyInvocation
try {
. .\Octopus-VSTS.ps1
$ConnectedServiceName = Get-VstsInput -Name ConnectedServiceName -Require
$Package = Get-VstsInput -Name Package -Require
$AdditionalArguments = Get-VstsInput -Name AdditionalArguments
$Replace = Get... | moppa/OctoTFS | source/VSTSExtensions/OctopusBuildAndReleaseTasks/Tasks/Push/Octopus-Push.ps1 | PowerShell | apache-2.0 | 946 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = '61463fc5229a023e8fc59f18d63ddecb550858df4348395e7fe821a1f07ac5b6'
$checksumType = 'sha256'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvr... | dtgm/chocolatey-packages | automatic/_output/kvrt/2016.07.30.0643/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 960 |
[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'] = 'b7d503c3-4288-46fe-a7cc... | nieprzecietny/Wise.goodREST | test/GoodREST.Core.Web/Properties/PublishProfiles/DEVEL_IIS-publish.ps1 | PowerShell | apache-2.0 | 774 |
#
# Module manifest for module 'Microsoft.Azure.Commands.Tags'
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/19/2015
#
@{
# Version number of this module.
ModuleVersion = '0.9.10'
# ID used to uniquely identify this module
GUID = '59713673-194f-418a-b1f2-ac60db82edf9'
# A... | dominiqa/azure-powershell | src/ResourceManager/Tags/AzureRM.Tags.psd1 | PowerShell | apache-2.0 | 2,591 |
<#
.Synopsis
Retrives the default active directory password policy
.DESCRIPTION
Retrives the default active directory password policy
.EXAMPLE
PS C:\> Pass-Pol
Output the default domain password policy
#>
function Get-PassPol
{
$domain = [ADSI]"WinNT://$env:userdomain"
$Name = @{Name='DomainName';Express... | nettitude/PoshC2 | resources/modules/Get-PassPol.ps1 | PowerShell | bsd-3-clause | 1,445 |
$hdiPassword = 'P@ssword123' # password used to access the HDI cluster dashboard website
$sshPassword = 'MSFTBuild2016'
# Note: other parameters will be prompted to the user
Login-AzureRmAccount
###### select subscription ######
$subscriptions = Get-AzureRmSubscription | where {!$_.State -or $_.State -eq "Enabled"}
... | DxNext/2016-Oct-L2 | Data/Module2-GainInsights/Setup/Archive/createHDICluster.ps1 | PowerShell | mit | 7,000 |
function Format-MSBuildArguments {
[cmdletbinding()]
param(
[string]$MSBuildArguments,
[string]$Platform,
[string]$Configuration
)
if ($Platform) {
Write-Verbose "Adding platform: $platform"
$MSBuildArguments = "$MSBuildArguments /p:platform=`"$Platform`""
}
... | vtbassmatt/vso-agent-tasks | Tasks/MSBuild/Helpers.ps1 | PowerShell | mit | 5,235 |
# Copyright 2019 The Kubernetes Authors.
#
# 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 ... | intelsdi-x/kubernetes | cluster/gce/windows/configure.ps1 | PowerShell | apache-2.0 | 4,676 |
#requires -Version 5
$StartTime = [System.Diagnostics.Stopwatch]::StartNew()
$computers = 'OHSQL9012'
$OutputPath = 'F:\DSCConfig'
$KeyPath = 'F:\publicKeys'
$cim = New-CimSession -ComputerName $computers
Function check-even($num){[bool]!($num%2)}
Function Get-Cert
{
Param
(
[System.String]$Re... | Arturas-K/xSQLServer | Examples/DSCSQLBuildEncrypted.ps1 | PowerShell | mit | 6,355 |
function Get-PackageRoot{
<#
.SYNOPSIS
Returns the Root path of a Boxstarter Package given the Chocolatey $MyInvocation
.DESCRIPTION
This function is intended to be called from inside a running
ChocolateyInstall.ps1 file. It returns the root path of the package
which is one level above the Tools directory. Th... | cam1985/boxstarter | Boxstarter.Chocolatey/Get-PackageRoot.ps1 | PowerShell | apache-2.0 | 2,040 |
# ----------------------------------------------------------------------------------
#
# 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... | AzureAutomationTeam/azure-powershell | src/ServiceManagement/Services/Commands.Test.Utilities/Resources/DSC/Configurations/Dummy/NameImportSingleInsideNode.ps1 | PowerShell | apache-2.0 | 847 |
######################3
#Requires NanoServerPackage module places in the same dir or already imported
#Connects to NANO host and allows management
#
#By Joel Ulrich
#
$Creds = Get-Credential
$ServerToManage = Read-Host "IP Or Hostname"
$WSMANhosts = Get-Item "WSMan:\localhost\Client\TrustedHosts"
#Check if WinRM is ... | scriptersx/ConnectGroup | NANO-Server/NANO-Server-FULL_Manage.ps1 | PowerShell | mit | 1,753 |
#!/usr/bin/powershell
param (
[string]$source = "HDMI3",
[bool]$wait = $false
)
$tv = "172.16.23.15"
$service = "urn:samsung.com:service:MainTVAgent2:1"
$upnpc = "..\bin\Debug\upnpc.exe"
$castnow = "..\..\castnow\castnow.cmd"
function Is-Tv-On {
if ($IsWindows) {
ping -n 1 -w 10 $tv *> $null
}... | yath/upnpc | examples/switch_tv_input.ps1 | PowerShell | mit | 1,768 |
[CmdletBinding()]
param()
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
. $PSScriptRoot\MockVariable.ps1
#Mock Vsts-Input
Register-Mock Get-VstsInput { "ConnectedServiceNameARM" } -ParametersEvaluator { $Name -eq "ConnectedServiceNameSelector" }
Register-Mock Get-VstsInput { "DacpacTask" } -ParametersEvaluat... | jotaylo/vsts-tasks | Tasks/SqlAzureDacpacDeploymentV1/Tests/L0ValidSqlAzureInputs.ps1 | PowerShell | mit | 2,135 |
Function Set-TfsTeam
{
[CmdletBinding(DefaultParameterSetName="Get by name")]
[OutputType([Microsoft.TeamFoundation.Client.TeamFoundationTeam])]
param
(
[Parameter(Position=0, ValueFromPipeline=$true)]
[Alias("Name")]
[ValidateScript({($_ -is [string]) -or ($_ -is [Microsoft.Team... | GersonDias/tfscmdlets | TfsCmdlets/TfsCmdlets/Team/Set-TfsTeam.ps1 | PowerShell | mit | 1,560 |
Describe "SSDTExtensions" {
#These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page
if (Test-isWin19) {
$testExtenions = @(
@{id = "04a86fc2-dbd5-4222-848e-911638e487fe"}
@{id = "851E7A09-7B2B-4F... | mattgwagner/New-Machine | .github-actions/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 | PowerShell | mit | 745 |
<#
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2019 v5.6.157
Created on: 2/8/2019 12:12 PM
Created by: CERBDM
Organization: Cerner Corporation
Filename: VE_XD7StoreFrontStoreFarm.psm1
-------------... | VirtualEngine/XenDesktop7 | DSCResources/VE_XD7StoreFrontStoreFarm/VE_XD7StoreFrontStoreFarm.psm1 | PowerShell | mit | 10,495 |
param([string]$resourceDirectory)
$inputFile = "$resourceDirectory\LocalizedStrings.resx"
$outputFile = "$resourceDirectory\LocalizedStrings.cs"
[xml]$resources = gc $inputFile
$strings = $resources.root.data | % { "public static string " + $_.name + " { get { return @`"" + $_.value.Replace("`"", """""") + "`"; } }"... | mjrousos/dotnet-apiport-old | CreateLocalizedStrings.ps1 | PowerShell | mit | 728 |
using module PSNativeAutomation
class MetadataLookupWindow : Window
{
[UIObject]$ButtonOK
[UIObject]$ButtonCancel
[UIObject]$ButtonSearch
[ListBox]$ListSearch
[UIObject]$TextDownloading
[UIObject]$TextSearch
MetadataLookupWindow() : base({Get-UIWindow -ProcessName "PlayniteUI" |... | JosefNemec/Playnite | tests/Mapping/MetadataLookupWindow.ps1 | PowerShell | mit | 1,301 |
<#
.SYNOPSIS
Installs and restores OSMC.
.DESCRIPTION
This cmdlet installs and restores OSMC for the Raspberry Pi. This cmdlet also support setting custom settings into the config.txt file. Using this cmdlet u will be able to do both a SD or USB install of OSMC.
The cmdlet supports the OSMC tar distributio... | juniinacio/RaspberryPi-PoSh | RaspberryPi-PoSh/Functions/Install-OSMC.ps1 | PowerShell | mit | 18,187 |
function Format-DynamicParameter {
[CmdletBinding()]
Param(
[Parameter(ValueFromPipeline=$True,Mandatory=$true)]
[object]$InputObject,
[Parameter(ValueFromPipeline=$false,Mandatory=$false)]
[string[]]$ExclusionList = @('parameterValue','isDynamic','defaultValue','required'... | DBremen/Show-CommandGUI | Public/Format-DynamicParameter.ps1 | PowerShell | mit | 1,377 |
# Runs every time a package is installed in a project
param($installPath, $toolsPath, $package, $project)
$project.Object.References.Add("Microsoft.CSharp");
$project.Object.References.Add("System.Configuration");
# $installPath is the path to the folder where the package is installed.
# $toolsPath is the path to ... | IncodingSoftware/Browsio | src/packages/Incoding.Framework.1.0.278.1005/tools/install.ps1 | PowerShell | apache-2.0 | 508 |
# With InvokeEntitySetActionWithSingleResult you can query arbitrary OData actions
# that operate on an entity set (i.e. EntityKinds as opposed to an entity such as 'EntityKind')
# which return a single object (hence WithSingleResult)
PS > $svc.Core.InvokeEntitySetActionWithSingleResult
OverloadDefinitions
----------... | dfensgmbh/biz.dfch.PS.Appclusive.Scriplets | src/GetEntityTemplate.ps1 | PowerShell | apache-2.0 | 5,333 |
<#
.DESCRIPTION
Updates aspnetcore_schema.xml to the latest version.
Updates aspnetcore_schema.xml to the latest version.
Requires admin privileges.
#>
[cmdletbinding(SupportsShouldProcess = $true)]
param()
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version 1
$ancmSchemaFileLocation = Join-Path $PSScriptRoot "as... | aspnet/AspNetCore | src/Servers/IIS/tools/update_schema.ps1 | PowerShell | apache-2.0 | 1,963 |
Import-Module -Name (Join-Path -Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) `
-ChildPath 'SqlServerDscHelper.psm1') `
-Force
Import-Module -Name (Join-Path -Path (Split-Path -Path $PSScriptRoot -Parent) `
-ChildPath 'CommonResourceHelper.psm1')
$script:localizedData = Get-Localize... | jpogran/puppetlabs-dsc | lib/puppet_x/dsc_resources/SqlServerDsc/DSCResources/MSFT_SqlServerDatabaseMail/MSFT_SqlServerDatabaseMail.psm1 | PowerShell | apache-2.0 | 24,284 |
$packageName = 'boinc'
$installerType = 'exe'
$silentArgs = '/S /v/qn'
$url = 'https://boinc.berkeley.edu/dl/boinc_7.8.3_windows_intelx86.exe'
$checksum = 'ec7ac2cac9e46b28f72cc9335398b8a6368a7070c01c79983333551767a30669'
$checksumType = 'sha256'
$url64 = 'https://boinc.berkeley.edu/dl/boinc_7.8.3_windows_x86_64.exe'
$... | dtgm/chocolatey-packages | automatic/_output/boinc/7.8.3/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 984 |
# Edit JSON preference files
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
function Set-JsonPreference
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[string] $Path,
... | turboapps/turbome | tools/powershell/Turbo/Set-JsonPreference.ps1 | PowerShell | apache-2.0 | 1,401 |
$script:ErrorActionPreference = "Stop"
$domain = .\Get-ConfigurationPropertyValue.ps1 Domain
$userName = .\Get-ConfigurationPropertyValue.ps1 UserName
$password = .\Get-ConfigurationPropertyValue.ps1 Password
$computerName = .\Get-ConfigurationPropertyValue.ps1 SUTComputerName
$transportType = .\Get-ConfigurationProper... | XinwLi/Interop-TestSuites-1 | FileSyncandWOPI/Source/MS-WOPI/Adapter/SUTControlAdapter/Implementation/AddFileToSUT.ps1 | PowerShell | mit | 1,710 |
$packageName = 'nsis.portable'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://sourceforge.net/projects/nsis/files/NSIS%203%20Pre-release/3.0b1/nsis-3.0b1.zip/download'
$checksum = 'e796d7d2cc12ac1f26eb17c6db4967f3170ab160'
$checksumType = 'sha1'
Install-ChocolateyZipPackage -Pac... | dtgm/chocolatey-packages | automatic/_output/nsis.portable/3.01-beta1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 602 |
$packageName = 'speedfan'
$installerType = 'EXE'
$silentArgs = '/S'
$processor = Get-WmiObject Win32_Processor
$is64bit = $processor.AddressWidth -eq 64
$validExitCodes = @(0) #please insert other valid exit codes here, exit codes for ms http://msdn.microsoft.com/en-us/library/aa368542(VS.85).aspx
try {
if ($is64bit... | dtgm/chocolatey-packages | automatic/_output/speedfan/4.50.20143011/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 692 |
cd $PSScriptRoot
.\packages\xunit.runner.console.2.1.0\tools\xunit.console.exe .\AllTests\bin\Debug\AllTests.dll @args
| BRML/BRMLDrivers | Run-Tests.ps1 | PowerShell | apache-2.0 | 119 |
###############################################################################
##
## Description:
## Verify kvm clock adjusting
##
###############################################################################
##
## Revision:
## V1.0 - boyang - 01/18/2017 - Build script
##
###########################################... | VirtQE-S1/ESX-LISA | testscripts/go_kvm_clock_adjusting.ps1 | PowerShell | apache-2.0 | 3,224 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "Get-EventSubscriber" -Tags "CI" {
AfterEach {
Unregister-Event -SourceIdentifier PesterTestRegister -ErrorAction SilentlyContinue
}
Context "Check return type of Get-EventSubscriber" {
It "Should ret... | Cowmonaut/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/Get-EventSubscriber.Tests.ps1 | PowerShell | mit | 1,581 |
@{
net_ACCOUNTS = @'
The syntax of this command is:
NET ACCOUNTS
[/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length]
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]
NET ACCOUNTS updates the user accounts database and modifies password
and logon requirements for ... | jazzdelightsme/TabExpansionPlusPlus | WindowsExe.Messages.psd1 | PowerShell | bsd-2-clause | 68,401 |
while ($true)
{
Start-Sleep 1.0
Write-Host "I am executing a BOSH JOB, BRUH!!!!!!!!!!!"
}
| cloudfoundry/bosh-init | vendor/github.com/cloudfoundry/bosh-agent/integration/windows/fixtures/templates/say-hello/bin/start.ps1 | PowerShell | apache-2.0 | 92 |
#!powershell
#Requires -Module Ansible.ModuleUtils.Legacy
$ErrorActionPreference = "Stop"
Function Assert-Equals($actual, $expected) {
if ($actual -cne $expected) {
$call_stack = (Get-PSCallStack)[1]
$error_msg = "AssertionError:`r`nActual: `"$actual`" != Expected: `"$expected`"`r`nLine: $($call_... | thaim/ansible | test/integration/targets/win_exec_wrapper/library/test_common_functions.ps1 | PowerShell | mit | 1,634 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.