Useful .NET and Azure Tutorials
.NET, JavaScript and Cloud - Community Links
O365, SharePoint, Android, C# , SQL , Software Development, Office Productivity, Visual Studio, Business Intelligence, Software Engineering , JavaScript , JQuery , Web Service, JS & .Net FW FUN!
Useful .NET and Azure Tutorials
.NET, JavaScript and Cloud - Community Links
On bing.com can I filter the All results by Date using the
UI?
I have used bing.com from Edge Chromium, Edge Mobile, Google
Chrome, logged into MS365 and logged out and in a private window.
The result is the same: I am unable to filter search results
by date using the UI, the “Any time” drop down is gone.
Is there any solution besides tweaking the query string or
adding special condition to a search?
Can we get the "Any time" drop down returned to
the Bing search screen for All?
I would love to use Bing but without a Date filter feature
that at least mimics Duckduckgo or at best matches google there is NO way I
would ever recommend Bing for the business or home.
Here are the options that I have currently tried , I am
personally using option 1 with 6 but it works for only my general searches.
When I need something narrower like “Last Month” I have to tweak the url again.
1) Add ‘Narrow by Date’ query sting params to url
last
day
&tbs=qdr:d
or year
&tbs=qdr:y
Only
date param that seems to use DatePublished and mimics duckduckgo / google
functionality
2 ) Add Freshness (not same as datePublished)
freshness=week
freshness=2021-08-23..2022-08-23
3) Adding datePublished to search (not sure what this does,
does not seem to work)
eg:
datePublished=YYYY-MM-DD
4) Adding date range to search value: (doesn’t work)
eg "test search" (Jan. 1 - Feb 18)
5) Some unrelated setting? (doesn’t work)
On the
Worldwide screen, select “United States English”. For their own reasons, Bing
only supports search-by-date in the United States.
https://www.oyetimes.com/lifestyle/technology/52485-how-to-enable-bing-search-by-date
{bing:baseURL}search?q=%s&tbs=qdr:y&{bing:cvid}{bing:msb}
So for some reason your VSCode is slow. Really slow. How are you supposed to be productive when the program is running at snail speed? I'm going to show you how to fix this and make VS Code faster.
a.
"editor.minimap.enabled": false,
Controls whether the minimap is shown I’ve set it to false
. In my opinion, it creates visual clutter rather than actually help me
while working in a file.
2.
editor.linkedEditing — Editor: Linked
Editing
a.
"editor.linkedEditing": true
I’ve set it to true
. As someone who likes to do frontend development,
I work with HTML templates a lot.
3.
Breadcrumbs thumbnails
a.
"breadcrumbs.enabled": false
not
use the fancy settings editor, you can manually add this to your configuration:
4.
Soft Preview
a.
"workbench.editor.enablePreview":
false
Disable single click soft preview file, this creates a preview window
with any single-click in vs code solution explorer.
5.
Whitespace render:
a.
"editor.renderWhitespace":
"all"
See whitespace usage.
6.
Code bracket readability
a.
"editor.bracketPairColorization.enabled":
false,
"editor.bracketPairColorization.independentColorPoolPerBracketType":
true
Improve code readability to improve productivity.
7.
Simple
file dialog
a.
"files.simpleDialog.enable":
true
Open file with in-app dialog
8.
Powershell and editor optimized settings:
a.
https://youtube.com/clip/UgkxJtWpfn9krX_U5U-KlZDjmM9PAlTeqtSG
9.
Window Title
"window.titleSeparator": "
|",
"window.title":
"${dirty}${remoteName}${separator}${rootName}${separator}${activeEditorShort}${separator}${appName}"
Controls the window title
based on the active editor. Variables are substituted based on the context:
10.
workbench.tips.enabled
a.
"workbench.tips.enabled": false
Disable the tips on load
11. debug.openExplorerOnEnd
a.
"debug.openExplorerOnEnd": true
12.
Telemetry might impact performance.
a.
"telemetry.telemetryLevel":
"off"
a.
"search.searchOnType": false
14.
Stop Notifications
a.
"update.showReleaseNotes":
false,
b.
"workbench.enableExperiments":
false
15.
Optional:
a.
CodeLens Disable
b.
Mindmap on/Off
c.
Terminal GPU Acceleration
d.
Extension Load times: You can easily monitor
the startup time of all those plugins by executing cmd + p > Developer: Show
Running Extensions.
All the user settings in json:
Symptoms:
When using the MS Graph Explorer in Azure:
Resolving the error "Application must have one of the following scopes" when accessing the GraphAPI
If you receive an error with the following substring part in the error message:
"Application is not authorized to perform this operation."
and/or
"Application must have one of the following scopes:"
When accessing the service url : https://graph.microsoft.com/beta/deviceManagement
An example response:
{
"error": {https://fef.msub05.manage.microsoft.com/DeviceConfiguration_1911/StatelessDeviceConfigurationFEService/deviceManagement?api-version=5019-09-20
>\",\r\n \"CustomApiErrorPhrase\": \"\",\r\n \"RetryAfter\": null,\r\n \"ErrorSourceService\": \"\",\r\n \"HttpHeaders\": \"{}\"\r\n}",Sign in to the Azure portal, go to Azure Active Directory > Enterprise Applications, and then select Graph explorer from the list of applications. For example for me : Enterprise Application is at this url
Click "Graph Explorer"
Click Permissions
Search for, Add and then Grant the permission that we want Graph Explorer to execute without error:
With our permission added, we can now execute without error:
###########################
# Write output and commands to text file DOS and PS
#########################
REM Check Version of spfx related packages and save to a file
node --version >> C:\temp\Logs\cmdPrompt.log
npm --version >> C:\temp\Logs\cmdPrompt.log
pnp --version >> C:\temp\Logs\cmdPrompt.log
yo --version >> C:\temp\Logs\cmdPrompt.log
gulp -v >> C:\temp\Logs\cmdPrompt.log
nvm ls >> C:\temp\Logs\cmdPrompt.log
choco --version >> C:\temp\Logs\cmdPrompt.log
type C:\temp\Logs\cmdPrompt.log
REM save command output to a file and command error output STDERR and STDOUT
choco --version 1>> C:\temp\Logs\cmdPrompt.log 2>&1
REM View file in cmd
type C:\temp\Logs\cmdPrompt.log
REM Save commands to append to a file
doskey /history >> C:\temp\Logs\cmdPrompt.Commands.log
REM Copy the Command Output to Windows Clipboard
REM ould copy the details of your network connections to the clipboard:
ipconfig /all | clip
REM opy the contents of a folder to the clipboard
dir | clip
# Powershell save commands + output
# ps output to a file, output to a text file with PowerShell on Windows 11 or Windows 10,
ipconfig | Out-File -FilePath C:\temp\Logs\cmdPrompt.log
#view the saved output on the screen
Gt-Content -Path C:\temp\Logs\cmdPrompt.log
# saving BOTH the commands you type AND all their output? I'm not talking about piping the output of any one to a file, like above. Instead, this is about the PowerShell Start-Transcript cmdlet. Try it out some time:
Start-Transcript
# Without any parameters, the transcript will be saved in the user’s documents folder, filename will automatically be generated and consists of the device name, random characters
#e.g:
# c:\users\name\documents\PowerShell_transcript.DEVICENAME.qp9EOTN2.20220301132612.txt
# Start recording
Start-Transcript
# stop recording
Stop-Transcript
# start options
# Append to a log file.
Start-Transcript -Path C:\temp\Logs\cmdPrompt.log -Append
#use -NoClobber prevent overwriting file
Start-Transcript -Path C:\temp\Logs\cmdPrompt.log -NoClobber
# -OutputDirectory parameter. This way we can specify the directory where we want to store the log file
Start-Transcript -OutputDirectory C:\Temp\Logs
# Result:
Transcript started, output file is C:\Temp\Logs\PowerShell_transcript.WIN11-LAB02.uftVAXsv.20220301045218.txt
# limit the header information to only a timestamp o
Start-Transcript -OutputDirectory C:\Temp\Logs -UseMinimalDeader
# E.g:
**********************
PowerShell transcript start
Start time: 20220301135543
**********************
# See also: https://itluke.online/2019/03/24/what-is-captured-with-powershell-transcripts/ for Verbose+Debug levels
# See also: https://4sysops.com/archives/powershell-transcript-record-a-session-to-a-text-file/
###########################
# Get Versions
#########################
# PS get version of Spfx imprtant packages
node --version
npm --version
pnp --version
yo --version
gulp -v
nvm ls
choco --version
winget --version
# get version of Powershell
host
# or
$PSVersionTable
$PSVersionTable.PSVersion
# get the value of the PowerShellVersion parameter in the registry key
(Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion
#Version of PowerShell on Remote Computers
Invoke-Command -ComputerName 192.168.1.15 -ScriptBlock {$PSVersionTable.PSVersion} -Credential $cred
# get version of .Net + .Net Core
# versions of the .NET SDK are currently installed with a terminal
dotnet --list-sdks
(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name
# which versions of the .NET runtime
dotnet --list-runtimes
(dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\Microsoft.NETCore.App')).Name
# dotnet core installed runtimes and SDKs, as well as some other info:
dotnet --info
# .NET Framework
# get from https://github.com/jmalarcon/DotNetVersions/releases save to C:\Windows\System32 or PATH
dotnetversions -b
# security updates and hotfixes that are installed on a computer using PowerShell:
$DotNetVersions = Get-ChildItem HKLM:\SOFTWARE\WOW6432Node\Microsoft\Updates | Where-Object {$_.name -like
"*.NET Framework*"}
ForEach($Version in $DotNetVersions){
$Updates = Get-ChildItem $Version.PSPath
$Version.PSChildName
ForEach ($Update in $Updates){
$Update.PSChildName
}
}
# Get CLR versions
# displays all the versions of the CLR installed on the computer. dl Clrver.exe (CLR Version Tool)
clrver
# get version of VS Code / Visual Studio
code --version
nuget help | select -First 1
dotnet nuget --version
# change based on version to be checked
(Get-Item "${env:ProgramFiles(x86)}\Microsoft Visual Studio 11.0\common7\ide\devenv.exe").VersionInfo.ProductVersion
# get paths to GAC
gacutil.exe -l
# get version of PnP
# get version of Spfx
REM DOS Get
Version of spfx related packages and save to a file
node --version >> C:\temp\Logs\cmdPrompt.log
npm --version >> C:\temp\Logs\cmdPrompt.log
pnp --version >> C:\temp\Logs\cmdPrompt.log
yo --version >> C:\temp\Logs\cmdPrompt.log
gulp -v >> C:\temp\Logs\cmdPrompt.log
nvm ls >> C:\temp\Logs\cmdPrompt.log
choco --version >> C:\temp\Logs\cmdPrompt.log
type C:\temp\Logs\cmdPrompt.log
###########################
# Get Install Folders
#########################
# get install location of powershell
###########################
# Update ps, choco,
#########################
#update ps core
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI"
# or
winget install PowerShell
The below command can be used to convert a GIF to an MP4 using the pre-requsite ffmpeg app on Windows:
1. Open notepad, create a bat file : e.g: "fmpg.bat"
2. Add the following : replace paths as needed:
cd [PathToFFMpeg]\FFMpeg\bin
echo fn %~n1
echo INFILE- %1
echo OUTFILE- [PathOutput]\%~n1.mp4
ffmpeg -i "%1" -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" [PathOutput]\%~n1.mp4
Usage:
fmpg "C:\MyGifs\1.gif"
When using the MS Graph Explorer in Azure:
If you recie b an eeor with the follwing substring text in the error message:
"Application is not authorized to perform this operation. Application must have one of the following scopes:"
For example:
Url:https://graph.microsoft.com/beta/deviceManagement
{
"error": {https://fef.msub05.manage.microsoft.com/DeviceConfiguration_1911/StatelessDeviceConfigurationFEService/deviceManagement?api-version=5019-09-20
>\",\r\n \"CustomApiErrorPhrase\": \"\",\r\n \"RetryAfter\": null,\r\n \"ErrorSourceService\": \"\",\r\n \"HttpHeaders\": \"{}\"\r\n}",Sign in to the Azure portal, go to Azure Active Directory > Enterprise Applications, and then select Graph explorer from the list of applications. For example for me : Enterprise Application is at this url
Click "Graph Explorer"
Click Permissions
Search for, Add and then Grant the permission that we want Graph Explorer to execute without error:
With our permission added, we can now execute without error:
There are numerous ways to do the same thing in Powershell. In this post, we will go over every way to check the PowerShell version. All these ways should work in both Windows PowerShell and PowerShell Core.
Invoke-Command -ComputerName 10.0.0.5 -ScriptBlock {Get-Host} -Credential $cred
results in for example:
You will see the same behavior via PowerShell Remoting with $host.Version
as you will running Get-Host
.
Invoke-Command -ComputerName 10.0.0.5 -ScriptBlock {$host.Version} -Credential $cred
If you don’t want to open up PowerShell itself, you can also check the registry. The version of PowerShell is tucked away under a value in the registry key path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine
. This registry key has a value called PowerShellVersion
that you can reference by using Get-ItemProperty
.
(Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion 5.1.17134.1
Also WMI:
reg query HKLM\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine /v PowerShellVersion HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine PowerShellVersion REG_SZ 5.1.17134.1
Registry on a remote computer:
$scriptBlock = { [version](Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine -Name 'PowerShellVersion').PowerShellVersion } PS51> Invoke-Command -ComputerName 10.0.0.5 -ScriptBlock $scriptBlock -Credential $cred
PSVersion
property on the $PSVersionTable
automatic variable. This method will always represent the PowerShell engine.