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 |
|---|---|---|---|---|---|
## Dot source the script
. "$PSScriptRoot\DoStuff.ps1"
describe 'Get-Thing' {
$result = Get-Thing
it 'should return "I got the thing"' {
$result | should be 'I got the thing'
}
}
describe 'Do-Thing' {
$result = Do-Thing
it 'should return "I did the thing"' {
## Notice no sh... | kidchenko/playground | powershell-testing-powerShell-with-pester/Demos/Introduction/DoStuff-All.Tests.ps1 | PowerShell | mit | 571 |
function Clean{
rm flot -Recurse -Force -ErrorAction SilentlyContinue
rm flot*.zip -ErrorAction SilentlyContinue
rm pkg -Recurse -Force -ErrorAction SilentlyContinue
}
function Update{
nuget update -self
$source = "http://www.flotcharts.org/downloads/flot-0.8.3.zip"
$destination = (Join-Path ... | blachniet/flot-nuget | build.ps1 | PowerShell | mit | 702 |
function Get-ScriptFunctionName{
param(
[string]$Path,
[switch]$Recurse
)
[Management.Automation.Language.Parser]::ParseFile((Resolve-Path $Path),[ref]$null,[ref]$null).FindAll({param($c)$c-is[Management.Automation.Language.FunctionDefinitionAst]},$Recurse).Name
} | jpsider/Invoke-Automation | Powershell/Random/Get-ScriptFunctionName.ps1 | PowerShell | mit | 297 |
[CmdletBinding(DefaultParameterSetName = 'Current')]
param(
# Domain controller.
[Parameter(ParameterSetName = 'Remote',
Mandatory = $true)]
[string]
$ComputerName,
# Credentials to use connection.
[Parameter(ParameterSetName = 'Remote',
Mandatory = $tru... | PSGumshoe/PSGumshoe | DirectoryService/Get-DSDirectoryEntry.Tests.ps1 | PowerShell | mit | 2,671 |
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.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 version 3 of the License, or
# (at your ... | coderobin/windows-container | nanoserver/neo4j/tools/Get-Neo4jPrunsrv.ps1 | PowerShell | mit | 7,908 |
<#
.SYNOPSIS
This PowerShell script module file contains common, reusable functions that
are intended to be included in all PowerShell scripts that reside within the
automation framework.
.DESCRIPTION
Note: This script module is NOT intended to be executed independent of another
PowerShell script referencing... | ChrisJaehnen/dev-tools-script-console | Modules/Format/Format-Xml.psm1 | PowerShell | apache-2.0 | 3,661 |
#
# Module manifest for module 'SharePointDsc'
#
# Generated by: Microsoft Corporation
#
# Generated on: 20/06/2018
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '3.2.0.0'
# ID used to uniquely identify this module
GUID =... | puppetlabs/puppetlabs-dsc | lib/puppet_x/dsc_resources/SharePointDsc/SharePointDsc.psd1 | PowerShell | apache-2.0 | 7,808 |
$packageName = '{{PackageName}}'
$installerType = 'exe'
$silentArgs = '/S'
$url = '{{DownloadUrl}}'
$checksum = '{{Checksum}}'
$checksumType = 'sha256'
$validExitCodes = @(0)
$chocoTempDir = Join-Path $Env:Temp "chocolatey"
$pkgTempDir = Join-Path $chocoTempDir "$packageName"
if (![System.IO.Directory]::Exists($pkgTe... | dtgm/chocolatey-packages | automatic/bitmeteros/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,754 |
<#
.SYNOPSIS
Uses Copy-VMfile cmdlet which ships with Hyper-V on Sever 2012 R2
.DESCRIPTION
Uses Copy-VMfile cmdlet (introduced in Server 2012 R2 Hyper-V) to perform the deployment.
The cmdlet has some issues while copying to C:\windows\System32 & 'C:\Program files' folder (issu... | DexterPOSH/PSDeploy | PSDeploy/PSDeployScripts/CopyVMFile.ps1 | PowerShell | mit | 5,752 |
@{
# Version number of this module.
ModuleVersion = '1.3.0.0'
# ID used to uniquely identify this module
GUID = '286890c9-a6c3-4605-9cd5-03c8413c8325'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this modu... | cowofevil/puppetlabs-dsc | lib/puppet_x/dsc_resources/xDhcpServer/xDhcpServer.psd1 | PowerShell | apache-2.0 | 1,696 |
function Enable-Assessor
{
<#
Enables an assessor account to be used with a vulnerability scanner.
If enable is chosen, it enables the account and escalates its privileges
If disable is chosen, demotes privileges and disables the account
Future Additions:
Ability to choose account
... | jbarcia/PoshSec | PoshSec/Account-Monitoring-Control/Enable-SecVulnAccount.ps1 | PowerShell | bsd-3-clause | 708 |
[CmdletBinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
. $PSScriptRoot\SetupMocks.ps1
Register-Mock Get-VstsInput { "FilePath" } -- -Name ScriptType -Require
Register-Mock Get-VstsInput { "$PSScriptRoot/PerformsBasicFlow_TargetScript.ps1" } -- -Name ScriptPath
Register-Mock Get-Vst... | dylan-smith/vso-agent-tasks | Tasks/ServiceFabricPowerShellV1/Tests/PerformsBasicFlow.ps1 | PowerShell | mit | 960 |
# psake
# Copyright (c) 2012 James Kovacs
# 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, publ... | jdaigle/FriendsOfDT | tools/psake/psake.psm1 | PowerShell | mit | 31,880 |
#Requires -Version 5.0
function Add-FilesIntoVirtualHardDisk {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '', Justification = 'Don''t use ShouldProcess in internal functions.')]
param (
[Parameter(Mandatory = $true)]
[string]$Path,
[Parameter(Mandatory = $fals... | CodeblackNL/HyperVLab | src/HyperVLab/Internal/LabVM/Add-FilesIntoVirtualHardDisk.ps1 | PowerShell | mit | 3,698 |
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$uncServer,
[Parameter(Mandatory=$True,Position=2)]
[string]$uncFullPath,
[Parameter(Mandatory=$True,Position=3)]
[string]$uncUser,
[Parameter(Mandatory=$True,Position=4)]
[string]$uncPass, # no point converting to ... | xarta/hmailserver-backup-scripts | XartaDeleteOldBkUps.ps1 | PowerShell | mit | 705 |
function Get-HtmlTableColGroup
{
<#
.SYNOPSIS
Generates Html <colgroup> tags based on table column widths
#>
[CmdletBinding()]
[OutputType([System.String])]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[ValidateNotNull()]
[System.Management.Automation.PSObject] $... | iainbrighton/PScribo | Src/Plugins/Html/Get-HtmlTableColGroup.ps1 | PowerShell | mit | 1,097 |
#Requires -Version 3.0
#-- Helper Functions --#
<#
.SYNOPSIS
Get encoding from the file your tried to read.
.DESCRIPTION
You can specify what is the encoding used in the file you want to check.
Will return encoding name used in PowerShell, it means you can pass returned value to Get-Content or other.
.NOTES
Author... | guitarrapc/valentia | valentia/Functions/Helper/Encoding/Get-ValentiaFileEncoding.ps1 | PowerShell | mit | 1,290 |
function Assert-ParameterCollection {
<#
.SYNOPSIS
Asserts that a $PSBoundParameters collection does or does not contain some parameter
names. This implements parameters set enforcement for DSC resources.
#>
[CmdletBinding()]
param (
## Specifies a PSBoundParametersDictionary... | VirtualEngine/RESONEServiceStore | DSCResources/ROSSCommon/Src/Assert-ParameterCollection.ps1 | PowerShell | mit | 4,231 |
$script:ModuleRoot = $PSScriptRoot
$script:ModuleVersion = (Import-PowerShellDataFile -Path "$($script:ModuleRoot)\PoShPRTG.psd1").ModuleVersion
# Detect whether at some level dotsourcing was enforced
$script:doDotSource = Get-PSFConfigValue -FullName PoShPRTG.Import.DoDotSource -Fallback $false
if ($PoShPRTG_dotsour... | AndiBellstedt/PoShPRTG | PoShPRTG/PoShPRTG.psm1 | PowerShell | mit | 3,265 |
VBoxManage controlvm "default" natpf1 "tcp-port55672,tcp,127.0.0.1,55672,,55672";
VBoxManage controlvm "default" natpf1 "tcp-port55673,tcp,127.0.0.1,55673,,55673";
VBoxManage controlvm "default" natpf1 "tcp-port55674,tcp,127.0.0.1,55674,,55674"; | BrighterCommand/Paramore.Brighter | samples/RMQPartitionTesting/expose_ports_to_toolbox_28.ps1 | PowerShell | mit | 245 |
# Single Export 20H2
$ISO = "E:\ISO\Windows 10 Business Editions x64 20H2 (updated March 2021).iso"
$WIM = "C:\Ref\REFW10-X64-20H2-March-2021-Enterprise.wim"
Mount-DiskImage -ImagePath $ISO
$ISOImage = Get-DiskImage -ImagePath $ISO | Get-Volume
$ISODrive = [string]$ISOImage.DriveLetter+":"
Export-WindowsImage -SourceI... | DeploymentResearch/DRFiles | Scripts/Export-Windows10EnterpriseWIMFromISO.ps1 | PowerShell | mit | 461 |
<#
You can do multiline
comments like this.
#>
# $$ Environment.
# $PSVersionTable.PSVersion # To find the version of Powershell that is running
# $PSHOME # PS home directory.
# $$ Basic structure of a command:
# command parameter1 parameter2-with-arg1 positional-arg
# Parameter n... | PhilipDaniels/learn | powershell/basics/start_here.ps1 | PowerShell | mit | 2,623 |
# Remember to authenticate off screen first
$cred = Get-Credential
Connect-Brickset -apiKey 'xxx' -credential $cred
# Get Number of Sets by Theme
Get-BricksetTheme | Sort-Object setcount -Descending | Format-Table theme,setcount
# Get Years for a given Theme
Get-BricksetYear -Theme 'Indiana Jones'
# Pipe into Get-Br... | jonathanmedd/Presentations | PowerShell/Developing a PowerShell Module/Examples.ps1 | PowerShell | mit | 1,543 |
# Copyright 2020 Google 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | GoogleCloudPlatform/opentelemetry-operations-collector | .build/googet/uninstall.ps1 | PowerShell | apache-2.0 | 676 |
################################################################################
#
# title : dns_servers.ps1
# description : Check_mk-Plugin, dass die aktuell eingetragenen DNS-Server
# ausliest und im Check_mk-Plugin-Format ausgibt
# author : Martin Schneider (martin@d... | der-mac/check-mk-toolbox | plugins/dns_servers/Client/dns_servers.ps1 | PowerShell | apache-2.0 | 1,044 |
$packageName = 'cports'
$url = 'http://www.nirsoft.net/utils/cports.zip'
$checksum = 'f81e07d50747b7efbb664125d42cd69b354847b94fa30e7566415ff52b928c83'
$checksumType = 'sha256'
$url64 = 'http://www.nirsoft.net/utils/cports-x64.zip'
$checksum64 = '5cb548dc7b5baa07a2d7157be92471e194621030004f50efe6f03d06e407061e'
$checks... | dtgm/chocolatey-packages | automatic/_output/cports/2.50/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 979 |
param
(
[parameter(Mandatory=$true, Position=0)]
[string] $ApiKey
)
Publish-Module -Name $PSScriptRoot\DevOpsFlex.Automation.PowerShell\DevOpsFlex.Automation.PowerShell.psd1 -NuGetApiKey $ApiKey
| eShopWorld/devopsflex-automation | src/Push-ToGallery.ps1 | PowerShell | mit | 204 |
# 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 ... | tcnghia/kubernetes | cluster/gce/windows/k8s-node-setup.psm1 | PowerShell | apache-2.0 | 81,944 |
function Get-TargetResource
{
# Ignoring this because we need to generate a stub credential to return up the current crawl account as a PSCredential
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
[CmdletBinding()]
[OutputType([System.Collections... | camiloborges/xSharePoint | Modules/SharePointDsc/DSCResources/MSFT_SPSearchServiceApp/MSFT_SPSearchServiceApp.psm1 | PowerShell | mit | 12,236 |
Import-Module AU
Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1"
#$redirectPage = 'http://wixtoolset.org/releases/v3-10-3-3007/' # Provided in case we need to update the latest stable
$releases = 'http://wixtoolset.org/releases/'
$softwareName = 'WiX Toolset*'
$padUnderVersion = '3.10.4'
function glob... | jberezanski/chocolatey-coreteampackages | automatic/wixtoolset/update.ps1 | PowerShell | apache-2.0 | 2,103 |
function Clear-LabVirtualMachine {
<#
.SYNOPSIS
Removes the current configuration a virtual machine.
.DESCRIPTION
Invokes/sets a virtual machine configuration using the xVMHyperV DSC resource.
.NOTES
Should be Remove-LabVirtualMachine but that and Remove-LabVM are already used.
#>
... | VirtualEngine/Lab | Src/Private/Clear-LabVirtualMachine.ps1 | PowerShell | mit | 2,094 |
[CmdletBinding()]
param(
[ValidateNotNull()]
[Parameter()]
[hashtable]$ModuleParameters = @{ })
if ($host.Name -ne 'ConsoleHost') {
Write-Warning "VstsTaskSdk is designed for use with powershell.exe (ConsoleHost). Output may be different when used with other hosts."
}
# Private module variables.
[bool... | DariuszPorowski/VSTS-MySQL-Toolkit-Win | Tasks/RunMySqlScripts/ps_modules/VstsTaskSdk/VstsTaskSdk.psm1 | PowerShell | mit | 6,076 |
#requires -Module EZOut
# https://github.com/StartAutomating/EZOut
# OR Install-Module EZOut
$myRoot = $MyInvocation.MyCommand.ScriptBlock.File | Split-Path
$myName = $MyInvocation.MyCommand.Name -replace '\.ezformat\.ps1', ''
Write-FormatView -Action {
$h = Get-History -C... | MSSedusch/azure-quickstart-templates | test/template-tests/AzRMTester.ezformat.ps1 | PowerShell | mit | 2,030 |
#Requires -RunAsAdministrator
$rootPath = [System.IO.Path]::GetFullPath((split-path $SCRIPT:MyInvocation.MyCommand.Path -parent))
&"c:\Program Files\git\usr\bin\patch" --binary --forward -r - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" $root... | dmitriyse/DevOpsSpellbook | vs/2017/apply-hardlinks-perf-tweak.ps1 | PowerShell | mit | 664 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
BeforeDiscovery {
$RunningInCIOnUbuntu = $IsLinux -and ($env:TF_BUILD -or $env:APPVEYOR) # some test cases randomly start and stop to fail in Ubuntu CI tests
$Srv2012_3_profile = 'win-8_x64_6.2.9200.0_3.0_x64_... | PowerShell/PSScriptAnalyzer | Tests/Rules/UseCompatibleCommands.Tests.ps1 | PowerShell | mit | 49,689 |
Function Write-LogInfo {
<#
.SYNOPSIS
Writes informational message to specified log file
.DESCRIPTION
Appends a new informational message to the specified log file
.PARAMETER LogPath
Mandatory. Full path of the log file you want to write to. Example: C:\Windows\Temp\Test_Script.log
.PARAMETER ... | mskccdanielm1/PSSystemInfo | Private/Write-LogInfo.ps1 | PowerShell | mit | 2,990 |
#region Build the GUI
[xml]$xaml = @"
<Window
xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
x:Name='Window' Title='' WindowStartupLocation = 'CenterScreen'
Width = '880' Height = '590' ShowInTaskbar = 'True'... | proxb/Presentations | NorCal - PowerShell_Runspaces/5_2_1_RunspacesDemo_GUI_NoRunspace_Multi.ps1 | PowerShell | mit | 5,461 |
$script:DSCModuleName = 'xSQLServer'
$script:DSCResourceName = 'MSFT_xSQLServerPermission'
#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 'DSCResource.Tests... | PaulFeaser/xSQLServer | Tests/Unit/MSFT_xSQLServerPermission.Tests.ps1 | PowerShell | mit | 14,248 |
Function New-FibonacciNumber
{
<#
.SYNOPSIS
Outputs the specified number of fibonacci numbers
.DESCRIPTION
Creates a list of numbers from the fibonacci sequence starting with
the first number in the sequence and ending with the specified limit.
.PARAMETER Limit
The number of fibonacci numbers to stop at
... | Midacts/test | FibonacciNumberCompare/Public/New-FibonacciNumber.ps1 | PowerShell | mit | 852 |
Function Get-AvailableModule {
Param ([string]$Name)
If ( -Not (Get-Module -Name $Name)) {
If (Get-Module -ListAvailable | Where-Object { $_.Name -eq $Name }) {
Import-Module -Name $Name
Return $True
# If module available then import
} Else {
... | aaronparker/powershell-scripts | Various/Get-AvailableModule.ps1 | PowerShell | mit | 476 |
$packageName = 'dumo'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'http://www.kcsoftwares.com/files/dumo_lite.exe'
$checksum = 'a4101f1c4a6c28bdceb75041df7bfd9ee9b64dae'
$checksumType = 'sha1'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packageName" `... | dtgm/chocolatey-packages | automatic/_output/dumo/2.5.0.28/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 635 |
#Set-DefaultAWSRegion 'us-east-1'
$VerbosePreference='Continue'
trap { break } #This stops execution on any exception
$ErrorActionPreference = 'Stop'
. $PSScriptRoot\ssm\ssmcommon.ps1
#Define which accounts or AWS services can assume the role.
$assumePolicy = @"
{
"Version":"2012-10-17",
"Statement":[
{... | padisetty/Samples | AWS/setup.ps1 | PowerShell | apache-2.0 | 1,930 |
$packageName = 'faview'
$url = 'http://www.nirsoft.net/utils/faview.zip'
$checksum = '9ddbcfef4cdd7681d88d1a2cd1599289a835711f'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "$($packageName).exe"
Install-ChocolateyZipPackage -PackageNam... | dtgm/chocolatey-packages | automatic/_output/faview/1.32/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 618 |
$packageName = 'dumo'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'http://www.kcsoftwares.com/files/dumo_lite.exe'
$checksum = '2f686934bfbee7d9402543f0cd7856a0a90c13e831c84f3599cf99081e467aec'
$checksumType = 'sha256'
$validExitCodes = @(0)
Install-ChocolateyPackage -Pa... | dtgm/chocolatey-packages | automatic/_output/dumo/2.12.0.65/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 661 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-56.0a1.en-US.win32.installer.exe'
$checksum = '663251159dcb5a9e5c1787690956af48caa78bff74340d69b2c6f179721f18aa'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/56.0.1.2017071811/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
$packageName = 'gpg4win'
$installerType = 'exe'
$silentArgs = '/S'
$url = 'https://files.gpg4win.org/gpg4win-2.3.4.exe'
$checksum = '26c38609dd4e67bbee65091d09f35356dcac0b58'
$checksumType = 'sha1'
$validExitCodes = @(0)
Write-Verbose "Stop service `"DirMngr`" if already running"
if (Get-Service -Name dirmngr -ErrorA... | dtgm/chocolatey-packages | automatic/_output/gpg4win/2.3.4.20170711/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 777 |
properties {
$zipFileName = "Json90r1.zip"
$majorVersion = "9.0"
$majorWithReleaseVersion = "9.0.1"
$nugetPrerelease = $null
$version = GetVersion $majorWithReleaseVersion
$packageId = "Newtonsoft.Json"
$signAssemblies = $false
$signKeyPath = "C:\Development\Releases\newtonsoft.snk"
$buildDocumentat... | pWnH/CarsonAgainstHumanity | lib/Json90r1/Source/Build/build.ps1 | PowerShell | apache-2.0 | 14,666 |
#Execute
###############################################################################################
# Flushdns on list of Machines
###############################################################################################
## Admin Name
$adminName = $env:adminName
## Path to list of computer-names and u... | Layer8Err/PowerShell_fmwrk | Remote/Maintenance/FlushDNS.ps1 | PowerShell | bsd-2-clause | 1,102 |
<#
.Synopsis
This Powershell script checks for required network access and service configuration
in order for enrollment to work correctly
.DESCRIPTION
When run, the script will check for access to necessary WS1 and Microsoft servers
and will also confirm that specific services are allowed to run. An HTML ... | vmwaresamples/AirWatch-samples | Windows-Samples/Tools & Utilities/Enrollment Troubleshooting Script/EnrollmentChecker.ps1 | PowerShell | bsd-3-clause | 7,592 |
@{
# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Remotely.psm1'
# Version number of this module.
ModuleVersion = '1.0.0'
# ID used to uniquely identify this module
GUID = 'a20c9efd-077e-4c53-a500-f74dec071799'
# Author of this module
Author = 'Microsoft Corporat... | hdansou/Remotely | Remotely.psd1 | PowerShell | mit | 2,166 |
# variables
$certPath = GetCertPath -CertStoreName My
$dns = "test.contoso.com"
$file = "test.pfx"
$parent = "C:\hoge"
$exportLocation = Join-Path $parent $file
# create self-signed certificate
$cert = New-SelfSignedCertificate -Dns $dns -CertStoreLocation $certPath
# export certificate
New-Item -Path $parent -ItemT... | guitarrapc/GraniResource | Tests/Grani_PfxImport/Configuration/Absent/ConfigurationSample.ps1 | PowerShell | mit | 1,181 |
#Requires -Version 5.0
#register my OneGet Server
Register-PackageSource -Name myChocolateyRepository -Location 'http://john-pc:8000/nuget' -Provider chocolatey -Trusted -Verbose
#list all packages from this source
Find-Package -Source myChocolateyRepository
#find package with UI and install the selected one
Find-... | jlouros/PowerShell-toolbox | Misc/PowerShell 5 Presentation Scripts (April 2015)/Demo-OurOwnOneGet-Commands.ps1 | PowerShell | mit | 485 |
#!/usr/bin/env pwsh
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#Requires -Version 6.0
#Requires -PSEdition Core
<#
.Synopsis
Updates or adds a cgmanifest.json for all pom.xmls in a directory based on its maven dependency tree.
.Parameter Directory
... | selvasingh/azure-sdk-for-java | eng/Set-ComponentRegistrations.ps1 | PowerShell | mit | 8,553 |
$packageName = 'tortoisesvn'
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart ADDLOCAL=ALL'
$urlArray = @('https://sourceforge.net/projects/tortoisesvn/files/1.8.11/Application/TortoiseSVN-1.8.11.26392-win32-svn-1.8.13.msi', 'https://sourceforge.net/projects/tortoisesvn/files/1.8.11/Application/TortoiseSVN-1... | maharishi/chocolatey-packages | automatic/_output/tortoisesvn/1.8.11/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,112 |
$packageName = 'gramps'
$packageSearch = "$packageName*"
$installerType = 'exe'
$silentArgs = '/S'
$validExitCodes = @(0)
Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
... | dtgm/chocolatey-packages | automatic/_output/gramps/4.2.5/tools/chocolateyUninstall.ps1 | PowerShell | apache-2.0 | 910 |
Param([string] $rootPath)
$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
if ([string]::IsNullOrEmpty($rootPath)) {
$rootPath = "$scriptPath\.."
}
Write-Host "Root path used is $rootPath" -ForegroundColor Yellow
docker-comp... | fmustaf/Samples | eShopOnContainers-dev/cli-windows/start-external.ps1 | PowerShell | mit | 422 |
# Use this file for debugging if you use Visual Studio Code
# Setup
# 1. Install Powershell Extension
# 2. Set "program": "${workspaceRoot}/Developer/Debug.ps1" in launch.json
#region Import Sitecore.Deployment
#Save the current Powershell Modules Paths in the $p variable.
$p = [Environment]::GetEnvironmentVariable(... | RosenPetrov/sitecore-deployment-powershell | Developer/Debug.ps1 | PowerShell | mit | 3,122 |
$ErrorActionPreference = "Stop"
Remove-Item "$env:USERPROFILE/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/docker-setup.cmd"
dockerd.exe --register-service
Start-Service docker | hbirchtree/coffeecutie-automation-tools | scripts/windows_docker/service-install.ps1 | PowerShell | mit | 195 |
<#
.SYNOPSIS
Configure local MSDTC for BizTalk
.DESCRIPTION
This script configures MSDTC for BizTalk. Requires Windows 8.1/Server 2012 R2 and PowerShell 4.0 or newer
.EXAMPLE
./MSDTC.ps1
.NOTES
Run the script on the servers that requires the configuration (BizTalk and SQL)
#>
cls
# Enable MSDTC for Network Access
Writ... | agilityroots/biztalk-provisioner | scripts/BizTalkInstallationToolkit/MSDTC.ps1 | PowerShell | mit | 720 |
## Active Directory: PowerShell Functions to Create AD Users and Groups, and Assign Members to Groups from CSV Input Files ##
<#
Overview: PowerShell functions to create AD User and Group accounts, and can also be modified to create Groups with specified Members assigned to them. Script uses CSV Input files
Usage:
... | borkit/scriptdump | PowerShell/Working/AD/CreateADUsersAndGroupsFromCSV.ps1 | PowerShell | mit | 7,508 |
# Default Display Group for the Firewall cmdlets
$DefaultDisplayGroup = "DSC_FirewallRule"
# DSC uses the Get-TargetResource cmdlet to fetch the status of the resource instance specified in the parameters for the target machine
function Get-TargetResource
{
param
(
# Name of the Firewall ... | grayzu/Examples | Configs/Petshop4AzureAutomation/Resources/xNetworking/DSCResources/MSFT_xFirewall/MSFT_xFirewall.psm1 | PowerShell | mit | 23,296 |
Function Find-AzureService()
{
param(
[parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string] $ServiceName
)
Write-Host "Searching for Azure Service '$ServiceName'..."
$service = Invoke-AzureCommand { Get-AzureService -ServiceName $ServiceName -ErrorAction Continue }
... | TimMurphy/azure-build-server | scripts/Library/Find-AzureService.ps1 | PowerShell | mit | 544 |
#################################
#Client Requirements:
#File names containing: title, commitment, policy for 800+ properties
#Search Location 1: I:/ Acquisitions/ _Georgia
#SearchLocation 2: I:/ Acquisitions/ SWAY Acquisition Documents
#Destination Location: I:\16. Dispositions\___(Externally Shared) Portfolio Dilige... | EmpressDeIT/PowerShell | ISE_Tabs/FileSearchScript.ps1 | PowerShell | mit | 1,142 |
param($installPath, $toolsPath, $package, $project)
$ref = $project.Object.References.Item("PowerPointApi")
if ($ref -and $ref.EmbedInteropTypes)
{
$ref.EmbedInteropTypes = $false
}
| CaioProiete/NetOffice-NuGet | nuget/NetOffice.PowerPoint/tools/install.ps1 | PowerShell | mit | 187 |
## Intro: Simple powershell script to install (or replace) a virtual directory
## Usage: CreateVirtualDirectory.ps1 [WebsiteName] [FolderName] [PhysicalPath] ([domain\user] [password])
## Note : These scripts require local admin priviliges!
# Load IIS tools
Import-Module WebAdministration
sleep 2 #see http://sta... | alastairtree/deploy-websites-with-powershell | CreateVirtualDirectory.ps1 | PowerShell | apache-2.0 | 2,341 |
Login-AzureRmAccount -EnvironmentName AzureChinaCloud
$RGNameDSCConfiguration = "RG-ARM-Demo-DSC"
$StgAcctName = "ARMDemoDSCStorage".ToLower()
$dscContainerName = "dscconfiguration"
$loc = "China North"
$storageEndpointSuffix = "core.chinacloudapi.cn"
#prepare resource group
#New-AzureRmResourceGroup -Name $RGNameDSCCo... | catweisun/ARMDeploymentDemo | TemplateDeployment/publishDscPackage.ps1 | PowerShell | apache-2.0 | 1,160 |
function Write-BoxstarterLogo {
$boxMod=(IEX (Get-Content (Join-Path $Boxstarter.Basedir Boxstarter.Common\Boxstarter.Common.psd1) | Out-String))
Write-BoxstarterMessage "Boxstarter Version $($boxMod.ModuleVersion)" -nologo -Color White
Write-BoxstarterMessage "$($boxMod.Copyright) https://boxstarter.org`r`... | mwrock/boxstarter | BoxStarter.Common/Write-BoxstarterLogo.ps1 | PowerShell | apache-2.0 | 346 |
# This is the install script for drox on windows with PowerShell.
# Windows and Linux dot repository living together?
# Shared git config? Common vim config?
# MADNESS I TELL YOU MADNESS
Push-Location
if($(Get-ExecutionPolicy) -eq "Restricted") {
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
}
cd... | oxo42/drox | Install-Drox.ps1 | PowerShell | apache-2.0 | 617 |
[cmdletbinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1 -Legacy
. $PSScriptRoot\..\..\..\Tasks\PublishSymbols\LegacyIndexHelpers.ps1
$env:AGENT_HOMEDIRECTORY = 'SomeDrive:\AgentHome'
Register-Mock Test-Path { $false }
Register-Mock Get-CurrentProcess
Register-Mock Add-DbghelpLibraryCore
# A... | jwendl/vso-agent-tasks | Tests/L0/PublishSymbols-Legacy/Add-DbghelpLibrary.ThrowsIfDllNotFound.ps1 | PowerShell | mit | 692 |
<#
Copyright 2015 Brandon Olin
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
di... | iainbrighton/NetScaler | NetScaler/Public/Add-NSRSAKey.ps1 | PowerShell | apache-2.0 | 2,919 |
Import-Module .\TestLibs\RDFELibs.psm1 -Force
$result = ""
$testResult = ""
$resultArr = @()
$isDeployed = DeployVMS -setupType $currentTestData.setupType -Distro $Distro -xmlConfig $xmlConfig
if ($isDeployed)
{
$vm1added = $false
foreach ($VMdata in $allVMData)
{
if ($VMdata.RoleName -imatch $currentTestData.set... | iamshital/azure-linux-automation | remote-scripts/NETWORK-LB-NO-PROBE-PORT-ONE-NODE-DOWN-TCP.ps1 | PowerShell | apache-2.0 | 19,503 |
function Get-Machine-Architecture()
{
# possible values: AMD64, IA64, x86
return $ENV:PROCESSOR_ARCHITECTURE
}
function Get-CLIArchitecture-From-Architecture([string]$Architecture)
{
switch ($Architecture.ToLower())
{
{ ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" }
{ $_ -eq "x8... | dylan-smith/vso-agent-tasks | Tasks/UseDotNetV2/externals/get-os-platform.ps1 | PowerShell | mit | 620 |
## PowerShell Function to set IIS logging locations on all or individual IIS web sites ##
## Important: This doesn't change Global 'centralBinaryLogFile' and 'centralW3CLogFile' locations in the applicationHost.config
Function Set-IISLogLocation {
<#
.SYNOPSIS
This command will allow you to set the IIS log locati... | borkit/scriptdump | PowerShell/Working/iis/IIS_Change_Log_File_Location.ps1 | PowerShell | mit | 3,363 |
function Invoke-XmlRecursive{
param(
$XmlDocOrElement,
[String]$FunctionToCall,
$IncrementalAttributes,
$PersistentData = $(New-Object PSObject),
$Level = -1
)
$Level++
foreach ($node in $XmlDocOrElement.ChildNodes){
if($node.NodeType -ne "Text"){
... | vigorcrust/SPContentCreator | import/system/xml/XmlRecursive.psm1 | PowerShell | mit | 2,014 |
Import-Module -Name (Join-Path -Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) -ChildPath 'xSQLServerHelper.psm1') -Force
<#
.SYNOPSIS
This function gets all Key properties defined in the resource schema file
.PARAMETER Database
This is the SQL database
.PARAMETER RecoveryModel
... | Arturas-K/xSQLServer | DSCResources/MSFT_xSQLServerDatabaseRecoveryModel/MSFT_xSQLServerDatabaseRecoveryModel.psm1 | PowerShell | mit | 4,842 |
$testString = "<https://sandbox.thelevelup.com/v14/locations/199/orders?page=2>; rel=`"next`""
$match = $testString -match '(?<=<)\S*(?=>)' | Out-Null; $Matches[0] | NedM/Powershell-Utils | Scripts/RegExTest.ps1 | PowerShell | mit | 166 |
function ExpandPayload {
[CmdletBinding()]
Param (
$response
)
if ($PSVersionTable.PSEdition -eq "Core") {
ConvertFrom-JsonNewtonsoft $response
}
else {
## Start Code Attribution
## ExpandPayload function is the work of the following Authors and should remain with the ... | gscales/Exch-Rest | internal/functions/other/ExpandPayload.ps1 | PowerShell | mit | 2,756 |
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param
(
[Parameter()]
[string]
$SharePointCmdletModule = (Join-Path -Path $PSScriptRoot `
-ChildPath "..\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm... | PowerShell/xSharePoint | tests/Unit/SharePointDsc/SharePointDsc.SPWebAppGeneralSettings.Tests.ps1 | PowerShell | mit | 23,743 |
# 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/Carbon.psd1 | PowerShell | mit | 19,344 |
Install-ChocolateyInstallPackage `
-PackageName 'stylecop' `
-FileType 'msi' `
-SilentArgs '/quiet' `
-File "$(Split-Path -Parent -Path $MyInvocation.MyCommand.Definition)\StyleCop-4.7.55.0.msi" `
-ValidExitCodes @(0, 3010)
| jberezanski/ChocolateyPackages | stylecop/tools/chocolateyInstall.ps1 | PowerShell | mit | 237 |
<#
.SYNOPSIS
Deactivates an alarm output.
.DESCRIPTION
Deactivates an alarm output.
If the result returns null, try the parameter "-Verbose" to get more details.
.EXAMPLE
.LINK
https://github.com/erwindevreugd/PSDataConduIT
.EXTERNALHELP PSDataConduIT-help.xml
#>
... | erwindevreugd/PSDataConduIT | PSDataConduIT/Public/Invoke-DeactivateAlarmOutput.ps1 | PowerShell | mit | 3,028 |
Expand-PsakeConfiguration `
@{
Configuration = 'Debug'
}
| dermeister0/TimesheetParser | Config.Development.ps1 | PowerShell | mit | 61 |
<#
.SYNOPSIS
Deploys the Pack.tests.template.ps1 file out to each pack folder, overwriting the contents. This is to ensure that all packs have up to date tests prior to running invoke-pester.
.PARAMETER Path
The location to (recursivly) start searching for packs that need updated tests.
.PARAMETER TemplateFi... | P2P-Nathan/SQMP-CMPC | Update-Tests.ps1 | PowerShell | mit | 765 |
# adapted from
# http://www.tavaresstudios.com/Blog/post/The-last-vsvars32ps1-Ill-ever-need.aspx
$script:rootVsKey = if ([IntPtr]::size -eq 8)
{ "HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio" }
else
{ "HKLM:SOFTWARE\Microsoft\VisualStudio" }
function Get-Batchfile ($file)
{
if (!(Test-Path $file))
{
th... | Iristyle/Midori | tools/VsVars.psm1 | PowerShell | mit | 6,628 |
#MIT License
#
#Copyright (c) 2017 Philip Stone
#
#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, publi... | SirHenryIII/PSLogParser | PSLogParser/Public/Test-PSLogParser.ps1 | PowerShell | mit | 2,162 |
# Get Issue
Get-JiraIssue -Key "TEST-1"
| christianjaeckle/Powershell-Scripts | Module JiraPS/Get issue with JiraPS.ps1 | PowerShell | mit | 40 |
function Update-HostFile{
Write-Host "Updating HOSTS file on local machine..."
$hostsFilePath = "c:\Windows\System32\Drivers\etc\hosts"
Clear-Content -Path $hostsFilePath
$dnsNames = "wingtipserver", `
"wingtipserver.wingtip.com",
"wingtip.com",
"my... | CriticalPathTraining/SharePoint2016VmSetupGuide | Setup/Scripts/Script01_InstallActiveDiretory.ps1 | PowerShell | mit | 2,078 |
#
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
#
# Input -
# (1) "stage" parameter, accepts either "build" or "run"
# (2) "vebose" parameter, accepts "verbose"
#
Param([string] $stage, [string] $verbose)
... | kai-zeng/Mobius | build/localmode/downloadtools.ps1 | PowerShell | mit | 20,643 |
BeforeDiscovery {
try
{
Import-Module -Name 'DscResource.Test' -Force -ErrorAction 'Stop'
}
catch [System.IO.FileNotFoundException]
{
throw 'DscResource.Test module dependency not found. Please run ".\build.ps1 -Tasks build" first.'
}
<#
Need to define that variables... | johlju/xSQLServer | tests/Integration/DSC_SqlAlwaysOnService.Integration.Tests.ps1 | PowerShell | mit | 8,067 |
write-host "Present working directory: $($pwd)"
$testsuites = [xml](get-content .\test-results\*.xml)
$anyFailures = $FALSE
foreach ($testsuite in $testsuites.testsuite) {
write-host " $($testsuite.name)"
foreach ($testcase in $testsuite.testcase){
$failed = $testcase.failure
$time = [decima... | johnnyreilly/globalize-so-what-cha-want | registerTestResults.ps1 | PowerShell | mit | 1,047 |
$packageName = 'hashmyfiles'
$url = 'http://www.nirsoft.net/utils/hashmyfiles.zip'
$checksum = 'b90954b38802de070d6862144ae500a881933c631b618b43280542a64dfe2e38'
$checksumType = 'sha256'
$url64 = 'http://www.nirsoft.net/utils/hashmyfiles-x64.zip'
$checksum64 = '099cb1770aabd341882390141de73a80a3e2152cb1730e4b58d7fef1f... | dtgm/chocolatey-packages | automatic/_output/hashmyfiles/2.23/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 997 |
<#
.Synopsis
.\install-ubuntu.ps1
.DESCRIPTION
install-scaleio is the a vmxtoolkit solutionpack for configuring and deploying scaleio svm´s
Copyright 2014 Karsten Bott
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... | bottkars/labbuildr | labbuildr/ubuntu-bakery.ps1 | PowerShell | apache-2.0 | 49,169 |
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Fake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Fake)
and execute your Fake build script with the parameters you provide.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The ... | InventoryLab/lighthouse | build.ps1 | PowerShell | apache-2.0 | 6,091 |
# AU Packages Template: https://github.com/majkinetor/au-packages-template
param([string] $Name, [string] $ForcedPackages, [string] $Root = "$PSScriptRoot\automatic")
if (Test-Path $PSScriptRoot/update_vars.ps1) { . $PSScriptRoot/update_vars.ps1 }
$Options = [ordered]@{
WhatIf = $au_WhatIf ... | octomike/chocolatey-coreteampackages | update_all.ps1 | PowerShell | apache-2.0 | 5,670 |
<#
Copyright 2015 Brandon Olin
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
di... | MattHodge/PasswordState | Functions/Get-PasswordStateAllPasswords.ps1 | PowerShell | apache-2.0 | 2,781 |
#
# Module manifest for module 'PSGet_AzureRM.LocationBasedServices'
#
# 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 = '1.0.0'
# Supported PSEditions
# Compat... | devigned/azure-powershell | src/ResourceManager/LocationBasedServices/AzureRM.LocationBasedServices.psd1 | PowerShell | apache-2.0 | 4,810 |
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build scri... | Dropcraft/Dropcraft | build.ps1 | PowerShell | mit | 3,553 |
function Diff-CSV {
<#
.SYNOPSIS
PowerShell wrapper for diff-table.exe a tool to diff csv files
.DESCRIPTION
PowerShell wrapper for diff-table.exe tool.
Generates row/column wise diffs conmparing two .csv files
This function requires diff-table.exe tool.
https://github.co... | DBremen/PowerShellScripts | Binary Wrapper/Diff-CSV.ps1 | PowerShell | mit | 2,293 |
C:\Windows\SysNative\WindowsPowerShell\v1.0\powershell.exe -Command {Remove-WebApplication -Site "Default Web Site" -Name PollWriter} | awslabs/aws-sdk-net-samples | Talks/vslive-2015/Pollster/App/src/PollWriter/CodeDeployScripts/IIS_RemoveWebApp.ps1 | PowerShell | apache-2.0 | 136 |
<#
The MIT License (MIT)
Copyright (c) 2015 Objectivity Bespoke Software Specialists
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
t... | Invenis/PSCI | PSCI/dsc/custom/cNssm/DscResources/OBJ_cNssm/OBJ_cNssm.psm1 | PowerShell | mit | 14,774 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.