Windows 11 has modern PowerShell cmdlets for disk management. This is cleaner than Diskpart because it's object-based and easier to script. You can save the script as .cmd and double click the file to partition a hard drive on Windows 11.
# List all drives
Get-Disk
# Initialize the new disk (replace 1 with your disk number)
Initialize-Disk -Number 1 -PartitionStyle GPT
# Create a 500GB partition
New-Partition -DiskNumber 1 -Size 500GB -DriveLetter D | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Games"
# Create another partition with the remaining space
New-Partition -DiskNumber 1 -UseMaximumSize -DriveLetter E | Format-Volume -FileSystem NTFS -NewFileSystemLabel "Files"
This does the same as diskpart but in a single, more readable script.
P.S. If you want a more user-friendly or advanced method (resize/move without limits), then a dedicated disk partition software is more recommended.