GithubHelp home page GithubHelp logo

Comments (7)

svrooij avatar svrooij commented on July 17, 2024 1

Someone warned me about the fact that supporting regular Powershell will make your life as a developer so much harder.

from contentprep.

svrooij avatar svrooij commented on July 17, 2024
  1. You should not package to a sub folder of the folder you want to package.

I do agree that it could give a better error message, and that is should check that the destination is not in the source

from contentprep.

juharuotsalainen avatar juharuotsalainen commented on July 17, 2024

Using the same folder for source and destination (and also using full path for setup) did not solve the issue:

PS C:\Program Files\WindowsPowerShell\Scripts> New-IntuneWinPackage -SourcePath "C:\temp\" -DestinationPath "C:\temp\" -SetupFile "C:\temp\test.exe" -verbose -Debug
VERBOSE: Begin creating package
VERBOSE: Trying to create package for C:\temp\test.exe

Confirm
The type initializer for 'PerTypeValues`1' threw an exception.
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): y
New-IntuneWinPackage : The type initializer for 'PerTypeValues`1' threw an exception.
At line:1 char:1
+ New-IntuneWinPackage -SourcePath "C:\temp\" -DestinationPath "C:\temp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-IntuneWinPackage], TypeInitializationException
    + FullyQualifiedErrorId : 1,SvR.ContentPrep.Cmdlet.NewIntuneWinPackageCommand

Is it possible I'm missing some dependencies? I tried installing recent versions of .NET SDK's and frameworks to no avail.

I'm running Windows 10 Enterprise, 22H2 version.

from contentprep.

juharuotsalainen avatar juharuotsalainen commented on July 17, 2024

Here's the inner exception:

PS C:\Program Files\WindowsPowerShell\Scripts> $Error[0].Exception.InnerException
Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system
cannot find the file specified.

from contentprep.

svrooij avatar svrooij commented on July 17, 2024

Are you running Powershell core or regular Powershell?

And you cannot package to the same folder!

Source c:\temp\source\....
Destination c:\temp\destination\...

from contentprep.

juharuotsalainen avatar juharuotsalainen commented on July 17, 2024

Same error even with New-IntuneWinPackage -SourcePath "C:\temp\source" -DestinationPath "C:\temp\destination" -SetupFile "C:\temp\source\test.exe" -verbose -Debug

I'm running the regular PowerShell that came bundled with Windows.

from contentprep.

juharuotsalainen avatar juharuotsalainen commented on July 17, 2024

With PowerShell 7 it works great, thanks for the suggestion.

from contentprep.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.