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 9
9
using System . Collections . Generic ;
10
10
using System . Management . Automation ;
11
11
using System . Management . Automation . Host ;
12
+ using System . Security ;
12
13
13
14
namespace Microsoft . PowerShell . EditorServices . Console
14
15
{
@@ -89,7 +90,17 @@ public FieldDetails(
89
90
this . IsMandatory = isMandatory ;
90
91
this . DefaultValue = defaultValue ;
91
92
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 ) )
93
104
{
94
105
this . IsCollection = true ;
95
106
this . ElementType = typeof ( object ) ;
Original file line number Diff line number Diff line change @@ -154,7 +154,8 @@ public override PSCredential PromptForCredential(
154
154
PSCredentialTypes allowedCredentialTypes ,
155
155
PSCredentialUIOptions options )
156
156
{
157
- throw new NotImplementedException ( ) ;
157
+ throw new NotSupportedException (
158
+ "'Get-Credential' is not yet supported." ) ;
158
159
}
159
160
160
161
public override PSCredential PromptForCredential (
@@ -163,7 +164,13 @@ public override PSCredential PromptForCredential(
163
164
string userName ,
164
165
string targetName )
165
166
{
166
- throw new NotImplementedException ( ) ;
167
+ return this . PromptForCredential (
168
+ caption ,
169
+ message ,
170
+ userName ,
171
+ targetName ,
172
+ PSCredentialTypes . Default ,
173
+ PSCredentialUIOptions . Default ) ;
167
174
}
168
175
169
176
public override PSHostRawUserInterface RawUI
@@ -198,7 +205,8 @@ public override string ReadLine()
198
205
199
206
public override SecureString ReadLineAsSecureString ( )
200
207
{
201
- throw new NotImplementedException ( ) ;
208
+ throw new NotSupportedException (
209
+ "'Read-Host -AsSecureString' is not yet supported." ) ;
202
210
}
203
211
204
212
public override void Write (
You can’t perform that action at this time.
0 commit comments