-3

I have just started angular and typescript and created a web application using the command "ng new myapp". And i want to run powershell commands from my web application. Can anyone help me with this?

This is my file structure that i have after creating the project- https://www.tutorialspoint.com/angular4/images/final_file_structure.jpg

thechosenone
  • 1
  • 1
  • 2

1 Answers1

2

This is not possible by sole Angular application. If the website would be able to execute commands that would be a major security issue. If you want to execute some powershell commands by pressing buttons in Angular you would need a f.e. node server with win32 api library. In angular you would be just calling node api and server would execute commands.

karoluS
  • 2,980
  • 2
  • 23
  • 44
  • This is my file structure that i have after creating the project where should i add the code- tutorialspoint.com/angular4/images/final_file_structure.jpg – thechosenone Feb 25 '19 at 03:49
  • @thechosenone either in different directory as separate app or you could put it in `/api/`. Really it's up to you. – karoluS Feb 25 '19 at 07:42