This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PART-1 Export IIS Application into Excel | |
import-module webadministration | |
$servername = $env:computername | |
get-website | select name,id,state,physicalpath, | |
@{n="Bindings"; e= { ($_.bindings | select -expa collection) -join ';' }} , | |
@{n="LogFile";e={ $_.logfile | select -expa directory}}, | |
@{n="attributes"; e={($_.attributes | % { $_.name + "=" + $_.value }) -join ';' }} | | |
Export-Csv -NoTypeInformation -Path C:\iis-sites.csv | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"swagger":"2.0","info":{"version":"v2","title":"TestingSwagger"},"host":"localhost:59988","schemes":["http"],"paths":{"/api/Account/UserInfo":{"get":{"tags":["Account"],"operationId":"Account_GetUserInfo","consumes":[],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/UserInfoViewModel"}}},"deprecated":false}},"/api/Account/Logout":{"post":{"tags":["Account"],"operationId":"Account_Logout","consumes":[],"produces":["application/json","text/json","application/xml","text/xml"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Object"}}},"deprecated":false}},"/api/Account/ManageInfo":{"get":{"tags":["Account"],"operationId":"Account_GetManageInfo","consumes":[],"produces":["application/json","text/json","application/xml","text/xml"],"parameters":[{"name":"returnUrl","in":"query","required":true,"type":"string"},{"name":"generateState","in":"query","required":false,"type":"boolean"}],"responses":{" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<string> HttpCall(string template, X509Certificate2 certificate, string url) | |
{ | |
try | |
{ | |
#region httpClient | |
var httpContent = new StringContent(template, Encoding.UTF8, "application/soap+xml"); | |
var handler = new WebRequestHandler(); | |
handler.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Validates the date time. yyyymmddhhmmssfffk | |
/// </summary> | |
/// <param name="dateString">The date string.</param> | |
public bool ValidateDateTime(string dateString) | |
{ | |
const string malformedTimeZone = | |
@"^\d{4}(?:(?:0[0-9]|1[0-2])(?:(?:[0-2][0-9]|3[0-1]))?(?:(?:[0-1][0-9]|2[0-4]))?(?:(?:[0-5][0-9]))?(?:(?:[0-5][0-9])(?:\.\d+)?)?)?(?:[+-](0[0-9]|1[0-2]):[0-5][0-9])?$"; | |
return Regex.IsMatch(dateString, malformedTimeZone); |