“Exécuter la commande PowerShell de JavaScript” Réponses codées

JavaScript exécuter le script 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

Exécuter la commande PowerShell de 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

Réponses similaires à “Exécuter la commande PowerShell de JavaScript”

Questions similaires à “Exécuter la commande PowerShell de JavaScript”

Plus de réponses similaires à “Exécuter la commande PowerShell de JavaScript” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code