Compartir a través de

Advertencia de Power Shell que hacer al respecto?

Anónimas
2021-06-11T17:39:25+00:00

Saludos a todos en esta prestigiosa comunidad.

Agradezco a quien me pueda asesorar en esto. Gracias

En Power Shell me apareció la siguiente advertencia y realmente no se que hacer para que no me aparezca mas. Apreciaría mucho a quien o a quienes me puedan ayudar a resolver esto. Gracias

Advertencia: PowerShell detectó que es posible que estés usando un lector de pantalla y que hayas deshabilitado PSReadLine con fines de compatibilidad. Si quieres volver a habilitarlo, ejecuta "Import-Module PSReadLine".

Windows para el hogar | Windows 10 | Archivos, carpetas y almacenamiento

Pregunta bloqueada. Esta pregunta se migró desde la Comunidad de Soporte técnico de Microsoft. Puede votar si es útil, pero no puede agregar comentarios o respuestas ni seguir la pregunta.

0 comentarios No hay comentarios

3 respuestas

Ordenar por: Muy útil
  1. Anónimas
    2021-06-11T18:41:50+00:00

    Hola Luydaddy

    Mi nombre es Dayarys soy asesora independiente de la Comunidad.

    Esto sucede porque Windows está en modo de lector de pantalla (una función de accesibilidad de Windows para personas con discapacidad visual) en el momento en que se inicia la sesión de PowerShell.

    Si accidentalmente se habilito puede deshabiltarlo en el registro:

    Registry::HKEY_CURRENT_USER\Control Panel\Accessibility\Blind Access' On 0

    Si este modo se ha activado accidentalmente en la sesión por una aplicación que se no desactiva este modoo o se ha bloqueado antes de poder hacerlo, puede ejecutar el siguiente codigo en powershell para desactivar el modo para que las futuras sesiones de PowerShell en la misma sesión de usuario del sistema operativo ya no vean la advertencia:

    Add-Type -TypeDefinition '

    using System;

    using System.ComponentModel;

    using System.Runtime.InteropServices;

    public static class ScreenReaderFixUtil

    {

    public static bool IsScreenReaderActive()
    
    {
    
        var ptr = IntPtr.Zero;
    
        try
    
        {
    
            ptr = Marshal.AllocHGlobal(sizeof(int));
    
            int hr = Interop.SystemParametersInfo(
    
                Interop.SPI\_GETSCREENREADER,
    
                sizeof(int),
    
                ptr,
    
                0);
    
    
    
            if (hr == 0)
    
            {
    
                throw new Win32Exception(Marshal.GetLastWin32Error());
    
            }
    
    
    
            return Marshal.ReadInt32(ptr) != 0;
    
        }
    
        finally
    
        {
    
            if (ptr != IntPtr.Zero)
    
            {
    
                Marshal.FreeHGlobal(ptr);
    
            }
    
        }
    
    }
    
    
    
    public static void SetScreenReaderActiveStatus(bool isActive)
    
    {
    
        int hr = Interop.SystemParametersInfo(
    
            Interop.SPI\_SETSCREENREADER,
    
            isActive ? 1u : 0u,
    
            IntPtr.Zero,
    
            Interop.SPIF\_SENDCHANGE);
    
    
    
        if (hr == 0)
    
        {
    
            throw new Win32Exception(Marshal.GetLastWin32Error());
    
        }
    
    }
    
    
    
    private static class Interop
    
    {
    
        public const int SPIF\_SENDCHANGE = 0x0002;
    
    
    
        public const int SPI\_GETSCREENREADER = 0x0046;
    
    
    
        public const int SPI\_SETSCREENREADER = 0x0047;
    
    
    
        [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
    
        public static extern int SystemParametersInfo(
    
            uint uiAction,
    
            uint uiParam,
    
            IntPtr pvParam,
    
            uint fWinIni);
    
    }
    

    }'

    if ([ScreenReaderFixUtil]::IsScreenReaderActive()) {

    [ScreenReaderFixUtil]::SetScreenReaderActiveStatus($false)
    

    }

    Referencia:

    https://github.com/PowerShell/PowerShell/issues...

    Estaré al pendiente de sus comentarios y resultados.

    Saludos Dayarys

    ________________________________________________________

    Nota Aclaratoria: Hay enlaces a sitios web que no son de Microsoft. Las páginas parecen proporcionar información precisa y segura. Tenga cuidado con los anuncios en los sitios que pueden anunciar productos frecuentemente clasificados como PUP (productos potencialmente no deseados). Investigue a fondo cualquier producto anunciado en los sitios antes de que decida descargarlo e instalarlo.

    9 personas han encontrado útil esta respuesta.
    0 comentarios No hay comentarios
  2. Anónimas
    2021-06-13T03:49:54+00:00

    Si presione la tecla Windows+X abra Windows Powershell como administrador copie y pegue el comando en la ventana y presione enter.

    7 personas han encontrado útil esta respuesta.
    0 comentarios No hay comentarios
  3. Anónimas
    2021-06-13T03:22:01+00:00

    Hola Dayarys gracias por responder.

    Disculpe porque sobre este tema no se mucho y me gustaría me pueda ayudar de forma mas expedita para poderla entender.

    Usted me indica hacer lo siguiente:

    Si accidentalmente se habilito puede deshabiltarlo en el registro:

    Registry::HKEY_CURRENT_USER\Control Panel\Accessibility\Blind Access' On 0

    Puede por favor usted indicarme paso a paso lo que puedo hacer con lo indicado en negrito? donde y como colocar eso que me indica?

    YO CREO QUE ES LA RUTA QUE DEBO SEGUIR DESDE EL REGEDIT CORRECTO? DE ESTAR EN LO CORRECTO YA HICE LO INDICADO Y EL INDICADOR On estaba en 1 y lo cambié a 0, pero me sigue apareciendo en PowerShell la misma nota:

    Advertencia: PowerShell detectó que es posible que estés usando un lector de pantalla y que hayas deshabilitado PSReadLine con fines de compatibilidad. Si quieres volver a habilitarlo, ejecuta "Import-Module PSReadLine".

    Por favor indíqueme si lo anterior lo hice bien y de validar que en efecto lo anterior lo hice bien, como segundo paso, entiendo que debo copiar y pegar este código así tal cual dentro de PowerShell y luego dar ENTER???

    Add-Type -TypeDefinition '
    using System;
    using System.ComponentModel;
    using System.Runtime.InteropServices;

    public static class ScreenReaderFixUtil
    {
    public static bool IsScreenReaderActive()
    {
    var ptr = IntPtr.Zero;
    try
    {
    ptr = Marshal.AllocHGlobal(sizeof(int));
    int hr = Interop.SystemParametersInfo(
    Interop.SPI_GETSCREENREADER,
    sizeof(int),
    ptr,
    0);

    if (hr == 0)
    {
    throw new Win32Exception(Marshal.GetLastWin32Error());
    }

    return Marshal.ReadInt32(ptr) != 0;
    }
    finally
    {
    if (ptr != IntPtr.Zero)
    {
    Marshal.FreeHGlobal(ptr);
    }
    }
    }

    public static void SetScreenReaderActiveStatus(bool isActive)
    {
    int hr = Interop.SystemParametersInfo(
    Interop.SPI_SETSCREENREADER,
    isActive ? 1u : 0u,
    IntPtr.Zero,
    Interop.SPIF_SENDCHANGE);

    if (hr == 0)
    {
    throw new Win32Exception(Marshal.GetLastWin32Error());
    }
    }

    private static class Interop
    {
    public const int SPIF_SENDCHANGE = 0x0002;

    public const int SPI_GETSCREENREADER = 0x0046;

    public const int SPI_SETSCREENREADER = 0x0047;

    [DllImport("user32", SetLastError = true, CharSet = CharSet.Unicode)]
    public static extern int SystemParametersInfo(
    uint uiAction,
    uint uiParam,
    IntPtr pvParam,
    uint fWinIni);
    }
    }'

    if ([ScreenReaderFixUtil]::IsScreenReaderActive()) {
    [ScreenReaderFixUtil]::SetScreenReaderActiveStatus($false)
    }

    5 personas han encontrado útil esta respuesta.
    0 comentarios No hay comentarios