@@ -129,5 +129,77 @@ private static string NormalizeStringLength(string str, int targetLength, char f
129
129
return str ;
130
130
}
131
131
}
132
+
133
+ public static string Format ( PSApplicationGatewaySslPredefinedPolicy policy , int depth = 0 )
134
+ {
135
+ string prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
136
+ StringBuilder output = new StringBuilder ( ) ;
137
+
138
+ output . AppendFormat ( "{0}{1}: {2}" , prefix , "Name" , policy . Name ) ;
139
+ output . AppendLine ( ) ;
140
+
141
+ output . AppendFormat ( "{0}{1}: {2}" , prefix , "MinProtocolVersion" , policy . MinProtocolVersion ) ;
142
+ output . AppendLine ( ) ;
143
+
144
+ output . AppendFormat ( "{0}{1}:" , prefix , "CipherSuites" ) ;
145
+ output . AppendLine ( ) ;
146
+ depth ++ ;
147
+ prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
148
+ foreach ( var cipher in policy . CipherSuites )
149
+ {
150
+ output . AppendFormat ( "{0}{1}" , prefix , cipher ) ;
151
+ output . AppendLine ( ) ;
152
+ }
153
+ output . AppendLine ( ) ;
154
+
155
+ return output . ToString ( ) ;
156
+ }
157
+
158
+ public static string Format ( PSApplicationGatewayAvailableSslOptions availableSslOptions , int depth = 0 )
159
+ {
160
+ string prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
161
+ StringBuilder output = new StringBuilder ( ) ;
162
+
163
+ output . AppendFormat ( "{0}{1}: {2}" , prefix , "DefaultPolicy" , availableSslOptions . DefaultPolicy ) ;
164
+ output . AppendLine ( ) ;
165
+
166
+ output . AppendFormat ( "{0}{1}:" , prefix , "PredefinedPolicies" ) ;
167
+ output . AppendLine ( ) ;
168
+ depth ++ ;
169
+ prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
170
+ foreach ( var policy in availableSslOptions . PredefinedPolicies )
171
+ {
172
+ output . AppendFormat ( "{0}{1}" , prefix , policy . Id ) ;
173
+ output . AppendLine ( ) ;
174
+ }
175
+ output . AppendLine ( ) ;
176
+
177
+ depth -- ;
178
+ prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
179
+ output . AppendFormat ( "{0}{1}:" , prefix , "AvailableCipherSuites" ) ;
180
+ output . AppendLine ( ) ;
181
+ depth ++ ;
182
+ prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
183
+ foreach ( var cipher in availableSslOptions . AvailableCipherSuites )
184
+ {
185
+ output . AppendFormat ( "{0}{1}" , prefix , cipher ) ;
186
+ output . AppendLine ( ) ;
187
+ }
188
+ output . AppendLine ( ) ;
189
+
190
+ depth -- ;
191
+ prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
192
+ output . AppendFormat ( "{0}{1}:" , prefix , "AvailableProtocols" ) ;
193
+ output . AppendLine ( ) ;
194
+ depth ++ ;
195
+ prefix = new string ( ' ' , depth * ApplicationGatewayPowerShellFormatting . TabSize ) ;
196
+ foreach ( var protocol in availableSslOptions . AvailableProtocols )
197
+ {
198
+ output . AppendFormat ( "{0}{1}" , prefix , protocol ) ;
199
+ output . AppendLine ( ) ;
200
+ }
201
+
202
+ return output . ToString ( ) ;
203
+ }
132
204
}
133
205
}
0 commit comments