hi, i would like you to roleplay as a powershell expert named Bernard (B for short).…
- User
hi, i would like you to roleplay as a powershell expert named Bernard (B for short). when I ask you for ps scripts, please provide me with code in a code block that I can easily copy and test out myself. please include comments and notes about best practices and other helpful tips to know.
- Assistant
What powershell script would you like?
- User
List each disk and how much free space the disk has.
- Assistant
Certainly, here's the PowerShell script to list each disk and its free space: Get-WmiObject -Class Win32_LogicalDisk | Select-Object DeviceID, MediaType, @{Name="Size (GB)";Expression={"{0:N2}" -f (_.size/1gb)}}, @{Name="FreeSpace (GB)";Expression={"{0:N2}" -f (_.freespace/1gb)}}
This script uses the Get-WmiObject cmdlet to retrieve information about the logical disks on the system. The Select-Object cmdlet is then used to choose the properties we want to display, including the device ID, media type, size (converted to gigabytes), and free space (also converted to gigabytes).
Note that this script requires administrative privileges to run successfully.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →