Basic knowledge of scripting, can’t run this script however. Not sure what to put in the expandeddata prompt when I run it.<\/p>\n
You cannot call a method on a null-valued expression.
\nAt C:\\scripts\\Get-WinDiskCapacity.ps1:26 char:1<\/p>\n
<\/code><\/pre>\n<\/li>\n- CategoryInfo : InvalidOperation: (
<\/span>, RuntimeException<\/li>\n- FullyQualifiedErrorId : InvokeMethodOnNull<\/li>\n<\/ul>\n
Advertisement
You cannot call a method on a null-valued expression.
\nAt C:\\scripts\\Get-WinDiskCapacity.ps1:27 char:1<\/p>\n
\n- $size = $size.Substring(0,$size.Length-2)<\/li>\n
- \n
<\/code><\/pre>\n<\/li>\n- CategoryInfo : InvalidOperation: (
<\/span>, RuntimeException<\/li>\n- FullyQualifiedErrorId : InvokeMethodOnNull<\/li>\n<\/ul>\n
You cannot call a method on a null-valued expression.
\nAt C:\\scripts\\Get-WinDiskCapacity.ps1:30 char:8<\/p>\n
\n- return $size.Trim()<\/li>\n
- \n
<\/code><\/pre>\n<\/li>\n- CategoryInfo : InvalidOperation: (
<\/span>, RuntimeException<\/li>\n- FullyQualifiedErrorId : InvokeMethodOnNull<\/li>\n<\/ul>","upvoteCount":2,"answerCount":7,"datePublished":"2018-04-12T12:55:02.000Z","author":{"@type":"Person","name":"jackmohler","url":"https://community.spiceworks.com/u/jackmohler"},"suggestedAnswer":[{"@type":"Answer","text":"
Basic knowledge of scripting, can’t run this script however. Not sure what to put in the expandeddata prompt when I run it.<\/p>\n
You cannot call a method on a null-valued expression.
\nAt C:\\scripts\\Get-WinDiskCapacity.ps1:26 char:1<\/p>\n
\n- $size = $size.Trim()<\/li>\n
- \n
<\/code><\/pre>\n<\/li>\n- CategoryInfo : InvalidOperation: (
<\/span>, RuntimeException<\/li>\n- FullyQualifiedErrorId : InvokeMethodOnNull<\/li>\n<\/ul>\n
You cannot call a method on a null-valued expression.
\nAt C:\\scripts\\Get-WinDiskCapacity.ps1:27 char:1<\/p>\n
\n- $size = $size.Substring(0,$size.Length-2)<\/li>\n
- \n
<\/code><\/pre>\n<\/li>\n- CategoryInfo : InvalidOperation: (
<\/span>, RuntimeException<\/li>\n- FullyQualifiedErrorId : InvokeMethodOnNull<\/li>\n<\/ul>\n
You cannot call a method on a null-valued expression.
\nAt C:\\scripts\\Get-WinDiskCapacity.ps1:30 char:8<\/p>\n
\n- return $size.Trim()<\/li>\n
- \n
<\/code><\/pre>\n<\/li>\n- CategoryInfo : InvalidOperation: (
<\/span>, RuntimeException<\/li>\n- FullyQualifiedErrorId : InvokeMethodOnNull<\/li>\n<\/ul>","upvoteCount":2,"datePublished":"2018-04-12T12:55:02.000Z","url":"https://community.spiceworks.com/t/windiskcapacity-script/645844/1","author":{"@type":"Person","name":"jackmohler","url":"https://community.spiceworks.com/u/jackmohler"}},{"@type":"Answer","text":"
Welcome!<\/p>\n
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>