Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell on Photon: Cannot add PowerShell Type #752

Closed
jakerobinson opened this issue Mar 20, 2018 · 5 comments
Closed

PowerShell on Photon: Cannot add PowerShell Type #752

jakerobinson opened this issue Mar 20, 2018 · 5 comments

Comments

@jakerobinson
Copy link

The following works fine on PowerShell installations of MacOS, Ubuntu Linux and Windows, but not on Photon:

$Source = @"
public class BasicTest
{
   public static int Add(int a, int b)
     {
         return (a + b);
     }
   public int Multiply(int a, int b)
     {
     return (a * b);
     }
 }
"@
Add-Type -TypeDefinition $Source

The error received:

Add-Type : Could not find a part of the path '/usr/lib/powershell/ref'.                                                At line:1 char:1                                                                                                       + Add-Type -TypeDefinition $Source                                                                                     + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                     + CategoryInfo          : NotSpecified: (:) [Add-Type], DirectoryNotFoundException                                     + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand
@suezzelur
Copy link
Contributor

As a workaround, can you try mkdir -p /usr/lib/powershell/ref/ && ln -s /usr/lib/powershell/*.dll /usr/lib/powershell/ref/

@YustasSwamp
Copy link
Contributor

@jakerobinson have you tried this?

@jakerobinson
Copy link
Author

as a matter of fact, I am trying it right now! :)

@jakerobinson
Copy link
Author

seems to work. Will add to dockerfile as workaround.

jakerobinson pushed a commit to jakerobinson/powerclicore that referenced this issue Apr 24, 2018
jakerobinson pushed a commit to jakerobinson/powerclicore that referenced this issue Apr 24, 2018
jakerobinson pushed a commit to jakerobinson/powerclicore that referenced this issue Apr 24, 2018
jakerobinson pushed a commit to jakerobinson/powerclicore that referenced this issue May 1, 2018
jakerobinson added a commit to vmware/powerclicore that referenced this issue May 1, 2018
ghost pushed a commit that referenced this issue Nov 18, 2019
- fix issues:
- #891
- #889
- #850
- #815
- #752

Change-Id: I28c8440f67be3816473e34b22fa6067b49deba60
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/8582
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Tapas Kundu <tkundu@vmware.com>
Reviewed-by: Shreyas Ranjan Behera <shreyasb@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
@ppadmavilasom
Copy link
Contributor

with 6.2.3 update, the workaround mentioned here is not required.

ghost pushed a commit that referenced this issue Dec 6, 2019
- fix issues:
- #891
- #889
- #850
- #815
- #752

Change-Id: I28c8440f67be3816473e34b22fa6067b49deba60
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/8607
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants