После обновления с Ruby 2.2 до Ruby 2.3 перестали работать вызовы powershell, поскольку профили powershell не загружались.
1) Если я открываю командную строку, она работает:
C:\Users\administrador>powershell.exe ls
Directory: C:\Users\administrador
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 26/06/2015 16:20 .android
d---- 24/08/2015 16:25 .gem
d-r-- 30/06/2017 11:27 Contacts
d-r-- 06/07/2017 16:53 Desktop
d-r-- 30/06/2017 11:27 Documents
d-r-- 30/06/2017 11:27 Downloads
d-r-- 30/06/2017 11:27 Favorites
d-r-- 30/06/2017 11:27 Links
d-r-- 30/06/2017 11:27 Music
d-r-- 30/06/2017 11:27 Pictures
d-r-- 30/06/2017 11:27 Saved Games
d-r-- 30/06/2017 11:27 Searches
d-r-- 30/06/2017 11:27 Videos
-a--- 22/01/2015 11:18 1796 volshext.log
2) Но если использовать Ruby, это не сработает. Я выполняю командную строку от имени администратора:
irb(main):002:0> system("powershell ls")
File C:\Windows\SysWOW64\WindowsPowerShell\v1.0\profile.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:2
+ . <<<< 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\profile.ps1'
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
File C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:2
+ . <<<< 'C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1'
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
File C:\Users\administrador\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:2
+ . <<<< 'C:\Users\administrador\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
Directory: C:\Users\administrador
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 26/06/2015 16:20 .android
d---- 24/08/2015 16:25 .gem
d-r-- 30/06/2017 11:27 Contacts
d-r-- 06/07/2017 16:53 Desktop
d-r-- 30/06/2017 11:27 Documents
d-r-- 30/06/2017 11:27 Downloads
d-r-- 30/06/2017 11:27 Favorites
d-r-- 30/06/2017 11:27 Links
d-r-- 30/06/2017 11:27 Music
d-r-- 30/06/2017 11:27 Pictures
d-r-- 30/06/2017 11:27 Saved Games
d-r-- 30/06/2017 11:27 Searches
d-r-- 30/06/2017 11:27 Videos
-a--- 22/01/2015 11:18 1796 volshext.log
=> true
Что может быть не так?