full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationComputeResourceResourcePool.ps1
Get-vRAReservationComputeResourceResourcePool.ps1
function Get-vRAReservationComputeResourceResourcePool { <# .SYNOPSIS Get available resource pools for a compute resource .DESCRIPTION Get available resource pools for a compute resource .PARAMETER Type The reservation type .PARAMETER ComputeResourceId The id of the compute resour...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Remove-vRAReservationPolicy.ps1
Remove-vRAReservationPolicy.ps1
function Remove-vRAReservationPolicy { <# .SYNOPSIS Remove a vRA Reservation Policy .DESCRIPTION Remove a vRA Reservation Policy .PARAMETER Id Reservation Policy ID .PARAMETER Name Reservation Policy Name .INPUTS System.String. .OUTPUTS None .EXAMPLE ...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Remove-vRAReservationNetwork.ps1
Remove-vRAReservationNetwork.ps1
function Remove-vRAReservationNetwork { <# .SYNOPSIS Remove a network from a reservation .DESCRIPTION Remove a network from a reservation .PARAMETER Id The id of the reservation .PARAMETER NetworkPath The network path .INPUTS System.String .EXAMPLE Get-vRARes...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationComputeResource.ps1
Get-vRAReservationComputeResource.ps1
function Get-vRAReservationComputeResource { <# .SYNOPSIS Get a compute resource for a reservation type .DESCRIPTION Get a compute resource for a reservation type .PARAMETER Type The resource type .PARAMETER Id The id of the compute resource .PARAMETER Name The name o...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationComputeResourceStorage.ps1
Get-vRAReservationComputeResourceStorage.ps1
function Get-vRAReservationComputeResourceStorage { <# .SYNOPSIS Get available storage for a compute resource .DESCRIPTION Get available storage for a compute resource .PARAMETER Type The reservation type .PARAMETER ComputeResourceId The id of the compute resource .PA...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Set-vRAReservation.ps1
Set-vRAReservation.ps1
function Set-vRAReservation { <# .SYNOPSIS Set a vRA reservation .DESCRIPTION Set a vRA reservation .PARAMETER Id The Id of the reservation .PARAMETER Name The name of the reservation .PARAMETER ReservationPolicy The reservation policy that will be associated with the reserva...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservation.ps1
Get-vRAReservation.ps1
function Get-vRAReservation { <# .SYNOPSIS Get a reservation .DESCRIPTION Get a reservation .PARAMETER Id The id of the reservation .PARAMETER Name The name of the reservation .PARAMETER Limit The number of entries returned per page from the API. This has a default va...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Set-vRAReservationStorage.ps1
Set-vRAReservationStorage.ps1
function Set-vRAReservationStorage { <# .SYNOPSIS Set vRA reservation storage properties .DESCRIPTION Set vRA reservation storage properties .PARAMETER Id The Id of the reservation .PARAMETER Path The storage path .PARAMETER ReservedSizeGB The size in GB of this reservati...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Set-vRAReservationPolicy.ps1
Set-vRAReservationPolicy.ps1
function Set-vRAReservationPolicy { <# .SYNOPSIS Update a vRA Reservation Policy .DESCRIPTION Update a vRA Reservation Policy .PARAMETER Id Reservation Policy Id .PARAMETER Name Reservation Policy Name .PARAMETER NewName Reservation Policy NewName .PARAMETER ...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Remove-vRAStorageReservationPolicy.ps1
Remove-vRAStorageReservationPolicy.ps1
function Remove-vRAStorageReservationPolicy { <# .SYNOPSIS Remove a vRA Storage Reservation Policy .DESCRIPTION Remove a vRA Storage Reservation Policy .PARAMETER Id Storage Reservation Policy ID .PARAMETER Name Storage Reservation Policy Name .INPUTS System.String. ...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Add-vRAReservationStorage.ps1
Add-vRAReservationStorage.ps1
function Add-vRAReservationStorage { <# .SYNOPSIS Add storage to an existing vRA reservation .DESCRIPTION This cmdlet enables the user to add new storage to a reservation. Only one new storage path can be added at a time. If a duplicate storage path is detected, the API will throw an error. .P...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationTemplate.ps1
Get-vRAReservationTemplate.ps1
function Get-vRAReservationTemplate { <# .SYNOPSIS Get a reservation json template .DESCRIPTION Get a reservation json template. This template can then be used to create a new reservation with the same properties .PARAMETER Id The id of the reservation .PARAMETER OutFile T...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Remove-vRAReservation.ps1
Remove-vRAReservation.ps1
function Remove-vRAReservation { <# .SYNOPSIS Remove a reservation .DESCRIPTION Remove a reservation .PARAMETER Id The id of the reservation .PARAMETER Name The name of the reservation .INPUTS System.String .EXAMPLE Remove-vRAReservation -Name Reservation1 ...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAStorageReservationPolicy.ps1
Get-vRAStorageReservationPolicy.ps1
function Get-vRAStorageReservationPolicy { <# .SYNOPSIS Retrieve vRA Storage Reservation Policies .DESCRIPTION Retrieve vRA Storage Reservation Policies .PARAMETER Id Specify the ID of a Storage Reservation Policy .PARAMETER Name Specify the Name of a Storage Reservation Polic...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/New-vRAReservation.ps1
New-vRAReservation.ps1
function New-vRAReservation { <# .SYNOPSIS Create a new reservation .DESCRIPTION Create a new reservation .PARAMETER Type The reservation type .PARAMETER Name The name of the reservation .PARAMETER Tenant The tenant that will own the reservation .PARAMETER BusinessGroup ...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationPolicy.ps1
Get-vRAReservationPolicy.ps1
function Get-vRAReservationPolicy { <# .SYNOPSIS Retrieve vRA Reservation Policies .DESCRIPTION Retrieve vRA Reservation Policies .PARAMETER Id Specify the ID of a Reservation Policy .PARAMETER Name Specify the Name of a Reservation Policy .PARAMETER Limit The number ...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationType.ps1
Get-vRAReservationType.ps1
function Get-vRAReservationType { <# .SYNOPSIS Get supported reservation types .DESCRIPTION Get supported reservation types .PARAMETER Id The id of the reservation type .PARAMETER Name The name of the reservation type .PARAMETER Limit The number of entries returned pe...
PowerShellCorpus/PowerShellGallery/PowervRA/2.2.0/Functions/Public/reservation-service/Get-vRAReservationComputeResourceNetwork.ps1
Get-vRAReservationComputeResourceNetwork.ps1
function Get-vRAReservationComputeResourceNetwork { <# .SYNOPSIS Get available networks for a compute resource .DESCRIPTION Get available network for a compute resource .PARAMETER Type The reservation type .PARAMETER ComputeResourceId The id of the compute resource .PARAM...
PowerShellCorpus/PowerShellGallery/posh-plantuml-urls/0.2/Tests/Tests.ps1
Tests.ps1
# Remove/reload, to ensure that there isn't an existing module of the same name loaded. Remove-Module Posh-Plantuml-Urls -Force Import-Module $PSScriptRoot\..\Posh-Plantuml-Urls.psm1 -Force InModuleScope posh-plantuml-urls { Describe 'ConvertTo-EncodedPlantUml' { # Sample text should be encoded usi...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Examples/Sample_AuditPolicyOption.ps1
Sample_AuditPolicyOption.ps1
<# This example will enable Base Directory auditing on the localhost. To use this example, run it using PowerShell. #> Configuration Sample_AuditOption { param ( [String] $NodeName = 'localhost' ) Import-DscResource -ModuleName AuditPolicyDsc Node $NodeName ...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Examples/Sample_AuditPolicySubcategory.ps1
Sample_AuditPolicySubcategory.ps1
<# This example will set the Logon Success and Failure flags on the localhost. To use this example, run it using PowerShell. #> Configuration Sample_AuditSubcategory { param ( [String] $NodeName = 'localhost' ) Import-DscResource -ModuleName AuditPolicyDsc Node...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Examples/Sample_AuditPolicyCsv.ps1
Sample_AuditPolicyCsv.ps1
<# This example will apply the audit policy settings in the CSV located at C:\data\AuditPolBackup.csv to the localhost. To use this example, run it using PowerShell. #> Configuration Sample_AuditPolicyCsv { param ( [String] $NodeName = 'localhost' ) Import-DscRe...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Unit/MSFT_AuditPolicySubcategory.tests.ps1
MSFT_AuditPolicySubcategory.tests.ps1
$script:DSCModuleName = 'AuditPolicyDsc' $script:DSCResourceName = 'MSFT_AuditPolicySubcategory' #region HEADER [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DS...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Unit/MSFT_AuditPolicyOption.tests.ps1
MSFT_AuditPolicyOption.tests.ps1
$script:DSCModuleName = 'AuditPolicyDsc' $script:DSCResourceName = 'MSFT_AuditPolicyOption' #region HEADER [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCReso...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Unit/MSFT_AuditPolicyCsv.tests.ps1
MSFT_AuditPolicyCsv.tests.ps1
$script:DSCModuleName = 'AuditPolicyDsc' $script:DSCResourceName = 'MSFT_AuditPolicyCsv' #region HEADER [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResourc...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/MSFT_AuditPolicyCsv.integration.tests.ps1
MSFT_AuditPolicyCsv.integration.tests.ps1
$script:DSCModuleName = 'AuditPolicyDsc' $script:DSCResourceName = 'MSFT_AuditPolicyCsv' #region HEADER # Integration Test Template Version: 1.1.1 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPa...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/MSFT_AuditPolicyCsv.config.ps1
MSFT_AuditPolicyCsv.config.ps1
configuration 'MSFT_AuditPolicyCsv_config' { param ( [Parameter(Mandatory = $true)] [System.String] $CsvPath ) Import-DscResource -ModuleName 'AuditPolicyDsc' node localhost { AuditPolicyCsv Integration_Test { IsSingleInst...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/MSFT_AuditPolicySubcategory.config.ps1
MSFT_AuditPolicySubcategory.config.ps1
configuration 'MSFT_AuditPolicySubcategory_Config' { param ( [Parameter(Mandatory = $true)] [System.String] $Name, [Parameter(Mandatory = $true)] [System.String] $AuditFlag, [Parameter(Mandatory = $true)] [System.String] ...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/MSFT_AuditPolicySubcategory.Integration.tests.ps1
MSFT_AuditPolicySubcategory.Integration.tests.ps1
$script:DSCModuleName = 'AuditPolicyDsc' $script:DSCResourceName = 'MSFT_AuditPolicySubcategory' #region HEADER # Integration Test Template Version: 1.1.1 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot ...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/MSFT_AuditPolicyOption.config.ps1
MSFT_AuditPolicyOption.config.ps1
configuration 'MSFT_AuditPolicyOption_config' { param ( [Parameter(Mandatory = $true)] [System.String] $OptionName, [Parameter(Mandatory = $true)] [System.String] $OptionValue ) Import-DscResource -ModuleName 'AuditPolicyDsc' ...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/MSFT_AuditPolicyOption.Integration.tests.ps1
MSFT_AuditPolicyOption.Integration.tests.ps1
$script:DSCModuleName = 'AuditPolicyDsc' $script:DSCResourceName = 'MSFT_AuditPolicyOption' #region HEADER # Integration Test Template Version: 1.1.1 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -Chil...
PowerShellCorpus/PowerShellGallery/AuditPolicyDsc/1.1.0.0/Tests/Integration/AuditPolicyResourceHelper.Integration.Tests.ps1
AuditPolicyResourceHelper.Integration.Tests.ps1
#requires -RunAsAdministrator # Get the root path of the resourse [String] $script:moduleRoot = Split-Path -Parent ( Split-Path -Parent $PSScriptRoot ) Import-Module -Name (Join-Path -Path $moduleRoot ` -ChildPath 'DSCResources\AuditPolicyResourceHelper\AuditPolicyResourceHelper.p...
PowerShellCorpus/PowerShellGallery/GetSQL/1.0.0.4/Excel.tests.ps1
Excel.tests.ps1
$sessionName = "XL" $xlconn = ".\dbtest.xlsx " $tableName = "[TestData$]" $ArbitrarySQL = "SELECT * from $tableName" $fieldname1 = "Extension" $fieldname2 = "Length" Describe "Connect to and query Excel Spreadsheet " { BeforeAll {$session = Get-SQL -Excel -Connecti...
PowerShellCorpus/PowerShellGallery/GetSQL/1.0.0.4/ArgumentCompleters.ps1
ArgumentCompleters.ps1
Function SQLDBSourceCompletion { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) (Get-Item 'HKCU:\software\ODBC\ODBC.INI\ODBC Data Sources').property | where {$_ -notmatch " Files$" -and $_ -like "$wordToComplete*" } | Sort-Object | ForEach-Object { ...
PowerShellCorpus/PowerShellGallery/GetSQL/1.0.0.4/Get-SQL.ps1
Get-SQL.ps1
if (-not $Global:DbSessions ) { $Global:DbSessions = @{} } Function Get-SQL { <# .Synopsis Queries an ODBC or SQL Server database .Description Get-SQL queries SQL databases using either ODBC or the native SQL-Server client. Connections to databases are kept open and reused to ...
PowerShellCorpus/PowerShellGallery/GetSQL/1.0.0.4/Access.tests.ps1
Access.tests.ps1
$sessionName = "ACCESS" $ACCconn = ".\Database1.accdb" $tableName = "TestData" $ArbitrarySQL = "SELECT * from $tableName" $fieldname1 = "Extension" $fieldname2 = "Length" Describe "Connect to and query Access Database " { BeforeAll {$session = Get-SQL -Access -Conn...
PowerShellCorpus/PowerShellGallery/GetSQL/1.0.0.4/sqlServer.tests.ps1
sqlServer.tests.ps1
$tableName = "CallType" $fieldName1 = "CallType" #Must be a name used to test wild card $fieldName2 = "CallTypeId" #Test for values 2,3,4 $dbName = "LcsCDR" $sessionName = "LcsCDR" $sqlconn = "bp1xeucc023" $End = [datetime]::Now ; $Start = $End.AddHours(-1) $Arbi...
PowerShellCorpus/PowerShellGallery/GitLabProvider/1.3.4/HelperFunctions.ps1
HelperFunctions.ps1
function Dump-InstalledPackages { param($InstalledPackages) $InstalledPackages | ConvertTo-Json | Out-File $script:InstalledPackagesPath -Force } function Dump-RegisteredPackageSources { $script:RegisteredPackageSources | Select * -ExcludeProperty Headers | ConvertTo-Json | Out-File $script:RegisteredPack...
PowerShellCorpus/PowerShellGallery/GitLabProvider/1.3.4/PackageProviderFunctions.ps1
PackageProviderFunctions.ps1
### # ==++== # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
PowerShellCorpus/PowerShellGallery/zaicadmintools/1.0.5/Public/ShowCalendar/Show-Calendar.ps1
Show-Calendar.ps1
<# .Synopsis Displays a visual repedreswentation of a calendar.. .Description Displays a visual representation of a cqwealendar. This function supports multiple months and lets you hightylight specific date ranges or days. .Parameter Start The first month to display. .Parameter End The last month to d...
PowerShellCorpus/PowerShellGallery/pspostman/1.0.29/PSPostMan.Tests.ps1
PSPostMan.Tests.ps1
#region import modules $ThisModule = "$($MyInvocation.MyCommand.Path -replace '\.Tests\.ps1$', '').psd1" $ThisModuleName = (($ThisModule | Split-Path -Leaf) -replace '\.psd1') Get-Module -Name $ThisModuleName -All | Remove-Module -Force Import-Module -Name $ThisModule -Force -ErrorAction Stop #endregion describe 'Mod...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Write-Log.ps1
Write-Log.ps1
function Write-Log { # write a message to the global log file [cmdletbinding()] param( [ValidateNotNullOrEmpty()] [string] $Message, [ValidateSet('Warning','Error','Verbose','Debug', 'Information')] [string] $Type = 'Information', [Parameter(Mandatory)] ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Register-AutoCompleter.ps1
Register-AutoCompleter.ps1
function Register-AutoCompleter { function StorageType { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $ARM = ((invoke-webrequest -Uri $function:TemplateUrl -UseBasicParsing).Content)|ConvertFrom-Json $ARM.Parameters.StorageType.AvailableValues|?{$_ -like "...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Connect-O365.ps1
Connect-O365.ps1
function Connect-O365 { [cmdletbinding()] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [pscredential] $Credential ) try{ $i= 0 $session365 = $null while($session365 -eq $null -and ((get-command get-unifiedgroup -ErrorAction Ignore) -eq $null)){ $i++ write-log -message "Attempt...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/ConvertFrom-O365.ps1
ConvertFrom-O365.ps1
function ConvertFrom-O365 { [cmdletbinding()] [outputtype([psobject[]])] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [Array] $Users, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Path ) begin{ $CSVArray = @() } process { try{ foreach($User in $Users){ ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-0365License.ps1
Get-0365License.ps1
function Get-O365License { [cmdletbinding()] [OutputType([HashTable])] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$TenantId ) $Licenses = @{}; $Usage = (Get-AzureADUser -All $true).AssignedLicenses|group -Property SkuId (Get-AzureADSubscribedSku).foreach{ $License = Ne...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Read-Choice.ps1
Read-Choice.ps1
Function Read-Choice { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Message, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Title, [Parameter(Mandatory=$true)] [ValidateNotN...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Invoke-Operation.ps1
Invoke-Operation.ps1
function Invoke-Operation { [cmdletbinding()] param( [switch] $Wait, [scriptblock] $Code ={}, [hashtable] $Parameters, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [hashtable] $SyncHash, [Parameter(Mandatory=$true)] [ValidateNo...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-XAML.ps1
Get-XAML.ps1
function Get-XAML { [OutputType([hashtable])] [cmdletbinding()] $xaml = @{ GUI = @" <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blen...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/ConvertTo-O365.ps1
ConvertTo-O365.ps1
function ConvertTo-O365{ [cmdletbinding()] param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Path, [Parameter()] [ValidateNotNullOrEmpty()] [string] $Separator = "`t", [Parameter(Mandatory=$true)] [hashtable] $Licenses ) try{ $Inventory = new-object -TypeName psobject -...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/New-SWRandomPassword.ps1
New-SWRandomPassword.ps1
function New-SWRandomPassword { <# .Synopsis Generates one or more complex passwords designed to fulfill the requirements for Active Directory .DESCRIPTION Generates one or more complex passwords designed to fulfill the requirements for Active Directory .EXAMPLE New-SWRandomPassword C&3SX6Kn Will ge...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Initialize-O365OneDrive.ps1
Initialize-O365OneDrive.ps1
function Initialize-O365OneDrive { [cmdletbinding()] param( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string[]] $Users, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [Valid...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/New-CSPAdmin.ps1
New-CSPAdmin.ps1
function New-CSPAdmin { [CmdletBinding()] [OutputType([pscredential])] param( [Parameter()] [ValidateNotNullOrEmpty()] [string] $AccountName = "CSPAdmin", [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $DomainName ) try{ ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Set-ModuleVariable.ps1
Set-ModuleVariable.ps1
Function Set-ModuleVariable { [cmdletbinding()] param() $Config = Get-Content "$global:Root\config.json"|ConvertFrom-Json foreach($Property in ($Config.config|gm -MemberType NoteProperty).Name){ $null = New-Variable -Scope Global -Name $Property -Value $($Config.config.$Property) -Force ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-JobVariable.ps1
Get-JobVariable.ps1
function Get-JobVariable { [cmdletbinding()] param( [Parameter()] [ValidateNotNullOrEmpty()] [string] $Id ) if((Get-Variable -Name SMBInstances -Scope Global -ErrorAction SilentlyContinue) -eq $null){ $global:SMBInstances = [hashtable]::Synchronized(@{}) ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Connect-Cloud.ps1
Connect-Cloud.ps1
function Connect-Cloud { [cmdletbinding()] param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [pscredential] $credential, [parameter()] [ValidateNotNull()] [string] $TenantId ) begin{} process{ if($TenantId){ ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Test-ModuleVersion.ps1
Test-ModuleVersion.ps1
function Test-ModuleVersion { [cmdletbinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $ModuleName ) try{ write-log -message "Checking if your $ModuleName module is up to date..." if(($CurrentModule = (Get-Module -Name $...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/New-O365Group.ps1
New-O365Group.ps1
function New-O365Group { param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string]$GroupName, [Parameter(Mandatory=$false)] [ValidateSet('office','security')] [string] $Type = 'security', ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-Tenant.ps1
Get-Tenant.ps1
function Get-Tenant { [cmdletbinding()] param( [Parameter()] [string] $TenantDomain, [Parameter()] [string] $TenantId, [Parameter()] [switch] $All ) begin { $Tenants = New-Object System.Collections.ArrayList $Tenant = $null ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Enable-O365ATP.ps1
Enable-O365ATP.ps1
Function Enable-O365ATP { [cmdletbinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $MailDomain ) begin{ $SafeLinkPolicyName = "$MailDomain Default SafeLink Policy" $SafeLinkRuleName = "$MailDomain Default SafeLink Rule" ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Register-Classes.ps1
Register-Classes.ps1
function Register-Classes { [CmdletBinding()] param() Add-Type -typedefinition @" using System; using System.Collections.Generic; using System.Linq; using System.Text; public enum TenantType { Office = 0, Azure = 1, All = 2 } public class License { ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Invoke-Message.ps1
Invoke-Message.ps1
function Invoke-Message { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Message ) Write-Log -Message $Message $null = Add-Type -AssemblyName System.Windows.Fo...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Start-Log.ps1
Start-Log.ps1
function Start-Log{ [OutputType([string])] [CmdletBinding()] param( [Parameter()] [ValidateNotNullOrEmpty()] [string] $LogName = "SMBBlueprint_$(([guid]::newguid().guid)).log", [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $InstanceId ) # recreates the log file and sets the scri...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/New-AzureServicePrincipal.ps1
New-AzureServicePrincipal.ps1
Function New-AzureServicePrincipal { [cmdletbinding()] [outputtype([string])] Param ( # Use to set scope to resource group. If no value is provided, scope is set to subscription. [Parameter(Mandatory=$false)] [String] $ResourceGroup, # Use to set subscription. If no value is provided, default subscri...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Test-AADPasswordComplexity.ps1
Test-AADPasswordComplexity.ps1
Function Test-AADPasswordComplexity { [outputtype([string])] [cmdletbinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string]$Password, [Parameter()] [ValidateNotNullOrEmpty()] [int]$MinimumLength = 8 ) begin{ ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/New-O365User.ps1
New-O365User.ps1
function New-O365User { param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string]$Username, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNul...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-Country.ps1
Get-Country.ps1
function Get-Country { [cmdletbinding()] param( ) $Hash = [ordered]@{ AD='Andorra' AE='United Arab Emirates' AF='Afghanistan' AG='Antigua and Barbuda' AI='Anguilla' AL='Albania' AM='Armenia' AO='Angola' AQ='An...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Add-O365UserToGroup.ps1
Add-O365UserToGroup.ps1
function Add-O365UserToGroup { param( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [ValidateNotNullOrEmpty()] [string]$Username, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true)] [string]$groupname, [ValidateSet('office','security')] [string] $Type =...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-AzureRMResourceLocation.ps1
Get-AzureRMResourceLocation.ps1
function Get-AzureRMResourceLocation { [cmdletbinding()] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Location, [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Resource ) begin{ $RegionMap ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Get-O365OneDrive.ps1
Get-O365OneDrive.ps1
function Get-O365OneDrive { [CmdletBinding()] param( [Parameter()] [ValidateNotNullOrEmpty()] [pscredential] $Credential = (Get-Credential -Message "Enter your Tenant Account credentials"), [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/private/Test-AzureResourceLocation.ps1
Test-AzureResourceLocation.ps1
function Test-AzureResourceLocation { [OutputType([System.Collections.ArrayList])] [CmdletBinding(DefaultParameterSetName="Type")] param( [Parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Location, [Parameter(Mandatory=$true,ParameterSetName="Type")] ...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/public/Start-SMBDeploymentGUI.ps1
Start-SMBDeploymentGUI.ps1
Function Start-SMBDeploymentGUI { [CmdletBinding()] param( [Parameter()] [switch] $NoUpdateCheck ) $SyncHash = Get-JobVariable $Log = Start-Log -InstanceId $SyncHash.InstanceId $SyncHash.Log = $Log # Set Module Version $SyncHash.ModuleVersion = (Get-Module -Name...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/public/New-SMBOfficeDeployment.ps1
New-SMBOfficeDeployment.ps1
function New-SMBOfficeDeployment { [cmdletbinding(DefaultParameterSetName="TenantId")] [OutputType([psobject])] param( [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()] # The location of the input CSV file. [String] $CSV, [parameter(ParameterSetName="TenantId",Mandatory=$true)] [ValidateNotNul...
PowerShellCorpus/PowerShellGallery/SMBBlueprint/8.2.0.3/functions/public/New-SMBAzureDeployment.ps1
New-SMBAzureDeployment.ps1
function New-SMBAzureDeployment { [cmdletbinding(DefaultParameterSetName = "AzureTenantDomain")] param( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $Location, [Parameter(Mandatory = $false)] [ValidateNotNullOrEmpty()] [string] $Autom...
PowerShellCorpus/PowerShellGallery/Windows2008PFXImport/1.0/Windows2008PFXImport.Tests.ps1
Windows2008PFXImport.Tests.ps1
Import-Module $PSScriptRoot\Windows2008PFXImport.psm1 -Force Describe 'Windows2008PFXImport' { Context 'Script Analyzer' { It 'Does not have any issues with the Script Analyser - Import-PfxCertificate' { Invoke-ScriptAnalyzer $PSScriptRoot\Functions\Import-PfxCertificate.ps1 | Should be $null ...
PowerShellCorpus/PowerShellGallery/Windows2008PFXImport/1.0/functions/Import-PfxCertificate.ps1
Import-PfxCertificate.ps1
<# .SYNOPSIS Imports certificates and private keys from a Personal Information Exchange (PFX) file to the destination store. This is a port of the code for Windows 2008. Idea from: https://social.technet.microsoft.com/Forums/windowsserver/en-US/e3de0bdc-e6a0-4906-83a1-75278cbcdff3/importpfxcert...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Remove-VaultEntry.ps1
Remove-VaultEntry.ps1
<# .SYNOPSIS Removes an existing entry in the Windows Credential Manager vault. .DESCRIPTION This cmdlet uses the native unmanaged Win32 api to remove a existing entry in the Windows Credential Manager vault. .INPUTS None. .OUTPUTS None. .EXAMPLE PS C:\> Get-VaultEntry -...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Invoke-Elevated.ps1
Invoke-Elevated.ps1
<# .SYNOPSIS Runs the specified command in an elevated context. .DESCRIPTION Runs the specified command in an elevated context. This is useful on Windows systems where the user account control is enabled. Input object and result objects are serialized using XML. It's important, the command...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Get-SecurityAuditPolicy.ps1
Get-SecurityAuditPolicy.ps1
<# .SYNOPSIS List the current audit policy setting on the local system. .DESCRIPTION This command uses the auditpol.exe command to get the current audit policy setting for the local system and parses the output into a custom object. .INPUTS None. .OUTPUTS SecurityFever.AuditPolic...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/New-VaultEntry.ps1
New-VaultEntry.ps1
<# .SYNOPSIS Create a new entry in the Windows Credential Manager vault. .DESCRIPTION This cmdlet uses the native unmanaged Win32 api to create a new entry in the Windows Credential Manager vault. The credential type and persist location can be specified. By default, a generic entry with no sp...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Get-VaultEntryCredential.ps1
Get-VaultEntryCredential.ps1
<# .SYNOPSIS Get the PSCredential objects from the Windows Credential Manager vault. .DESCRIPTION This cmdlet uses the native unmanaged Win32 api to retrieve all entries from the Windows Credential Manager vault. The entries are of type PSCredential. To get the full credential entries with all...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Get-VaultEntry.ps1
Get-VaultEntry.ps1
<# .SYNOPSIS Get the credential entries from the Windows Credential Manager vault. .DESCRIPTION This cmdlet uses the native unmanaged Win32 api to retrieve all entries from the Windows Credential Manager vault. The entries are not objects of type PSCredential. The PSCredential is available on ...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Get-SecurityActivity.ps1
Get-SecurityActivity.ps1
<# .SYNOPSIS Show security relevant activities on a system. .DESCRIPTION Show security relevant activities on a system. This includes: - Startup / Shutdown - Awake / Sleep - Logon / Logoff .INPUTS None. .OUTPUTS SecurityFever.ActivityRecord. Array of custom activity recor...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Get-SecurityAuditPolicySetting.ps1
Get-SecurityAuditPolicySetting.ps1
<# .SYNOPSIS Get one audit policy setting on the local system. .DESCRIPTION This command uses the auditpol.exe command to get the current audit policy setting for the local system and parses the output for the target setting. .INPUTS None. .OUTPUTS System.Boolean. Return true if ...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Update-VaultEntry.ps1
Update-VaultEntry.ps1
<# .SYNOPSIS Update an existing entry in the Windows Credential Manager vault. .DESCRIPTION This cmdlet uses the native unmanaged Win32 api to update an existing entry in the Windows Credential Manager vault. Use a entry object or the target name and type combination to identiy the entry to up...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Get-VaultEntrySecureString.ps1
Get-VaultEntrySecureString.ps1
<# .SYNOPSIS Get the secure string objects from the Windows Credential Manager vault. .DESCRIPTION This cmdlet uses the native unmanaged Win32 api to retrieve all entries from the Windows Credential Manager vault. The entries are of type secure string. To get the full credential entries with a...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Functions/Test-Credential.ps1
Test-Credential.ps1
<# .SYNOPSIS Test the provided credentials with the choosen test method against the local system or Active Directory. .DESCRIPTION Test the provided credentials against the local system by starting a simple process or against Active Directory by binding to the root via ADSI. .INPUTS S...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId4634.ps1
Convert-EventLogObjectId4634.ps1
function Convert-EventLogObjectId4634 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) # Definition: Types $typeMap = @{ '2' = 'Interactive' '3' = ...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Invoke-AuditPolGetCategoryAllCsv.ps1
Invoke-AuditPolGetCategoryAllCsv.ps1
function Invoke-AuditPolGetCategoryAllCsv { [CmdletBinding()] param () (auditpol.exe /get /category:* /r) | Where-Object { -not [String]::IsNullOrEmpty($_) } }
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObject.ps1
Convert-EventLogObject.ps1
function Convert-EventLogObject { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) $activity = New-Object -TypeName PSObject -Property @{ ComputerName = $Record.Ma...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId4625.ps1
Convert-EventLogObjectId4625.ps1
function Convert-EventLogObjectId4625 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) # Definition: Types $typeMap = @{ '2' = 'Interactive' '3' = ...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId6008.ps1
Convert-EventLogObjectId6008.ps1
function Convert-EventLogObjectId6008 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) $activity = Convert-EventLogObject -Record $Record -Map $Map try { ...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId42.ps1
Convert-EventLogObjectId42.ps1
function Convert-EventLogObjectId42 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) $activity = Convert-EventLogObject -Record $Record -Map $Map # Grab record prop...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId4624.ps1
Convert-EventLogObjectId4624.ps1
function Convert-EventLogObjectId4624 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) # Definition: Types $typeMap = @{ '2' = 'Interactive' '3' = ...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Test-AdministratorRole.ps1
Test-AdministratorRole.ps1
function Test-AdministratorRole { [CmdletBinding()] param () # Check against the generic administrator role (language neutral). $AdministratorRole = [Security.Principal.WindowsBuiltInRole]::Administrator # Get the current user identity $CurrentWindowsPrincipal = [Security.Principal.WindowsPri...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId4647.ps1
Convert-EventLogObjectId4647.ps1
function Convert-EventLogObjectId4647 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) $activity = Convert-EventLogObject -Record $Record -Map $Map # Grab record pr...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId1074.ps1
Convert-EventLogObjectId1074.ps1
function Convert-EventLogObjectId1074 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) $activity = Convert-EventLogObject -Record $Record -Map $Map # Grab record pr...
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Invoke-AuditPolListSubcategoryAllCsv.ps1
Invoke-AuditPolListSubcategoryAllCsv.ps1
function Invoke-AuditPolListSubcategoryAllCsv { [CmdletBinding()] param () (auditpol.exe /list /subcategory:* /r) | Where-Object { -not [String]::IsNullOrEmpty($_) } }
PowerShellCorpus/PowerShellGallery/SecurityFever/1.1.0/Helpers/Convert-EventLogObjectId1.ps1
Convert-EventLogObjectId1.ps1
function Convert-EventLogObjectId1 { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] $Record, [Parameter(Mandatory = $true)] [System.Collections.Hashtable] $Map ) $activity = Convert-EventLogObject -Record $Record -Map $Map # Grab record prope...
PowerShellCorpus/PowerShellGallery/Traverse/0.6.2/build.ps1
build.ps1
function Resolve-Module { [Cmdletbinding()] param ( [Parameter(Mandatory)] [string[]]$Name ) Process { foreach ($ModuleName in $Name) { $Module = Get-Module -Name $ModuleName -ListAvailable Write-Verbose -Message "Resolving Module $($Modul...