Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Monday, December 16, 2013

Pass arguments to powershell in batch file


Sometimes you want to run Powershell script without .ps1 files (directly from batch file).
My last post was about that but now I'll show you how to pass arguments to your scriptblock.
It is relatively easy but not easily found from internet.

Here goes:
powershell -Command "& { Write-host $args[0] }" "ARGUMENTS_HERE"

The output should be "ARGUMENTS_HERE".

Real life example:
I needed this for simple script that is fired from another batch file with arguments of files, that need to be scanned for lines. If lines are found, e-mail is sent.

powershell -Command "& { Get-Childitem -Path $args[0] -Filter $args[1] | foreach { $len = get-content $_.FullName | measure-object -char; if ($len.Characters -gt 0) { Send-MailMessage  -SmtpServer 'MAILSERVER HERE' -From 'SENDER HERE' -To 'RECEIVER HERE' -Subject $( 'Errors in log: ' + $($_.Name) ) } } }" "PATH HERE" "FILTER HERE"


It has been long since I posted anything here, I should make a better use for this blog as I search for my own code snippets pretty often :)

Merry Christmas!

Thursday, November 8, 2012

Surface Pro details leaked

Although the RT version of Microsoft’s first tablet ever is already experiencing record sales, there’s no doubt that most people are actually expecting the Surface Pro. 

And the reason is as simple as it could be: it will be able to run legacy Windows programs and won’t be limited to RT apps like the currently available Surface.


Microsoft hasn’t provided too much info on the Surface Pro, but German retailer Notebook.de has recently unveiled pricing for the device and even kicked off a pre-order campaign for local buyers.


The Surface Pro will come equipped with the actual Windows 8 operating system and will pack more advanced hardware as compared to the RT. Sources close to the matter suggest that it’ll feature a larger battery, a higher resolution display and more storage space, most likely up to 128 GB.


The German retailer lists two different Surface Pro versions, one with 128 GB and the other one with 64 GB of storage space.


Hardware information is still limited, but the 128 GB model is priced at $1165 (€909), while the 64 GB version is a bit cheaper – $1035 (€809). Since it’s a European Union state, Germany also has a Value Added Tax (VAT), so the device is going to be cheaper in the United States.


US buyers will be able to get the Surface Pro with 128 GB of storage space for $975 (€763) and the 64 GB flavor for $870 (€679).


While the Surface Pro is going to be a bit heavier than the Surface RT, it’ll provide a full Windows 8 experience. The device will be delivered with a stylus and will boast 4 GB of RAM to better handle the operating system and the installed apps. An Intel Core i5 processor is very likely to be installed on all Surface Pro versions.


The Surface Pro will be heavier than the Surface RT, but it'll be able to run legacy Windows app. The device is expected to be released in early 2013.

Here are the technical specs provided by Notebook.de, but we cannot guarantee that all of these are indeed accurate. Microsoft is yet to issue a comment on the matter, but we’ve contacted the Redmondians and we’ll get back to you as soon as we receive an answer. The technical specification list provided by Microsoft is available here (PDF viewer needed).

- 10.6-inch full HD ClearType display
- 1920x1080 resolution
- Intel Core i5 processor
- 4 GB of RAM
- 128 GB / 64 GB of storage space
- Intel HD 4000 video card
- 802.11 a/b/g/n wireless card
- Bluetooth 4.0
- HD camera
- Vapor Magnesium case
- Total weight – 900g


Anticipating :)

Sunday, October 28, 2012

Surface tablet keynote

If you missed the keynote then now you have the chance to check it out. I am personally quite impressed about the touch cover, which I didn't like from the pictures. The overall quality of the device seems superb, I love how thorough Microsoft has been when developing this product.
But does the RT version come with desktop mode also or are the ones in the end of demo pro versions?
I thought it will be unavailable on RT.
My next PC will be surface :)


Wednesday, October 17, 2012

Microsoft Surface with WinRT prices revealed


Well, the day has come, pre-ordering of Microsoft Surface is open and the prices have been revealed.
To be honest, I'm a bit disappointed in the prices. In this article we look into US prices.
Don't be fooled, these devices are bundled with WinRT version and have ARM processor and no real PC power nor access to desktop programs or desktop itself, like Windows users have today.
For the real PC tablets we have to wait probably until next year 1st or 2nd quarter.


How much do they cost?


Only the 32gb tablet without any extras would be 499$. To get the "touch" cover for it you have to pay extra 100$
Now if you are not into touch keyboard cover and want to go with real typing keyboard cover then replace latter with 120$ (or 130$ for black model that matches your tablet color).
Probably you want a cover anyway so you basically can choose between 599$ tablet with touch keyboard or 619$ or 629$ with real typing keyboard (depending on your color preference).
I strongly believe that it is still a good to have an option to buy the tablet without the cover (developers clap their hands for this)

What about the storage options?

The metro programs are quite small (because there are no super-duper HQ programs yet in MS Store). But if you think about it, 32gb is probably not enough to store your movies and music. Probably you would like to double the storage and go with 64gb version which costs 699$ (and comes with the touch cover).
That's 100$ extra on top of the 599$ device. Isn't that a lot of money for extra 32gb?
Let's compare... If the devices have SSD inside, you can get 120gb laptop SSD drive from amazon right now, if you want to compare. If you sum 32gb with 120gb you get 150gb.
There are no other options besides 32 and 64 gigabytes right now.


All these prices are for US. In United Kingdom, the 699$ model would cost over 900$ (if converted).


What could be better?


To beat Apple's iPad, I think the options provided will not be sufficient and the Surface will remain in shelves until the prices drop or something get's better than iPad (For example if the tablet is equivalent to regular PC by processor and/or operating system).

They would have to come out with a lot better options like:

  • 32gb version (no cover) for super cheap price like 300$ or less (for devs to make more apps)
  • 64gb retail version with cover for 449$
  • 120gb top notch version with cover for 649$
Also, there should be more color options for personalizing the experience (Probably will happen after general availability)
The platform has not proved itself yet and it is quite hard to do so with no decent customer base and programs in the store.
I really like the concept of Windows 8, Windows phone 8 and Metro for touch devices but the high priced hardware provided is not helping this technology to get into the masses...
I would like to go with the cheapest option myself and start experimenting with the platform because there is no real reason why to buy Surface right now. There are no really useful apps for Metro (besides those bundled by Microsoft, but I can access my calendar, mail, IM and other stuff like that even without this tablet).

Pre-Order now!

If you are interested in pre-ordering this great (but high priced) device and live in the US - click here
For other countries - click here (Expect even more higher prices than US)

More information and a video about the Surface


What do you think about the device itself or the pre-order pricing? Leave a comment!