Created
November 8, 2019 06:19
-
-
Save dstreefkerk/be93ec900abd7bc2947d97a749e9fa27 to your computer and use it in GitHub Desktop.
Batch file that enables a CSV to be dragged/dropped and then opened in a PowerShell GridView. Requires the PowerShell ISE to be instaled.
This file contains 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
@echo off | |
IF "%~1"=="" GOTO NOFILE | |
set CSVPATH=%~1 | |
ECHO Loading CSV %CSVPATH% | |
powershell.exe -NoProfile -NoExit -NoLogo -Command "if ((Test-Path $env:CSVPATH -PathType Leaf) -and ($env:CSVPATH -like '*.csv')) {Import-Csv -Path $env:CSVPATH | Out-GridView -Wait -Title $env:CSVPATH};exit" | |
GOTO END | |
:NOFILE | |
ECHO No file specified | |
:END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment