1/ Go to ARR Cache, then Server Proxy Settings
2/ Check on Enable proxy
3/ Create a site call AutoACME and add a binding to support autoacme.com port 80
4/ Go to URL Rewrite
| // source is a byte array | |
| using (var reader = new PdfReader(source)) | |
| { | |
| using (var output = new StringWriter()) | |
| { | |
| for (int i = 1; i <= reader.NumberOfPages; i++) | |
| { | |
| output.WriteLine(PdfTextExtractor.GetTextFromPage(reader, i)); | |
| } |
| # Remove ALL containers | |
| docker ps -a -q | % { docker rm $_ } | |
| # Stop and then remove all RUNNING containers | |
| docker ps -q | % { docker stop $_; docker rm $_ } | |
| # Dockerfile command to create a L drive from C:\Logs folder | |
| RUN Set-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'L:' -Value '\??\C:\Logs' -Type String; |
| -- Get all db files from a bak | |
| RESTORE FILELISTONLY | |
| FROM DISK = 'Path to full backup file' | |
| GO | |
| -- Restore database from a bak with move logical files (note on NORECOVERY) | |
| RESTORE DATABASE FindTheBest FROM DISK = 'Path to full backup file' | |
| WITH MOVE 'Data file 1' TO 'Path to data file', | |
| MOVE 'Log file 1' TO 'Path to log file', | |
| NORECOVERY |
In my opinion this is the best way for executing external commands from PowerShell with arguments in a safe manner - via the use of an array to hold the arguments.
Consider this one a PowerShell gem to keep in the toolbox.
Note: the example below makes use of EchoArgs.exe - a small utility that simply echoes back arguments passed to it. Utility is part of the PowerShell Community Extensions, or the exe alone can be downloaded at http://ss64.com/ps/EchoArgs.exe.
Running example.ps1 yields the following output:
| public class EmbededAssemblyHelper | |
| { | |
| private static Assembly _embededResourcesAsm; | |
| private static string _embededResourcesNamespace; | |
| public static void Setup(Assembly embededResourcesAsm, string embededResourcesNamespace) | |
| { | |
| _embededResourcesAsm = embededResourcesAsm; | |
| _embededResourcesNamespace = embededResourcesNamespace; | |
| } |
| Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
| # Install SQL Server 2014 Management Studio | |
| choco install mssqlservermanagementstudio2014express -y --version 12.2.5000.20170905 | |
| # Install SQL Server 2014 | |
| choco install mssqlserver2014express -y --version 12.2.5000.20170905 |
| Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
| # 7Zip - https://chocolatey.org/packages/7zip | |
| choco install 7zip -y | |
| # Notepad++ - https://chocolatey.org/packages/notepadplusplus.install | |
| choco install notepadplusplus.install -y | |
| # TreeSize Free https://chocolatey.org/packages/treesizefree | |
| choco install treesizefree -y |
| SELECT name, create_date, modify_date | |
| FROM sys.objects | |
| WHERE type = 'P' | |
| ORDER BY modify_date desc, create_date desc |