Try changing that "select" cmdlet to:
$res | Select-Object @{n='ServiceName';e={($_.ServiceName -split "\.")[1]}}, Status, MachineName
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Requirement is to fetch only name of service by cutting down before and after period, AAA.BBB.CCC is the service name which is writing to excel so while importing that excel we need to have trimmed it to display only BBB.
Please help here
Try changing that "select" cmdlet to:
$res | Select-Object @{n='ServiceName';e={($_.ServiceName -split "\.")[1]}}, Status, MachineName
Hey,
can you please post the script you have written? Please explain what is not working, what the challenges are?
Thanks in advnace!
Regards,
Stoyan