File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+
4
+ < head >
5
+ < title > ps12exe Online</ title >
6
+ </ head >
7
+
8
+ < body >
9
+ < textarea style ="width: 98%; height:95vh; "> </ textarea >
10
+ < br >
11
+ < button id ="compileButton " onclick ="compileCode() "> 编译</ button >
12
+ < script type ="text/javascript ">
13
+ var language = navigator . language || navigator . userLanguage ;
14
+ var compileMessage = "已将编译用的Powershell代码复制到剪切板!\n现在你只需要在Powershell里粘贴并运行代码就可以得到编译结果了!" ;
15
+ switch ( language ) {
16
+ case 'zh' :
17
+ case 'zh-CN' :
18
+ case 'zh-TW' :
19
+ case 'zh-HK' :
20
+ break ;
21
+ default :
22
+ document . getElementById ( 'compileButton' ) . textContent = 'Compile' ;
23
+ compileMessage = "Copied the compile code to clipboard! \nNow you can just paste and run the code in Powershell to get the compiled result!" ;
24
+ break ;
25
+ }
26
+ function compileCode ( ) {
27
+ var code = document . getElementsByTagName ( 'textarea' ) [ 0 ] . value ;
28
+ var compileCodebase = code . replace ( "\'" , "''" ) ;
29
+ var compileCode = "if (-not (Get-Module -ListAvailable ps12exe)) { Install-Module ps12exe -Force -Scope CurrentUser };" +
30
+ "'" + compileCodebase + "' | ps12exe" ;
31
+ navigator . clipboard . writeText ( compileCode ) ;
32
+ alert ( compileMessage ) ;
33
+ }
34
+ </ script >
35
+ </ body >
36
+
37
+ </ html >
You can’t perform that action at this time.
0 commit comments