Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Remove part of a output

$
0
0

Hi everybody,

 

I´m very close to going really crazy because I cant figure out whats wrong ...

I have the following query:

 

######################

$User = Get-ADUser -Filter {name -like "ABC1*"} | sort-object -property name -descending | Select -Exp Name -First 1 | ft name

######################

This is my result:

ABC1234

######################

Then I try to make this:

$User.Remove(3,0)

but I get the following error message:

 

Fehler beim Aufrufen der Methode, da [Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData] keine Methode mit dem Namen "Remove" enthält.
In Zeile:1 Zeichen:1
+ $User.Remove(3,0)
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

 

What I need is, just to "cut" the numbers (in this example 1234) and increase this +1.

 

Can somebody please help me?

 

Many thanks

Best regards

Sempai0815


Viewing all articles
Browse latest Browse all 6937

Trending Articles