Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
How to get .Direcory of $args?
Last Post 15 Aug 2010 08:06 AM by
absolutebeginner
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
absolutebeginner
New Member
Posts:14
15 Aug 2010 08:02 AM
Hello,
I do have some scripts that I access through links in Windows-Explorers SendTo context menu. For example one of them is "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit sha1" which is a link to a script that calculates the SHA-1 of the file I right-clicked on. The path of the file gets passed to the script as $args.
Now I make a script for which I need to get the Directory of that $args ($args.Directory) but unfortunately this isn't possible. Powershell doesn't even show an error. Simply nothing happens.
How could I achive this?
Thanks!
absolutebeginner
New Member
Posts:14
15 Aug 2010 08:06 AM
BTW, this forum flattens my postings. The returns get omitted. Do I have to insert
?
EDIT: Aha!
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2