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 |
|---|---|---|---|---|---|
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe 'NullCoalesceOperations' -Tags 'CI' {
BeforeAll {
$someGuid = New-Guid
$typesTests = @(
@{ name = 'string'; valueToSet = 'hello' }
@{ name = 'dotnetType'; valueToSet = $someGuid }
@... | JamesWTruher/PowerShell-1 | test/powershell/Language/Operators/NullConditional.Tests.ps1 | PowerShell | mit | 11,369 |
$packageName = '{{PackageName}}'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha1'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packageName" `
-FileType "$installer... | maharishi/chocolatey-packages | automatic/speex/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 587 |
param([String] $version)
invoke-expression ".\bump-version.ps1 -ver $version"
invoke-expression -command .\build.ps1
.\nuget\nuget.exe pack .\nuget\PlugToolkit.nuspec
move-item PlugToolkit.*.nupkg ..\..\packages\ | Syn-McJ/PlugToolkit | tools/prepare-package.ps1 | PowerShell | mit | 216 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 593e1540-3778-4260-9389-1deceb419c8c
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/xFailOverCluster/blob/main/LICENSE
.PROJECTURI https://github.c... | PowerShell/xFailOverCluster | source/Examples/Resources/xCluster/2-xCluster_JoinAdditionalNodeToFailoverClusterConfig.ps1 | PowerShell | mit | 2,329 |
dotnet pack ./src/Carbon.Color -o ./../../release/Carbon.Color/ | Carbon/Color | build.ps1 | PowerShell | mit | 63 |
function Enable-ADSIComputer
{
<#
.SYNOPSIS
Function to enable a Computer Account
.DESCRIPTION
Function to enable a Computer Account
.PARAMETER Identity
Specifies the Identity of the Computer.
You can provide one of the following properties
DistinguishedName
Guid
Name
SamAccountName
Sid
.PARAMETER Cre... | evetsleep/AdsiPS | AdsiPS/Public/Enable-ADSIComputer.ps1 | PowerShell | mit | 2,401 |
<#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/SPFarmAdministrators/2-SetIncludeExcludeAdmins.ps1 | PowerShell | mit | 1,357 |
<##################################################################################################
Description
===========
- This script does the following -
- installs chocolatey
- installs specified chocolatey packages
- This script generates logs in the following folder -
- %ALLUSERSPROFILE%\C... | rnithish/MyOpenGit | DevTestLabs/azure-devtestlab-master/Artifacts/windows-slack/ChocolateyPackageInstaller.ps1 | PowerShell | mit | 6,597 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tags "UnitTests" {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Param... | dsolodow/dbatools | tests/Get-DbaDbRoleMember.Tests.ps1 | PowerShell | mit | 3,115 |
. "$PSScriptRoot\Test-Environment.ps1"
<#
.SYNOPSIS
Gets the most recent builds for a build definition
.DESCRIPTION
Long description
.PARAMETER recent
How many builds to return at most. Defaults to 4
.PARAMETER sourceBranch
The branch that the build was invoked against. Defaults to the branch the call is made from, ... | kleinux/OctoVsts | Code/Modules/Get-VstsRecentBuilds.psm1 | PowerShell | mit | 3,289 |
$ErrorActionPreference = 'Continue'
Set-Location -LiteralPath $PSScriptRoot
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$env:DOTNET_NOLOGO = '1'
dotnet tool restore
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
dotnet cake @args
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE... | nunit/nunit-console | build.ps1 | PowerShell | mit | 323 |
$script:ModuleName = 'Helper'
#region HEADER
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'))) -or
(-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests\TestHelpe... | PlagueHO/xDhcpServer | Tests/Unit/Helper.Tests.ps1 | PowerShell | mit | 2,935 |
########################################################
##
## Roles.ps1
## Client facade to user management Pip.Services
## User roles commands
##
#######################################################
function Get-PipRoles
{
<#
.SYNOPSIS
Get user roles
.DESCRIPTION
Gets all assigned roles to a user by its id
.P... | pip-services-users/pip-facade-users-ps | src/clients/Roles.ps1 | PowerShell | mit | 3,719 |
$resourceModulePath = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent
$modulesFolderPath = Join-Path -Path $resourceModulePath -ChildPath 'Modules'
$aDCommonModulePath = Join-Path -Path $modulesFolderPath -ChildPath 'ActiveDirectoryDsc.Common'
Import-Module -Name $aDCommonModulePath
$dscResourceComm... | PowerShell/xActiveDirectory | source/DSCResources/MSFT_ADObjectPermissionEntry/MSFT_ADObjectPermissionEntry.psm1 | PowerShell | mit | 12,493 |
Describe "Chrome" {
Context "WebDriver" {
It "ChromeWebDriver environment variable and path exists" {
$env:ChromeWebDriver | Should -Not -BeNullOrEmpty
$env:ChromeWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\ChromeDriver"
$env:ChromeWebDriver | Should -Exist
... | mattgwagner/New-Machine | .github-actions/images/win/scripts/Tests/Browsers.Tests.ps1 | PowerShell | mit | 5,576 |
<#
NOTE: This does take measurable time to run, evaluate whether running
repeatedly in CI is preferable to just having an image that has had it run
to complete installation with it remaining available in that image (runtime
cost when CI instances currently overloaded versus required image storage -
and whether other de... | TileDB-Inc/TileDB | scripts/run-azurite.ps1 | PowerShell | mit | 3,513 |
<#
.SYNOPSIS
Gets RDS instance information.
.DESCRIPTION
Returns information for RDS instances in a given AWS region.
.PARAMETER Region
The AWS region to check for empty security groups.
.PARAMETER ProfileName
The name of the AWS profile to use for the operation.
.OUTPUTS
Returns $AllRDSInstances w... | stewarda/Posh-AWS | Posh-AWS.psm1 | PowerShell | mit | 169,611 |
#set-alias pandoc C:\Users\xunil\AppData\Local\Pandoc\pandoc.exe
mkdir .\builds -EA SilentlyContinue
pandoc .\solution001.tex -t latex -o .\builds\solutions001.pdf
pandoc .\solution001.tex -t docx -o .\builds\solutions001.docx | xunilrj/sandbox | sources/mit1801/build.ps1 | PowerShell | apache-2.0 | 226 |
$packageName = 'cyberduck.install'
$installerType = 'exe'
$silentArgs = '/S'
$url = 'https://update.cyberduck.io/windows/Cyberduck-Installer-5.0.11.20753.exe'
$checksum = 'f7be24310af52d8535e434c6be82de5178223a36d463075e5a24db8f4595da44'
$checksumType = 'sha256'
$validExitCodes = @(0)
Install-ChocolateyPackage -Packa... | dtgm/chocolatey-packages | automatic/_output/cyberduck.install/5.0.11.20753/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 660 |
$packageName = 'dolphin'
$url = 'https://dl.dolphin-emu.org/builds/dolphin-master-5.0-6936-x64.7z'
$checksum = '{checksum}'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Install-ChocolateyZipPackage... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.6936/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 737 |
# originally posted at https://github.com/JorritSalverda/msbuild-by-convention/
# based on https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
Param(
$serverName = "",
$databaseName = "",
$username = "",
$password = "",
$timeStampFormat = "g",
$selectedsubscription = "default"... | mirabeau-nl/msbuild-by-convention | msbuild-by-convention/Scripts/AzureDbDelete.ps1 | PowerShell | bsd-3-clause | 1,628 |
configuration Sample_xSslSettings_RequireCert
{
param
(
# Target nodes to apply the configuration
[String[]] $NodeName = 'localhost'
)
# Import the module that defines custom resources
Import-DscResource -Module xWebAdministration
Node $NodeName
{
xSslSettings SiteD... | remcoeissing/xWebAdministration | source/Examples/Resources/xSslSettings/Sample_xSslSettings_RequireCert.ps1 | PowerShell | mit | 496 |
#Get public and private function definition files
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
#Dot source the files
Foreach($import in @($Public + $Private))
{
Try
{
... | equelin/Format-Pester | Format-Pester/Format-Pester.psm1 | PowerShell | mit | 584 |
# CreateVersions.ps1
$git_version = (git describe --tags --long --match ?.?.? | Select-String -pattern '(?<major>[0-9]+)\.(?<minor>[0-9]+).(?<patch>[0-9]+)-(?<commitCount>[0-9]+)-(?<hash>[a-z0-9]+)').Matches[0].Groups
$majorVersion = $git_version['major']
$minorVersion = $git_version['minor']
$patchVersion = $git_ver... | simonbaas/EasyZMq | deploy/CreateVersions.ps1 | PowerShell | apache-2.0 | 1,176 |
$packageName = '{{PackageName}}'
$url = '{{DownloadUrlx64}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha256'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
Get-ChocolateyWebFile -PackageName "$packageName" `
-Fil... | dtgm/chocolatey-packages | automatic/pathmanager/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 644 |
$packageName = 'andy'
$installerType = 'exe'
$url = 'http://d1ubedgu4eka0j.cloudfront.net/ANDY/installer/v43/Andy_Android_Emulator_v43_1.exe'
$silentArgs = '/S'
$validExitCodes = @(0)
$checksum = '206e3706a33a76aa98cf310ff21123af'
$checksumType = 'md5'
Install-ChocolateyPackage -PackageName "$packageName" `
... | dtgm/chocolatey-packages | automatic/_output/andy/0.43.3.01/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 624 |
$packageName = 'dispcalgui.portable'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'http://sourceforge.net/projects/dispcalgui/files/release/3.0.0.0/dispcalGUI-3.0.0.0-win32.zip/download'
$checksum = '7f158631850a3ce4e67162692d8cb6272bfa5051'
$checksumType = 'sha1'
$url64 = "$url"
$check... | dtgm/chocolatey-packages | automatic/_output/dispcalgui.portable/3.0.0.0/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 818 |
function Remove-Comments
{
<#
.SYNOPSIS
Strips comments and extra whitespace from a script.
PowerSploit Function: Remove-Comments
Author: Matthew Graeber (@mattifestation)
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
.DESCRIPTION
Remove-Comments strips out comments ... | nullbind/PowerSploit | ScriptModification/Remove-Comments.ps1 | PowerShell | bsd-3-clause | 5,062 |
<#
.SYNOPSIS
Uses cspell (from NPM) to check spelling of recently changed files
.DESCRIPTION
This script checks files that have changed relative to a base branch (default
branch) for spelling errors. Dictionaries and spelling configurations reside
in a configurable `cspell.json` location.
This script uses `npx` and a... | Azure/azure-sdk-for-python | eng/common/scripts/check-spelling-in-changed-files.ps1 | PowerShell | mit | 9,446 |
[cmdletbinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1
Register-Mock Get-TaskVariable { "c:\testSource" }
Register-Mock Convert-String { $true }
Register-Mock Find-Files { $true }
Register-Mock Invoke-VSTest { $true } -TestAssemblies @("c:\test1.dll,c:\test2.dll") -VSTestVersion "vsTestVers... | ivyzhu/vsts-tasks | Tests/L0/VsTest/ValidateTestAssembliesAreNotSplit.ps1 | PowerShell | mit | 1,431 |
param($installPath, $toolsPath, $package, $project)
function MarkDirectoryAsCopyToOutputRecursive($item)
{
$item.ProjectItems | ForEach-Object { MarkFileASCopyToOutputDirectory($_) }
}
function MarkFileASCopyToOutputDirectory($item)
{
Try
{
Write-Host Try set $item.Name
$item.Properties.It... | agracio/edge-js | tools/nuget/tools/install.ps1 | PowerShell | apache-2.0 | 554 |
<#
MTSXtremIO Smoke Test code
Used to test functionality of all XtremIO REST API objects via MTSXtremIO PowerShell module
DO NOT RUN THIS SCRIPT ON PRODUCTION ARRAYS
DO NOT USE IF YOU DO NOT UNDERSTAND THIS CODE. IT WILL CREATE AND DELETE OBJECTS!!
Script has not yet beened designed to run and complete automated ... | dmuegge/MTSXtremIO | Tests/MTSXtremIO_SmokeTest.ps1 | PowerShell | mit | 26,786 |
function New-EXRAttendee
{
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $false)]
[string]
$Name,
[Parameter(Position = 1, Mandatory = $true)]
[string]
$Address,
[Parameter(Position = 2, Mandatory = $true)]
[ValidateSet("required", "optional", "resource")]
[string]
$Type
)
... | gscales/Exch-Rest | functions/other/New-EXRAttendee.ps1 | PowerShell | mit | 580 |
#
# NugetPackAndPush.ps1
#
Copy-Item .\src\Moosetrail.LaTeX\bin\Release\* .\dist\lib | moosetrail/Latex-in-csharp | vsoSetupForPublish.ps1 | PowerShell | mit | 85 |
function Get-ADSIFsmo
{
<#
.SYNOPSIS
Function to retrieve the Flexible single master operation (FSMO) roles owner(s)
.DESCRIPTION
Function to retrieve the Flexible single master operation (FSMO) roles owner(s)
.PARAMETER Credential
Specifies the Alternative credential to use
.PARAMETER ForestName
Specifies the ... | evetsleep/AdsiPS | AdsiPS/Public/Get-ADSIFsmo.ps1 | PowerShell | mit | 2,525 |
Remove-Item *.vsix
$assemblyInfoExtension = (Get-Item -Path ".\" -Verbose).FullName + "\src"
tfx extension create --manifest-globs vss-extension.json --root $assemblyInfoExtension | BMuuN/vsts-assemblyinfo-task | Package.ps1 | PowerShell | mit | 181 |
# TODO: Invoke-VultrServerRestore_Backup.ps1 | sdsalyer/PSVultrAPI | PSVultrAPI/Public/server/Invoke-VultrServerRestore_Backup.ps1 | PowerShell | mit | 44 |
$script:DSCModuleName = 'xSQLServer'
$script:DSCResourceName = 'MSFT_xSQLServerAvailabilityGroupListener'
#region HEADER
# Unit Test Template Version: 1.2.0
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DS... | PaulFeaser/xSQLServer | Tests/Unit/MSFT_xSQLServerAvailabilityGroupListener.Tests.ps1 | PowerShell | mit | 41,770 |
# Build Packages
# --------------
#
# A powershell script to build packages for HstWB Installer.
#
# Author: Henrik Noerfjand Stengaard
# Date: 2018-06-25
# paths
$currentDir = Resolve-Path '.'
$packagesDir = Resolve-Path '..\packages'
# create packages directory, if it doesn't exist
if (!(Test-Path ... | henrikstengaard/hstwb-installer | tools/build_packages.ps1 | PowerShell | mit | 2,937 |
Write-Host "Stopping docker service"
Stop-Service docker
$version = "17.09.0-ce-rc2"
Write-Host "Downloading docker-$version.zip"
$wc = New-Object net.webclient
$wc.DownloadFile("https://download.docker.com/win/static/test/x86_64/docker-$version.zip", "$env:TEMP\docker-$version.zip")
Write-Host "Extracting docker-$ver... | StefanScherer/docker-windows-box | scripts/update-docker-rc.ps1 | PowerShell | mit | 897 |
<#
.SYNOPSIS
Moves a folder to a different drive at the same location and keeps the original path
working (leaves a shadow behind).
.DESCRIPTION
This cmdlet is intended to make freeing space on a drive easier by moving
folders without a configuration change. The original path becomes
a symbolic link to the new desti... | ssg/Move-Shadow | Move-Shadow.ps1 | PowerShell | mit | 2,301 |
# Inspired by Mark Embling
# http://www.markembling.info/view/my-ideal-powershell-prompt-with-git-integration
$global:GitPromptSettings = New-Object PSObject -Property @{
DefaultForegroundColor = $Host.UI.RawUI.ForegroundColor
BeforeText = "`n["
... | HaroldAlmon/posh-git | GitPrompt.ps1 | PowerShell | mit | 13,943 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 07323d21-39a0-4f62-bed7-7acc943f9234
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT Copyright the DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/ComputerManagementDsc/blob/main/LICENSE
.PROJECTURI https... | PowerShell/xComputerManagement | source/Examples/Resources/WindowsEventlog/5-WindowsEventLog_SetSecurityDescriptor_Config.ps1 | PowerShell | mit | 1,122 |
[cmdletbinding()]
param()
try{
Remove-Module pecan-waffle-visualstudio -Force -ErrorAction SilentlyContinue | Out-Null
}
catch{
# do nothing
}
$scriptDir = split-path -parent $MyInvocation.MyCommand.Definition
# all types here must be strings
$global:pwvssettings = New-Object -TypeName psobject -Property @{... | ligershark/pecan-waffle | pecan-waffle-visualstudio.psm1 | PowerShell | apache-2.0 | 18,640 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = ''
$checksumType = 'sha1'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvrt.exe"
try {
Get-ChocolateyWebFile -PackageName "$packageName" `... | dtgm/chocolatey-packages | automatic/_output/kvrt/2016.03.09.0448/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 894 |
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost".
# If it's not then please replace this with with your hosting url.
# Source PDF file
$SourceFile = ".\sample.pdf"
# Comma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-... | bytescout/ByteScout-SDK-SourceCode | Cloud API Server/PDF To Image API/PowerShell/Convert PDF To TIFF From Uploaded File/ConvertPdfToTiffFromUploadedFile.ps1 | PowerShell | apache-2.0 | 2,719 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-1714-x64.7z'
$checksum = 'b9c8620b897d0e6f3c7892c80afccacea5ef91cd6585c39823ba12b83a78c81b'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.1714/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 790 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = '0a04e7a1be94a7465589635748782c7f578f6694'
$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.03.20.1419/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 931 |
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", ""
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", ""
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$caption = "Warning!"
$message = "This will delete EVERYTHING in your Azure subsc... | benc-uk/azure-designer | ps/Azure_Nuke.ps1 | PowerShell | apache-2.0 | 681 |
Configuration Sample_xArchive_CompressMultipleDirs
{
param
(
[parameter(mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]] $Path,
[parameter (mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string] $Destination,
[parameter (mandatory=$false)]
... | grayzu/Examples | Configs/Wordpress/Resources/xPSDesiredStateConfiguration/Examples/Sample_xArchive_CompressMultipleDirs.ps1 | PowerShell | mit | 920 |
$packageName = 'drivergenius'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'http://www.driver-soft.com/products/DG_Setup.exe'
$checksum = '340a36106dcb03d3f2f77a273e3d99fd476a63f6'
$checksumType = 'sha1'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packa... | dtgm/chocolatey-packages | automatic/_output/drivergenius/15.0.0.1046/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 644 |
function Find-DbaDbUnusedIndex {
<#
.SYNOPSIS
Find unused indexes
.DESCRIPTION
This command will help you to find Unused indexes on a database or a list of databases
For now only supported for CLUSTERED and NONCLUSTERED indexes
.PARAMETER SqlInstance
The SQL Server you... | kozloski/dbatools | functions/Find-DbaDbUnusedIndex.ps1 | PowerShell | mit | 11,238 |
function Update-KeePassDatabaseConfiguration
{
<#
.SYNOPSIS
Function to Update a KeePass Database Configuration Profile in the KeePassConfiguration.xml
.DESCRIPTION
The Profile Created will be accessible from the core functions Get,Update,New,Remove KeePassEntry and ect.
... | chritea/PSKeePass | functions/Update-KeePassDatabaseConfiguration.ps1 | PowerShell | mit | 8,926 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Parame... | alevyinroc/dbatools | tests/Test-DbaNetworkLatency.Tests.ps1 | PowerShell | mit | 1,651 |
<######################################################################
Menu-driven PowerCLI script to delete, add, and update DNS and NTP on
VMware ESXi hosts.
**Save as set-ntp.ps1
**Switch to directory ps1 is saved in and run
** MAKE SURE LOCAL SYSTEM TIME IS CORRECT!!!!
v1.0 27 February 2014: Initial draft
v... | joshuatownsend/set-vmware-ntp-dns | set-ntp.ps1 | PowerShell | mit | 8,194 |
#
# Reading the registry for progids takes > 500ms, so we do it at module load time.
#
function InitClassIdTable
{
[InitializeArgumentCompleter('New-Object_ComObject')]
param()
$progIds = [Microsoft.Win32.Registry]::ClassesRoot.GetSubKeyNames()
$versionedProgIds = new-object System.Collections.Generi... | nylyst/Powershell | Modules/ISESteroids/3rdParty/TabExpansion++/Microsoft.PowerShell.Utility.ArgumentCompleters.ps1 | PowerShell | mit | 4,918 |
#Requires -Version 3.0
#-- Deploy Folder/File Module Functions --#
# ipremark
<#
.SYNOPSIS
Remark Deploy ip from deploygroup file
.DESCRIPTION
This cmdlet remark deploygroup ipaddresses from $valentia.root\$valentia.branch.deploygroup not to refer the ipaddress
.NOTES
Author: guitarrapc
Created: 04/Oct/2013
.EX... | guitarrapc/valentia | valentia/Functions/Helper/Group/Invoke-ValentiaDeployGroupRemark.ps1 | PowerShell | mit | 2,751 |
[CmdletBinding(SupportsShouldProcess=$true)]
Param
(
[Parameter(Mandatory=$True)]
[String]$UncPath,
[Parameter(Mandatory=$True)]
[String]$ConfigFileName
)
Set-Location $UncPath
$c2RFileName = "SetupOffice2013.exe"
$app = ".\$c2RFileName"
$arguments = "/configure", "$ConfigFileName"
& $app @arguments | KurtDeGreeff/Office-IT-Pro-Deployment-Scripts | Configure-GPOOfficeInstallation/InstallOffice2013.ps1 | PowerShell | mit | 313 |
Register-ArgumentCompleter -Native -CommandName aws -ScriptBlock {
param ($wordToComplete, $commandAst, $cursorPosition)
$env:COMP_LINE = $commandAst.Extent.Text.PadRight($cursorPosition, ' ')
$env:COMP_POINT = $cursorPosition
aws_completer
$env:COMP_LINE = $env:COMP_POINT = $null
}
| matt9ucci/PSProfiles | PSModules/AwsCliV2/AwsCliV2.psm1 | PowerShell | mit | 292 |
#requires -Version 4.0 -Modules Pester
#region Setup for tests
$DSCResourceName = 'ActiveDirectoryAuditRuleEntry'
Import-Module "$($PSScriptRoot)\..\..\DSCResources\$($DSCResourceName)\$($DSCResourceName).psm1" -Force
Import-Module "$($PSScriptRoot)\..\..\DscResources\AccessControlResourceHelper\AccessControlResourc... | mcollera/AccessControlDsc | Tests/Unit/ActiveDirectoryAuditRuleEntry.Tests.ps1 | PowerShell | mit | 20,973 |
function GetLastCreatedDir
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true)]
[string]$Directory
)
if(!(Test-Path $Directory))
{
return $null
}
$lastCreatedDir = Get-ChildItem -Path $Directory | Where-Object {$_.PSIsContainer} | Sort-Object CreationTime -Desc... | RosenPetrov/sitecore-deployment-powershell | Sitecore.Deployment/Private/CommonFunctions.ps1 | PowerShell | mit | 6,142 |
function Install-DbaMaintenanceSolution {
<#
.SYNOPSIS
Download and Install SQL Server Maintenance Solution created by Ola Hallengren (https://ola.hallengren.com)
.DESCRIPTION
This script will download and install the latest version of SQL Server Maintenance Solution created by Ola Hallengr... | kozloski/dbatools | functions/Install-DbaMaintenanceSolution.ps1 | PowerShell | mit | 19,395 |
Function Test-WebSites
{
[CmdletBinding()]
param (
[hashtable]$PoShMonConfiguration
)
$allTestsOutput = @()
foreach ($websiteDetailKey in $PoShMonConfiguration.WebSite.WebsiteDetails.Keys)
{
$siteUrl = $websiteDetailKey
$textToLocate = $PoShMonConfiguration.... | HiltonGiesenow/PoShMon | src/Functions/PoShMon.Monitoring.Web/Test-WebSites.ps1 | PowerShell | mit | 2,579 |
configuration Sample_xVMScsiController_AddControllers
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost',
[Parameter(Mandatory = $true)]
[System.String]
$VMName,
[Parameter(Mandatory = $true)]
[System.String]
$VhdPath
)... | PowerShell/xHyper-V | source/Examples/Sample_xVMScsiController_AddControllers.ps1 | PowerShell | mit | 1,564 |
function Get-OneLoginEvent
{
[CmdletBinding()]
[OutputType([OneLogin.Event])]
param
(
[ValidateScript(
{
$EnumValues = [OneLogin.EventFilterParameter].GetEnumNames()
foreach ($Property in $_.GetEnumerator().Name)
{
... | mattmcnabb/OneLogin | OneLogin/functions/Get-OneLoginEvent.ps1 | PowerShell | mit | 2,131 |
configuration Sample_xVHD_MissingPropertyVHD
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$Name,
[Parameter(Mandatory = $true)]
[System.String]
$Path,
[Parameter()]
[ValidateSet('Vhd', 'Vhdx')]
[System.String]
$Generat... | PowerShell/xHyper-V | source/Examples/Sample_xVhd_MissingPropertyVHD.ps1 | PowerShell | mit | 712 |
$servicePath = "$PSScriptRoot\..\src\Services\NT.CustomerService.Api"
sl $servicePath
# & "C:\Program Files\dotnet\dotnet.exe" restore
# & "C:\Program Files\dotnet\dotnet.exe" build
& "C:\Program Files\dotnet\dotnet.exe" run
$HOST.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") | OUT-NULL
$HOST.UI.RawUI.Flushinputbuffer() | thangchung/ShoppingCartDemo | builds/start_customer_service.ps1 | PowerShell | mit | 319 |
if (-not ([System.Management.Automation.PSTypeName]'VersionComponent').Type) {
Add-Type -TypeDefinition @"
using System;
using System.Text;
public enum VersionComponent
{
Major = 0,
Minor = 1,
Patch = 2,
Build = 3,
Suffix = 4,
SuffixBranch = 45,
... | qbikez/ps-csproj | src/SemVer/SemVer.psm1 | PowerShell | mit | 8,624 |
ng build
docker build -t doc-stack-app . | schwamster/doc-stack-app | build.ps1 | PowerShell | mit | 40 |
#Disable the Policy
Set-ItemProperty -Path $AdobeReaderPolicyFLKey -Name 'bDisplayAboutDialog' -Value 0 -ea SilentlyContinue
| DBHeise/VM_Setup | 03_Acrobat/DisableSpashScreen.ps1 | PowerShell | mit | 128 |
$servers = @(import-csv("servers.csv"))
foreach($server in $servers)
{
if((Test-Connection -ComputerName $server -count 1 -ErrorAction 0)) {
$cstatus = "Connected"
$exists = Test-RegKey -CN $server.name -Hive LocalMachine -Key "Software\Microsoft\Microsoft Operations Manager\3.0\Agent Management G... | abix-/powershell-practical | random scripts/windows-server/Check-SCOMInstall.ps1 | PowerShell | mit | 1,284 |
# -----------------------------------------------------------------------
# Desc: This is the PSCX initialization module script that loads nested
# modules. Which nested modules are loaded is controlled via
# $Pscx:Preferences.ModulesToImport. You can override the default
# settings by passing eit... | nylyst/Powershell | Modules/pscx/Pscx.psm1 | PowerShell | mit | 18,345 |
# Initial implementation by Jeremy Skinner
# http://www.jeremyskinner.co.uk/2010/03/07/using-git-with-windows-powershell/
$Global:GitTabSettings = New-Object PSObject -Property @{
AllCommands = $false
}
$subcommands = @{
bisect = 'start bad good skip reset visualize replay log run'
notes = 'edit show'
... | pstaszko/posh-git | GitTabExpansion.ps1 | PowerShell | mit | 11,164 |
<# -- get-adPrincipalGroups.ps1 --
| params:
| $user1 is user 1's distinguished name
| $user2 is user 2's distinguished name
|
| cmdlets: Get-ADPrincipalGroupMembership
|
| returns: [JSON formatted object]$global:outObj
| [array]user1sGroups
| [array]user2sGroups (optionally)
| [string]user1Name
| [string]user2Name (op... | BenjaminMichael/Node-Powershell-Fun | scripts/get-adPrincipalGroups.ps1 | PowerShell | cc0-1.0 | 2,098 |
Param(
[Parameter(Mandatory=$true)][string]$JobDropTargetId,
[Parameter(Mandatory=$true)][string]$SubjectNodeId,
[Parameter(Mandatory=$false)][string]$JobName="",
[Parameter(Mandatory=$false)][bool]$CreateDisabled=$false)
# $JobDropTargetId = job drop target node id where new job should be created
# $S... | Cinegy/powershell | Cas/CAS-CreateJob-SubjectNode.ps1 | PowerShell | apache-2.0 | 2,109 |
$packageName = 'peazip.portable'
$packageVersion = '6.0.2'
$urlArray = @('http://sourceforge.net/projects/peazip/files/6.0.2/peazip_portable-6.0.2.WINDOWS.zip', 'http://sourceforge.net/projects/peazip/files/6.0.2/peazip_portable-6.0.2.WIN64.zip')
$url = $urlArray[0]
$checksum = '470f89751db75fbc4b94ff79c2a00d9bb386a28c... | dtgm/chocolatey-packages | automatic/_output/peazip.portable/6.0.2/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 964 |
###############################################################################
# Copyright 2013 - 2018 Software AG, Darmstadt, Germany and/or its licensors
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | SoftwareAG/sagdevops-antcc | bootstrap/install.ps1 | PowerShell | apache-2.0 | 4,670 |
#requires -Version 5
Configuration SMA
{
Import-DscResource -Module xSQLServer
Import-DscResource -Module xSCSMA
# Set role and instance variables
$Roles = $AllNodes.Roles | Sort-Object -Unique
foreach($Role in $Roles)
{
$Servers = @($AllNodes.Where{$_.Roles | Where-Object {$_ -eq $Rol... | phongdly/puppetlabs-dsc | lib/puppet_x/dsc_resources/xSCSMA/Examples/SCSMA-SeperateSQL-TP.ps1 | PowerShell | apache-2.0 | 13,406 |
# Returns C: Drive Available Free Space (Bytes)
# Return Type: Integer
# Execution Context: System
$cdrive=Get-WmiObject -Class Win32_logicaldisk | where DeviceID -eq "C:" | Select-Object -Property "FreeSpace"
write-output $cdrive.FreeSpace
| vmwaresamples/AirWatch-samples | Windows-Samples/Sensors/os_disk_free_space.ps1 | PowerShell | bsd-3-clause | 242 |
#requires -version 5.0
#test if VM setup is complete
#The password will be passed by the control script WaitforVM.ps1
#You can manually set it while developing this Pester test
$LabData = Import-PowerShellDataFile -Path .\*.psd1
$Secure = ConvertTo-SecureString -String "$($labdata.allnodes.labpassword)" -AsPlainTex... | jdhitsolutions/PS-AutoLab-Env | Standalone/POC-MultiRole/VMValidate.test.ps1 | PowerShell | mit | 4,875 |
function Get-DbaAgentServer {
<#
.SYNOPSIS
Gets SQL Agent Server information for each instance(s) of SQL Server.
.DESCRIPTION
The Get-DbaAgentServer returns connected SMO object for SQL Agent Server information for each instance(s) of SQL Server.
.PARAMETER SqlInstance
The targ... | Splaxi/dbatools | functions/Get-DbaAgentServer.ps1 | PowerShell | mit | 3,808 |
#Get public and private function definition files.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
#Dot source the files
Foreach($import in @($Public + $Private))
... | ulfvins/PowerShell | Modules/NonPSJob/NonPSJob.psm1 | PowerShell | mit | 768 |
$packageName = 'combofix'
$url = 'http://download.bleepingcomputer.com/sUBs/ComboFix.exe'
$checksum = '7ffcc5c821b0dae3b31eea023cca5a1f65c3205d'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "ComboFix.exe"
try {
Get-ChocolateyWebFile -... | dtgm/chocolatey-packages | automatic/_output/combofix/15.6.23.1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 646 |
$packageName = 'bitmessage'
$url = 'https://bitmessage.org/download/windows/Archive/Bitmessage v0.4.4.exe'
$checksum = '05f286aaa0ce521081ce0607e0105d96407871e0'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
try {
... | dtgm/chocolatey-packages | automatic/_output/bitmessage/0.4.4.20150402/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 715 |
$packageName = 'andy'
$installerType = 'exe'
$url = 'http://d1ubedgu4eka0j.cloudfront.net/ANDY/installer/v45/Andy_Android_Emulator_v45_12.exe'
$silentArgs = '/S'
$validExitCodes = @(0)
$checksum = '36aa3801aa5f33079476bf298f7500f6'
$checksumType = 'md5'
Install-ChocolateyPackage -PackageName "$packageName" `
... | dtgm/chocolatey-packages | automatic/_output/andy/0.45.12/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 625 |
# AU Packages Template: https://github.com/majkinetor/au-packages-template
param([string[]] $Name, [string] $ForcedPackages, [string] $Root = $PSScriptRoot)
if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }
$Options = [ordered]@{
WhatIf = $au_WhatIf ... | flcdrg/au-packages | update_all.ps1 | PowerShell | mit | 6,223 |
# ----------------------------------------------------------------------------------
#
# 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... | yoavrubin/azure-powershell | src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/ContainerServiceTests.ps1 | PowerShell | apache-2.0 | 7,267 |
..\..\eng\scripts\Export-API.ps1 modelsrepository | jackmagic313/azure-sdk-for-net | sdk/modelsrepository/Update-ApiSurface.ps1 | PowerShell | mit | 49 |
$packageName = 'bluej'
$packageSearch = "$packageName"
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$validExitCodes = @(0,3010)
Get-ItemProperty -Path @( 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\... | dtgm/chocolatey-packages | automatic/_output/bluej/3.1.7/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 862 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Parame... | alevyinroc/dbatools | tests/Get-DbaAvailableCollation.Tests.ps1 | PowerShell | mit | 1,098 |
########################################################################
#
# Linux on Hyper-V and Azure Test Code, ver. 1.0.0
# 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 Lice... | bogdancarpusor/lis-test | WS2008R2/lisa/setupscripts/ShutDownVM.ps1 | PowerShell | apache-2.0 | 3,472 |
# ----------------------------------------------------------------------------------
#
# 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... | mayurid/azure-powershell | src/ResourceManager/Dns/Commands.Dns.Test/ScenarioTests/ZoneTests.ps1 | PowerShell | apache-2.0 | 10,211 |
# Copyright (c) Microsoft Corporation. All rights reserved.
$InitialDatabase = '0'
$knownExceptions = @(
'System.Data.Entity.Migrations.Infrastructure.MigrationsException',
'System.Data.Entity.Migrations.Infrastructure.AutomaticMigrationsDisabledException',
'System.Data.Entity.Migrations.Infrastru... | wadewegner/BeerStation | ref/BeerStation/packages/EntityFramework.6.1.0/tools/EntityFramework.psm1 | PowerShell | apache-2.0 | 44,234 |
$msbuild = (Join-Path $env:windir 'Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe')
$projDir = Get-Location
$solution = "$projDir\VowelCalc\PoemBeautifier.sln"
$tempDir = "$projDir\tmp"
$prodDir = "$projDir\Release"
#check directories
if (-Not (Test-Path $msbuild)) {
Write-Error "Error: MSBUILD not found"
ex... | alisa-teplouhova/distributed_systems | lab2/build_script.ps1 | PowerShell | mit | 1,376 |
using namespace PowerShell.Clipboard
Import-Module .\Clipboard.psd1
enum Platform
{
Unknown = '0';
Windows = '1';
Linux = '2';
OSX = '3';
}
function Get-Platform
{
[Platform] $value = [Platform]::Unknown
if ($PSHOME.EndsWith('\WindowsPowerShell\v1.0', [System.StringComparison]::OrdinalIgnoreC... | DanTravison/PowerShell | Clipboard/Tests/Clipboard.Tests.ps1 | PowerShell | mit | 8,408 |
$script:SPDscUtilModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\SharePointDsc.Util'
Import-Module -Name $script:SPDscUtilModulePath
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[... | PowerShell/xSharePoint | SharePointDsc/DSCResources/MSFT_SPWebAppSiteUseAndDeletion/MSFT_SPWebAppSiteUseAndDeletion.psm1 | PowerShell | mit | 11,071 |
#
# ConfigData.psd1
#
@{
AllNodes = @(
@{
NodeName = "*"
PSDscAllowPlainTextPassword = $true
PSDscAllowDomainUser = $true
}
@{
NodeName = "DC1"
Path = 'C:\DC1.txt'
Role = 'PDC'
}
@{
NodeName = "DC2"
Path = 'C:\DC2.txt'
Role = 'DC'
}
@{
... | brwilkinson/3VMDomain-VS | 3VMDomain/DSC/ConfigData.psd1 | PowerShell | mit | 401 |
param (
[string] $configuration = "Debug",
[string] $outputPath = ".",
[string] $versionSuffix
)
ls src\*.csproj -recurse | `
% {
Write-Host -ForegroundColor Cyan "dotnet pack $_"
if ("$versionSuffix" -eq "") {
dotnet pack $_ -c $configuration -o $outputPath
... | meekys/Meekys.OData | Scripts/Pack.ps1 | PowerShell | mit | 453 |
$ErrorActionPreference = 'Stop';
$file = Join-Path (Join-Path (Join-Path $env:LOCALAPPDATA Microsoft) Teams) Update.exe
Start-ChocolateyProcessAsAdmin -ExeToRun $file -Statements "--uninstall -s" | bc3tech/chocolatey | microsoftteams/tools/chocolateyuninstall.ps1 | PowerShell | mit | 204 |
<#
.SYNOPSIS
Automated unit test for DSC_SqlPermission DSC resource.
#>
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1')
$script:dscModuleName = 'SqlServerDsc'
$script:dscResourceName = 'DSC_SqlPermission'
function Invoke-TestSetup
{
try
{
... | johlju/xSQLServer | tests/Unit/DSC_SqlPermission.Tests.ps1 | PowerShell | mit | 14,191 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.