Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ####
- # Package the source files into an appx
- # makeappx.exe pack /d .\MCServer /p .\MCServer.appx
- ####
- # Create self signed certificate to sign AppX
- # makecert.exe /n "CN=ITProConNY, O=ITProConNY, L=NewYorkCity, S=NY, C=USA" /r /h 0
- #/eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e 03/25/2017 /sv .\ITProConNY.pvk .\ITProConNY.cer
- ####
- # copy private/public key into a PFX file used to sign appx
- # pvk2pfx.exe /pvk .\ITProConNY.pvk /pi P@ssw0rd /spc .\ITProConNY.cer /pfx .\ITProConNY.pfx /po P@ssw0rd
- ####
- # sign appx with pfx file
- # signtool.exe sign /fd SHA256 /a /f .\ITProConNY.pfx /p P@ssw0rd .\MCServer.appx
- ####
- # Copy working files locally
- Copy-Item "C:\Users\dsebban\OneDrive\Scripts\ITProConNY2016\Demos\Demo4\" Z:\ -Recurse
- Enter-PSSession -VMName NanoLab-Nano1 -Credential NANO\dsebban
- ####
- # add certificate used to sign AppX to trusted sources
- certoc -addstore TrustedPeople C:\ITProConNY.cer
- ####
- # add AppX pacakage
- Get-Service MCServerService
- Add-AppxPackage C:\MCServer.appx
- Get-AppxPackage
- Get-Service MCServerService
- ####
- # remove AppX package
- Get-AppxPackage | Remove-AppxPackage
- Get-Service MCServerService
- ####
- # Copy binaries locally
- netsh advfirewall firewall add rule name="JavaW-In" dir=in program="c:\Demo4\MCServer\jre\bin\javaw.exe" action=allow enable=yes
- netsh advfirewall firewall add rule name="JavaW-Out" dir=out program="c:\Demo4\MCServer\jre\bin\javaw.exe" action=allow enable=yes
- cd c:\Demo4\MCServer
- c:\Demo4\MCServer\jre\bin\javaw.exe -jar c:\Demo4\MCServer\minecraft_server.1.9.jar nogui
Add Comment
Please, Sign In to add comment