This file contains hidden or 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
| Add-WebTransform -ProjectPath "WebApplication1.csproj" -Environment "Dev" | |
| Add-WebTransform -ProjectPath "WebApplication1.csproj" -Environment "Live" | |
| Add-WebTransform -ProjectPath "WebApplication1.csproj" -Environment "PreLive" | |
| Add-WebTransform -ProjectPath "WebApplication1.csproj" -Environment "Staging" | |
| function Add-WebTransform() { | |
| Param( | |
| $ProjectPath = "WebApplication1.csproj", | |
| $Environment = "Dev" |
This file contains hidden or 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
| Param( | |
| $userAccount = "NT AUTHORITY\SYSTEM", | |
| $exePath = "C:\Code\SampleTaskConsole\bin\Debug\SampleTaskConsole.exe", | |
| $taskName = "ScormCloudReporting" | |
| ) | |
| Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue | |
| $action = New-ScheduledTaskAction -Execute $exePath | |
| $trigger = New-ScheduledTaskTrigger -Daily -At 1am |
This file contains hidden or 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 static CustomerDto Map(Customer customerEntity) | |
| { | |
| var config = new MapperConfiguration(cfg => cfg.CreateMap<Customer, CustomerDto>()); | |
| var mapper = new Mapper(config); | |
| return mapper.Map<CustomerDto>(customerEntity); | |
| } |
This file contains hidden or 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 (HttpStatusCode Status, string Content) Get(string url) | |
| { | |
| HttpResponseMessage response; | |
| string content = string.Empty; | |
| using (var client = new HttpClient()) | |
| { | |
| response = client.GetAsync(url).Result; | |
| } |
This file contains hidden or 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 class LogController : ApiController | |
| { | |
| public log4net.Repository.Hierarchy.Hierarchy LogHierarchy | |
| { | |
| get | |
| { | |
| return (log4net.Repository.Hierarchy.Hierarchy)LogManager.GetRepository(); | |
| } | |
| } |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <configuration> | |
| <configSections> | |
| <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/> | |
| </configSections> | |
| <appSettings> | |
| <add key="log4net.Internal.Debug" value="true"/> | |
| </appSettings> | |
| <log4net configSource="log4net.config"/> | |
| <startup> |
This file contains hidden or 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
| <system.diagnostics> | |
| <trace autoflush="true"> | |
| <listeners> | |
| <add | |
| name="textWriterTraceListener" | |
| type="System.Diagnostics.TextWriterTraceListener" | |
| initializeData="C:\Users\jmoss\Desktop\log4net.txt" /> | |
| </listeners> | |
| </trace> | |
| </system.diagnostics> |
This file contains hidden or 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
| write-host "Removing existing user $(BasicHttpUsername)" | |
| Get-LocalUser | Where { $_.Name -eq $(BasicHttpUsername) } | Remove-LocalUser | |
| $pwd = ConvertTo-SecureString $(BasicHttpPassword) -AsPlainText -Force | |
| New-LocalUser $(BasicHttpUsername) -Password $pwd -FullName $(BasicHttpUsername) -Description "Http Basic Auth Account" |
This file contains hidden or 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
| import-module DevProjectTools | |
| # Edit this file | |
| function Edit-Profile() { | |
| vim $profile | |
| } | |
| # Edit the vimrc file | |
| function Edit-Vimrc() { | |
| vim $HOME\_vimrc |
This file contains hidden or 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 void AddOrUpdate<T>(string fileName, params string[] columnNames) where T : class | |
| { | |
| Console.WriteLine($"AddOrUpdate : {fileName} "); | |
| var entityRows = new List<T>(); | |
| var csvRows = _csvFileReader.ReadAllRows("DataFiles\\" + fileName); | |
| foreach (var csvRow in csvRows) | |
| { |