About MicrosoftTeams-TeamFunSettings - microsoft-teams

Today I found that the MicrosoftTeams powershell command Get-TeamFunSettings failed to run when the property GiphyContentRating value is "Allow all content".
Error info:
Get-TeamFunSettings : Error converting value "unknownFutureValue" to
type
'System.Nullable`1[Microsoft.TeamsCmdlets.PowerShell.Custom.Model.GiphyRatingType]'.
Path 'funSettings.giphyContentRating', line 1, position 844. At line:1
char:1
+ Get-TeamFunSettings -GroupId a3f33284-82a5-4643-a43d-401f2568177c
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-TeamFunSettings], JsonSerializationException
+ FullyQualifiedErrorId : Newtonsoft.Json.JsonSerializationException,Microsoft.TeamsCmdlets.PowerShell.Custom.GetF
unSettings

We are actively investigating this issue and a fix is expected shortly. Note this commend is in beta so instability is not unexpected.

Maybe it's just very new but according to the documentation of the command "Allow all content" is not an option. (I do think it should be one, though)
https://learn.microsoft.com/en-us/powershell/module/teams/set-teamfunsettings

Related

cURL not recognizing command line parameters (Windows 10)

Not sure what I'm doing wrong, but any command line parameters I try to pass into curl (using double dash) are interpreted as a url.
Running curl --help:
curl : The remote name could not be resolved: '--help'
At line:1 char:1
+ curl --help
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
With a single dash it seems to interpret a url parameter, but it doesn't find certain parameters. Running curl -sSL:
Invoke-WebRequest : A parameter cannot be found that matches parameter name 'sSL'.
At line:1 char:6
+ curl -sSL
+ ~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Curl binary downloaded from https://curl.se/windows/
You can find the answer here: Running curl via powershell - how to construct arguments?
"In PowerShell curl is a built in alias to Invoke-WebRequest cmdlet. And aliases have priority in command resolution. To solve your problem you have more specifically, use curl.exe instead of curl, so command not resolved to alias"

Errors when opening Power Shell or VSC

When I open Windows PowerShell or VSC it prints this message:
Invoke-Expression : At line:1 char:768
... es\Git\cmd;"C:\Users\Shawn\AppData\Local\Microsoft\WindowsApps;C:\Use ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'C:\Users\Shawn\AppData\Local\Microsoft\WindowsApps' in expression or statement.
At C:\Users\Shawn\anaconda3\shell\condabin\Conda.psm1:101 char:9
Invoke-Expression -Command $activateCommand;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
FullyQualifiedErrorId : UnexpectedToken,Microsoft.PowerShell.Commands.InvokeExpressionCommand
How do I remedy this so that I can be sure that my system will run things correctly.

AppxProvisionedPackage commands stuck on PowerShell and return DismInitialize failed

I am trying to install LOB UWP application
I used:
Add-AppxProvisionedPackage -Online -PackagePath "APPX_PATH"
-DependencyPackagePath "DEPENDENCIES"-SkipLicense
It worked for the first time, i even asked one of my colleagues to log in and the app was there.
But, after that, i tried to reinstall it with the same command. But the command refused to execute, it's just blinking and loading.
I tried other commands to get the packages or remove the package but all have the same behavior.
What could be a valid reason for that?
Get-AppXProvisionedPackage -Online | Select PackageName
Remove-AppxProvisionedPackage
-PackageName "PackageName" -Online -AllUsers
EDIT#1:I am getting the following error after waiting for long time and pressing PgDn or End buttons on keyboard.
Remove-AppxProvisionedPackage : DismInitialize failed. Error code = 0x80004005
At line:1 char:1
+ Remove-AppxProvisionedPackage -PackageName PACKAGE_NAME ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Copy files from corrupted HD using a powershell script

I am trying to use a script that ignores I/O errors on a HD, to copy whatever is good there into another HD.
I found this script here : http://81.165.15.172:1983/blog/2013/06/02/ignoring-device-io-errors-during-copy-with-powershell/comment-page-1/
(https://raw.github.com/DavorJ/PS-ForceCopy/master/Force-Copy.ps1)
that does just that...but i cant get it to work.
I am trying with command :
.\Force-Copy.ps1 -SourceFilePath "I:\Downloads\" -DestinationFilePath "H:\Downloads" -MaxRetries 6
but it gives me this weird error:
F:\SSDU\Desktop\Force-Copy.ps1 : Cannot validate argument on parameter 'SourceFilePath'. The "Test-Path -LiteralPath $_ -Type Leaf" validation script for the argument with value "I:\Downloads\" did not return true. Determine why the validation script failed and then try the command again.
At line:1 char:34
+ .\Force-Copy.ps1 -SourceFilePath "I:\Downloads\" -DestinationFilePath
"H:\Downlo ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Force-Copy.ps1], ParameterBind
ingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Force-Copy.ps1
Anyone knows how to use this in win-8 64-bit ?
-Thanks
So, it's not a PowerShell solution, but for getting whatever you can off a dying drive I recommend using Roadkil's Unstoppable Copier. You can download it from the author at:
http://www.roadkil.net/program.php/P29/Unstoppable%20Copier
I have had good success with that one.

search-mailbox command not work in my exchange 2010 sp1

My search-mailbox command not work. the issue is like:
[PS] C:\Windows\system32>Search-Mailbox -Identity "abc" -SearchQuery "Subject:'test'"
Target mailbox or .pst file path is required.
+ CategoryInfo : InvalidArgument: (:) [], ArgumentException
+ FullyQualifiedErrorId : 78AF2AE3
At the same time, the command like get-mailbox has no problem.
Doese anybody can help?
The problem fixed by set target mailbox and folder. Use command like folloing:
Search-Mailbox -Identity "abc" -SearchQuery "Subject:'test mail'" -TargetMailbox "demo.xw" -TargetFolder "SearchLog"

Resources