Как выполнить скрипт PowerShell с помощью оснастки?

Как мне запустить это powershell скрипт?

thufir@dur:~/powershell$ 
thufir@dur:~/powershell$ ./hello.ps1 
bash: ./hello.ps1: /usr/bin/pwsh: bad interpreter: No such file or directory
thufir@dur:~/powershell$ 
thufir@dur:~/powershell$ cat hello.ps1 
#!/usr/bin/pwsh -Command


echo "hello world"
"done"

thufir@dur:~/powershell$ 
thufir@dur:~/powershell$ pwsh hello.ps1 
hello world
done
thufir@dur:~/powershell$ 
thufir@dur:~/powershell$ snap info powershell
name:      powershell
summary:   PowerShell for every system!
publisher: Microsoft PowerShell✓
contact:   https://github.com/powershell/powershell
license:   unset
description: |
  PowerShell is an automation and configuration management platform.
  It consists of a cross-platform (Windows, Linux, and macOS)
  command-line shell and associated scripting language.

  See
  https://docs.microsoft.com/en-us/powershell/scripting/powershell-core-suppo
  rt for support details.
commands:
  - powershell
snap-id:      JSNnoJl3EqkMuWoy5Dgq8PMqZ0uNcpie
tracking:     stable
refresh-date: 3 days ago, at 20:29 PDT
channels:
  stable:    6.1.3 2019-02-20 (19) 59MB classic
  candidate: 6.1.3 2019-02-20 (19) 59MB classic
  beta:      6.1.3 2019-02-20 (19) 59MB classic
  edge:      6.1.3 2019-02-19 (19) 59MB classic
installed:   6.1.3            (19) 59MB classic
thufir@dur:~/powershell$ 

Я думаю, что мне просто нужен путь для где snap Установленный PowerShell:

thufir@dur:~$ 
thufir@dur:~$ ll /snap/bin/powershell 
lrwxrwxrwx 1 root root 13 Mar 13 20:29 /snap/bin/powershell -> /usr/bin/snap*
thufir@dur:~$ 

0 ответов

Другие вопросы по тегам