text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163
values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751
values | repo_full_name stringclasses 752
values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```powershell
function Update-LabMemorySettings
{
# Cmdlet is not called on Linux systems
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCmdlets", "")]
[Cmdletbinding()]
Param ()
Write-LogFunctionEntry
$machines = Get-LabVM -All -IncludeLinux | Where-Object SkipDeployment -... | /content/code_sandbox/AutomatedLabCore/internal/functions/Update-LabMemorySettings.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,309 |
```powershell
function Remove-LabAzureWebApp
{
param (
[Parameter(Mandatory, Position = 0, ParameterSetName = 'ByName', ValueFromPipeline, ValueFromPipelineByPropertyName)]
[string[]]$Name,
[Parameter(Mandatory, Position = 1, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[str... | /content/code_sandbox/AutomatedLabCore/internal/functions/Remove-LabAzureWebApp.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 258 |
```powershell
function Remove-LabAzureAppServicePlan
{
param (
[Parameter(Mandatory, Position = 0, ParameterSetName = 'ByName', ValueFromPipeline, ValueFromPipelineByPropertyName)]
[string[]]$Name,
[Parameter(Mandatory, Position = 1, ValueFromPipeline, ValueFromPipelineByPropertyName)]
... | /content/code_sandbox/AutomatedLabCore/internal/functions/Remove-LabAzureAppServicePlan.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 266 |
```powershell
function New-LabADSite
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[string]$ComputerName,
[Parameter(Mandatory)]
[string]$SiteName,
[Parameter(Mandatory)]
[string]$SiteSubnet
)
Write-LogFunctionEntry
$lab = Get-Lab
$mac... | /content/code_sandbox/AutomatedLabCore/internal/functions/New-LabADSite.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 985 |
```powershell
function New-LabAzureCertificate
{
[CmdletBinding()]
param ()
throw New-Object System.NotImplementedException
Write-LogFunctionEntry
Update-LabAzureSettings
$certSubject = "CN=$($Script:lab.Name).cloudapp.net"
$service = Get-LabAzureDefaultResourceGroup
$cert = Get-ChildI... | /content/code_sandbox/AutomatedLabCore/internal/functions/New-LabAzureCertificate.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 358 |
```powershell
function Set-LabBuildWorkerCapability
{
[CmdletBinding()]
param
( )
$buildWorkers = Get-LabVM -Role TfsBuildWorker
if (-not $buildWorkers)
{
return
}
foreach ($machine in $buildWorkers)
{
$role = $machine.Roles | Where-Object Name -eq TfsBuildWorker
... | /content/code_sandbox/AutomatedLabCore/internal/functions/Set-LabBuildWorkerCapability.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 354 |
```powershell
function Install-LabSharePoint
{
[CmdletBinding()]
param
(
[switch]
$CreateCheckPoints
)
Write-LogFunctionEntry
$lab = Get-Lab
if (-not (Get-LabVM))
{
Write-LogFunctionExitWithError -Message 'No machine definitions imported, so there is nothing to... | /content/code_sandbox/AutomatedLabCore/internal/functions/Install-LabSharePoint.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 2,325 |
```powershell
function New-LabSourcesPath
{
[CmdletBinding()]
param
(
[string]
$RelativePath,
[Microsoft.Azure.Storage.File.CloudFileShare]
$Share
)
$container = Split-Path -Path $RelativePath
if (-not $container)
{
New-AzStorageDirectory -Share $Sha... | /content/code_sandbox/AutomatedLabCore/internal/functions/New-LabSourcesPath.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 161 |
```powershell
function Install-LabCAMachine
{
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[AutomatedLab.Machine]$Machine,
[int]$PreDelaySeconds,
[switch]$PassThru
)
Write-LogFunctionEntry
Write-PSFMessage -Message '******************************************... | /content/code_sandbox/AutomatedLabCore/internal/functions/Install-LabCAMachine.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 15,163 |
```powershell
function Get-LabImageOnLinux
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[string]
$MountPoint,
[IO.FileInfo]
$IsoFile
)
$dismPattern = 'Index:\s+(?<Index>\d{1,2})(\r)?\nName:\s+(?<Name>.+)'
$standardImagePath = Join-Path -Path $Mount... | /content/code_sandbox/AutomatedLabCore/internal/functions/Get-LabImageOnLinux.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,674 |
```powershell
function Move-LabDomainController
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[string]$ComputerName,
[Parameter(Mandatory)]
[string]$SiteName
)
Write-LogFunctionEntry
$dcRole = (Get-LabVM -ComputerName $ComputerName).Roles | Where-Object N... | /content/code_sandbox/AutomatedLabCore/internal/functions/Move-LabDomainController.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 521 |
```powershell
function Initialize-GatewayNetwork
{
param
(
[Parameter(Mandatory = $true)]
[AutomatedLab.Lab]
$Lab
)
Write-LogFunctionEntry
Write-PSFMessage -Message ('Creating gateway subnet for lab {0}' -f $Lab.Name)
$targetNetwork = $Lab.VirtualNetworks | Select-Objec... | /content/code_sandbox/AutomatedLabCore/internal/functions/Initialize-GatewayNetwork.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 742 |
```powershell
function Start-ShellHWDetectionService
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCmdlets", "")]
[CmdletBinding()]
param ( )
Write-LogFunctionEntry
$service = Get-Service -Name ShellHWDetection -ErrorAction SilentlyContinue
if (-not $service)
{
... | /content/code_sandbox/AutomatedLabCore/internal/functions/Start-ShellHWDetectionService.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 329 |
```powershell
function Set-VpnDnsForwarders
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$SourceLab,
[Parameter(Mandatory = $true)]
[System.String]
$DestinationLab
)
Import-Lab $SourceLab -NoValidation
$sourceDcs = Get-LabVM -Role DC, Root... | /content/code_sandbox/AutomatedLabCore/internal/functions/Set-VpnDnsForwarders.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 535 |
```powershell
function Reset-DNSConfiguration
{
[CmdletBinding()]
param
(
[string[]]$ComputerName,
[int]$ProgressIndicator,
[switch]$NoNewLine
)
Write-LogFunctionEntry
$machines = Get-LabVM -ComputerName $ComputerName
$jobs = @()
foreach ($machine in $machine... | /content/code_sandbox/AutomatedLabCore/internal/functions/Reset-DNSConfiguration.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 361 |
```powershell
function Remove-LabNetworkSwitches
{
[cmdletBinding()]
param (
[switch]$RemoveExternalSwitches
)
$Script:data = Get-Lab
if (-not $Script:data)
{
Write-Error 'No definitions imported, so there is nothing to do. Please use Import-Lab first'
return
}
... | /content/code_sandbox/AutomatedLabCore/internal/functions/Remove-LabNetworkSwitches.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 451 |
```powershell
function Get-LabImageOnWindows
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[char]
$DriveLetter,
[IO.FileInfo]
$IsoFile
)
$dismPattern = 'Index : (?<Index>\d{1,2})(\r)?\nName : (?<Name>.+)'
$standardImagePath = Get-Item -Path "$DriveL... | /content/code_sandbox/AutomatedLabCore/internal/functions/Get-LabImageOnWindows.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 2,431 |
```powershell
function Install-LabOrchestrator2012
{
[cmdletBinding()]
param ()
Write-LogFunctionEntry
#region prepare setup script
function Install-LabPrivateOrchestratorRole
{
param (
[Parameter(Mandatory)]
[string]$OrchServiceUser,
[Parameter(Man... | /content/code_sandbox/AutomatedLabCore/internal/functions/Install-LabOrchestrator2012.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,478 |
```powershell
function Install-LabFileServers
{
[cmdletBinding()]
param ([switch]$CreateCheckPoints)
Write-LogFunctionEntry
$roleName = [AutomatedLab.Roles]::FileServer
if (-not (Get-LabVM))
{
Write-LogFunctionExitWithError -Message 'No machine definitions imported, so there is n... | /content/code_sandbox/AutomatedLabCore/internal/functions/Install-LabFileServers.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 542 |
```powershell
function Test-LabAzureSubscription
{
[CmdletBinding()]
param ( )
Test-LabHostConnected -Throw -Quiet
try
{
$ctx = Get-AzContext
}
catch
{
throw "No Azure Context found, Please run 'Connect-AzAccount' first"
}
}
``` | /content/code_sandbox/AutomatedLabCore/internal/functions/Test-LabAzureSubscription.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 72 |
```powershell
function Get-LabAzureDefaultSubscription
{
[CmdletBinding()]
param ()
Write-LogFunctionEntry
Update-LabAzureSettings
$script:lab.AzureSettings.DefaultSubscription
Write-LogFunctionExit
}
``` | /content/code_sandbox/AutomatedLabCore/internal/functions/Get-LabAzureDefaultSubscription.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 51 |
```powershell
function Dismount-LabDiskImage
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCmdlets", "")]
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[string]
$ImagePath
)
if (Get-Command -Name Dismount-DiskImage -ErrorAction SilentlyContinue)... | /content/code_sandbox/AutomatedLabCore/internal/functions/Dismount-LabDiskImage.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 159 |
```powershell
function Stop-ShellHWDetectionService
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseCompatibleCmdlets", "")]
[CmdletBinding()]
param ( )
Write-LogFunctionEntry
$service = Get-Service -Name ShellHWDetection -ErrorAction SilentlyContinue
if (-not $service)
{
... | /content/code_sandbox/AutomatedLabCore/internal/functions/Stop-ShellHWDetectionService.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 284 |
```powershell
function New-LabNetworkSwitches
{
[cmdletBinding()]
param ()
Write-LogFunctionEntry
$Script:data = Get-Lab
if (-not $Script:data)
{
Write-Error 'No definitions imported, so there is nothing to do. Please use Import-Lab first'
return
}
$vmwareNetworks = $d... | /content/code_sandbox/AutomatedLabCore/internal/functions/New-LabNetworkSwitches.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 290 |
```powershell
function Update-CMSite
{
[CmdletBinding()]
Param (
[Parameter(Mandatory)]
[String]$CMSiteCode,
[Parameter(Mandatory)]
[String]$CMServerName
)
#region Initialise
$CMServer = Get-LabVM -ComputerName $CMServerName
$CMServerFqdn = $CMServer.FQDN
W... | /content/code_sandbox/AutomatedLabCore/internal/functions/Update-CMSite.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,658 |
```powershell
function Set-VMUacStatus
{
[CmdletBinding()]
param(
[bool]$EnableLUA,
[int]$ConsentPromptBehaviorAdmin,
[int]$ConsentPromptBehaviorUser
)
$currentSettings = Get-VMUacStatus -ComputerName $ComputerName
$uacStatusChanged = $false
$registryPath = 'Software\... | /content/code_sandbox/AutomatedLabCore/internal/functions/Set-VMUacStatus.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 352 |
```powershell
function ValidateUpdate-ConfigurationData
{
param (
[Parameter(Mandatory)]
[hashtable]$ConfigurationData
)
if( -not $ConfigurationData.ContainsKey('AllNodes'))
{
$errorMessage = 'ConfigurationData parameter need to have property AllNodes.'
$exception = New-... | /content/code_sandbox/AutomatedLabCore/internal/functions/ValidateUpdate-ConfigurationData.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 591 |
```powershell
function Reset-LabAdPassword
{
param(
[Parameter(Mandatory)]
[string]$DomainName
)
$lab = Get-Lab
$domain = $lab.Domains | Where-Object Name -eq $DomainName
$vm = Get-LabVM -Role RootDC, FirstChildDC | Where-Object DomainName -eq $DomainName
Invoke-LabComm... | /content/code_sandbox/AutomatedLabCore/internal/functions/Reset-LabAdPassword.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 247 |
```powershell
function Publish-LabCAInstallCertificates
{
param (
[switch]$PassThru
)
#Install the certificates to all machines in lab
Write-LogFunctionEntry
$targetMachines = @()
#Publish to all Root DC machines (only one DC from each Root domain)
$targetMachines += Get-LabVM -... | /content/code_sandbox/AutomatedLabCore/internal/functions/Publish-LabCAInstallCertificates.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,372 |
```powershell
$adInstallRootDcScriptPre2012 = {
param (
[string]$DomainName,
[string]$Password,
[string]$ForestFunctionalLevel,
[string]$DomainFunctionalLevel,
[string]$NetBiosDomainName,
[string]$DatabasePath,
[string]$LogPath,
[string]$SysvolPath,
... | /content/code_sandbox/AutomatedLabCore/internal/scripts/Variables.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 11,432 |
```powershell
if ($PSEdition -eq 'Core')
{
Add-Type -Path $PSScriptRoot/lib/core/AutomatedLab.dll
# These modules SHOULD be marked as Core compatible, as tested with Windows 10.0.18362.113
# However, if they are not, they need to be imported.
$requiredModules = @('Dism')
$requiredModulesImplicit = ... | /content/code_sandbox/AutomatedLabCore/internal/scripts/Initialization.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 13,156 |
```powershell
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/scripts... | /content/code_sandbox/PSFileTransfer/PSFileTransfer.psm1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 108 |
```powershell
@{
RootModule = 'PSFileTransfer.psm1'
ModuleVersion = '1.0.0'
CompatiblePSEditions = 'Core', 'Desktop'
GUID = '789c9c76-4756-4489-a74f-31ca64488c7b'
Author = 'Raimund Andree, Per Pedersen'
CompanyName = 'Autom... | /content/code_sandbox/PSFileTransfer/PSFileTransfer.psd1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 247 |
```powershell
function Receive-Directory
{
param (
## The target path on the remote computer
[Parameter(Mandatory = $true)]
$SourceFolderPath,
## The path on the local computer
[Parameter(Mandatory = $true)]
$DestinationFolderPath,
## The session that repres... | /content/code_sandbox/PSFileTransfer/functions/Core/Receive-Directory.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 465 |
```powershell
function Receive-File
{
param (
[Parameter(Mandatory = $true)]
[string]$SourceFilePath,
[Parameter(Mandatory = $true)]
[string]$DestinationFilePath,
[Parameter(Mandatory = $true)]
[System.Management.Automation.Runspaces.PSSession] $Session
)
$... | /content/code_sandbox/PSFileTransfer/functions/Core/Receive-File.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 362 |
```powershell
function Send-Directory
{
param (
## The path on the local computer
[Parameter(Mandatory = $true)]
$SourceFolderPath,
## The target path on the remote computer
[Parameter(Mandatory = $true)]
$DestinationFolderPath,
## The session that represent... | /content/code_sandbox/PSFileTransfer/functions/Core/Send-Directory.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 603 |
```powershell
function Send-File
{
param (
[Parameter(Mandatory = $true)]
[string]$SourceFilePath,
[Parameter(Mandatory = $true)]
[string]$DestinationFolderPath,
[Parameter(Mandatory = $true)]
[System.Management.Automation.Runspaces.PSSession[]]$Session,
[s... | /content/code_sandbox/PSFileTransfer/functions/Core/Send-File.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 503 |
```powershell
function Get-FileLength
{
[OutputType([int])]
param (
[Parameter(Mandatory = $true)]
[string]$FilePath
)
try
{
$FilePath = $executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($FilePath)
}
catch
{
throw $_
}
(Get-... | /content/code_sandbox/PSFileTransfer/internal/functions/Get-FileLength.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 89 |
```powershell
function Write-File
{
param (
[Parameter(Mandatory = $true)]
[string]$DestinationFullName,
[Parameter(Mandatory = $true)]
[byte[]]$Bytes,
[bool]$Erase,
[bool]$Force
)
Write-Debug -Message "Send-File $($env:COMPUTERNAME): writing $DestinationF... | /content/code_sandbox/PSFileTransfer/internal/functions/Write-File.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 410 |
```powershell
$certStoreTypes = @'
using System;
using System.Runtime.InteropServices;
namespace System.Security.Cryptography.X509Certificates
{
public class Win32
{
[DllImport("crypt32.dll", EntryPoint="CertOpenStore", CharSet=CharSet.Auto, SetLastError=true)]
public static extern IntPtr CertO... | /content/code_sandbox/AutomatedLabCore/internal/scripts/Types.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 10,128 |
```powershell
$chunkSize = 1MB
``` | /content/code_sandbox/PSFileTransfer/internal/scripts/Initialize.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 9 |
```powershell
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/functions" -Filter *.ps1 -Recurse) {
. $file.FullName
}
foreach ($file in Get-ChildItem -Path "$PSScriptRoot/internal/scripts... | /content/code_sandbox/PSLog/PSLog.psm1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 108 |
```powershell
function Read-File
{
[OutputType([Byte[]])]
param (
[Parameter(Mandatory = $true)]
[string]$SourceFile,
[Parameter(Mandatory = $true)]
[int]$Offset,
[int]$Length
)
#Convert the destination path to a full filesytem path (to support relative paths)
... | /content/code_sandbox/PSFileTransfer/internal/functions/Read-File.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 230 |
```powershell
function Write-LogFunctionEntry
{
[CmdletBinding()]
param()
$Global:LogFunctionEntryTime = Get-Date
Get-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
$Message = 'Entering...'
$caller = (Get-PSCallStack)[1]
$callerFunctionName = $caller.Comm... | /content/code_sandbox/PSLog/functions/Core/Write-LogFunctionEntry.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 631 |
```powershell
@{
RootModule = 'PSLog.psm1'
ModuleVersion = '1.0.0'
CompatiblePSEditions = 'Core', 'Desktop'
GUID = 'cd303a6c-f405-4dcb-b1ce-fbc2c52264e9'
Author = 'Raimund Andree, Per Pedersen'
Description = 'Redirects stan... | /content/code_sandbox/PSLog/PSLog.psd1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 337 |
```powershell
function Write-LogFunctionExit
{
[CmdletBinding()]
param
(
[Parameter(Position = 0)]
[string]$ReturnValue
)
if ($Global:LogFunctionEntryTime)
{
$ts = New-TimeSpan -Start $Global:LogFunctionEntryTime -End (Get-Date)
}
else
{
$ts = New-Tim... | /content/code_sandbox/PSLog/functions/Core/Write-LogFunctionExit.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 303 |
```powershell
function Write-ProgressIndicator
{
if (-not (Get-PSCallStack)[1].InvocationInfo.BoundParameters['ProgressIndicator'])
{
return
}
Write-ScreenInfo -Message '.' -NoNewline
}
``` | /content/code_sandbox/PSLog/functions/Core/Write-ProgressIndicator.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 51 |
```powershell
function Write-LogFunctionExitWithError
{
[CmdletBinding(
ConfirmImpact = 'Low',
DefaultParameterSetName = 'Message'
)]
param
(
[Parameter(Position = 0, ParameterSetName = 'Message')]
[ValidateNotNullOrEmpty()]
[string]$Message,
[Parameter(... | /content/code_sandbox/PSLog/functions/Core/Write-LogFunctionExitWithError.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 435 |
```powershell
function Write-ScreenInfo
{
param
(
[Parameter(Position = 1)]
[string[]]$Message,
[Parameter(Position = 2)]
[timespan]$TimeDelta,
[Parameter(Position = 3)]
[timespan]$TimeDelta2,
[ValidateSet('Error', 'Warning', 'Info', 'Verbose', 'Debug'... | /content/code_sandbox/PSLog/functions/Core/Write-ScreenInfo.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,762 |
```powershell
function Write-LogError
{
[CmdletBinding(
ConfirmImpact = 'Low',
DefaultParameterSetName = 'Name'
)]
param
(
[Parameter(Position = 0, Mandatory = $true, ParameterSetName = 'Message')]
[ValidateNotNullOrEmpty()]
[string]$Message,
[Parameter(P... | /content/code_sandbox/PSLog/functions/Core/Write-LogError.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 374 |
```powershell
function Write-ProgressIndicatorEnd
{
if (-not (Get-PSCallStack)[1].InvocationInfo.BoundParameters['ProgressIndicator'])
{
return
}
if ((Get-PSCallStack)[1].InvocationInfo.BoundParameters['NoNewLine'].IsPresent)
{
return
}
Write-ScreenInfo -Message '.'
}
``` | /content/code_sandbox/PSLog/functions/Core/Write-ProgressIndicatorEnd.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 79 |
```smalltalk
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Text;
using System.Threading.Tasks;
namespace TestClient
{
public class PowerShellHelper : IDisposable
{
Runspace runspace;
... | /content/code_sandbox/TestClient/PowerShellHelper.cs | smalltalk | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 426 |
```powershell
function Get-CallerPreference
{
[CmdletBinding(DefaultParameterSetName = 'AllVariables')]
param (
[Parameter(Mandatory = $true)]
[ValidateScript( { $_.GetType().FullName -eq 'System.Management.Automation.PSScriptCmdlet' })]
$Cmdlet,
[Parameter(Mandatory = $true)]
... | /content/code_sandbox/PSLog/functions/Core/Get-CallerPreference.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 856 |
```smalltalk
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
namespace AutomatedLab
{
static class Extensions
{
public delegate TOut Action2<TIn, TOut>(TIn element);
public static IEnumerable<TOut> ForEach<TIn, TOut>(this IEnumerable... | /content/code_sandbox/TestClient/Extensions.cs | smalltalk | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 371 |
```unknown
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
``` | /content/code_sandbox/TestClient/App.config | unknown | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 54 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="path_to_url">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGro... | /content/code_sandbox/TestClient/TestClient.csproj | xml | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 871 |
```smalltalk
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Net;
//using System.Text;
//using System.Threading.Tasks;
//namespace AutomatedLab
//{
// class IpConfig
// {
// private int prefix;
// private IPAddress address;
// public int Prefix
// ... | /content/code_sandbox/TestClient/IpConfig.cs | smalltalk | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 535 |
```smalltalk
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: Assem... | /content/code_sandbox/TestClient/Properties/AssemblyInfo.cs | smalltalk | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 276 |
```smalltalk
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Reflection;
using AutomatedLab;
using LabXml;
using AutomatedLab.Azure;
using System.Xml;
namespace TestClient
{
public enum MyColor
{
Black = 0,
Dar... | /content/code_sandbox/TestClient/Program.cs | smalltalk | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 3,534 |
```powershell
@{
RootModule = 'AutomatedLab.Ships.psm1'
CompatiblePSEditions = 'Core', 'Desktop'
ModuleVersion = '1.0.0'
GUID = 'fc08e0e1-d274-41a3-afdd-09247e497c08'
Author = 'Raimund Andree, Per Pedersen, Jan-Hendrik Peters'
CompanyName ... | /content/code_sandbox/AutomatedLab.Ships/AutomatedLab.Ships.psd1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 261 |
```powershell
using namespace Microsoft.PowerShell.SHiPS
[SHiPSProvider(UseCache = $true)]
[SHiPSProvider(BuiltinProgress = $false)]
class LabHost : SHiPSDirectory {
LabHost(
[string]$name) : base($name) {
}
[object[]] GetChildItem() {
if (-not (Get-Module -ListAvailable AutomatedLabCore))... | /content/code_sandbox/AutomatedLab.Ships/AutomatedLab.Ships.psm1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 592 |
```powershell
BeforeDiscovery {
$rootpath = $PSScriptRoot
if (-not (Get-Module -List AutomatedLab.Common)) { Install-Module -Name AutomatedLab.Common -Force -SkipPublisherCheck -AllowClobber }
if (-not (Get-Module -List PSFramework)) { Install-Module -Name PSFramework -Force -SkipPublisherCheck -AllowClobb... | /content/code_sandbox/Tests/Integration/Get-LabConfigurationItem.tests.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 794 |
```powershell
<#
Ensure that all exported cmdlets offer help that is not auto-generated
#>
BeforeDiscovery {
$rootpath = $PSScriptRoot
$skippedCommands = @(
# @raandree --> :)
'Add-LabAzureWebAppDefinition'
'Get-LabAzureWebApp'
'Get-LabAzureWebApp'
'Get-LabAzureWebAppDefi... | /content/code_sandbox/Tests/Integration/Help.tests.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,586 |
```powershell
$labName = 'CRMLab1'
# Create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
# Make the network definition
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.81.0/24
Set-LabInstal... | /content/code_sandbox/LabSources/SampleScripts/HyperV/Single 2012R2 Server DC SQL2014 Web CA.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 417 |
```powershell
$labName = 'Test5'
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
#make the network definition
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.71.0/24
#and the domain d... | /content/code_sandbox/LabSources/SampleScripts/HyperV/MediumLab 2012R2 SQL.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 967 |
```powershell
$labName = 'Test5'
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
#make the network definition
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.71.0/24
#and the domain d... | /content/code_sandbox/LabSources/SampleScripts/HyperV/MediumLab 2012R2 SQL EX.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,031 |
```powershell
$labName = 'ALLovesLinux'
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.130.0/24
Add-LabVirtualNetworkDefinition -Name 'Default Switch' -HyperVProperties @{ SwitchType = 'External'; AdapterName = 'Ethernet' }
$P... | /content/code_sandbox/LabSources/SampleScripts/HyperV/AL Loves Linux.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 593 |
```powershell
$labName = 'Test3'
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
#make the network definition
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.50.0/24
#and the domain d... | /content/code_sandbox/LabSources/SampleScripts/HyperV/BigLab 2012R2 EX SQL ORCH VS OFF.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,712 |
```powershell
# Sample script for installing office 365ProPlus as a custom role
$labName = 'SingleMachine'
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
#Our one and only machine with nothing on it
$role... | /content/code_sandbox/LabSources/SampleScripts/HyperV/Single 10 Client with Office2019.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 169 |
```powershell
$labName = 'ExSmall1'
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
#make the network definition
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.84.0/24
Set-LabInstall... | /content/code_sandbox/LabSources/SampleScripts/HyperV/SmallLab 2012R2 EX.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 376 |
```powershell
<# Prerequisites :
- VMware environment with vCenter server
- ResourcePool 'Test'
- A VM folder named Templates
- In that folder, a powered down VM named 'AL_WindowsServer2012R2DataCenter', fully installed with said OS, and VMware tools installed.\
- A snapshot of the VM above (this is... | /content/code_sandbox/LabSources/SampleScripts/VMWare/VMWare Single Server.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 408 |
```powershell
<#
.SYNOPSIS
Use Azure Stack Hub as a target for AutomatedLab
.DESCRIPTION
Requires Azure Stack Hub - deploy an SDK here: path_to_url
Requires that Azure Stack Hub is registered properly.
Requires connectivity to your Azure Stack Hub ARM APIs, for example via VPN or ExpressRoute.
Not... | /content/code_sandbox/LabSources/SampleScripts/Azure/AzureStackHub.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 878 |
```powershell
$labName = 'MultiForest<SOME UNIQUE DATA>' #THIS NAME MUST BE GLOBALLY UNIQUE
$azureDefaultLocation = 'West Europe' #COMMENT OUT -DefaultLocationName BELOW TO USE THE FASTEST LOCATION
#your_sha256_hash----------------------------------------------------
#----------------------- CHANGING ANYTHING BEYOND ... | /content/code_sandbox/LabSources/SampleScripts/Azure/MultiForestLab 2012R2.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,264 |
```powershell
@{
Tag = 'DomainJoined','ActiveDirectory','MultiForest','Azure'
Description = 'This sample script deploys a multi-forest lab on Azure, including VNET peering, using very old server versions'
Name = 'MultiforestOnAzure2012'
}
``` | /content/code_sandbox/LabSources/SampleScripts/Azure/MultiForestLab 2012R2.psd1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 60 |
```powershell
param
(
[string]
$LabName = ('mnmf-{0:yyyyMMdd}' -f (Get-Date)),
[string]
$AzureDefaultLocation = 'West Europe'
)
#create an empty lab template and define where the lab XML files and the VMs will be stored
New-LabDefinition -Name $labName -DefaultVirtualizationEngine Azure
Add-LabAzureSub... | /content/code_sandbox/LabSources/SampleScripts/Azure/MultiNetMultiForest.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,210 |
```powershell
@{
Tag = 'DomainJoined','ActiveDirectory','MultiForest','Azure'
Description = 'This sample script deploys a multi-forest lab on Azure, including VNET peering'
Name = 'MultiForestOnAzure'
}
``` | /content/code_sandbox/LabSources/SampleScripts/Azure/MultiNetMultiForest.psd1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 51 |
```powershell
<#
.DESCRIPTION
This script deploys a Hyper-V VM using nested virtualization and deploys a build agent on it, connected to an Azure DevOps organisation's agent pool
#>
param
(
# Your user name on Azure DevOps, or an organisation's name
[Parameter(Mandatory)]
[string]
$Organisation,
... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/AzureDevOpsBuildAgent.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 364 |
```powershell
#Requires -Module AutomatedLab
param
(
[AutomatedLab.VirtualizationHost]
$Engine = 'HyperV',
[string]
$LabName = 'SCVMM'
)
New-LabDefinition -Name $LabName -DefaultVirtualizationEngine $Engine
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:Network' = $LabName
'Add-LabMa... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/SCVMM2019.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 799 |
```powershell
<#
This scenario demos a DSC pull server. The lab must have an internet connection in order to download additional required bits. PowerShell 5.0
or greater is required on all DSC pull servers or clients. Please take a look at introduction script '10 ISO Offline Patching.ps1' if you
want to create a Window... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/DSC Pull Scenario 1 (Pull Configuration, SQL Reporting).ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,009 |
```powershell
<#
This scenario demos a DSC pull server. The lab must have an internet connection in order to download additional required bits. PowerShell 5.0
or greater is required on all DSC pull servers or clients. Please take a look at introduction script '10 ISO Offline Patching.ps1' if you
want to create a Window... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/DSC Pull Scenario 1 (Pull Configuration).ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 888 |
```powershell
<#
This lab script serves the purpose of showing you how to create and connect two Azure labs in different resource groups e.g. in different locations
You will need an Azure subscription and both labs need to be created within the same subscription. Otherwise you can have a look at the other
options that... | /content/code_sandbox/LabSources/SampleScripts/Azure/VpnConnectedLab.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 813 |
```powershell
New-LabDefinition -Name TFS2015 -DefaultVirtualizationEngine HyperV
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2016 Datacenter (Desktop Experience)'
'Add-LabMachineDefinition:DomainName' = 'contoso.com'
'Add-LabMachineDefinition:Memory' ... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/TFS 2015 Deployment.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 393 |
```powershell
$labname = 'FailOverLab3'
New-LabDefinition -Name $labname -DefaultVirtualizationEngine HyperV
Add-LabDomainDefinition -Name contoso.com -AdminUser Install -AdminPassword Somepass1
Set-LabInstallationCredential -Username Install -Password Somepass1
# Two cluster networks with an IP out of each one
# One... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/Failover Clustering 3 MultipleNetworks.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 754 |
```powershell
New-LabDefinition -Name MDTLab2 -DefaultVirtualizationEngine HyperV
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:ToolsPath' = "$labSources\Tools"
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2016 Datacenter (Desktop Experience)'
'Add-LabMachineDefinition:Memory' = ... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/MDT Lab 2, DC and MDT Server.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 342 |
```powershell
param
(
[Parameter()]
[string]
$LabName = 'nuget',
[Parameter()]
[string]
[ValidateSet('Azure', 'HyperV')]
$Engine = 'HyperV'
)
New-LabDefinition -Name $LabName -DefaultVirtualizationEngine $Engine
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.30.0/24
A... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/NuGetServer.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 503 |
```powershell
# Checkout the other parameters for Add-LabAzureSubscription! Get-Command -Syntax Add-LabAzureSubscription
$subscriptionName = 'Your subscription'
$labname = 'FailOverLab3'
New-LabDefinition -Name $labname -DefaultVirtualizationEngine Azure
Add-LabAzureSubscription -SubscriptionName $subscriptionName
Add... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/Failover Clustering 3 MultipleNetworksAzure.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 810 |
```powershell
$labName = 'WACLab'
$domainName = 'contoso.com'
New-LabDefinition -Name $labname -DefaultVirtualizationEngine HyperV
Add-LabDomainDefinition -Name $domainName -AdminUser Install -AdminPassword Somepass1
Set-LabInstallationCredential -Username Install -Password Somepass1
$PSDefaultParameterValues = @{
... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/WindowsAdminCenter.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 445 |
```powershell
$labName = 'SharingIsCaring'
New-LabDefinition -Name $labName -DefaultVirtualizationEngine HyperV
Add-LabVirtualNetworkDefinition -Name $labName -AddressSpace 192.168.30.0/24
Add-LabDomainDefinition -Name contoso.com -AdminUser Install -AdminPassword Somepass1
Set-LabInstallationCredential -Username Inst... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/SharePoint2016.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 295 |
```powershell
@{
Tag = 'DomainJoined', 'Arc', 'Azure'
Description = 'Deploys a Hyper-V lab with Domain Services, Certificate Services, SQL Server and web servers and connects VMs using Azure Arc.'
Name = 'AzureArcConnectedHyperV'
}
``` | /content/code_sandbox/LabSources/SampleScripts/Scenarios/AzureArcConnectedHyperV.psd1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 59 |
```powershell
<#
Deploy ConfigurationManager in a lab
#>
param
(
# Lab Name
[string]
$LabName = 'cm2203',
# Hypervisor to use
[ValidateSet('Azure', 'HyperV')]
[string]
$Engine = 'HyperV',
# Domain FQDn
[string]
$DomainName = 'contoso.com',
# Path to SQL 2019, leave empty t... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/CM-2203.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 768 |
```powershell
[CmdletBinding()]
param
(
# Select platform, defaults to HyperV
[AutomatedLab.VirtualizationHost]
$Hypervisor = 'HyperV',
# Indicates that the installation of Dynamics should be split
# into its three components
[switch]
$IndividualComponents
)
New-LabDefinition -name dynamic... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/Dynamics365.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 417 |
```powershell
New-LabDefinition -Name MDTLab1 -DefaultVirtualizationEngine HyperV
$mdtRole = Get-LabPostInstallationActivity -CustomRole MDT -Properties @{
DeploymentFolder = 'C:\DeploymentShare'
DeploymentShare = 'DeploymentShare$'
InstallUserID = 'MdtService'
InstallPassword = 'Somepass1'
Operati... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/MDT Lab 1, MDT Server 1.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 238 |
```powershell
#This lab installs the SCCM role (1702). All required resources except the SQL Server ISO are downloaded during the deployment.
New-LabDefinition -Name SccmLab1 -DefaultVirtualizationEngine HyperV
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:ToolsPath' = "$labSources\Tools"
'Add-LabM... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/SCCM Lab 1.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 400 |
```powershell
$labName = "ProGet_$((1..6 | ForEach-Object { [char[]](97..122) | Get-Random }) -join '')"
$azureLocation = 'West Europe'
#your_sha256_hash----------------------------------------------------
#----------------------- CHANGING ANYTHING BEYOND THIS LINE SHOULD NOT BE REQUIRED ------------------------------... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/ProGet Lab - Azure.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,121 |
```powershell
<#
Build a lab with the help of nested virtualization. Adjust the machine memory if necessary.
The build worker will use Polaris as a simple REST endpoint that takes your lab data to deploy.
AutomatedLab will be copied to the machine. Lab sources will be mirrored to the machine as well, so that lab deplo... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/Lab in a Box 3 - Build worker.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 699 |
```powershell
<#
This scenario demos a DSC pull server confuguration using 3 pull servers. Each pull server publishes a configuration and the clients are
pulling the configurations from all three servers (see "partial configuration').
The lab must have an internet connection in order to download additional required bi... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/DSC Pull Scenario 2 (Pull Partial Configuration).ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,000 |
```powershell
<#
.SYNOPSIS
An AutomatedLab script for Configuration Manager 1902 with support for installing updates.
.DESCRIPTION
An AutomatedLab script for Configuration Manager 1902 with support for installing updates.
.PARAMETER LabName
The name of the AutomatedLab lab created by this script.
.PARAMETER... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/CM-1902.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 5,247 |
```powershell
$labName = 'ProGet'
#your_sha256_hash----------------------------------------------------
#----------------------- CHANGING ANYTHING BEYOND THIS LINE SHOULD NOT BE REQUIRED ----------------------------------
#----------------------- + EXCEPT FOR THE LINES STARTING WITH: REMOVE THE COMMENT TO ------------... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/ProGet Lab - HyperV.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 1,167 |
```powershell
$labName = 'WACLab'
$domainName = 'contoso.com'
New-LabDefinition -Name $labname -DefaultVirtualizationEngine HyperV
Add-LabDomainDefinition -Name $domainName -AdminUser Install -AdminPassword Somepass1
Set-LabInstallationCredential -Username Install -Password Somepass1
$PSDefaultParameterValues = @{
... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/WindowsAdminCenter-OnPrem.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 696 |
```powershell
$labname = 'SCVMMHV'
New-LabDefinition -Name $labname -DefaultVirtualizationEngine HyperV
Add-LabDomainDefinition -Name contoso.com -AdminUser Install -AdminPassword Somepass1
Set-LabInstallationCredential -Username Install -Password Somepass1
Add-LabVirtualNetworkDefinition -Name $labname -AddressSpac... | /content/code_sandbox/LabSources/SampleScripts/Scenarios/HyperVClusterWithVmm.ps1 | powershell | 2016-08-23T00:08:15 | 2024-08-16T12:01:05 | AutomatedLab | AutomatedLab/AutomatedLab | 1,988 | 531 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.