|
|
@@ -1,56 +1,20 @@
|
|
|
+#requires -Version 3
|
|
|
+
|
|
|
param(
|
|
|
- $sevenzip = "C:\Program Files\7-Zip\7z.exe"
|
|
|
+ $Command
|
|
|
)
|
|
|
-cd $PSSCriptRoot
|
|
|
-
|
|
|
-$dist = "dist"
|
|
|
-$src = "WinImager"
|
|
|
-$sfx = "sfx"
|
|
|
-
|
|
|
-$szfile = "$dist/WinImager.7z"
|
|
|
-$exefile = "$dist/WinImager.exe"
|
|
|
-
|
|
|
-New-Item -itemtype directory -Path $dist -Force
|
|
|
-Remove-Item -Force $szfile
|
|
|
-
|
|
|
-&$sevenzip a $szfile $src "-xr0!*.log"
|
|
|
-
|
|
|
-Get-Content -Encoding Byte -Read 512 -Path "$sfx/7zsd_All_x64.sfx","$sfx/sfx_config.txt",$szfile |
|
|
|
- Set-Content -Encoding Byte $exefile
|
|
|
-
|
|
|
-
|
|
|
-$PSVERSION="7.2.5"
|
|
|
-$PSFILE="PowerShell-$PSVERSION-win-x64.zip"
|
|
|
-$PSURL="https://github.com/PowerShell/PowerShell/releases/download/v$PSVERSION/$PSFILE"
|
|
|
|
|
|
-$PSTOOLSFILE="PSTools.zip"
|
|
|
-$PSTOOLSURL="https://download.sysinternals.com/files/$PSTOOLSFILE"
|
|
|
-$wintermsfx_build="wintermsfx\build"
|
|
|
-New-Item -itemtype directory -Path $wintermsfx_build -Force
|
|
|
-
|
|
|
-if ($null -eq (Get-Item "$wintermsfx_build\windowsterminal")){
|
|
|
- .\wintermsfx\wintermportable.ps1
|
|
|
-}
|
|
|
-Copy-Item -Force .\wintermsfx\main.ps1 "$wintermsfx_build\main.ps1"
|
|
|
-
|
|
|
-cd $wintermsfx_build
|
|
|
-Remove-Item -Force windowsterminal.7z
|
|
|
-
|
|
|
-
|
|
|
-if ($null -eq (Get-Item $PSFILE)){
|
|
|
- Invoke-WebRequest -Uri $PSURL -OutFile $PSFILE
|
|
|
+if (!$Command) {
|
|
|
+ foreach($_ in Get-ChildItem $PSScriptRoot\mk -Name) {
|
|
|
+ [System.IO.Path]::GetFileNameWithoutExtension($_)
|
|
|
+ }
|
|
|
+ return
|
|
|
}
|
|
|
-if ($null -eq (Get-Item $PSTOOLSFILE)){
|
|
|
- Invoke-WebRequest -Uri $PSTOOLSURL -OutFile $PSTOOLSFILE
|
|
|
+if ($Command -eq "all"){
|
|
|
+ foreach($_ in Get-ChildItem $PSScriptRoot\mk -File) {
|
|
|
+ & $_.FullName
|
|
|
+ }
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
-Remove-Item -Recurse -Force windowsterminal\powershell\
|
|
|
-Expand-Archive $PSFILE -DestinationPath windowsterminal\powershell\
|
|
|
-Expand-Archive $PSTOOLSFILE -DestinationPath windowsterminal\powershell\
|
|
|
-
|
|
|
-&$sevenzip a windowsterminal.7z main.ps1 windowsterminal
|
|
|
-
|
|
|
-cd $PSSCriptRoot
|
|
|
-
|
|
|
-Get-Content -Encoding Byte -Read 512 $sfx/7zsd_All_x64.sfx,$sfx/sfx_main.txt,wintermsfx\build\windowsterminal.7z |
|
|
|
- Set-Content -Encoding Byte "$dist\wintermsfx.exe"
|
|
|
+& "$PSScriptRoot\mk\$Command.ps1" @args
|