Posts Tagged cmd

Managing TortoiseSVN commit and update from command line and creating PowerShell alias

I started to using PowerShell in my development environment simply to learn it a little bit more (though I’m still using the old command from cmd or UNIX) and also to get out of the stone aged cmd. And because I’m using the console a lot – yep, I get used to it on UNIX/Linux machines with terminal access) I was not happy to open explorer just to issue commit or update to/from SVN (these are most common commands I’m using, together with diff in commit window).

And happily TortoiseSVN has a utility to manage most of the basic tasks. It’s called TortoiseProc. To do commit or update in current directory, you’ll simply execute:

tortoiseproc /command:commit /path:.

or

tortoiseproc /command:update /path:.

For a while I was happy with it. But typing it everytime or looking into history (I wish cmd/PS had Ctrl+R as bash has) was not perfect for me. So I started looking for a way to create alias in PowerShell. Some kind of alias. PowerShell, sure, has something like this, I thought. And it has – Set-Alias. Though, limited. If you try to create alias to command with hardcoded parameters, …

set-alias commit "tortoiseproc /command:commit /path:."

… as I was trying, you’ll not succeed. After some searching and trying I found and an idea from Andrew Watt using a function (yes, I’m a PowerShell newbie). It’s easy and convenient to wrap the command into it.

So finally I create PowerShell aliases for TortoiseSVN to nicely support my work from command line:

set-alias update fn_update
set-alias commit fn_commit
function fn_update {tortoiseproc /command:update /path:.}
function fn_commit {tortoiseproc /command:commit /path:.}

Tags: , , ,

EdmGen on steroids? EdmGen2!

The EdmGen tool available in Entity Framework or simply SP1 installation is good tool for playing with CSDL, SSDL and MSL files. On the other hand, when using Visual Studio you get all these files in one EDMX file. Though it’s just a pack of these two files, you cannot use it as input/output for EdmGen.

Fortunately there’s a solution – EdmGen2. It’s simply EdmGen on steroids. :) EdmGen2 can read and write EDMX files and also translate between EDMX and CSDL, SSDL and MSL files. The source code is also available, so you can use sources as learning material to API in System.Data.Entity.Design.

Tags: ,

Sysinternals utilities available “live”

If you’re using Sysinternals utilities (who’s not???), you can now use it “Live”. Just go to \\live.sysinternals.com\tools\ and that’s it. You have available all the great tools you need/want. Great.

Tags: ,

Logování baťáků

Uchovávám si logy z různých skriptů, které automaticky spouštím pro pozdější prozkoumání. Ale řešil jsem, jak jednoduše zajistit zápis do logu (občas někde něco člověk zapomene) a případně jeho potlačení. Nakonec jsem vymyslel jednoduché řešení:

@echo off

if "%1" NEQ "CALL" (
call %0 CALL > batak.log
goto finito
) else (

rem prikazy ...
goto finito
)

:FINITO

Tags: ,