re: [msh] get-property not working on alias



This is exactly the reason why we changed the names of that cmdlet family to *-ItemProperty (coming soon to a build near you.)



These cmdlets provide access to properties of items when exposed by a certain type of Cmdlet Provider. For example, the Registry provider lets you manage values on Registry keys.



This is a slightly different concept than properties on .Net or COM objects, although one could conceptually write a provider that does understand these type of objects.



--

Lee Holmes [MSFT]

Microsoft Command Shell Development

Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.





-----Original Message-----

From: /\\/\\o\\/\\/

Posted At: Thursday, March 09, 2006 12:02 PM

Posted To: microsoft.public.windows.server.scripting

Conversation: [msh] get-property not working on alias

Subject: [msh] get-property not working on alias





while playing with get-property, I got this error :



MSH>gp alias:td

get-property : Cannot use interface. The IPropertyCmdletProvider

interface is not supported by this provider.

At line:1 char:3

+ gp <<<< alias:td



as an alias has properies see command below, I think the provider should

provide this interface.



MSH>ls alias:td | gm -membertype property





TypeName: System.Management.Automation.AliasInfo



Name MemberType Definition

---- ---------- ----------

CommandType Property System.Management.Automation.CommandTypes

CommandType {get;}

Definition Property System.String Definition {get;}

Description Property System.String Description {get;set;}

Name Property System.String Name {get;}

Options Property

System.Management.Automation.ScopedItemOptions Options {get;set;}

ReferencedCommand Property System.Management.Automation.CommandInfo

ReferencedCommand {get;}

ResolvedCommand Property System.Management.Automation.CommandInfo

ResolvedCommand {get;}



also it would be nice I think as GP will show ALL propeties

MSH>gp test.txt





Directory: Microsoft.Management.Automation.Core\FileSystem::C:\





Mode LastWriteTime Length Name

---- ------------- ------ ----

-a--- 2/20/2006 12:46 AM 28 test.txt





MSH>gi test.txt





Directory: Microsoft.Management.Automation.Core\FileSystem::C:\





Mode LastWriteTime Length Name

---- ------------- ------ ----

-a--- 2/20/2006 12:46 AM 28 test.txt



MSH> gi test.txt | gm -membertype property



now it does not make a difference what command you use, I think if you

use get-property you should not get the default formatting but all

properties like this :





MSH>gi test.txt | fl *





MshPath :

Microsoft.Management.Automation.Core\FileSystem::C:\test.txt

MshParentPath : Microsoft.Management.Automation.Core\FileSystem::C:\

MshChildName : test.txt

MshDrive : C

MshProvider : Microsoft.Management.Automation.Core\FileSystem

MshIsContainer : False

Mode : -a---

Name : test.txt

Length : 28

DirectoryName : C:\

Directory : C:\

IsReadOnly : False

Exists : True

FullName : C:\test.txt

Extension : .txt

CreationTime : 10/13/2005 9:11:47 PM

CreationTimeUtc : 10/13/2005 7:11:47 PM

LastAccessTime : 2/21/2006 7:56:07 PM

LastAccessTimeUtc : 2/21/2006 6:56:07 PM

LastWriteTime : 2/20/2006 12:46:13 AM

LastWriteTimeUtc : 2/19/2006 11:46:13 PM

Attributes : Archive





maybe that would make it a bit more usefull in this case, as now its

just the same anyway.



b.t.w. I do not think I used the get-property command much before

anyway, as in the regprovider.



my natural reaction would be more like this :



(gi .).ExecutionPolicy = 'RemoteSigned'



but in this case I get back this information :



MSH>(gi .).property

Path

ExecutionPolicy



Ok this then ;-)



MSH>(gi .).property.ExecutionPolicy

MSH>(gi .).property |gm





TypeName: System.String



hmm, Nope not much use either.





gr /\/\o\/\/


.



Relevant Pages

  • [msh] get-property not working on alias
    ... while playing with get-property, I got this error: ... The IPropertyCmdletProvider interface is not supported by this provider. ... as an alias has properies see command below, I think the provider should provide this interface. ...
    (microsoft.public.windows.server.scripting)
  • Re: Add record and update List
    ... Click the command button and it opens a form to add a record. ... You have a form that's used for Provider demographics (what's ... Microsoft Office/Access MVP ...
    (microsoft.public.access.formscoding)
  • Bug in OdbcCommandBuilder
    ... I need to access Sybase ASE Server 12.0, but Oledb provider provided by ... so I have to use ODBC. ... the command text built is: ...
    (microsoft.public.dotnet.languages.csharp)
  • Data access in XML from Sql-server200 using asp
    ... Dim adoStreamQuery ' As ADODB.Stream ... Set adoCmd.CommandStream = adoStreamQuery ' Set the command object's command to the input stream set above ... Object or provider is not capable of performing requested operation. ... SQLXMLOLEDB Provider command object can only execute to a stream. ...
    (microsoft.public.inetserver.asp.db)
  • Re: (msh) get-command does not work in variable provider
    ... Looks like get command is trying to navigate over current provider. ... Please open a bug. ...
    (microsoft.public.windows.server.scripting)

Loading