Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
SQL Server
Help required : Manipulating select output
Last Post 09 Aug 2009 10:36 AM by
Boolean_z
. 2 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Boolean_z
New Member
Posts:2
09 Aug 2009 09:37 AM
Hi All,
Below is a typical code for getting result regarding SQL jobs
$srv.JobServer.Jobs | Where-Object {$_.IsEnabled -eq $TRUE} | Select Name,LastRunOutcome, LastRunDate
For sake of brevity I am not giving full code, in the above code srv is sql server.
What I need ?
I want to add a text before name of the job like- if job name is "Job - Truncate Table", i want it to be "MY - Job - Truncate Table". So I want to add "MY " before all job name. Please help.
Mike Pfeiffer
New Member
Posts:28
09 Aug 2009 10:17 AM
Accepted Answer
Try this:
$srv.JobServer.Jobs | Select @{n="Name";e={"My {0}" -f $_.name}},LastRunOutcome, LastRunDate
Boolean_z
New Member
Posts:2
09 Aug 2009 10:36 AM
Great! works absolutely fine.
Thanks a lot..
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
SQL Server
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2