You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Refer to https://learn.microsoft.com/en-us/previous-versions/windows/desktop/smb/msft-smbmapping
14
+
const (
15
+
SmbMappingStatusOKint32=iota
16
+
SmbMappingStatusPaused
17
+
SmbMappingStatusDisconnected
18
+
SmbMappingStatusNetworkError
19
+
SmbMappingStatusConnecting
20
+
SmbMappingStatusReconnecting
21
+
SmbMappingStatusUnavailable
22
+
23
+
credentialDelimiter=":"
24
+
)
25
+
26
+
// escapeQueryParameter escapes a parameter for WMI Queries
27
+
funcescapeQueryParameter(sstring) string {
28
+
s=strings.ReplaceAll(s, "'", "''")
29
+
s=strings.ReplaceAll(s, "\\", "\\\\")
30
+
returns
31
+
}
32
+
33
+
funcescapeUserName(userNamestring) string {
34
+
// refer to https://github.com/PowerShell/PowerShell/blob/9303de597da55963a6e26a8fe164d0b256ca3d4d/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs#L169-L170
// refer to https://github.com/PowerShell/PowerShell/blob/9303de597da55963a6e26a8fe164d0b256ca3d4d/src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/cimConverter.cs#L166-L178
0 commit comments