full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/AzureAutomationDebug/1.3.8/AzureAutomationRunbook/Get-PSCredential.ps1
Get-PSCredential.ps1
Param ( $name, $salt1,$salt2 ) function Encrypt-String($String, $Passphrase, $salt="SaltCrypto", $init="IV_Password", [switch]$arrayOutput) { # Create a COM Object for RijndaelManaged Cryptography $r = new-Object System.Security.Cryptography.RijndaelManaged # Convert the Passphrase to UTF8 Bytes $pass = [...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/New-LocalUser.ps1
New-LocalUser.ps1
<# .Synopsis Creates local user(s) on computer(s) .DESCRIPTION Creates local user(s) on computer(s) .EXAMPLE New-LocalUser -Name 'User1', 'User2' -Password 'SuperSecretPassword' Creates "User1" and "User2" on local computer .EXAMPLE New-LocalUser -Name 'User1', 'User2' -ComputerName 'Client0...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Get-LocalUser.ps1
Get-LocalUser.ps1
<# .Synopsis Retrieves local users from computer(s) .DESCRIPTION Retrieves local users from computer(s) .EXAMPLE Get-LocalUser Gets all user accounts from local computer .EXAMPLE Get-LocalUser test, guest Gets user accounts "test" and "guest" on the local computer if they exist .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Get-LocalUser.Tests.ps1
Get-LocalUser.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" # helper function function createUsers([String[]]$User) { $userList = @() foreach ($u in $User) { $userList += [pscustomobject]@{ name = "$u"...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Remove-LocalUserProfile.ps1
Remove-LocalUserProfile.ps1
<# .Synopsis Removes local users PROFILE from computer(s) .DESCRIPTION Removes local users PROFILE from computer(s) .EXAMPLE 'User1', 'User2' | Remove-LocalUser Removes User1 and User2 from local computer .EXAMPLE Remove-LocalUserProfile -Name 'User1', 'User2' -ComputerName 'Client01', Clien...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Remove-LocalUserProfile.Tests.ps1
Remove-LocalUserProfile.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" function userComputerObject ([String[]]$Name, [String[]]$ComputerName) { $objArray = @() foreach ($c in $ComputerName) { foreach ($n in $Name) {...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Remove-LocalUser.Tests.ps1
Remove-LocalUser.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" # helper function function userComputerObject ([String[]]$Name, [String[]]$ComputerName) { $objArray = @() foreach ($c in $ComputerName) { fore...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Remove-LocalUser.ps1
Remove-LocalUser.ps1
<# .Synopsis Removes local users from computer(s) .DESCRIPTION Removes local users from computer(s) .EXAMPLE 'User1', 'User2' | Remove-LocalUser Removes User1 and User2 from local computer .EXAMPLE Remove-LocalUser -Name 'User1', 'User2' -ComputerName 'Client01', Client02' -Force Remov...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/New-LocalUser.Tests.ps1
New-LocalUser.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" # helper function function userComputerObject ([String[]]$Name, [String[]]$ComputerName) { $objArray = @() foreach ($c in $ComputerName) { fore...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Set-LocalUser.Tests.ps1
Set-LocalUser.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") . "$here\$sut" function userComputerObject ([String[]]$Name, [String[]]$ComputerName) { $objArray = @() foreach ($c in $ComputerName) { foreach ($n in $Name) {...
PowerShellCorpus/PowerShellGallery/LocalAccountManagement/0.1.1/Functions/Set-LocalUser.ps1
Set-LocalUser.ps1
<# .Synopsis Updates settings on local user(s) on computer(s) .DESCRIPTION Updates settings on local user(s) on computer(s) .EXAMPLE Set-LocalUser -Name test1, test2 -Password 'SuperSecretPassword' -Description 'Test Accounts' Updates password and description for accounts test1 and test2 on the loc...
PowerShellCorpus/PowerShellGallery/Bitbucket/1.0.5/OAuth.ps1
OAuth.ps1
<# .Synopsis Login to your Bitbucket account for use with other commands. .DESCRIPTION Logs in to your Bitbucket account and stores it in your current PowerShell session for later use. .EXAMPLE Login-BitbucketAccount .EXAMPLE Login-BitbucketAccount -Credential $credential #> function Login-Bitbuck...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/DscResources/MSFT_xMySqlDatabase/xMySqlDatabaseDesigner.ps1
xMySqlDatabaseDesigner.ps1
# a Powershell script to create MySqlDatabase resource using xDSCResourceDesigner tool $friendlyName = "xMySqlDatabase" $resourceName = "MSFT_$friendlyName" $classVersion = "1.0.0" $scriptRoot = Split-Path $MyInvocation.MyCommand.Path $originalModuleRoot = join-Path $scriptroot "..\.." $originalModuleRootPath =...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/DscResources/MSFT_xMySqlUser/xMySqlUserDesigner.ps1
xMySqlUserDesigner.ps1
# a Powershell script to create MySqlDatabase resource using xDSCResourceDesigner tool $friendlyName = "xMySqlGrant" $resourceName = "MSFT_$friendlyName" $classVersion = "1.0.0" $scriptRoot = Split-Path $MyInvocation.MyCommand.Path $originalModuleRoot = join-Path $scriptroot "..\.." $originalModuleRootPath = Re...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/DscResources/MSFT_xMySqlGrant/xMySqlGrantDesigner.ps1
xMySqlGrantDesigner.ps1
# a Powershell script to create MySqlDatabase resource using xDSCResourceDesigner tool $friendlyName = "xMySqlGrant" $resourceName = "MSFT_$friendlyName" $classVersion = "1.0.0" $scriptRoot = Split-Path $MyInvocation.MyCommand.Path $originalModuleRoot = join-Path $scriptroot "..\.." $originalModuleRootPath = Re...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/Sample_InstallMySQL_Default.ps1
Sample_InstallMySQL_Default.ps1
configuration SQLInstanceInstallationConfiguration { param ( [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $MySQLInstancePackagePath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $MySQLInstancePackageName ...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/Sample_InstallMySQLInstanceAndDatabase.ps1
Sample_InstallMySQLInstanceAndDatabase.ps1
configuration SQLInstanceAndDatabaseInstallationConfiguration { param ( [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $MySQLInstancePackagePath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $MySQLInstancePackag...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/InstallRequiredModules.ps1
InstallRequiredModules.ps1
# This Script installs the required modules for the MySql Sample # It uses the PowerShell Resource Gallery, see https://msconfiggallery.cloudapp.net/ # This requires WMF 5. If you don't have WMF 5, Please install the modules manually. Write-Host "Installing required modules..." Install-Module xMySql -MinimumVers...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/GrantMySqlDatabaseAccess.ps1
GrantMySqlDatabaseAccess.ps1
################### # Configuration script to grant full access to given my sql database for given my sql user. # It assumes that mySql is installed on local machine with root user $RootUser and root password $global:pwd ################### configuration MySQLGrantConfiguration { param ( [par...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/Sample_RemoveMySQL_Default.ps1
Sample_RemoveMySQL_Default.ps1
configuration SQLInstanceRemovalConfiguration { Import-DscResource -Module xMySql node $AllNodes.NodeName { xMySqlServer MySQLInstance { Ensure = "Absent" RootPassword = $global:cred ServiceName = "MySQLInstanceServiceName"...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/CreateMySQLUser.ps1
CreateMySQLUser.ps1
################### # Configuration script to create my sql user. It assumes that mySql is installed on local machine with root user $RootUser and root password $global:pwd ################### configuration CreateMySQLUserConfiguration { param ( [parameter(Mandatory = $true)] [Validate...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Examples/Sample_RemoveMySQLAndDatabase.ps1
Sample_RemoveMySQLAndDatabase.ps1
configuration SQLRemoveInstanceAndDatabaseInstallationConfiguration { param ( [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $MySQLInstancePackagePath, [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [String] $MySQLInstance...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Tests/MSFT_xMySqlUser.Tests.ps1
MSFT_xMySqlUser.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path if (! (Get-Module xDSCResourceDesigner)) { Import-Module -Name xDSCResourceDesigner } Describe 'Schema Validation MSFT_xMySqlUser' { It 'should pass Test-xDscResource' { $path = Join-Path -Path $((get-item $here).parent.FullName) -ChildP...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Tests/MSFT_xMySqlUtilities.Tests.ps1
MSFT_xMySqlUtilities.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path if (! (Get-Module xDSCResourceDesigner)) { Import-Module -Name xDSCResourceDesigner } if (Get-Module xMySql) { Remove-Module xMySql } if (Get-Module MSFT_xMySqlUtilities -All) { Get-Module MSFT_xMySqlUtilities -All | Remove-Module } ...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Tests/MSFT_xMySqlDatabase.Tests.ps1
MSFT_xMySqlDatabase.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path if (! (Get-Module xDSCResourceDesigner)) { Import-Module -Name xDSCResourceDesigner } Describe 'Schema Validation MSFT_xMySqlDatabase' { It 'should pass Test-xDscResource' { $path = Join-Path -Path $((get-item $here).parent.FullName) -Ch...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Tests/MSFT_xMySqlServer.Tests.ps1
MSFT_xMySqlServer.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path if (! (Get-Module xDSCResourceDesigner)) { Import-Module -Name xDSCResourceDesigner } Describe 'Schema Validation MSFT_xMySqlServer' { It 'should pass Test-xDscResource' { $path = Join-Path -Path $((Get-Item $here).Parent.FullName) -Chil...
PowerShellCorpus/PowerShellGallery/xMySql/2.1.0.0/Tests/MSFT_xMySqlGrant.Tests.ps1
MSFT_xMySqlGrant.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path if (! (Get-Module xDSCResourceDesigner)) { Import-Module -Name xDSCResourceDesigner } Describe 'Schema Validation MSFT_xMySqlGrant' { It 'should pass Test-xDscResource' { $path = Join-Path -Path $((get-item $here).parent.FullName) -Child...
PowerShellCorpus/PowerShellGallery/xPendingReboot/0.3.0.0/Tests/xPendingReboot.tests.ps1
xPendingReboot.tests.ps1
<# .summary Test suite for MSFT_xPendingReboot.psm1 For PR https://github.com/PowerShell/xPendingReboot/pull/1 #> [CmdletBinding()] param() Import-Module $PSScriptRoot\..\DSCResources\MSFT_xPendingReboot\MSFT_xPendingReboot.psm1 -Force $ErrorActionPreference = 'stop' Set-StrictMode -Version lat...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Examples/Sample_cNtfsPermissionsInheritance.ps1
Sample_cNtfsPermissionsInheritance.ps1
<# .SYNOPSIS Disable NTFS permissions inheritance. .DESCRIPTION This example shows how to use the cNtfsPermissionsInheritance DSC resource to disable NTFS permissions inheritance. #> Configuration Sample_cNtfsPermissionsInheritance { param ( [Parameter(Mandatory = $false)] [...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Examples/Sample_cNtfsPermissionEntry.ps1
Sample_cNtfsPermissionEntry.ps1
<# .SYNOPSIS Assign NTFS permissions. .DESCRIPTION This example shows how to use the cNtfsPermissionEntry DSC resource to assign NTFS permissions. #> Configuration Sample_cNtfsPermissionEntry { param ( [Parameter(Mandatory = $false)] [ValidateNotNullOrEmpty()] [Stri...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Tests/Unit/cNtfsPermissionEntry.Tests.ps1
cNtfsPermissionEntry.Tests.ps1
#requires -Version 4.0 -Modules Pester, CimCmdlets $Global:DSCModuleName = 'cNtfsAccessControl' $Global:DSCResourceName = 'cNtfsPermissionEntry' #region Header $ModuleRoot = Split-Path -Path $Script:MyInvocation.MyCommand.Path -Parent | Split-Path -Parent | Split-Path -Parent if ( (-not (Test-Path -...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Tests/Unit/cNtfsPermissionsInheritance.Tests.ps1
cNtfsPermissionsInheritance.Tests.ps1
#requires -Version 4.0 -Modules Pester $Global:DSCModuleName = 'cNtfsAccessControl' $Global:DSCResourceName = 'cNtfsPermissionsInheritance' #region Header $ModuleRoot = Split-Path -Path $Script:MyInvocation.MyCommand.Path -Parent | Split-Path -Parent | Split-Path -Parent if ( (-not (Test-Path -Path ...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Tests/Integration/cNtfsPermissionEntry.Integration.Tests.ps1
cNtfsPermissionEntry.Integration.Tests.ps1
#requires -Version 4.0 -Modules Pester $Global:DSCModuleName = 'cNtfsAccessControl' $Global:DSCResourceName = 'cNtfsPermissionEntry' #region Header $ModuleRoot = Split-Path -Path $Script:MyInvocation.MyCommand.Path -Parent | Split-Path -Parent | Split-Path -Parent if ( (-not (Test-Path -Path (Join-P...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Tests/Integration/cNtfsPermissionEntry.Config.ps1
cNtfsPermissionEntry.Config.ps1
#requires -Version 4.0 $TestParameters = [PSCustomObject]@{ Ensure = 'Present' Path = (Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath ([Guid]::NewGuid().Guid)) Principal = 'BUILTIN\Users' } Configuration cNtfsPermissionEntry_Config { Import-DscResource -ModuleName cNtfsAccessCo...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Tests/Integration/cNtfsPermissionsInheritance.Integration.Tests.ps1
cNtfsPermissionsInheritance.Integration.Tests.ps1
#requires -Version 4.0 -Modules Pester $Global:DSCModuleName = 'cNtfsAccessControl' $Global:DSCResourceName = 'cNtfsPermissionsInheritance' #region Header $ModuleRoot = Split-Path -Path $Script:MyInvocation.MyCommand.Path -Parent | Split-Path -Parent | Split-Path -Parent if ( (-not (Test-Path -Path ...
PowerShellCorpus/PowerShellGallery/cNtfsAccessControl/1.3.0/Tests/Integration/cNtfsPermissionsInheritance.Config.ps1
cNtfsPermissionsInheritance.Config.ps1
#requires -Version 4.0 $TestParameters = [PSCustomObject]@{ Path = (Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath ([Guid]::NewGuid().Guid)) Enabled = $false PreserveInherited = $true } Configuration cNtfsPermissionsInheritance_Config { Import-DscResource -ModuleName cNtfsAcces...
PowerShellCorpus/PowerShellGallery/VMware.VimAutomation.Core/6.5.1.5374329/VMware.VimAutomation.Core.ps1
VMware.VimAutomation.Core.ps1
[VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule( "VMware.VimAutomation.ViCore.Cmdlets", (Split-Path $script:MyInvocation.MyCommand.Path)); function global:New-DatastoreDrive([string] $Name, $Datastore){ begin { if ($Datastore) { Write-Output $Datastore | New-Da...
PowerShellCorpus/PowerShellGallery/PSVersion/1.7/PublishModuleToGallery.ps1
PublishModuleToGallery.ps1
$p = @{ Name = "PSVersion" NuGetApiKey = $NuGetApiKey } Publish-Module @p
PowerShellCorpus/PowerShellGallery/PSVersion/1.7/InstallModule.ps1
InstallModule.ps1
$ModuleName = "PSVersion" $ModulePath = "C:\Program Files\WindowsPowerShell\Modules" $TargetPath = "$($ModulePath)\$($ModuleName)" if(!(Test-Path $TargetPath)) { md $TargetPath | out-null} $targetFiles = echo ` *.json ` *.psm1 ` *.psd1 Get-ChildItem -Path $targetFiles | ForEach...
PowerShellCorpus/PowerShellGallery/PSVersion/1.7/Functions/Get-PSVersion.ps1
Get-PSVersion.ps1
function Get-PSVersion { <# .SYNOPSIS Maps information from $PSVersionTable to a mapping table to retrieve friendly names for Windows PowerShell build numbers .DESCRIPTION Get-PSVersion is a function to map information from $PSVersionTable to a mapping table in order to retrieve friendly names for W...
PowerShellCorpus/PowerShellGallery/PSVersion/1.7/Functions/Update-PSVersionData.ps1
Update-PSVersionData.ps1
function Update-PSVersionData { <# .SYNOPSIS Updates mapping table used by Get-PSVersion .DESCRIPTION Updates mapping table used by Get-PSVersion, a function to map information from $PSVersionTable in order to retrieve friendly names for Windows PowerShell build numbers .PARAMETER Uri The Ur...
PowerShellCorpus/PowerShellGallery/PSVersion/1.7/Tests/Get-PSVersion.Tests.ps1
Get-PSVersion.Tests.ps1
Import-Module $PSScriptRoot\..\PSVersion.psd1 -Force InModuleScope PSVersion { Describe 'Get-PSVersion' { Context "Desired output" { It "Returns a PSCustomObject" { (Get-PSVersion).GetType().FullName | Should Be 'System.Management.Automation.PSCustomObject' } } Context "Test...
PowerShellCorpus/PowerShellGallery/PSVersion/1.7/Tests/appveyor.pester.ps1
appveyor.pester.ps1
# This script will invoke pester tests # It should invoke on PowerShell v2 and later # We serialize XML results and pull them in appveyor.yml #If Finalize is specified, we collect XML output, upload tests, and indicate build errors param( [switch]$Finalize, [switch]$Test, [string]$ProjectRoot = $EN...
PowerShellCorpus/PowerShellGallery/Logging/2.4.5/targets/ElasticSearch.ps1
ElasticSearch.ps1
@{ Name = 'ElasticSearch' Configuration = @{ Index = @{Required = $true; Type = [string]} Type = @{Required = $true; Type = [string]} ServerName = @{Required = $true; Type = [string]} ServerPort = @{Required = $true; Type = [int]} Fl...
PowerShellCorpus/PowerShellGallery/Logging/2.4.5/targets/File.ps1
File.ps1
@{ Name = 'File' Configuration = @{ Path = @{Required = $true; Type = [string]} PrintBody = @{Required = $false; Type = [bool]} Append = @{Required = $false; Type = [bool]} Encoding = @{Required = $false; Type = [string]} Level = @{Required = $...
PowerShellCorpus/PowerShellGallery/Logging/2.4.5/targets/Email.ps1
Email.ps1
@{ Name = 'Email' Configuration = @{ SMTPServer = @{Required = $true; Type = [string]} From = @{Required = $true; Type = [string]} To = @{Required = $true; Type = [string]} Subject = @{Required = $false; Type = [string]} Credential = @{Require...
PowerShellCorpus/PowerShellGallery/Logging/2.4.5/targets/Slack.ps1
Slack.ps1
@{ Name = 'Slack' Configuration = @{ ServerUri = @{Required = $true; Type = [string]} BotName = @{Required = $false; Type = [string]} Channel = @{Required = $false; Type = [string]} Level = @{Required = $false; Type = [string]} } Logger = { pa...
PowerShellCorpus/PowerShellGallery/Logging/2.4.5/targets/Console.ps1
Console.ps1
@{ Name = 'Console' Description = 'Writes messages to console with different colors.' Configuration = @{ Level = @{Required = $false; Type = [string]} Format = @{Required = $false; Type = [string]} } Logger = { param( $Log, $Format, $Confi...
PowerShellCorpus/PowerShellGallery/Net.Appclusive.PS.Client/4.0.2.20170503/Import-Module.ps1
Import-Module.ps1
# # Import-Module.ps1 # # Place any pre-initialisation script here # Note: # * When executed the module is not yet loaded # * Everything you define here (e.g. a variable) is defined OUTSIDE the module scope. # If this script is loaded via "ScriptsToProcess" it will incorrectly # show up as loaded module, s...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroup/1_FullMesh.ps1
1_FullMesh.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. An au...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroup/2_Simple.ps1
2_Simple.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains two folders called Software and Misc. An automatic Full Mesh connection topology will be assigned. The Content Paths for each folder and member will be se...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroup/3_Complete.ps1
3_Complete.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. The r...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroupMembership/2_Complete.ps1
2_Complete.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. The r...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroupMembership/1_FullMesh.ps1
1_FullMesh.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. An au...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroupFolder/2_Complete.ps1
2_Complete.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. The r...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroupFolder/1_FullMesh.ps1
1_FullMesh.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. An au...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceServerConfiguration/1_Standalone_FQDN.ps1
1_Standalone_FQDN.ps1
<# .EXAMPLE Create a standalone DFS namespace using FQDN called public on the server fileserver1.contoso.com. A namespace folder called brochures is also created in this namespace that targets the \\fileserver2.contoso.com\brochures share. #> Configuration Example { param ( [Pa...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceRoot/1_Domain_MultipleTarget.ps1
1_Domain_MultipleTarget.ps1
<# .EXAMPLE Create an AD Domain V2 based DFS namespace called software in the domain contoso.com with a three targets on the servers ca-fileserver, ma-fileserver and ny-fileserver. It also creates a IT folder in each namespace. #> Configuration Example { param ( [Parameter()] ...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceRoot/3_Standalone_FQDN.ps1
3_Standalone_FQDN.ps1
<# .EXAMPLE Create a standalone DFS namespace using FQDN called public on the server fileserver1.contoso.com. A sub-folder called brochures is also created in this namespace that targets the \\fileserver2.contoso.com\brochures share. #> Configuration Example { param ( [Paramete...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceRoot/2_Domain_SingleTarget.ps1
2_Domain_SingleTarget.ps1
<# .EXAMPLE Create an AD Domain V2 based DFS namespace called departments in the domain contoso.com with a single root target on the computer fs_1. Two sub-folders are defined under the departments folder with targets that direct to shares on servers fs_3 and fs_8. #> Configuration Example { ...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceRoot/4_Standalone.ps1
4_Standalone.ps1
<# .EXAMPLE Create a standalone DFS namespace called public on the server fileserver1. A namespace folder called brochures is also created in this namespace that targets the \\fileserver2\brochures share. #> Configuration Example { param ( [Parameter()] [System.String[...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceFolder/1_Domain_MultipleTarget.ps1
1_Domain_MultipleTarget.ps1
<# .EXAMPLE Create an AD Domain V2 based DFS namespace called software in the domain contoso.com with a three targets on the servers ca-fileserver, ma-fileserver and ny-fileserver. It also creates a IT folder in each namespace. #> Configuration Example { param ( [Parameter()] ...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceFolder/3_Standalone_FQDN.ps1
3_Standalone_FQDN.ps1
<# .EXAMPLE Create a standalone DFS namespace using FQDN called public on the server fileserver1.contoso.com. A sub-folder called brochures is also created in this namespace that targets the \\fileserver2.contoso.com\brochures share. #> Configuration Example { param ( [Paramete...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceFolder/2_Domain_SingleTarget.ps1
2_Domain_SingleTarget.ps1
<# .EXAMPLE Create an AD Domain V2 based DFS namespace called departments in the domain contoso.com with a single root target on the computer fs_1. Two sub-folders are defined under the departments folder with targets that direct to shares on servers fs_3 and fs_8. #> Configuration Example { ...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSNamespaceFolder/4_Standalone.ps1
4_Standalone.ps1
<# .EXAMPLE Create a standalone DFS namespace called public on the server fileserver1. A namespace folder called brochures is also created in this namespace that targets the \\fileserver2\brochures share. #> Configuration Example { param ( [Parameter()] [System.String[...
PowerShellCorpus/PowerShellGallery/xDFS/3.2.0.0/Examples/Resources/xDFSReplicationGroupConnection/1_Complete.ps1
1_Complete.ps1
<# .EXAMPLE Create a DFS Replication Group called Public containing two members, FileServer1 and FileServer2. The Replication Group contains a single folder called Software. A description will be set on the Software folder and it will be set to exclude the directory Temp from replication. The r...
PowerShellCorpus/PowerShellGallery/VMware.VimAutomation.Storage/6.5.1.5374001/VMware.VimAutomation.Storage.ps1
VMware.VimAutomation.Storage.ps1
[VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule( "VMware.VimAutomation.Storage.Commands", (Split-Path $script:MyInvocation.MyCommand.Path)); # SIG # Begin signature block # MIIdVgYJKoZIhvcNAQcCoIIdRzCCHUMCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Private/Add-ObjectDetail.ps1
Add-ObjectDetail.ps1
function Add-ObjectDetail { <# .SYNOPSIS Decorate an object with - A TypeName - New properties - Default parameters .DESCRIPTION Helper function to decorate an object with - A TypeName - New properties - De...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Connect-B2Cloud.ps1
Connect-B2Cloud.ps1
function Connect-B2Cloud { <# .SYNOPSIS The Connect-B2Cloud cmdlet sets the API key for the Backblaze B2 module cmdlets. .DESCRIPTION The Connect-B2Cloud cmdlet is used to retireve the API Uri, download Uri, and API token that authorizes actions againt a B2 account. The cmdlet returns the results ...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Remove-B2Bucket.ps1
Remove-B2Bucket.ps1
function Remove-B2Bucket { <# .SYNOPSIS Remove-B2Bucket will remove the selected bucket. The cmdlet will only remove a bucket if the bucket is empty. .DESCRIPTION Remove-B2Bucket will remove the selected bucket. The cmdlet will only remove a bucket if the bucket is empty. An API key i...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Get-B2Bucket.ps1
Get-B2Bucket.ps1
function Get-B2Bucket { <# .SYNOPSIS The Get-B2Bucket cmdlet will list buckets associated with the account. .DESCRIPTION The Get-B2Bucket cmdlet will list buckets associated with the account. An API key is required to use this cmdlet. .EXAMPLE Get-B2Bucket BucketName Buck...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Get-B2ItemProperty.ps1
Get-B2ItemProperty.ps1
function Get-B2ItemProperty { <# .SYNOPSIS The Get-B2ItemProperty cmdlet will pull extra file information. .DESCRIPTION The Get-B2ItemProperty cmdlet will pull extra file information for the specified file ID. The file information to be returned: - Name - FileInfo - Type ...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Invoke-B2ItemDownload.ps1
Invoke-B2ItemDownload.ps1
function Invoke-B2ItemDownload { <# .SYNOPSIS The Invoke-B2ItemDownload cmdlet downloads files by either the file ID or file name. .DESCRIPTION The Invoke-B2ItemDownload cmdlet downloads files by either the file ID or file name. When downloading by the file name the bucket ID the file resides in must...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Get-B2UploadUri.ps1
Get-B2UploadUri.ps1
function Get-B2UploadUri { <# .SYNOPSIS Get-B2UploadUri will get the upload Uri for a given bucket. .DESCRIPTION Get-B2UploadUri will get the upload Uri for a given bucket. An upload Uri and upload authorization token are valid for 24 hours or until the endpoint rejects an upload. ...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/New-B2Bucket.ps1
New-B2Bucket.ps1
function New-B2Bucket { <# .SYNOPSIS New-B2Bucket will create a new private or public bucket and requires a globally unique name. .DESCRIPTION New-B2Bucket will create a new private or public bucket and requires a globally unique name. An API key is required to use this cmdlet. .EXAMPLE N...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Get-B2ItemVersion.ps1
Get-B2ItemVersion.ps1
function Get-B2ItemVersion { <# .SYNOPSIS The Get-B2ItemVersion cmdlet retirives file version info. .DESCRIPTION The Get-B2ItemVersion cmdlet retirives file version info. Bucket information required for this cmdlet can be retirived with Get-B2Bucket. An API key is required to use this cmdl...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Get-B2ChildItem.ps1
Get-B2ChildItem.ps1
function Get-B2ChildItem { <# .SYNOPSIS The Get-B2ChildItem cmdlet will return a list of items in a bucket and associated file properties. .DESCRIPTION The Get-B2ChildItem cmdlet will return a list of items in a bucket and associated file properties. The file information to be returned: ...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Set-B2Bucket.ps1
Set-B2Bucket.ps1
function Set-B2Bucket { <# .SYNOPSIS Set-B2Bucket allows you to change the bucket type. .DESCRIPTION Set-B2Bucket allows you to change the bucket type. An API key is required to use this cmdlet. .EXAMPLE Set-B2Bucket -BucketID 4a48fe8875c6214145260818 -BucketType allPublic Buck...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Remove-B2ItemVersion.ps1
Remove-B2ItemVersion.ps1
function Remove-B2ItemVersion { <# .SYNOPSIS Remove-B2ItemVersion will remove the version of a given file. If the file only has one version the file will be deleted. .DESCRIPTION Remove-B2ItemVersion will remove the version of a given file. If the file only has one version the file will be delet...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Invoke-B2ItemUpload.ps1
Invoke-B2ItemUpload.ps1
function Invoke-B2ItemUpload { <# .SYNOPSIS The Invoke-B2ItemUpload cmdlet uploads files to a specified bucket. .DESCRIPTION The Invoke-B2ItemUpload cmdlet uploads files to a specified bucket. When uploading a file keep in mind that: - It must not exceed 5 billion bytes or 4.6 GB - It...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Public/Hide-B2Item.ps1
Hide-B2Item.ps1
function Hide-B2Item { <# .SYNOPSIS Hide-B2Item will mark a file name as hidden. .DESCRIPTION Hide-B2Item will mark a file name as hidden. Hides a file so that downloading by name will not find the file, but previous versions of the file are still stored. An API key is required ...
PowerShellCorpus/PowerShellGallery/PS.B2/1.0.1/Script/Set-OutputTypes.ps1
Set-OutputTypes.ps1
if(-not $(Get-TypeData -TypeName 'PS.B2.*')) { #Used to import the mime type finder in Invoke-B2ItemUpload Add-Type -AssemblyName System.Web #Adds account OutputType $account = @{ MemberType = 'NoteProperty' TypeName = 'PS.B2.Account' Value = $null } Update-...
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.Windows/1.0.0.8/Unzip-Item.ps1
Unzip-Item.ps1
function Unzip-Item { [CmdletBinding()] Param ( # The full source-filepath of the file that should be unzipped [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [Alias('Fullname')] $SourcePath, # The full Destionation...
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.Windows/1.0.0.8/Write-IStreamToFile.ps1
Write-IStreamToFile.ps1
function Write-IStreamToFile([__ComObject] $istream, [string] $fileName) { # NOTE: We cannot use [System.Runtime.InteropServices.ComTypes.IStream], # since PowerShell apparently cannot convert an IStream COM object to this # Powershell type. (See http://stackoverflow.com/a/9037299/223837 for # details.) # I...
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.Windows/1.0.0.8/New-ISOFileFromFolder.ps1
New-ISOFileFromFolder.ps1
Function New-ISOFileFromFolder{ <# .SYNOPSIS Creates an ISO file from a filepath #> param( [Parameter(Mandatory=$true)] [String]$FilePath, [Parameter(Mandatory=$true)] [String]$Name, [Parameter(Mandatory=$true)] [String]$ResultFullFi...
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.Windows/1.0.0.8/Create-FolderIfNotExist.ps1
Create-FolderIfNotExist.ps1
function Create-FolderIfNotExist { [CmdletBinding()] param ( [String]$MyFolder ) if ( -Not (Test-Path $MyFolder)) { New-Item $MyFolder -type directory } }
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.Windows/1.0.0.8/Create-ZipFileFromPipedItems.ps1
Create-ZipFileFromPipedItems.ps1
#still some work to do - doesn't work that well .. #source: http://www.technologytoolbox.com/blog/jjameson/archive/2012/02/28/zip-a-folder-using-powershell.aspx function Create-ZipFileFromPipedItems { param([string]$zipfilename) if(test-path($zipfilename)) { get-item $zipfilename | remove-item } ...
PowerShellCorpus/PowerShellGallery/TfsCmdlets/1.0.0.894/Startup.ps1
Startup.ps1
$binDir = (Join-Path $PSScriptRoot 'lib') $assemblyList = '' foreach($a in Get-ChildItem $binDir) { $assemblyList += "{""$($a.BaseName)"", @""$($a.FullName)""},`r`n" } if (-not ([System.Management.Automation.PSTypeName]'TfsCmdlets.AssemblyResolver').Type) { Add-Type -ErrorAction SilentlyContinue -L...
PowerShellCorpus/PowerShellGallery/TfsCmdlets/1.0.0.894/chocolateyInstall.ps1
chocolateyInstall.ps1
$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"...
PowerShellCorpus/PowerShellGallery/TfsCmdlets/1.0.0.894/chocolateyUninstall.ps1
chocolateyUninstall.ps1
$InstallPath = Join-Path $($env:ChocolateyInstall) 'lib\TfsCmdlets' $ToolsDir = Join-Path $InstallPath 'Tools' if ($env:PSModulePath -like "*$ToolsDir*") { Write-Output "TfsCmdlets: Removing installation directory from PSModulePath environment variable" $NewModulePath = $Env:PSModulePath.Replace($ToolsDi...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/New-JiraIssue.ps1
New-JiraIssue.ps1
function New-JiraIssue { <# .Synopsis Creates an issue in JIRA .DESCRIPTION This function creates a new issue in JIRA. Creating an issue requires a lot of data, and the exact data may be different from one instance of JIRA to the next. To identify what data is required f...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Remove-JiraGroupMember.ps1
Remove-JiraGroupMember.ps1
function Remove-JiraGroupMember { <# .Synopsis Removes a user from a JIRA group .DESCRIPTION This function removes a JIRA user from a JIRA group. .EXAMPLE Remove-JiraGroupMember -Group testUsers -User jsmith This example removes the user jsmith from the group testUsers. ....
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Get-JiraField.ps1
Get-JiraField.ps1
function Get-JiraField { <# .Synopsis This function returns information about JIRA fields .DESCRIPTION This function provides information about JIRA fields, or about one field in particular. This is a good way to identify a field's ID by its name, or vice versa. Typically, this inform...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Get-JiraGroup.ps1
Get-JiraGroup.ps1
function Get-JiraGroup { <# .Synopsis Returns a group from Jira .DESCRIPTION This function returns information regarding a specified group from JIRA. By default, this function does not display members of the group. This is JIRA's default behavior as well. To display group memb...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Get-JiraComponent.ps1
Get-JiraComponent.ps1
function Get-JiraComponent { <# .Synopsis Returns a Component from Jira .DESCRIPTION This function returns information regarding a specified component from Jira. If -InputObject is given via parameter or pipe all components for the given project are returned. It is not pos...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Remove-JiraSession.ps1
Remove-JiraSession.ps1
function Remove-JiraSession { <# .Synopsis Removes a persistent JIRA authenticated session .DESCRIPTION This function removes a persistent JIRA authenticated session and closes the session for JIRA. This can be used to "log out" of JIRA once work is complete. If called with the ...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Remove-JiraGroup.ps1
Remove-JiraGroup.ps1
function Remove-JiraGroup { <# .Synopsis Removes an existing group from JIRA .DESCRIPTION This function removes an existing group from JIRA. Deleting a group does not delete users from JIRA. .EXAMPLE Remove-JiraGroup -GroupName testGroup Removes the JIRA group testGro...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Get-JiraIssueType.ps1
Get-JiraIssueType.ps1
function Get-JiraIssueType { [CmdletBinding()] param( # The Issue Type name or ID to search [Parameter(Mandatory = $false, Position = 0, ValueFromRemainingArguments = $true)] [String[]] $IssueType, # Credentials to use to connect to Jira ...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/New-JiraGroup.ps1
New-JiraGroup.ps1
function New-JiraGroup { <# .Synopsis Creates a new group in JIRA .DESCRIPTION This function creates a new group in JIRA. .EXAMPLE New-JiraGroup -GroupName testGroup This example creates a new JIRA group named testGroup. .INPUTS This function does not accept pipeli...
PowerShellCorpus/PowerShellGallery/PSJira/1.2.5.251/Public/Get-JiraIssueComment.ps1
Get-JiraIssueComment.ps1
function Get-JiraIssueComment { <# .Synopsis Returns comments on an issue in JIRA. .DESCRIPTION This function obtains comments from existing issues in JIRA. .EXAMPLE Get-JiraIssueComment -Key TEST-001 This example returns all comments posted to issue TEST-001. .EXAMPLE ...