Comments (7)
Can you try adding Microsoft.PowerShell.Utility to ModulesToImport in your PSRC? JEA can get funny with dependencies because the module discovery and auto-loading doesn't work the same as it does in a full language session. We generally recommend adding any modules called inside custom scripts or functions to ModulesToImport to ensure they're pre-loaded into the session. You can also try fully qualifying the cmdlet name in your function definition: Microsoft.PowerShell.Utility\Clear-Variable
from jea.
Unfortunately it's exactly the same. We tried many different workarounds and never got back functions :-/
from jea.
@PaulHigin Any tips for Julien? I'm not sure why the built-in commands would stop working inside custom functions.
from jea.
I provided some workarounds on this page: https://jnury.github.io/JEA_term_not_recognized_name_cmdlet/
By the way, I only found 6 functions affected:
- ConvertFrom-SddlString
- Format-Hex
- Get-FileHash
- Import-PowerShellDataFile
- New-Guid
- New-TemporaryFile
These functions are all provided by the Microsoft.PowerShell.Utility module
from jea.
I'll take a look.
from jea.
@jnury Thanks for reporting this. I am able to reproduce the problem. This is old endpoint configuration code that imports core modules into the restricted session through "snapins". The Microsoft.PowerShell.Utility module consists of binary and script components but snapins only deal with the binary component and leave the script out, which is why the script functions are not available.
I think this is just old legacy code that should be re-written to use module loading rather than snapins.
Can you create an issue on https://github.com/powershell/powershell?
I believe the fix is to re-write how core modules are loaded in the InitialSessionState.CreateRestrictedForRemoteServer() method.
from jea.
Thank-you @PaulHigin !
I found this issue on UserVoice: https://windowsserver.uservoice.com/forums/301869-powershell/suggestions/17852350-wmf-5-1-restrictedremoteserver-session-type-fails so just voted and commented on it. If i can reproduce the behaviour on Powershell Core, I'll open an issue on GitHub.
from jea.
Related Issues (20)
- JustEnoughAdministration DSC: Unable to set GroupManagedServiceAccount HOT 4
- Register-PSSessionConfiguration causes WinRM service hanging in state 'stopping' HOT 15
- Changing Path before changing PSSessionConfiguration damages WinRM service
- Configuration is never compliant when GMSA is not setted
- Resource availability on PowerShell gallery HOT 11
- No License HOT 1
- Implement Ensure parameter in JEA Endpoint DSC resource HOT 1
- Implement a RoleCapabilities DSC resource HOT 5
- JEAEndpoint may be 'not compliant' but actually compliant HOT 3
- Supress Module Warning HOT 8
- Exposing a JEA endpoint as a web service HOT 1
- Register-PSSessionConfiguration continues even when error is reported
- Problem running example in DemoConfig.ps1, fails on ScriptsToProcess
- WinRM service is restarted when running Set, which breaks the DSC run HOT 6
- Access Denied with Domain Controller endpoint HOT 2
- ConvertStringToHashtable should return sorted Hashtable
- Versioning PSSessionConfiguration HOT 1
- Module Versioning
- Set-VMFirmware -Firstbootdevice is not possible
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 jea.