File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
+ "version" : " 2.0" ,
2
3
"logger" : {
3
4
"categoryFilter" : {
4
5
"defaultLevel" : " Trace" ,
Original file line number Diff line number Diff line change @@ -28,7 +28,14 @@ internal class PowerShellManager
28
28
internal PowerShellManager ( RpcLogger logger )
29
29
{
30
30
var initialSessionState = InitialSessionState . CreateDefault ( ) ;
31
- initialSessionState . ExecutionPolicy = Microsoft . PowerShell . ExecutionPolicy . Unrestricted ;
31
+
32
+ // Setting the execution policy on macOS and Linux throws an exception so only update it on Windows
33
+ if ( Platform . IsWindows )
34
+ {
35
+ // This sets the execution policy on Windows to Unrestricted which is required to run the user's function scripts on
36
+ // Windows client versions. This is needed if a user is testing their function locally with the func CLI
37
+ initialSessionState . ExecutionPolicy = Microsoft . PowerShell . ExecutionPolicy . Unrestricted ;
38
+ }
32
39
_pwsh = PowerShell . Create ( initialSessionState ) ;
33
40
_logger = logger ;
34
41
Original file line number Diff line number Diff line change 1
1
{
2
- "Description " :{
3
- "Language " :" powershell" ,
4
- "Extension" : " .ps1" ,
5
- "DefaultExecutablePath " :" dotnet" ,
6
- "DefaultWorkerPath " :" Azure.Functions.PowerShell.Worker.dll"
2
+ "description " :{
3
+ "language " :" powershell" ,
4
+ "extensions" :[ " .ps1" ] ,
5
+ "defaultExecutablePath " :" dotnet" ,
6
+ "defaultWorkerPath " :" Azure.Functions.PowerShell.Worker.dll"
7
7
}
8
8
}
You can’t perform that action at this time.
0 commit comments