I recently found myself in a situation where I had deal with Ticks in Powershell.
What's a tick? you ask.
A tick is the core time measurement in Powershell and .NET, I think...
[System.Datetime] - Core time measurement is a tick.
a tick is 100 nanoseconds.
There are 10000000 ticks in a second.
I was going to try to explain how to convert ticks into seconds but I found a post doing just that. So for sake of not reinventing the wheel, here is the [Link] to the Blog [Get-Admin.com] Explaining how to do it.
May The PoSH Be With You
Powershell Jedi
Friday, December 19, 2008
Tuesday, December 16, 2008
Finding Powershell information on the Internet
Over the Past few months is have evolved into a Powershell junkie.
This is how I find information about Powershell on the Internet.
1.) Google News Alerts - I create several news alerts for phrases like "Powershell", "Powershell WMI", Powershell Snover, Powershell 2.0 2 CTP3 -CTP2 -Beta -2008 (the minus subtracts the following phrase from the search results). Next, I create a folder called "News Alerts - Powershell" in my email client of choice "Yahoo" and a filter that auto sorts all emails containing the word "Powershell" in the subject line into it. Any Time anything is posted any where on the web and is searched by google will be sent directly to me :)
2.) Delicious: I keep a list of interesting Powershell links on Delicious. I'm sure your familiar with Delicious it's very easy to see what other people interested in Powershell have book marked. I often peek at halr9000 from (PowershellCommunity.org)'s Bookmarks.
3.) Powshell Toolbar This Toolbar has links to all of the Major Powershell Blogs, Sites and Online Resources.
Ok, Now that I found all this Information on Powershell my only problem is sifting through it all.
May The PoSH Be With You
Powershell Jedi
This is how I find information about Powershell on the Internet.
1.) Google News Alerts - I create several news alerts for phrases like "Powershell", "Powershell WMI", Powershell Snover, Powershell 2.0 2 CTP3 -CTP2 -Beta -2008 (the minus subtracts the following phrase from the search results). Next, I create a folder called "News Alerts - Powershell" in my email client of choice "Yahoo" and a filter that auto sorts all emails containing the word "Powershell" in the subject line into it. Any Time anything is posted any where on the web and is searched by google will be sent directly to me :)
2.) Delicious: I keep a list of interesting Powershell links on Delicious. I'm sure your familiar with Delicious it's very easy to see what other people interested in Powershell have book marked. I often peek at halr9000 from (PowershellCommunity.org)'s Bookmarks.
3.) Powshell Toolbar This Toolbar has links to all of the Major Powershell Blogs, Sites and Online Resources.
Ok, Now that I found all this Information on Powershell my only problem is sifting through it all.
May The PoSH Be With You
Powershell Jedi
Monday, December 15, 2008
PSSession = Runspace
In Powershell v2 CTP3 which is due any day now all CMDlets ending in the word -Runspace have been renamed to -PSSession.
I think this is good to remember because the powershell development team has stated repeatedly that you will be able to provide users customised or scaled down Runspaces. In a scaled down Runspace users only have access to the CMDlet provided by the administrator.
I think this is good to remember because the powershell development team has stated repeatedly that you will be able to provide users customised or scaled down Runspaces. In a scaled down Runspace users only have access to the CMDlet provided by the administrator.
Labels:
2.0,
CTP 3,
Powershell,
v2
Wednesday, December 10, 2008
Missing CMD function in Powershell
As a network admin I type c:\>start \\RemoteMachine\c$
at the command prompt about 100 times a day.
I like using it because it keeps the run line on my servers and management box clean, call me nitpicky.
But Powershell doesn't have this basic command, and It annoys me to no end.
For me to be able to go 100% PoSH. I would need that command.
lets say...
Start-Location -path \\RemoteMachine\c$
or written with an alias
Start \\RemoteMachine\c$
Ok so I know you do this...
(new-object -comObject Shell.Application).open("\\RemoteMachine\c$")
Seriously?...
I thought Powershell was supposed to reduce typing
Don't get me wrong I love Powershell as much as the next tech.
Hmm...
I wonder it I can use Script CMDlets to turn that into a CMDlet
Just Rambling I guess,
May The PoSH Be With You,
Powershell Jedi
at the command prompt about 100 times a day.
I like using it because it keeps the run line on my servers and management box clean, call me nitpicky.
But Powershell doesn't have this basic command, and It annoys me to no end.
For me to be able to go 100% PoSH. I would need that command.
lets say...
Start-Location -path \\RemoteMachine\c$
or written with an alias
Start \\RemoteMachine\c$
Ok so I know you do this...
(new-object -comObject Shell.Application).open("\\RemoteMachine\c$")
Seriously?...
I thought Powershell was supposed to reduce typing
Don't get me wrong I love Powershell as much as the next tech.
Hmm...
I wonder it I can use Script CMDlets to turn that into a CMDlet
Just Rambling I guess,
May The PoSH Be With You,
Powershell Jedi
Tuesday, December 9, 2008
M.O.M.
Great, another overlapping acronym, “M.O.M.”... No not "Microsoft Operations Manager". As you can see I've been Powershell 2.0 Remoting crazy today. And in Powershell 2.0 you will undoubtedly come across the M.O.M. acronym in a vague theory sort of way akin to how the O.S.I. model relates to the day to day tasks of an Network Admin.
Ok so what is M.O.M. you ask?
Mobile Object Model: Jeffry Snover describes the Mobile Object Model in this way "Islands of optimization in a sea of interoperability."
Let’s say your managing a Exchange 12 box remotely. Exchange isn't installed on your remote machine. So there’s no way for your machine to understand the exchange code.
When you are remoting using in Powershell 2.0 objects are serialized then returned to you as XML over the wire. Because the methods of the remote objects are code which didn’t come across the wire you cannot use the methods of the objects while remoting.
Coded based applications like Exchange = Islands of optimization
The serialized XML data = The Sea of interoperability
Ok, that it for a while.
May the PoSH Be with you,
Powershell Jedi
Ok so what is M.O.M. you ask?
Mobile Object Model: Jeffry Snover describes the Mobile Object Model in this way "Islands of optimization in a sea of interoperability."
Let’s say your managing a Exchange 12 box remotely. Exchange isn't installed on your remote machine. So there’s no way for your machine to understand the exchange code.
When you are remoting using in Powershell 2.0 objects are serialized then returned to you as XML over the wire. Because the methods of the remote objects are code which didn’t come across the wire you cannot use the methods of the objects while remoting.
Coded based applications like Exchange = Islands of optimization
The serialized XML data = The Sea of interoperability
Ok, that it for a while.
May the PoSH Be with you,
Powershell Jedi
Labels:
2,
Powershell,
Remoting,
Web Services
Who needs SMS!!
Install an .MSI package via WMI
(Get-WMIObject -ComputerName $TargetSys -list | Where-Object -FilterScript {$_.Name -eq "Win32_Product"}).PSBase.InvokeMethod("Install","\\AppSrv\dsp\NewPackage.msi")
May the PoSH Be with you,
Powershell Jedi
(Get-WMIObject -ComputerName $TargetSys -list | Where-Object -FilterScript {$_.Name -eq "Win32_Product"}).PSBase.InvokeMethod("Install","\\AppSrv\dsp\NewPackage.msi")
May the PoSH Be with you,
Powershell Jedi
Finding Remotable CMDlets
Find all remotable Powershell CMDlets in any Session
Get-Help * -Parameter ComputerName
May the PoSH Be with you,
Powershell Jedi
Get-Help * -Parameter ComputerName
May the PoSH Be with you,
Powershell Jedi
Subscribe to:
Posts (Atom)