“Jalankan perintah PowerShell dari JavaScript” Kode Jawaban

JavaScript menjalankan skrip PowerShell

var spawn = require("child_process").spawn,child;
child = spawn("powershell.exe",["c:\\temp\\helloworld.ps1"]);
child.stdout.on("data",function(data){
    console.log("Powershell Data: " + data);
});
child.stderr.on("data",function(data){
    console.log("Powershell Errors: " + data);
});
child.on("exit",function(){
    console.log("Powershell Script finished");
});
child.stdin.end(); //end input
vlT

Jalankan perintah PowerShell dari JavaScript

while True:
    choices = ["rock","paper","scissors"]

    computer = random.choice(choices)
    player = None

    while player not in choices:
        player = input("rock, paper, or scissors?: ").lower()

    if player == computer:
        print("computer: ",computer)
        print("player: ",player)
        print("Tie!")

   
            print("computer: ", computer)
            print("player: ", player)
            print("You win!")

    play_again = input("Play again? (yes/no): ").lower()

    if play_again != "yes":
        break

print("Bye!")
Unusual Unicorn

Jawaban yang mirip dengan “Jalankan perintah PowerShell dari JavaScript”

Pertanyaan yang mirip dengan “Jalankan perintah PowerShell dari JavaScript”

Lebih banyak jawaban terkait untuk “Jalankan perintah PowerShell dari JavaScript” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya