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
| Set-NetIPInterface -InterfaceIndex 12 -AutomaticMetric Disabled -InterfaceMetric 1 | |
| Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled false | |
| Install-WindowsFeature RemoteAccess -IncludeManagementTools | |
| Add-WindowsFeature -name Routing -IncludeManagementTools | |
| Restart-Computer | |
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
| Get-NetIPInterface | |
| Set-NetIPInterface -InterfaceIndex 12 -AutomaticMetric Disabled -InterfaceMetric 1 |
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
| Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled false |
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
| Install-WindowsFeature RemoteAccess -IncludeManagementTools | |
| Add-WindowsFeature -name Routing -IncludeManagementTools | |
| Restart-Computer |
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
| static void Main(string[] args) | |
| { | |
| var client = new HttpClient(); | |
| client.DefaultRequestHeaders.Add("X-License-Key", "YourLicenseKey"); | |
| client.DefaultRequestHeaders.Add("Accept", "application/json"); | |
| var last = DateTime.Now; | |
| while (true) | |
| { | |
| Thread.Sleep(60 * 1000); |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Net; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| using System.Reactive.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; |
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
| "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:dirPath="C:\Repository" -dest:computerName="http://ww.xx.yy.zz/MSDeployAgentService",userName="administrator",password="zeijaku",includeAcls="False",dirPath="C:\www\Image" -skip:objectName='dirPath',absolutePath='\\\.git' |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Converters; | |
| namespace Chatwork.Service | |
| { | |
| public static class DateTimeExtensions |
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
| using (var rs = RunspaceFactory.CreateRunspace()) | |
| { | |
| rs.Open(); | |
| using (var ps = PowerShell.Create()) | |
| { | |
| ps.Runspace = rs; | |
| ps.AddCommand("Get-ChildItem"); | |
| foreach (var result in ps.Invoke()) | |
| { | |
| Console.WriteLine("{0} {1}", result.Properties["Name"].Value, result.Properties["CreationTime"].Value); |
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
| var connectionInfo = new WSManConnectionInfo() | |
| { | |
| Scheme = "https", | |
| ComputerName = "servername.cloudapp.net", | |
| Port = 7654, | |
| Credential = new PSCredential("username", | |
| "syoboipassword".Aggregate(new SecureString(), (s, c) => | |
| { | |
| s.AppendChar(c); | |
| return s; |