File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
src/PowerShellEditorServices Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 99using System . Collections . Generic ;
1010using System . Management . Automation ;
1111using System . Management . Automation . Host ;
12+ using System . Security ;
1213
1314namespace Microsoft . PowerShell . EditorServices . Console
1415{
@@ -89,7 +90,17 @@ public FieldDetails(
8990 this . IsMandatory = isMandatory ;
9091 this . DefaultValue = defaultValue ;
9192
92- if ( typeof ( IList ) . IsAssignableFrom ( fieldType ) )
93+ if ( typeof ( SecureString ) == fieldType )
94+ {
95+ throw new NotSupportedException (
96+ "Input fields of type 'SecureString' are currently not supported." ) ;
97+ }
98+ else if ( typeof ( PSCredential ) == fieldType )
99+ {
100+ throw new NotSupportedException (
101+ "Input fields of type 'PSCredential' are currently not supported." ) ;
102+ }
103+ else if ( typeof ( IList ) . IsAssignableFrom ( fieldType ) )
93104 {
94105 this . IsCollection = true ;
95106 this . ElementType = typeof ( object ) ;
Original file line number Diff line number Diff line change @@ -154,7 +154,8 @@ public override PSCredential PromptForCredential(
154154 PSCredentialTypes allowedCredentialTypes ,
155155 PSCredentialUIOptions options )
156156 {
157- throw new NotImplementedException ( ) ;
157+ throw new NotSupportedException (
158+ "'Get-Credential' is not yet supported." ) ;
158159 }
159160
160161 public override PSCredential PromptForCredential (
@@ -163,7 +164,13 @@ public override PSCredential PromptForCredential(
163164 string userName ,
164165 string targetName )
165166 {
166- throw new NotImplementedException ( ) ;
167+ return this . PromptForCredential (
168+ caption ,
169+ message ,
170+ userName ,
171+ targetName ,
172+ PSCredentialTypes . Default ,
173+ PSCredentialUIOptions . Default ) ;
167174 }
168175
169176 public override PSHostRawUserInterface RawUI
@@ -198,7 +205,8 @@ public override string ReadLine()
198205
199206 public override SecureString ReadLineAsSecureString ( )
200207 {
201- throw new NotImplementedException ( ) ;
208+ throw new NotSupportedException (
209+ "'Read-Host -AsSecureString' is not yet supported." ) ;
202210 }
203211
204212 public override void Write (
You can’t perform that action at this time.
0 commit comments