Combining two commands into one and exporting to csv file in Powershell
up vote
0
down vote
favorite
Below is the code I'm using get data from the output of two commands, I then put them into two separate array's. When I combine the arrays the output looks how I would expect, but when I do select and try to output, it has gaps and not formatted correct. How get I get this to output nice to a csv file?
Example code:
$a = get-agentserver
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."Name" -Split '.(?!d)')[0]
'Policy Type' = $_."AgentServerType"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
}
} | Select "Client Name","Policy Type","Backup State","logon","account"
#$NewCSV
$l = foreach($i in $a.name){
get-definition -agentserver $i}
$l | convertto-csv | out-file t1.csv
$m = import-csv t1.csv | select agentserver,name,selectionsummary
$defcsv = $m | foreach-object{
new-object psobject -prop @{
'Policy Name' = $_.Name
'Backup Selection' = $_.selectionsummary
}
} | select "Policy Name","Backup Selection"
#$defcsv
$hope = $NewCSV + $defcsv
$hope2 = $hope | select "Client Name","Policy Name","Policy Type","Backup Selection"
$hope2
Ex output $hope(that look right to me)
Client Name : Name
Policy Type : Ndmp
Backup State : Unknown
logon : Succeeded
account : ndmp_user
Policy Name : Diff Bakcup
Backup Selection : COMMON, D: (Partial)
Ex output of $hope2(which is killing me how to fix)
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
Name Windows
Name Windows
Name Windows
Name Windows
Name Windows
Name Ndmp
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Name e$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Namee$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
Name Backup BLR_Pro... /root_vdm/IN-BLR400-FS-C...
I have cleaned up my code and tried to put my command outputs into one variable and iterate through it in one go, which looks much nicer, but the output result in the same as above in my $hope2 output. It is leaving a big gap under two of the header "Policy Name" and "Backup Selection". Is there a way to use regex to remove those particular spaces only under those two columns in Powershell?
This is the new code I am running using
$agentserver = get-agentserver
$agentserver | convertto-csv | select-object -skip 2 | out-file t2.csv
$agentserver = import-csv t2.csv -Header server,id,type,accountstate,logonaccount
$budefinition = foreach($i in $a.name){
get-backupdefinition -agentserver $i}
$budefinition | convertto-csv | out-file t1.csv
$converted_budef = import-csv t1.csv | select agentserver,name,selectionsummary
$a = $agentserver + $converted_budef
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."server" -Split '.(?!d)')[0]
'Policy Type' = $_."type"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
'Policy Name' = ($_.Name -replace ","," ")
'Backup Selection' = ($_.selectionsummary -replace ","," ")
}
} | Select "Client Name","Policy Name","Policy Type","Backup Selection"
$NewCSV
Example of what I am trying to accomplish would look like this, that I can then use the export-csv and have a nice csv doc.
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
NAME Diff Bakup Windows Common D
NAME Archive Ndmp /root_vdm/
After doing $NewCSV | fl I get a output of two separate list as shown below and I need them to all be in one. Any ideas how to fix it in my code above?
Client Name : Name
Policy Name :
Policy Type : Ndmp
Backup Selection :
Client Name :
Policy Name : Diff Bakcup
Policy Type :
Backup Selection : COMMON D: (Partial)
powershell powershell-v2.0 powershell-v3.0
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 3 more comments
up vote
0
down vote
favorite
Below is the code I'm using get data from the output of two commands, I then put them into two separate array's. When I combine the arrays the output looks how I would expect, but when I do select and try to output, it has gaps and not formatted correct. How get I get this to output nice to a csv file?
Example code:
$a = get-agentserver
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."Name" -Split '.(?!d)')[0]
'Policy Type' = $_."AgentServerType"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
}
} | Select "Client Name","Policy Type","Backup State","logon","account"
#$NewCSV
$l = foreach($i in $a.name){
get-definition -agentserver $i}
$l | convertto-csv | out-file t1.csv
$m = import-csv t1.csv | select agentserver,name,selectionsummary
$defcsv = $m | foreach-object{
new-object psobject -prop @{
'Policy Name' = $_.Name
'Backup Selection' = $_.selectionsummary
}
} | select "Policy Name","Backup Selection"
#$defcsv
$hope = $NewCSV + $defcsv
$hope2 = $hope | select "Client Name","Policy Name","Policy Type","Backup Selection"
$hope2
Ex output $hope(that look right to me)
Client Name : Name
Policy Type : Ndmp
Backup State : Unknown
logon : Succeeded
account : ndmp_user
Policy Name : Diff Bakcup
Backup Selection : COMMON, D: (Partial)
Ex output of $hope2(which is killing me how to fix)
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
Name Windows
Name Windows
Name Windows
Name Windows
Name Windows
Name Ndmp
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Name e$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Namee$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
Name Backup BLR_Pro... /root_vdm/IN-BLR400-FS-C...
I have cleaned up my code and tried to put my command outputs into one variable and iterate through it in one go, which looks much nicer, but the output result in the same as above in my $hope2 output. It is leaving a big gap under two of the header "Policy Name" and "Backup Selection". Is there a way to use regex to remove those particular spaces only under those two columns in Powershell?
This is the new code I am running using
$agentserver = get-agentserver
$agentserver | convertto-csv | select-object -skip 2 | out-file t2.csv
$agentserver = import-csv t2.csv -Header server,id,type,accountstate,logonaccount
$budefinition = foreach($i in $a.name){
get-backupdefinition -agentserver $i}
$budefinition | convertto-csv | out-file t1.csv
$converted_budef = import-csv t1.csv | select agentserver,name,selectionsummary
$a = $agentserver + $converted_budef
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."server" -Split '.(?!d)')[0]
'Policy Type' = $_."type"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
'Policy Name' = ($_.Name -replace ","," ")
'Backup Selection' = ($_.selectionsummary -replace ","," ")
}
} | Select "Client Name","Policy Name","Policy Type","Backup Selection"
$NewCSV
Example of what I am trying to accomplish would look like this, that I can then use the export-csv and have a nice csv doc.
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
NAME Diff Bakup Windows Common D
NAME Archive Ndmp /root_vdm/
After doing $NewCSV | fl I get a output of two separate list as shown below and I need them to all be in one. Any ideas how to fix it in my code above?
Client Name : Name
Policy Name :
Policy Type : Ndmp
Backup Selection :
Client Name :
Policy Name : Diff Bakcup
Policy Type :
Backup Selection : COMMON D: (Partial)
powershell powershell-v2.0 powershell-v3.0
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You shouild choose better variable names, $a=$AgentServers , $l=BackupDefinitions, $m a stripped down version of that, What properties shall defcsv get? Join arrays doesn't work the way you tried. I'd nest the iterations and build the desired final outcome in one go.
– LotPings
Nov 17 at 16:07
@LotPings Ok thank you, sorry if I use the wrong terminally, maybe combine is a better word, the result of $hope has all the data I want to export out to csv. I will try to nest the $defcsv code into the $NewCsv code and see how it turns out. The porperties of defcsv are getting the properties I need, 'Policy Name', and 'Backup Selection' (unless this is not what you mean by properties). Thanks again
– jim wood
Nov 17 at 18:11
What do you get from $hope2 | fl ?
– Walter Mitty
Nov 17 at 21:01
@WalterMitty I am trying to get the final result to be in a nice format that I can do a export-csv and create a csv document.
– jim wood
Nov 18 at 4:08
@WalterMitty I ran my output through the | fl. I see what you mean, it looks to be two seperated list. one list has some entry's missing and the other this has those entry's but has the other two missing. I will post my an example above. Any idea how to correct it?
– jim wood
Nov 18 at 12:48
|
show 3 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Below is the code I'm using get data from the output of two commands, I then put them into two separate array's. When I combine the arrays the output looks how I would expect, but when I do select and try to output, it has gaps and not formatted correct. How get I get this to output nice to a csv file?
Example code:
$a = get-agentserver
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."Name" -Split '.(?!d)')[0]
'Policy Type' = $_."AgentServerType"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
}
} | Select "Client Name","Policy Type","Backup State","logon","account"
#$NewCSV
$l = foreach($i in $a.name){
get-definition -agentserver $i}
$l | convertto-csv | out-file t1.csv
$m = import-csv t1.csv | select agentserver,name,selectionsummary
$defcsv = $m | foreach-object{
new-object psobject -prop @{
'Policy Name' = $_.Name
'Backup Selection' = $_.selectionsummary
}
} | select "Policy Name","Backup Selection"
#$defcsv
$hope = $NewCSV + $defcsv
$hope2 = $hope | select "Client Name","Policy Name","Policy Type","Backup Selection"
$hope2
Ex output $hope(that look right to me)
Client Name : Name
Policy Type : Ndmp
Backup State : Unknown
logon : Succeeded
account : ndmp_user
Policy Name : Diff Bakcup
Backup Selection : COMMON, D: (Partial)
Ex output of $hope2(which is killing me how to fix)
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
Name Windows
Name Windows
Name Windows
Name Windows
Name Windows
Name Ndmp
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Name e$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Namee$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
Name Backup BLR_Pro... /root_vdm/IN-BLR400-FS-C...
I have cleaned up my code and tried to put my command outputs into one variable and iterate through it in one go, which looks much nicer, but the output result in the same as above in my $hope2 output. It is leaving a big gap under two of the header "Policy Name" and "Backup Selection". Is there a way to use regex to remove those particular spaces only under those two columns in Powershell?
This is the new code I am running using
$agentserver = get-agentserver
$agentserver | convertto-csv | select-object -skip 2 | out-file t2.csv
$agentserver = import-csv t2.csv -Header server,id,type,accountstate,logonaccount
$budefinition = foreach($i in $a.name){
get-backupdefinition -agentserver $i}
$budefinition | convertto-csv | out-file t1.csv
$converted_budef = import-csv t1.csv | select agentserver,name,selectionsummary
$a = $agentserver + $converted_budef
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."server" -Split '.(?!d)')[0]
'Policy Type' = $_."type"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
'Policy Name' = ($_.Name -replace ","," ")
'Backup Selection' = ($_.selectionsummary -replace ","," ")
}
} | Select "Client Name","Policy Name","Policy Type","Backup Selection"
$NewCSV
Example of what I am trying to accomplish would look like this, that I can then use the export-csv and have a nice csv doc.
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
NAME Diff Bakup Windows Common D
NAME Archive Ndmp /root_vdm/
After doing $NewCSV | fl I get a output of two separate list as shown below and I need them to all be in one. Any ideas how to fix it in my code above?
Client Name : Name
Policy Name :
Policy Type : Ndmp
Backup Selection :
Client Name :
Policy Name : Diff Bakcup
Policy Type :
Backup Selection : COMMON D: (Partial)
powershell powershell-v2.0 powershell-v3.0
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Below is the code I'm using get data from the output of two commands, I then put them into two separate array's. When I combine the arrays the output looks how I would expect, but when I do select and try to output, it has gaps and not formatted correct. How get I get this to output nice to a csv file?
Example code:
$a = get-agentserver
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."Name" -Split '.(?!d)')[0]
'Policy Type' = $_."AgentServerType"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
}
} | Select "Client Name","Policy Type","Backup State","logon","account"
#$NewCSV
$l = foreach($i in $a.name){
get-definition -agentserver $i}
$l | convertto-csv | out-file t1.csv
$m = import-csv t1.csv | select agentserver,name,selectionsummary
$defcsv = $m | foreach-object{
new-object psobject -prop @{
'Policy Name' = $_.Name
'Backup Selection' = $_.selectionsummary
}
} | select "Policy Name","Backup Selection"
#$defcsv
$hope = $NewCSV + $defcsv
$hope2 = $hope | select "Client Name","Policy Name","Policy Type","Backup Selection"
$hope2
Ex output $hope(that look right to me)
Client Name : Name
Policy Type : Ndmp
Backup State : Unknown
logon : Succeeded
account : ndmp_user
Policy Name : Diff Bakcup
Backup Selection : COMMON, D: (Partial)
Ex output of $hope2(which is killing me how to fix)
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
Name Windows
Name Windows
Name Windows
Name Windows
Name Windows
Name Ndmp
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Name e$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
ArchiveJob_Backup_to_Tape Namee$ (Partial), ...
Diff Bakcup - Name ,... COMMON, D: (Partial)
Name Backup BLR_Pro... /root_vdm/IN-BLR400-FS-C...
I have cleaned up my code and tried to put my command outputs into one variable and iterate through it in one go, which looks much nicer, but the output result in the same as above in my $hope2 output. It is leaving a big gap under two of the header "Policy Name" and "Backup Selection". Is there a way to use regex to remove those particular spaces only under those two columns in Powershell?
This is the new code I am running using
$agentserver = get-agentserver
$agentserver | convertto-csv | select-object -skip 2 | out-file t2.csv
$agentserver = import-csv t2.csv -Header server,id,type,accountstate,logonaccount
$budefinition = foreach($i in $a.name){
get-backupdefinition -agentserver $i}
$budefinition | convertto-csv | out-file t1.csv
$converted_budef = import-csv t1.csv | select agentserver,name,selectionsummary
$a = $agentserver + $converted_budef
$NewCSV = $a | ForEach-Object {
New-Object PSObject -Prop @{
'Client Name' = ($_."server" -Split '.(?!d)')[0]
'Policy Type' = $_."type"
'Backup State' = $_."BackupStatus"
'logon' = $_."LogonAccountTestStatus"
'account' = $_."LogonAccount"
'Policy Name' = ($_.Name -replace ","," ")
'Backup Selection' = ($_.selectionsummary -replace ","," ")
}
} | Select "Client Name","Policy Name","Policy Type","Backup Selection"
$NewCSV
Example of what I am trying to accomplish would look like this, that I can then use the export-csv and have a nice csv doc.
Client Name Policy Name Policy Type Backup Selection
----------- ----------- ----------- ----------------
NAME Diff Bakup Windows Common D
NAME Archive Ndmp /root_vdm/
After doing $NewCSV | fl I get a output of two separate list as shown below and I need them to all be in one. Any ideas how to fix it in my code above?
Client Name : Name
Policy Name :
Policy Type : Ndmp
Backup Selection :
Client Name :
Policy Name : Diff Bakcup
Policy Type :
Backup Selection : COMMON D: (Partial)
powershell powershell-v2.0 powershell-v3.0
powershell powershell-v2.0 powershell-v3.0
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Nov 18 at 12:53
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Nov 17 at 15:16
jim wood
173
173
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
jim wood is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You shouild choose better variable names, $a=$AgentServers , $l=BackupDefinitions, $m a stripped down version of that, What properties shall defcsv get? Join arrays doesn't work the way you tried. I'd nest the iterations and build the desired final outcome in one go.
– LotPings
Nov 17 at 16:07
@LotPings Ok thank you, sorry if I use the wrong terminally, maybe combine is a better word, the result of $hope has all the data I want to export out to csv. I will try to nest the $defcsv code into the $NewCsv code and see how it turns out. The porperties of defcsv are getting the properties I need, 'Policy Name', and 'Backup Selection' (unless this is not what you mean by properties). Thanks again
– jim wood
Nov 17 at 18:11
What do you get from $hope2 | fl ?
– Walter Mitty
Nov 17 at 21:01
@WalterMitty I am trying to get the final result to be in a nice format that I can do a export-csv and create a csv document.
– jim wood
Nov 18 at 4:08
@WalterMitty I ran my output through the | fl. I see what you mean, it looks to be two seperated list. one list has some entry's missing and the other this has those entry's but has the other two missing. I will post my an example above. Any idea how to correct it?
– jim wood
Nov 18 at 12:48
|
show 3 more comments
You shouild choose better variable names, $a=$AgentServers , $l=BackupDefinitions, $m a stripped down version of that, What properties shall defcsv get? Join arrays doesn't work the way you tried. I'd nest the iterations and build the desired final outcome in one go.
– LotPings
Nov 17 at 16:07
@LotPings Ok thank you, sorry if I use the wrong terminally, maybe combine is a better word, the result of $hope has all the data I want to export out to csv. I will try to nest the $defcsv code into the $NewCsv code and see how it turns out. The porperties of defcsv are getting the properties I need, 'Policy Name', and 'Backup Selection' (unless this is not what you mean by properties). Thanks again
– jim wood
Nov 17 at 18:11
What do you get from $hope2 | fl ?
– Walter Mitty
Nov 17 at 21:01
@WalterMitty I am trying to get the final result to be in a nice format that I can do a export-csv and create a csv document.
– jim wood
Nov 18 at 4:08
@WalterMitty I ran my output through the | fl. I see what you mean, it looks to be two seperated list. one list has some entry's missing and the other this has those entry's but has the other two missing. I will post my an example above. Any idea how to correct it?
– jim wood
Nov 18 at 12:48
You shouild choose better variable names, $a=$AgentServers , $l=BackupDefinitions, $m a stripped down version of that, What properties shall defcsv get? Join arrays doesn't work the way you tried. I'd nest the iterations and build the desired final outcome in one go.
– LotPings
Nov 17 at 16:07
You shouild choose better variable names, $a=$AgentServers , $l=BackupDefinitions, $m a stripped down version of that, What properties shall defcsv get? Join arrays doesn't work the way you tried. I'd nest the iterations and build the desired final outcome in one go.
– LotPings
Nov 17 at 16:07
@LotPings Ok thank you, sorry if I use the wrong terminally, maybe combine is a better word, the result of $hope has all the data I want to export out to csv. I will try to nest the $defcsv code into the $NewCsv code and see how it turns out. The porperties of defcsv are getting the properties I need, 'Policy Name', and 'Backup Selection' (unless this is not what you mean by properties). Thanks again
– jim wood
Nov 17 at 18:11
@LotPings Ok thank you, sorry if I use the wrong terminally, maybe combine is a better word, the result of $hope has all the data I want to export out to csv. I will try to nest the $defcsv code into the $NewCsv code and see how it turns out. The porperties of defcsv are getting the properties I need, 'Policy Name', and 'Backup Selection' (unless this is not what you mean by properties). Thanks again
– jim wood
Nov 17 at 18:11
What do you get from $hope2 | fl ?
– Walter Mitty
Nov 17 at 21:01
What do you get from $hope2 | fl ?
– Walter Mitty
Nov 17 at 21:01
@WalterMitty I am trying to get the final result to be in a nice format that I can do a export-csv and create a csv document.
– jim wood
Nov 18 at 4:08
@WalterMitty I am trying to get the final result to be in a nice format that I can do a export-csv and create a csv document.
– jim wood
Nov 18 at 4:08
@WalterMitty I ran my output through the | fl. I see what you mean, it looks to be two seperated list. one list has some entry's missing and the other this has those entry's but has the other two missing. I will post my an example above. Any idea how to correct it?
– jim wood
Nov 18 at 12:48
@WalterMitty I ran my output through the | fl. I see what you mean, it looks to be two seperated list. one list has some entry's missing and the other this has those entry's but has the other two missing. I will post my an example above. Any idea how to correct it?
– jim wood
Nov 18 at 12:48
|
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
jim wood is a new contributor. Be nice, and check out our Code of Conduct.
jim wood is a new contributor. Be nice, and check out our Code of Conduct.
jim wood is a new contributor. Be nice, and check out our Code of Conduct.
jim wood is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53352549%2fcombining-two-commands-into-one-and-exporting-to-csv-file-in-powershell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You shouild choose better variable names, $a=$AgentServers , $l=BackupDefinitions, $m a stripped down version of that, What properties shall defcsv get? Join arrays doesn't work the way you tried. I'd nest the iterations and build the desired final outcome in one go.
– LotPings
Nov 17 at 16:07
@LotPings Ok thank you, sorry if I use the wrong terminally, maybe combine is a better word, the result of $hope has all the data I want to export out to csv. I will try to nest the $defcsv code into the $NewCsv code and see how it turns out. The porperties of defcsv are getting the properties I need, 'Policy Name', and 'Backup Selection' (unless this is not what you mean by properties). Thanks again
– jim wood
Nov 17 at 18:11
What do you get from $hope2 | fl ?
– Walter Mitty
Nov 17 at 21:01
@WalterMitty I am trying to get the final result to be in a nice format that I can do a export-csv and create a csv document.
– jim wood
Nov 18 at 4:08
@WalterMitty I ran my output through the | fl. I see what you mean, it looks to be two seperated list. one list has some entry's missing and the other this has those entry's but has the other two missing. I will post my an example above. Any idea how to correct it?
– jim wood
Nov 18 at 12:48