I found a way to make it work. It's very convoluted and may have been what Andreas was trying to convey to me, but it took me a few more tries to get it to work. I've made the code generic but if it helps someone else, I'm glad to have done it.
# This creates the hashed password file and only needs to run once unless the password changes.
Read-Host -AsSecureString |ConvertFrom-SecureString |Out-File C:\directory1\directory2\hashedPasswordFile.txt
# This section reads the hashedPasswordFile.txt file from above, converts it back to plain text, and enters it into the -password parameter
$EncryptedSQLPass = Get-Content -Path "C:\directory1\directory2\hashedPasswordFile.txt"
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString $EncryptedSQLPass)))
Invoke-Sqlcmd -ServerInstance '<connectionString,port>' -Database '<databaseName>' -Username '<userName>' -Password ([Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR((ConvertTo-SecureString $EncryptedSQLPass)))) -Query 'select <column1>, <column2> from <databaseTable> where condition = 1 order by <column1>' | Export-csv -NoTypeInformation -Path 'C:\directory\textFile.csv'