Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host List Export is Empty #3

Open
CraigTolley opened this issue Aug 5, 2016 · 2 comments
Open

Host List Export is Empty #3

CraigTolley opened this issue Aug 5, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@CraigTolley
Copy link

When creating a Host List report, the file is created but contains no data even though the list view shows the data.

@CraigTolley
Copy link
Author

CraigTolley commented Aug 5, 2016

The supplied collection to the Out-File is Null. Change $uiHash.Listview.DataContext to $uiHash.Listview.Items

The working code block for me is:

"Host File List" {
If ($uiHash.Listview.Items.count -gt 0) {
$uiHash.StatusTextBox.Foreground = "Black"
$savedreport = Join-Path $Global:ReportPath "hosts.txt"
$uiHash.Listview.Items | Select -Expand Computer | Out-File $savedreport
$uiHash.StatusTextBox.Text = "Report saved to $savedreport"
} Else {
$uiHash.StatusTextBox.Foreground = "Red"
$uiHash.StatusTextBox.Text = "No report to create!"
}
}

@proxb
Copy link
Owner

proxb commented Aug 5, 2016

Thanks again!

@proxb proxb added the bug label Aug 5, 2016
@proxb proxb self-assigned this Aug 5, 2016
@proxb proxb added this to the 2.1.8 milestone Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants