Forum Discussion

amsrivas's avatar
amsrivas
Helper IV
5 years ago
Solved

To add Identity column in PowerShell result

Hi Guys!!

 

I have executed below command and data has been captured.

 

$Workspaces = Get-PowerBIWorkspace

$Workspaces

 

Output is shown as below 

 

Id : 5eyh4u7e-11e1-4c53-95f9-938fhf7d5af
Name : WorkSpace-1
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

Id : b3j756b5-r745-3t56-q234-frbrf481a84f7
Name : Workspace-2
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

I want to add one more column of Identity, sat ColA =1 etc as shown as below

 

ColA =1

Id : 5eyh4u7e-11e1-4c53-95f9-938fhf7d5af
Name : WorkSpace-1
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

ColA =2

Id : b3j756b5-r745-3t56-q234-frbrf481a84f7
Name : Workspace-2
IsReadOnly : False
IsOrphaned : False
IsOnDedicatedCapacity : True
CapacityId : 97jsuh6u-87hy-4k78-CF45B-C34ff354r41D

 

Please suggest how to achieve this.

 

Thanks

Amit Srivastava

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi amsrivas,

    As lbendlin said, your results already exists on unique field values. If you want a common readable index column, you can rank these unique values based on characters.  

    Regards,

    Xiaoxin Sheng

2 Replies

  • You already have a unique ID attribute.  What's the rationale for adding another ?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi amsrivas,

    As lbendlin said, your results already exists on unique field values. If you want a common readable index column, you can rank these unique values based on characters.  

    Regards,

    Xiaoxin Sheng