Comments (10)
from powertype.
Thanks for the issue looks like it doesn't allow ExecutionPolicy.Unrestricted
, to be honest I haven't tried this on linux yet so it might not be Arch specific.
from powertype.
@KJP12 could you try 0.0.15 and see if that works as expected?
from powertype.
Enable-PowerType
now throws a URI parsing exception. It seems like either .NET Core or PowerShell doesn't return the location information, given the following:
> [System.Reflection.Assembly]::GetExecutingAssembly()
GAC Version Location
--- ------- --------
False v4.0.30319
Location however might be just blank here because it is being interpreted. Although, it's possible that it is getting something for a URI anyways, given that /home/name
and @
both being passed into the URI builder return the same error without giving any useful information, which seems like a rather odd choice of .NET for being able to debug it, since it removes any ability to even know why. It does seem that C:/home/name
does however get correctly converted to the file protocol with it returning file:///C:/home/name
. It might be more ideal to go ahead and process the path through a URL escaper then prepending file:///
before it before throwing it at URI? That would also account for #
, ?
and %
being present, even if it isn't normally allowed by Windows. Alternatively, if there is a builder API of sorts, that could handle the path part for you.
Example from [System.UriBuilder]::new("@")
PSMessageDetails :
Exception : System.Management.Automation.MethodInvocationException: Exception calling ".ctor" with "1"
argument(s): "Invalid URI: The hostname could not be parsed."
---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions&
creationOptions)
at System.Uri..ctor(String uriString)
at System.UriBuilder..ctor(String uri)
at CallSite.Target(Closure , CallSite , Type , String )
--- End of inner exception stack trace ---
at
System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception
exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
at CallSite.Target(Closure , CallSite , Type , String )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
TargetObject :
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : UriFormatException
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
MyCommand :
BoundParameters : {}
UnboundArguments : {}
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : -1
ScriptName :
Line : [System.UriBuilder]::new("@")
PositionMessage : At line:1 char:1
+ [System.UriBuilder]::new("@")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PSScriptRoot :
PSCommandPath :
InvocationName :
PipelineLength : 0
PipelinePosition : 0
ExpectingInput : False
CommandOrigin : Internal
DisplayScriptPosition :
00000000000000000000000000000000000000000000000000000000000000000000000000000000
ErrorRecord : Exception calling ".ctor" with "1" argument(s): "Invalid URI: The hostname could not be
parsed."
WasThrownFromThrowStatement : False
TargetSite : Void ConvertToMethodInvocationException(System.Exception, System.Type, System.String, Int32,
System.Reflection.MemberInfo)
Message : Exception calling ".ctor" with "1" argument(s): "Invalid URI: The hostname could not be
parsed."
Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
InnerException : System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind,
UriCreationOptions& creationOptions)
at System.Uri..ctor(String uriString)
at System.UriBuilder..ctor(String uri)
at CallSite.Target(Closure , CallSite , Type , String )
HelpLink :
Source : System.Management.Automation
HResult : -2146233087
StackTrace : at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exc
eption exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
at CallSite.Target(Closure , CallSite , Type , String )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1
arg1)
at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
11111111111111111111111111111111111111111111111111111111111111111111111111111111
TargetSite : Void CreateThis(System.String, Boolean, System.UriKind, System.UriCreationOptions ByRef)
Message : Invalid URI: The hostname could not be parsed.
Data : {}
InnerException :
HelpLink :
Source : System.Private.Uri
HResult : -2146233033
StackTrace : at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions&
creationOptions)
at System.Uri..ctor(String uriString)
at System.UriBuilder..ctor(String uri)
at CallSite.Target(Closure , CallSite , Type , String )
Relevant code:
PowerType/PowerType/EnablePowerTypePredictor.cs
Lines 66 to 74 in 96ad142
New error with URI
PSMessageDetails :
Exception : System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions&
creationOptions)
at System.Uri..ctor(String uriString)
at System.UriBuilder..ctor(String uri)
at PowerType.EnablePowerTypePredictor.get_AssemblyPath() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 70
at PowerType.EnablePowerTypePredictor.get_ModuleDirectory() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 76
at PowerType.EnablePowerTypePredictor.get_DictionariesDirectory() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 78
at PowerType.EnablePowerTypePredictor.GetDictionaries()+MoveNext() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 82
at PowerType.PowerTypePredictor..ctor(ICurrentWorkingDirectoryProvider
currentWorkingDirectoryProvider, IEnumerable`1 dictionaryFiles) in
D:\a\PowerType\PowerType\PowerType\PowerTypePredictor.cs:line 30
at PowerType.EnablePowerTypePredictor.ProcessRecord() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 56
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
TargetObject :
CategoryInfo : NotSpecified: (:) [Enable-PowerType], UriFormatException
FullyQualifiedErrorId : System.UriFormatException,PowerType.EnablePowerTypePredictor
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
MyCommand : Enable-PowerType
BoundParameters : {}
UnboundArguments : {}
ScriptLineNumber : 1
OffsetInLine : 1
HistoryId : 4
ScriptName :
Line : Enable-PowerType
PositionMessage : At line:1 char:1
+ Enable-PowerType
+ ~~~~~~~~~~~~~~~~
PSScriptRoot :
PSCommandPath :
InvocationName : Enable-PowerType
PipelineLength : 0
PipelinePosition : 0
ExpectingInput : False
CommandOrigin : Internal
DisplayScriptPosition :
00000000000000000000000000000000000000000000000000000000000000000000000000000000
TargetSite : Void CreateThis(System.String, Boolean, System.UriKind, System.UriCreationOptions ByRef)
Message : Invalid URI: The hostname could not be parsed.
Data : {}
InnerException :
HelpLink :
Source : System.Private.Uri
HResult : -2146233033
StackTrace : at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions&
creationOptions)
at System.Uri..ctor(String uriString)
at System.UriBuilder..ctor(String uri)
at PowerType.EnablePowerTypePredictor.get_AssemblyPath() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 70
at PowerType.EnablePowerTypePredictor.get_ModuleDirectory() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 76
at PowerType.EnablePowerTypePredictor.get_DictionariesDirectory() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 78
at PowerType.EnablePowerTypePredictor.GetDictionaries()+MoveNext() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 82
at PowerType.PowerTypePredictor..ctor(ICurrentWorkingDirectoryProvider currentWorkingDirectoryProvider,
IEnumerable`1 dictionaryFiles) in D:\a\PowerType\PowerType\PowerType\PowerTypePredictor.cs:line 30
at PowerType.EnablePowerTypePredictor.ProcessRecord() in
D:\a\PowerType\PowerType\PowerType\EnablePowerTypePredictor.cs:line 56
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
from powertype.
Sorry for the huge delay, if you have the time, could you create a unit test that recreates the issue and create a fix and send them as a PR?
from powertype.
I get this error in Ubuntu
Enable-PowerType: Invalid URI: The hostname could not be parsed.
from powertype.
Guessing the issue is on all Linux based systems.
I don't currently have a linux install with powershell.
If you can provide a unit test that recreates the issue then I might be able to fix it!
from powertype.
Guessing the issue is on all Linux based systems.
I don't currently have a linux install with powershell.
If you can provide a unit test that recreates the issue then I might be able to fix it!
Well, I don't have experience in C# so I don't think I can do it :) you could just use a VM or WSL might work ;)
from powertype.
@fluentmoheshwar @Ampflower Could you guys try 0.0.16
and see if that solves the issue?
from powertype.
Great :) sorry that it took so much time to fix the issue.
from powertype.
Related Issues (20)
- Add nvm for windows dictionary
- Handle matches from both ValueParameter without keys and Parameters with Keys
- Move platform to filename
- Add Get-PowerType-Dictionaries HOT 1
- Allow the user to specify what Dictionaries to load
- Add support for loading custom Dictionaries
- Add argument completer mode
- DynamicSource caching does not respect current working directory
- Remove code smells
- Add troubleshooting cmdlet
- simplify conditions to constant
- Fix code scanning alert - Missing statement block after 'else' keyword.
- Improve ast handeling HOT 1
- Order suggestions based on usage
- Remove Add-PowerTypeDictionary
- A parameter cannot be found that matches the parameter name 'PredictionSource' HOT 15
- Git merge should suggest local branches
- git push should suggest origin and branch
- Cannot install 0.0.13-preview HOT 2
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 powertype.