Question: I need to store command output to pass it as variable in function later

```
#This works
[scriptblock]$command = {Get-EventLog system -newest 1  | Format-List}
$command.Invoke()

```

But when I try to Write-Host it fails

```
#This works
[scriptblock]$command = {Get-EventLog system -newest 1  | Format-List}
Write-Host $command.Invoke()

```

with output

```
Microsoft.PowerShell.Commands.Internal.Format.FormatStartData Microsoft.PowerShell.Commands.Internal.Format.GroupStartData Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData Microsoft.PowerShell.Commands.Internal.Format.GroupEndData Microsoft.PowerShell.Commands.Internal.Format.FormatEndData

```

Line of the script in which I'm trying to use it is

```
$SMTPMessage = New-Object System.Net.Mail.MailMessage('UserName user@my.domain','user2@my.domain','subjectText',($command.Invoke()) )

```

Thanks

Answer: 
> 
> Is there a way to solve this without creating and copying to a new partition
> 
> 
> 

Nope, the number of inodes is fixed when the filesystem is created as the [man page](http://linux.die.net/man/8/mke2fs) says

> 
> Be warned that it is not possible to expand the number of inodes on a filesystem after it is created, so be careful deciding the correct value for this parameter.
> 
> 
>
Mostly no, but in your case you have used LVM and there is a LV (Logical Volume) for home.

If you run `pvdisplay` and look for "free extents" it may be possible run `lvexpand` to increase the size of the home LV, and then run `resize2fs` 

Downside is you'll only add inodes at the same rate as the current filesyste already has.

What you need to do is find which directory has a lot of files, and decide if you need them

**A 0-byte file will use an inode.**

`$ ls -la /home
drwxr-xr-x 194 criggie criggie 28672 Sep 8 18:13 criggie
drwxr-xr-x 2 statler statler 4096 Dec 13 2015 statler
drwxr-xr-x 2 wakdorf waldorf 4096 Dec 21 2014 waldorf`

Notice the **194** in the second column? This shows there are a lot of inodes in use in that directory. `cd` into that directory and repeat.

I suspect you have a temp directory or something with many thousands of small files, which can likely be purged.