.
This commit is contained in:
10
bin/SoftwareList.bat
Executable file
10
bin/SoftwareList.bat
Executable file
@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
set check_computername=%COMPUTERNAME%
|
||||
echo "Found computer %check_computername%"
|
||||
|
||||
set PACKAGES="C:\Packages"
|
||||
set WPUBLIC="C:\wPublic"
|
||||
|
||||
echo "Dump software list"
|
||||
set PSFILE="%WPUBLIC%\bin\ListSoftware.ps1"
|
||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% > "C:\%check_computername%.txt"
|
||||
18
bin/SpeedUp.ps1
Executable file
18
bin/SpeedUp.ps1
Executable file
@ -0,0 +1,18 @@
|
||||
function Optimize-PowershellAssemblies {
|
||||
# NGEN powershell assembly, improves startup time of powershell by 10x
|
||||
$old_path = $env:path
|
||||
try {
|
||||
$env:path = [Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
|
||||
[AppDomain]::CurrentDomain.GetAssemblies() | % {
|
||||
if (! $_.location) {continue}
|
||||
$Name = Split-Path $_.location -leaf
|
||||
if ($Name.startswith("Microsoft.PowerShell.")) {
|
||||
Write-Progress -Activity "Native Image Installation" -Status "$name"
|
||||
ngen install $_.location | % {"`t$_"}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
$env:path = $old_path
|
||||
}
|
||||
}
|
||||
Optimize-PowershellAssemblies
|
||||
11
bin/SpeedUpPS.bat
Normal file
11
bin/SpeedUpPS.bat
Normal file
@ -0,0 +1,11 @@
|
||||
@echo off
|
||||
set check_computername=%COMPUTERNAME%
|
||||
echo "Found computer %check_computername%"
|
||||
|
||||
set PACKAGES="C:\Packages"
|
||||
set WPUBLIC="C:\wPublic"
|
||||
|
||||
echo "Speed up Powershell processing"
|
||||
set PSFILE="%WPUBLIC%\bin\SpeedUp.ps1"
|
||||
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
|
||||
|
||||
Reference in New Issue
Block a user