You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems we already have microsoft.codeanalysis.csharp-2.0.0 and microsoft.codeanalysis.csharp-2.0.0 (last version of the packages is 2.2.0 /cc Dongbo Wang (@daxian-dbw) -Should we update? ) and the next works well:
$Source=@"using System;public class BasicTest{public static void PrintStars(string s) { if (int.TryParse(s, out var i)) { Console.WriteLine(new string('*', i)); } else { Console.WriteLine("Cloudy - no stars tonight!"); } } }"@Add-Type-TypeDefinition $Source
[BasicTest]::PrintStars("3")
The example above already works in beta.1, so I guess we should add CSharpVersion7 to the enum.
As for microsoft.codeanalysis.csharp, it will be updated to 2.2.0 with the next refreshment, see PR #3887
Activity
lzybkr commentedon May 30, 2017
If it works, then yeah.
Windows PowerShell relies on CodeDom instead of Roslyn for Add-Type, so there are differences, mostly CodeDom isn't updated.
iSazonov commentedon May 31, 2017
It seems we already have microsoft.codeanalysis.csharp-2.0.0 and microsoft.codeanalysis.csharp-2.0.0 (last version of the packages is 2.2.0 /cc Dongbo Wang (@daxian-dbw) -Should we update? ) and the next works well:
daxian-dbw commentedon May 31, 2017
The example above already works in beta.1, so I guess we should add
CSharpVersion7to the enum.As for
microsoft.codeanalysis.csharp, it will be updated to 2.2.0 with the next refreshment, see PR #3887iSazonov commentedon May 31, 2017
Thanks! Clear!