Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

233
Vistas
In JavaScript, Take 2 values and add them & run it on a Powershell script

I'm struggling to find the answer to this. I need to take two values, one is an input type "Printer Name" and the other is a dropdown value "DCdropdown", and I need to take those values given and assign them to certain parts of powershell script and then run the script. I know the script that I need to write, but I don't know how to take the values and add it to the script and then run it when I hit the "Make it so" button. This is what I have so far:

<p>Which printer would you like to add?</p>

<input type="text" placeholder="Printer Name" id="myInput">
           
    <script>
        function getInputValue(){
            // Selecting the input element and get its value 
            var inputVal = document.getElementById("myInput").value;
            
            // Displaying the value
            alert(inputVal);
        }
    </script>

<p>Which Distribution Center are you located?</p>

<select id="DCdropdown" onchange="leaveChange(this)">
<option value=""></option>
<option value="xxx">CMB</option>
<option value="xxx">DS</option>
<option value="xxx">FNO</option>
<option value="xxx">GNWD</option>
<option value="xxx">JAX</option>
<option value="xxx">RMVL</option>
</select>


 <button type="button" onclick="getInputValue();">Make it so</button>
 <script>
  function myFunction(){
  document.getElementByID
}
 </script>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is impossible without additional infrastructure, and this is by design.

Web browsers cannot run PowerShell code. You would at a minimum need to be running a web application which can execute PowerShell code on its end. This could be listening on the local machine, or it could be remote. But it's not happening with only the browser alone, and it's not happening with raw JavaScript.

If this is part of a webapp being served then this is possible but still would have to be done by executing something on the webserver itself, can't be done from the browser on the local machine. In any event suggesting a solution in this space exceeds the scope of this question.

In theory a custom browser plugin (not extensions) could facilitate this this but AFAIK all major browsers either no longer support plugins or disable them by default, and you have to ensure such a plugin is installed.

Edit: I forgot about a newer technology called Blazor that lets dotnet run under WebAssembly (and in theory PowerShell), but it would not be useful here as it is sandboxed to the browser just as Javascript and other site code is.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda