Skip to content

Instantly share code, notes, and snippets.

@ilkka
Created December 11, 2017 10:01
Show Gist options
  • Save ilkka/24b6554567e9fcee3f54a40fe03b7011 to your computer and use it in GitHub Desktop.
Save ilkka/24b6554567e9fcee3f54a40fe03b7011 to your computer and use it in GitHub Desktop.
Script for creating/updating shim PowerShell scripts that transparently run your Python scripts.
# Just drop this in the 'Scripts' directory in your virtualenv and run it.
$Dir = Split-Path ((Get-Variable MyInvocation).Value).MyCommand.Path
$Scripts = Get-ChildItem $Dir | Where-Object {($_.name -match '\.py$') -and ($_.name -notmatch '^activa
te')}
foreach ($Script in $Scripts) {
Write-Output "python $($Script.Fullname) @args" | Out-File ($Script.Fullname -replace '\.py$','.ps1')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment