This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ((Get-Disk).NumberOfPartitions -eq 4) | |
{ | |
[System.IO.DriveInfo]::GetDrives() | ` | |
? { (($_.DriveType -eq 'Fixed') -and ($_.VolumeLabel -eq 'RECOVERY')) } | ` | |
% { | |
Write-Host ('{0}util' -f $_.RootDirectory) | |
if (test-path ('{0}MININT' -f $_.RootDirectory)) { Remove-Item ('{0}MININT' -f $_.RootDirectory) -Force -Recurse } | |
if (test-path ('{0}_SMSTaskSequence' -f $_.RootDirectory)) { Remove-Item ('{0}_SMSTaskSequence' -f $_.RootDirectory) -Force -Recurse } | |
if (test-path ('{0}util' -f $_.RootDirectory)) { Remove-Item ('{0}util' -f $_.RootDirectory) -Force -Recurse } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$false)] | |
[switch]$AddRecoveryBcd, | |
[Parameter(Mandatory=$false)] | |
[string]$TaskSequence, | |
[Parameter(Mandatory=$false)] | |
[switch]$HideRecovery | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script performs the installation of MDT including dependencies. | |
# LICENSE # | |
PowerShell EasyMdt BG edition | |
Copyright (C) 2019 - Brian Gonzalez. | |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. | |
.DESCRIPTION | |
This script sets up MDT including it's dependencies. It also performs some basic configurations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions | |
Enable-RemoteDesktop | |
Install-WindowsUpdate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Script creates a Selection Profile for each folder under the MDT's "Out-of-Box Drivers" node. | |
$deployRoot = "D:\AiO" | |
Import-Module -Name "${env:ProgramFiles}\Microsoft Deployment Toolkit\bin\MicrosoftDeploymentToolkit.psd1" | |
New-PSDrive -Name 'SelectionProfileScript' -PSProvider MDTProvider -Root $deployRoot -Force | |
Get-ChildItem -Path 'SelectionProfileScript:\Out-Of-Box Drivers' -Recurse | ` | |
Where-Object { $_.NodeType -eq 'DriverFolder' } | ` | |
ForEach-Object { | |
#before: Out-Of-Box Drivers\10 x64\Panasonic\PDP_CF-53mk4_Win7x64_V2.00L11M00 | |
#after: OoB-10x64-Panasonic-PDP_CF-53mk4_Win7x64_V2.00L11M00 | |
$path = ($_.PSPath -replace 'MicrosoftDeploymentToolkit\\MDTProvider::SelectionProfileScript:\\', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param([string]$Phase = "A") | |
#$VerbosePreference = "Continue" | |
# Give system time to start up and re-connect to vagrant shares. | |
#Import-Module "$env:WinDir\system32\WindowsPowerShell\v1.0\Modules\NetTCPIP\NetTCPIP.psd1" | |
#Import-Module "$env:WinDir\system32\WindowsPowerShell\v1.0\Modules\ServerManager\ServerManager.psd1" | |
$scriptPath = $myInvocation.MyCommand.Definition | |
function DCRoleInstall { | |
$SafeModeAdministratorPasswordText = "P@ssw0rd" | |
$SafeModeAdministratorPassword = ConvertTo-SecureString -AsPlainText $SafeModeAdministratorPasswordText -Force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' ScriptCryptor Project Options Begin | |
' HasVersionInfo: No | |
' Companyname: | |
' Productname: | |
' Filedescription: | |
' Copyrights: | |
' Trademarks: | |
' Originalname: | |
' Comments: | |
' Productversion: 0. 0. 0. 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Install Windows ADK ( https://developer.microsoft.com/en-us/windows/hardware/windows-assessment-deployment-kit ) | |
REM If USB3.0 drivers where not already injected into PE: | |
REM a. download our Win7x64 USB3.0 drivers: | |
REM USB 3.0 Host Controller Driver: http://pc-dl.panasonic.co.jp/dl/docs/069978?dc%5B%5D=002001&lang=005&no=20&oc=001020&p1=117&p2=1170534&score=1.0&sri=10357315&trn_org=2 | |
REM USB 3.0 Driver: http://pc-dl.panasonic.co.jp/dl/docs/069977?dc%5B%5D=002001&lang=005&no=21&oc=001020&p1=117&p2=1170534&score=1.0&sri=10357315&trn_org=2 | |
REM d. Extract the EXEs using 7zip. | |
REM e. Add the extracted folder path to the DriverPath variable. | |
REM f. un-REM the lines to install them. | |
REM In SCCM07, edit the "winpe.wim" boot file ( file name does NOT include packageid ) then run "Update Dis.." against the Boot Image in the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DISM commands to prepare thumbdrive for applying Pre-Staged media: | |
* tested with ADK Win 10 | |
copype amd64 \PEx64 | |
dism /mount-wim /wimfile:\PEx64\media\sources\boot.wim /index:1 /mountdir:\PEx64\mount | |
explorer \PEx64\mount\Windows\System32 | |
- copy/overwrite custom startnet.cmd | |
dism /unmount-wim /mountdir:\PEx64\mount /commit | |
- copy PreStagedMedia.wim to root of thumbdrive. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-DirSize { | |
param([Parameter(Mandatory = $true, ValueFromPipeline = $true)][string]$path) | |
Set-Location $env:SystemDrive | |
$Size = (Get-ChildItem -Path $path | Measure-Object -Property Length -Sum).Sum | |
If ( $Size -lt 1KB ) { $formattedsize = "$("{0:N2}" -f $Size) B" } | |
ElseIf ( $Size -lt 1MB ) { $formattedsize = "$("{0:N2}" -f ($Size / 1KB)) KB" } | |
ElseIf ( $Size -lt 1GB ) { $formattedsize = "$("{0:N2}" -f ($Size / 1MB)) MB" } | |
ElseIf ( $Size -lt 1TB ) { $formattedsize = "$("{0:N2}" -f ($Size / 1GB)) GB" } | |
$FileCount = (Get-ChildItem -Path $path | Measure-Object).Count | |
$Name = (Get-Item -Path $path).Name |