Comments (7)
Someone warned me about the fact that supporting regular Powershell will make your life as a developer so much harder.
from contentprep.
- 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.
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.
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.
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.
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.
With PowerShell 7 it works great, thanks for the suggestion.
from contentprep.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contentprep.