[英]Is it possible to embed a jar file in a Windows Powershell script?
When I have a jar( hoge.jar
) file, and a unix shell script( hoge.sh
) or a windows batch file( hoge.bat
), I can obtain ones with the jar file like below: When I have a jar(
hoge.jar
) file, and a unix shell script( hoge.sh
) or a windows batch file( hoge.bat
), I can obtain ones with the jar file like below:
cat hoge.sh hoge.jar >foo.sh
or或者
copy /b hoge.bat+hoge.jar foo.bat
Is there any way to do that with a powershell script ( hoge.ps1
)有没有办法用 powershell 脚本(
hoge.ps1
)做到这一点
copy /b hoge.ps1+hoge.jar foo.ps1
As for the foo.ps1
obtained as above,至于如上得到的
foo.ps1
,
java -jar foo.ps1
does work, but the part of the powerscript never runs... (when used as the powerscript ofcourse)确实有效,但powerscript的一部分永远不会运行......(当用作powerscript时)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.