PowerShell polyglot

Here’s an example of a CMD script that is implemented in PowerShell. @@:: This prolog allows a PowerShell script to be embedded in a .CMD file. @@:: Any non-PowerShell content must be preceeded by “@@” @@setlocal @@set POWERSHELL_BAT_ARGS=%* @@if defined POWERSHELL_BAT_ARGS set POWERSHELL_BAT_ARGS=%POWERSHELL_BAT_ARGS:”=\”% @@PowerShell -Command Invoke-Expression $(‘$args=@(^&{$args} %POWERSHELL_BAT_ARGS%);’+[String]::Join(‘;’,$((Get-Content ‘%~f0’) -notmatch ‘^^@@’))) & goto :EOF If…

1

Is Virtual Memory dead?

To figure out whether virtual memory makes sense, you have to look at the following factors: RAM size Disk size RAM speed Disk speed It’s the relationship between these values that matter.  (All of these are considered in the context of a fifth factor: price.  For example, you can usually find a way to buy…

1