'I search how to match with my last character
I'm on PowerShell and i need to match my last character of my variable:
My example is not to get user
$Myobject = Get-Something -Filter 'Name -like "T*"'
When I write $Myobject I have this:
Ta
Taaa
Tb
Tbaa
Tc
Tcaa
I'm trying to match to have only:
Ta
Tb
Tc
So I have try this:
$MyObject | Where-Object{ ($_.Name -match '^T[a-c]$')} | Select-Object Name
The only result i have with different type of command is the first result and it's impossible to find on the web "How to match the last character".
Thank you for your help.
Best regards
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
